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