update:只读文件隐藏操作按钮
This commit is contained in:
@@ -421,59 +421,61 @@ export function ScriptWorkspace({
|
|||||||
<Icon name="chevron" size={13} />
|
<Icon name="chevron" size={13} />
|
||||||
<strong>{script.script_name}</strong>
|
<strong>{script.script_name}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div className="editor-toolbar__actions">
|
{!isReadOnlyMode && (
|
||||||
{isPythonEditing ? (
|
<div className="editor-toolbar__actions">
|
||||||
<>
|
{isPythonEditing ? (
|
||||||
{showSaveButton && (
|
<>
|
||||||
<button
|
{showSaveButton && (
|
||||||
type="button"
|
<button
|
||||||
className={`editor-save-button${activePythonBuf?.saving ? " is-saving" : ""}`}
|
type="button"
|
||||||
disabled={saveDisabled}
|
className={`editor-save-button${activePythonBuf?.saving ? " is-saving" : ""}`}
|
||||||
onClick={() => onSavePythonEditor(script.script_id)}
|
disabled={saveDisabled}
|
||||||
>
|
onClick={() => onSavePythonEditor(script.script_id)}
|
||||||
{activePythonBuf?.saving
|
>
|
||||||
? <><span className="button-spinner button-spinner--blue" /> 保存中</>
|
{activePythonBuf?.saving
|
||||||
: "保存"}
|
? <><span className="button-spinner button-spinner--blue" /> 保存中</>
|
||||||
</button>
|
: "保存"}
|
||||||
)}
|
</button>
|
||||||
<button type="button" className="end-edit-button" onClick={() => onExitPythonEditor(script.script_id)}>结束编辑</button>
|
)}
|
||||||
</>
|
<button type="button" className="end-edit-button" onClick={() => onExitPythonEditor(script.script_id)}>结束编辑</button>
|
||||||
) : isEditing ? (
|
</>
|
||||||
|
) : isEditing ? (
|
||||||
|
<button
|
||||||
|
className="end-edit-button"
|
||||||
|
type="button"
|
||||||
|
disabled={editBusy}
|
||||||
|
onClick={onEndEditing}
|
||||||
|
>
|
||||||
|
{editBusy ? "正在释放…" : "结束编辑"}
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => onInfo({
|
||||||
|
tone: "info",
|
||||||
|
message: "Jupyter 中保存后会直接写入 Workspace 工作副本",
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
保存说明
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
className="end-edit-button"
|
className="release-button"
|
||||||
type="button"
|
type="button"
|
||||||
disabled={editBusy}
|
onClick={onPublish}
|
||||||
onClick={onEndEditing}
|
|
||||||
>
|
>
|
||||||
{editBusy ? "正在释放…" : "结束编辑"}
|
发布稳定版
|
||||||
</button>
|
</button>
|
||||||
) : (
|
<span className={`stage-badge${isEditing ? " is-editing" : ""}`}>
|
||||||
<button
|
<span />
|
||||||
type="button"
|
{
|
||||||
onClick={() => onInfo({
|
latestVersion
|
||||||
tone: "info",
|
? `最新 ${latestVersion.version_label}`
|
||||||
message: "Jupyter 中保存后会直接写入 Workspace 工作副本",
|
: "工作副本已就绪"
|
||||||
})}
|
}
|
||||||
>
|
</span>
|
||||||
保存说明
|
</div>
|
||||||
</button>
|
)}
|
||||||
)}
|
|
||||||
<button
|
|
||||||
className="release-button"
|
|
||||||
type="button"
|
|
||||||
onClick={onPublish}
|
|
||||||
>
|
|
||||||
发布稳定版
|
|
||||||
</button>
|
|
||||||
<span className={`stage-badge${isEditing ? " is-editing" : ""}`}>
|
|
||||||
<span />
|
|
||||||
{
|
|
||||||
latestVersion
|
|
||||||
? `最新 ${latestVersion.version_label}`
|
|
||||||
: "工作副本已就绪"
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 只读模式:显示只读编辑器 */}
|
{/* 只读模式:显示只读编辑器 */}
|
||||||
|
|||||||
Reference in New Issue
Block a user