style(frontend): 精简脚本语言提示并移除解释器输入框

- 脚本语言提示从大块灰色卡片改成下拉框右侧的一行说明
- Python 表单不再显示解释器输入框,固定使用 .venv 里的 Python
- 虚拟环境目录字段改为全宽并明确自动探测语义
- 非 Python 语言仍由语言自动设置 cmd.exe/node.exe/lua.exe,API 仍可传自定义 interpreter
This commit is contained in:
2026-11-04 22:51:37 +08:00
parent 917674880b
commit 10f8e6bb66
4 changed files with 66 additions and 73 deletions
+34 -49
View File
@@ -526,28 +526,28 @@ export function TaskEditorModal({
</div>
{actionType === 'script' ? (
<div className="form-grid language-grid">
<FormField label="脚本语言">
<Controller
control={control}
name="script.language"
render={({ field }) => (
<Select
className="form-select"
options={SCRIPT_LANGUAGE_OPTIONS}
value={field.value}
onChange={(value) =>
applyScriptLanguage(value as ScriptLanguage)
}
/>
)}
/>
</FormField>
<div className="language-hint">
<Text size="sm" tone="sub">
{scriptMeta.hint}
</Text>
<div className="script-language-row">
<div className="script-language-field">
<FormField label="脚本语言">
<Controller
control={control}
name="script.language"
render={({ field }) => (
<Select
className="form-select"
options={SCRIPT_LANGUAGE_OPTIONS}
value={field.value}
onChange={(value) =>
applyScriptLanguage(value as ScriptLanguage)
}
/>
)}
/>
</FormField>
</div>
<Text className="script-language-hint" size="sm" tone="sub">
{scriptMeta.hint}
</Text>
</div>
) : null}
@@ -580,34 +580,19 @@ export function TaskEditorModal({
{isPythonScript ? (
<>
<div className="form-grid venv-grid">
<FormField
label="虚拟环境目录 (可选)"
htmlFor="task-venv"
hint="检测到虚拟环境会自动填入,可直接修改;留空则按工作目录自动探测"
error={errors.script?.venv?.message}
>
<Input
id="task-venv"
{...register('script.venv')}
className="mono-input"
placeholder="例如:.venv"
/>
</FormField>
<FormField
label="解释器(可选)"
htmlFor="task-interpreter"
hint="留空自动使用虚拟环境 Python;也可以填自定义 Python 路径"
error={errors.script?.interpreter?.message}
>
<Input
id="task-interpreter"
{...register('script.interpreter')}
className="mono-input"
placeholder="留空自动使用虚拟环境 Python"
/>
</FormField>
</div>
<FormField
label="虚拟环境目录"
htmlFor="task-venv"
hint="自动探测项目里的 .venv;需要时也可以手动指定。Python 任务始终使用 .venv 里的 Python"
error={errors.script?.venv?.message}
>
<Input
id="task-venv"
{...register('script.venv')}
className="mono-input"
placeholder="留空自动探测,例如 .venv"
/>
</FormField>
<VenvDetectorBar
workingDir={debouncedWorkingDir}