refactor(config): add reload button and remove sync cloud config

- Implement a 'Reload' button to refresh the configuration.
- Remove the 'Sync Cloud Configs && Reload Workflows' button to simplify the UI.
- Adjust the 'Save' button to be conditionally displayed based on whether the form is being submitted.
This commit is contained in:
Rankin Zheng 2024-08-27 18:28:52 +08:00
parent 82873a0b8a
commit 87c6c104db
2 changed files with 10 additions and 7 deletions

View File

@ -59,6 +59,7 @@
"Please enter the proxy url and port": "请输入您的代理URL和端口",
"Cancel": "取消",
"Save": "保存",
"Reload": "重载",
"Max input tokens": "最大输入数",
"/unit_tests": "/生成单测",
"Generate unit tests.": "为函数生成Happy Path和Edge Case测试用例。",
@ -75,4 +76,4 @@
"/refactor": "/代码重构",
"rewrite selected code.": "对所选代码进行重构。",
"workflowTip": "为了确保高准确度,我们的 {{name}} 采纳了包括规划、工具使用、反思在内的LLM设计模式。这些模式能显著提高回应的精确性但请注意由于深度处理的需要回应时间可能超过<3>1分钟</3>。"
}
}

View File

@ -161,6 +161,8 @@ const Config = observer(() => {
};
const handleSync = () => {
config.updateSettle(false);
startLoading();
// 调用 Local Service 更新工作流,更新、重载命令列表
MessageUtil.handleMessage({ command: "reloadConfig" });
};
@ -456,10 +458,6 @@ const Config = observer(() => {
/>
</>
)}
<Button onClick={handleSync} >
{t("Sync Cloud Configs && Reload Workflows")}
</Button>
</Stack>
<Group
grow
@ -473,9 +471,13 @@ const Config = observer(() => {
background: "var(--vscode-sideBar-background)",
}}
>
<Button type="submit" disabled={disabledSubmit}>
{t("Save")}
{disabledSubmit
? <Button onClick={handleSync} >
{t("Reload")}
</Button>
: <Button type="submit" disabled={disabledSubmit}>
{t("Save")}
</Button>}
<Button
variant="outline"
color="gray"