mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-03 18:23:51 +08:00
feat: 新增 Commit 设置及本地提交信息生成
- 新增 CommitSettingsCard 组件,支持选择生成模型与编辑提示词 - 新增 /settings/commit GET/PUT 接口及 CommitSettings 持久化 - 实现 WriteGitCommitMessage RPC 本地生成,空 model_id 时直连转发 - 新增 NetworkService/IsConnected 探针响应,防止流式生成被中断 - 添加 commit prompt 模板及 proto 消息定义 - 补充 zh-CN / en-US 国际化词条
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
@use "../../styles/typography" as type;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
padding: 16px;
|
||||
|
||||
> div:first-child {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
small {
|
||||
color: var(--vscode-descriptionForeground);
|
||||
font-size: type.$font-size-xs;
|
||||
}
|
||||
}
|
||||
|
||||
.select {
|
||||
min-width: 280px;
|
||||
}
|
||||
|
||||
.textButton {
|
||||
padding: 4px;
|
||||
color: var(--vscode-textLink-foreground);
|
||||
background: transparent;
|
||||
border: 0;
|
||||
|
||||
&:hover { color: var(--vscode-textLink-activeForeground); }
|
||||
&:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
}
|
||||
|
||||
.promptEditor {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
min-height: 320px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 12px;
|
||||
color: var(--vscode-input-foreground);
|
||||
background: var(--vscode-input-background);
|
||||
border: 1px solid var(--vscode-input-border, var(--vscode-sideBar-border));
|
||||
border-radius: 6px;
|
||||
font-family: var(--vscode-editor-font-family, monospace);
|
||||
font-size: type.$font-size-xs;
|
||||
line-height: 1.6;
|
||||
resize: none;
|
||||
|
||||
&:focus {
|
||||
outline: 1px solid var(--vscode-focusBorder);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { api, type CommitSettingsView } from "../../shared/api";
|
||||
import { useAppStore } from "../../shared/store/appStore";
|
||||
import { Modal } from "../../shared/ui/Modal";
|
||||
import { Select } from "../../shared/ui/Select";
|
||||
import { TitledCard } from "../../shared/ui/TitledCard";
|
||||
import { useMessage } from "../../shared/ui/message";
|
||||
import controls from "../../shared/ui/Controls.module.scss";
|
||||
import styles from "./CommitSettingsCard.module.scss";
|
||||
|
||||
function errorText(cause: unknown) {
|
||||
return cause instanceof Error ? cause.message : String(cause);
|
||||
}
|
||||
|
||||
export function CommitSettingsCard() {
|
||||
const { models } = useAppStore();
|
||||
const message = useMessage();
|
||||
const [view, setView] = useState<CommitSettingsView | null>(null);
|
||||
const [savingModel, setSavingModel] = useState(false);
|
||||
const [promptOpen, setPromptOpen] = useState(false);
|
||||
const [promptDraft, setPromptDraft] = useState("");
|
||||
const [savingPrompt, setSavingPrompt] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
void api.commitSettings().then(setView).catch((cause) => message(errorText(cause)));
|
||||
}, [message]);
|
||||
|
||||
const modelOptions = useMemo(() => {
|
||||
const options: Array<{ value: string; label: string }> = [{ value: "", label: t("直连") }];
|
||||
const seen = new Set<string>();
|
||||
for (const model of models) {
|
||||
seen.add(model.model_hash);
|
||||
options.push({
|
||||
value: model.model_hash,
|
||||
label: model.display_name && model.display_name !== model.model_id
|
||||
? `${model.display_name}(${model.model_id})`
|
||||
: model.display_name || model.model_id,
|
||||
});
|
||||
}
|
||||
if (view?.model_id && !seen.has(view.model_id)) {
|
||||
options.push({ value: view.model_id, label: view.model_id });
|
||||
}
|
||||
return options;
|
||||
}, [models, view]);
|
||||
|
||||
const selectedModelId = view?.model_id ?? "";
|
||||
|
||||
const persist = useCallback(
|
||||
async (modelId: string, prompt: string) => {
|
||||
if (!view) return null;
|
||||
const normalizedPrompt =
|
||||
prompt.trim() === view.default_prompt.trim() ? "" : prompt.trim();
|
||||
return api.setCommitSettings({ model_id: modelId, prompt: normalizedPrompt });
|
||||
},
|
||||
[view],
|
||||
);
|
||||
|
||||
const changeModel = useCallback(
|
||||
async (modelId: string) => {
|
||||
if (!view) return;
|
||||
setSavingModel(true);
|
||||
try {
|
||||
const saved = await persist(modelId, view.prompt);
|
||||
if (saved) setView(saved);
|
||||
} catch (cause) {
|
||||
message(errorText(cause));
|
||||
} finally {
|
||||
setSavingModel(false);
|
||||
}
|
||||
},
|
||||
[view, persist, message],
|
||||
);
|
||||
|
||||
const openPrompt = useCallback(() => {
|
||||
if (!view) return;
|
||||
setPromptDraft(view.prompt || view.default_prompt);
|
||||
setPromptOpen(true);
|
||||
}, [view]);
|
||||
|
||||
const savePrompt = useCallback(async () => {
|
||||
if (!view) return;
|
||||
setSavingPrompt(true);
|
||||
try {
|
||||
const saved = await persist(view.model_id, promptDraft);
|
||||
if (saved) setView(saved);
|
||||
setPromptOpen(false);
|
||||
message(t("提示词设置已保存"));
|
||||
} catch (cause) {
|
||||
message(errorText(cause));
|
||||
} finally {
|
||||
setSavingPrompt(false);
|
||||
}
|
||||
}, [view, promptDraft, persist, message]);
|
||||
|
||||
const resetPrompt = useCallback(() => {
|
||||
if (!view) return;
|
||||
setPromptDraft(view.default_prompt);
|
||||
}, [view]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<TitledCard
|
||||
title={t("Commit 设置")}
|
||||
action={
|
||||
<button type="button" className={styles.textButton} disabled={!view} onClick={openPrompt}>
|
||||
{t("提示词设置")}
|
||||
</button>
|
||||
}
|
||||
>
|
||||
<div className={styles.row}>
|
||||
<div>
|
||||
<strong>{t("生成模型")}</strong>
|
||||
<small>{t("直连走 Cursor 原有通道;选择 Cursor 页已配置的模型后由本地生成。")}</small>
|
||||
</div>
|
||||
<div className={styles.select}>
|
||||
<Select
|
||||
value={selectedModelId}
|
||||
options={modelOptions}
|
||||
disabled={!view || savingModel}
|
||||
ariaLabel={t("生成模型")}
|
||||
onChange={(value) => void changeModel(value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</TitledCard>
|
||||
|
||||
<Modal
|
||||
open={promptOpen}
|
||||
title={t("提示词设置")}
|
||||
wide
|
||||
fullHeight
|
||||
busy={savingPrompt}
|
||||
onClose={() => setPromptOpen(false)}
|
||||
onSubmit={() => void savePrompt()}
|
||||
submitLabel={t("保存")}
|
||||
closeLabel={t("取消")}
|
||||
secondaryAction={
|
||||
<button type="button" className={controls.secondary} onClick={resetPrompt}>
|
||||
{t("恢复默认")}
|
||||
</button>
|
||||
}
|
||||
>
|
||||
<textarea
|
||||
className={styles.promptEditor}
|
||||
value={promptDraft}
|
||||
spellCheck={false}
|
||||
aria-label={t("提交信息提示词")}
|
||||
onChange={(event) => setPromptDraft(event.target.value)}
|
||||
/>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { api, type ProxySettings, type ProxySettingsInput, type StatisticsStorag
|
||||
import { PageContent } from "../../shell/layout/PageContent";
|
||||
import { LegacyModelImport } from "../models/LegacyModelImport";
|
||||
import { AppLifecycleSettingsCard } from "./AppLifecycleSettingsCard";
|
||||
import { CommitSettingsCard } from "./CommitSettingsCard";
|
||||
import { ProxySettingsCard } from "./ProxySettingsCard";
|
||||
import { TabSettingsCard } from "./TabSettingsCard";
|
||||
import { Button } from "../../shared/ui/Button";
|
||||
@@ -229,6 +230,7 @@ export function SettingsPage() {
|
||||
</TitledCard>
|
||||
<ProxySettingsCard settings={outboundProxy} draft={proxyDraft} editing={editingProxy} saving={savingProxy} onDraftChange={setProxyDraft} onEdit={editProxy} onCancel={cancelProxyEdit} onSave={() => void saveProxy()} />
|
||||
<TabSettingsCard settings={tabSettings} draft={tabDraft} editing={editingTab} saving={savingTab} onDraftChange={setTabDraft} onEdit={editTab} onCancel={cancelTabEdit} onSave={() => void saveTab()} />
|
||||
<CommitSettingsCard />
|
||||
<AppLifecycleSettingsCard />
|
||||
<LegacyModelImport>{({ busy, previewing, open }) => <TitledCard title={t("导入")}>
|
||||
<div className={styles.importRow}>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 185,
|
||||
"line": 186,
|
||||
"column": 82
|
||||
},
|
||||
{
|
||||
@@ -131,6 +131,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"0525054436acdb6e": {
|
||||
"source": "提交信息提示词",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 147,
|
||||
"column": 23
|
||||
}
|
||||
]
|
||||
},
|
||||
"05468af47054d488": {
|
||||
"source": "模型 {model} 连通性测试成功({duration} ms)",
|
||||
"kind": "template",
|
||||
@@ -345,7 +357,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 94,
|
||||
"line": 95,
|
||||
"column": 38
|
||||
}
|
||||
]
|
||||
@@ -374,7 +386,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 277,
|
||||
"line": 279,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
@@ -611,6 +623,23 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"19bb071f8c362695": {
|
||||
"source": "提示词设置",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 106,
|
||||
"column": 14
|
||||
},
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 129,
|
||||
"column": 16
|
||||
}
|
||||
]
|
||||
},
|
||||
"1a3f0617d6de8e52": {
|
||||
"source": "用户名",
|
||||
"kind": "text",
|
||||
@@ -691,7 +720,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 281,
|
||||
"line": 283,
|
||||
"column": 60
|
||||
}
|
||||
]
|
||||
@@ -717,17 +746,17 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 64,
|
||||
"line": 65,
|
||||
"column": 42
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 190,
|
||||
"line": 191,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 217,
|
||||
"line": 218,
|
||||
"column": 58
|
||||
}
|
||||
]
|
||||
@@ -814,7 +843,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 255,
|
||||
"line": 257,
|
||||
"column": 43
|
||||
}
|
||||
]
|
||||
@@ -826,7 +855,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 119,
|
||||
"line": 120,
|
||||
"column": 15
|
||||
}
|
||||
]
|
||||
@@ -850,7 +879,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 304,
|
||||
"line": 306,
|
||||
"column": 24
|
||||
}
|
||||
]
|
||||
@@ -999,6 +1028,11 @@
|
||||
"line": 274,
|
||||
"column": 70
|
||||
},
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 136,
|
||||
"column": 21
|
||||
},
|
||||
{
|
||||
"file": "features/settings/ProxySettingsCard.tsx",
|
||||
"line": 32,
|
||||
@@ -1006,12 +1040,12 @@
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 181,
|
||||
"line": 182,
|
||||
"column": 81
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 296,
|
||||
"line": 298,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
@@ -1105,7 +1139,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 143,
|
||||
"line": 144,
|
||||
"column": 15
|
||||
}
|
||||
]
|
||||
@@ -1257,7 +1291,7 @@
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 240,
|
||||
"line": 242,
|
||||
"column": 27
|
||||
}
|
||||
]
|
||||
@@ -1330,7 +1364,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 306,
|
||||
"line": 308,
|
||||
"column": 42
|
||||
}
|
||||
]
|
||||
@@ -1407,7 +1441,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 288,
|
||||
"line": 290,
|
||||
"column": 14
|
||||
}
|
||||
]
|
||||
@@ -1431,7 +1465,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 240,
|
||||
"line": 242,
|
||||
"column": 39
|
||||
}
|
||||
]
|
||||
@@ -1481,12 +1515,12 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 247,
|
||||
"line": 249,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 253,
|
||||
"line": 255,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
@@ -1563,7 +1597,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 158,
|
||||
"line": 159,
|
||||
"column": 66
|
||||
}
|
||||
]
|
||||
@@ -1575,7 +1609,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 272,
|
||||
"line": 274,
|
||||
"column": 52
|
||||
}
|
||||
]
|
||||
@@ -1986,7 +2020,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 179,
|
||||
"line": 180,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
@@ -2068,7 +2102,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 233,
|
||||
"line": 235,
|
||||
"column": 78
|
||||
}
|
||||
]
|
||||
@@ -2114,7 +2148,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 237,
|
||||
"line": 239,
|
||||
"column": 21
|
||||
}
|
||||
]
|
||||
@@ -2353,7 +2387,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "shared/api.ts",
|
||||
"line": 486,
|
||||
"line": 495,
|
||||
"column": 43
|
||||
}
|
||||
]
|
||||
@@ -2468,7 +2502,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 94,
|
||||
"line": 95,
|
||||
"column": 55
|
||||
}
|
||||
]
|
||||
@@ -2632,7 +2666,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 169,
|
||||
"line": 170,
|
||||
"column": 16
|
||||
}
|
||||
]
|
||||
@@ -2656,7 +2690,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 264,
|
||||
"line": 266,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
@@ -2680,7 +2714,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "shared/api.ts",
|
||||
"line": 481,
|
||||
"line": 490,
|
||||
"column": 43
|
||||
}
|
||||
]
|
||||
@@ -2704,7 +2738,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 297,
|
||||
"line": 299,
|
||||
"column": 23
|
||||
}
|
||||
]
|
||||
@@ -2759,7 +2793,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 137,
|
||||
"line": 138,
|
||||
"column": 83
|
||||
}
|
||||
]
|
||||
@@ -2834,7 +2868,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "shared/api.ts",
|
||||
"line": 418,
|
||||
"line": 427,
|
||||
"column": 21
|
||||
}
|
||||
]
|
||||
@@ -3062,7 +3096,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 236,
|
||||
"line": 238,
|
||||
"column": 22
|
||||
}
|
||||
]
|
||||
@@ -3189,7 +3223,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 161,
|
||||
"line": 162,
|
||||
"column": 7
|
||||
}
|
||||
]
|
||||
@@ -3460,7 +3494,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 244,
|
||||
"line": 246,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
@@ -3496,7 +3530,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 57,
|
||||
"line": 58,
|
||||
"column": 34
|
||||
}
|
||||
]
|
||||
@@ -3571,6 +3605,11 @@
|
||||
"line": 317,
|
||||
"column": 193
|
||||
},
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 135,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
"file": "features/settings/ProxySettingsCard.tsx",
|
||||
"line": 33,
|
||||
@@ -3578,7 +3617,7 @@
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 182,
|
||||
"line": 183,
|
||||
"column": 133
|
||||
},
|
||||
{
|
||||
@@ -3924,6 +3963,11 @@
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 29,
|
||||
"column": 83
|
||||
},
|
||||
{
|
||||
"file": "features/settings/TabSettingsCard.tsx",
|
||||
"line": 31,
|
||||
@@ -4066,7 +4110,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 158,
|
||||
"line": 159,
|
||||
"column": 45
|
||||
}
|
||||
]
|
||||
@@ -4092,7 +4136,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 280,
|
||||
"line": 282,
|
||||
"column": 22
|
||||
}
|
||||
]
|
||||
@@ -4167,6 +4211,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"ba2e93e73037c71e": {
|
||||
"source": "恢复默认",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 139,
|
||||
"column": 14
|
||||
}
|
||||
]
|
||||
},
|
||||
"ba5865fbc734e672": {
|
||||
"source": "例如:主力模型",
|
||||
"kind": "text",
|
||||
@@ -4191,6 +4247,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"bac36835ace45f3a": {
|
||||
"source": "Commit 设置",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 103,
|
||||
"column": 16
|
||||
}
|
||||
]
|
||||
},
|
||||
"baff6c144180b185": {
|
||||
"source": "连通性测试完成:成功 {successful},失败 {failed}",
|
||||
"kind": "template",
|
||||
@@ -4230,7 +4298,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 272,
|
||||
"line": 274,
|
||||
"column": 40
|
||||
}
|
||||
]
|
||||
@@ -4511,12 +4579,12 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 167,
|
||||
"line": 168,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 173,
|
||||
"line": 174,
|
||||
"column": 20
|
||||
}
|
||||
]
|
||||
@@ -4528,7 +4596,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 204,
|
||||
"line": 205,
|
||||
"column": 21
|
||||
}
|
||||
]
|
||||
@@ -4564,7 +4632,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 160,
|
||||
"line": 161,
|
||||
"column": 7
|
||||
}
|
||||
]
|
||||
@@ -4769,6 +4837,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"d8c589c455675b46": {
|
||||
"source": "提示词设置已保存",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 87,
|
||||
"column": 15
|
||||
}
|
||||
]
|
||||
},
|
||||
"da521d1c1cbd36af": {
|
||||
"source": "需要授权安装证书",
|
||||
"kind": "text",
|
||||
@@ -4899,7 +4979,7 @@
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 316,
|
||||
"line": 318,
|
||||
"column": 30
|
||||
},
|
||||
{
|
||||
@@ -5086,6 +5166,23 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"e2ebc59779f012ed": {
|
||||
"source": "生成模型",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 112,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 120,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
},
|
||||
"e3fee05f688708b4": {
|
||||
"source": "LLM 调用",
|
||||
"kind": "text",
|
||||
@@ -5146,7 +5243,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 70,
|
||||
"line": 71,
|
||||
"column": 17
|
||||
}
|
||||
]
|
||||
@@ -5228,7 +5325,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 164,
|
||||
"line": 165,
|
||||
"column": 26
|
||||
}
|
||||
]
|
||||
@@ -5341,7 +5438,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 223,
|
||||
"line": 224,
|
||||
"column": 16
|
||||
}
|
||||
]
|
||||
@@ -5447,7 +5544,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 248,
|
||||
"line": 250,
|
||||
"column": 21
|
||||
}
|
||||
]
|
||||
@@ -5514,6 +5611,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"fa2352729a82e74b": {
|
||||
"source": "直连走 Cursor 原有通道;选择 Cursor 页已配置的模型后由本地生成。",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/CommitSettingsCard.tsx",
|
||||
"line": 113,
|
||||
"column": 21
|
||||
}
|
||||
]
|
||||
},
|
||||
"fa5b4b8a751c7d1b": {
|
||||
"source": "Cursor 使用的本地代理端口;填写 0 时启动时随机选择。",
|
||||
"kind": "text",
|
||||
@@ -5521,7 +5630,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 191,
|
||||
"line": 192,
|
||||
"column": 21
|
||||
}
|
||||
]
|
||||
@@ -5683,7 +5792,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 307,
|
||||
"line": 309,
|
||||
"column": 38
|
||||
}
|
||||
]
|
||||
@@ -5700,7 +5809,7 @@
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 182,
|
||||
"line": 183,
|
||||
"column": 121
|
||||
},
|
||||
{
|
||||
@@ -5729,17 +5838,17 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 65,
|
||||
"line": 66,
|
||||
"column": 46
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 203,
|
||||
"line": 204,
|
||||
"column": 22
|
||||
},
|
||||
{
|
||||
"file": "features/settings/SettingsPage.tsx",
|
||||
"line": 218,
|
||||
"line": 219,
|
||||
"column": 58
|
||||
}
|
||||
]
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"028c60a8a8e30a1b": "Page {page} / {total}",
|
||||
"03ff62ab4b818492": "Cache write: {tokens} × ${price}/1M = {cost}",
|
||||
"051836569928a9f9": "Edit",
|
||||
"0525054436acdb6e": "Commit message prompt",
|
||||
"05468af47054d488": "Connectivity test for {model} succeeded ({duration} ms)",
|
||||
"0580e0a99a6f1afc": "Artifacts",
|
||||
"06619f339fa0ab46": "Preparing the plugin runtime",
|
||||
@@ -40,6 +41,7 @@
|
||||
"1813d362a82fd437": "Maximize window",
|
||||
"18165f8865eacc91": "No plugins installed",
|
||||
"19658d9fa9aa8de4": "Installing…",
|
||||
"19bb071f8c362695": "Prompt settings",
|
||||
"1a3f0617d6de8e52": "Username",
|
||||
"1a60c9eb3cf1dbb5": "Import finished: {added} added, {updated} updated",
|
||||
"1aa65c55c6cc6163": "Device code",
|
||||
@@ -287,8 +289,10 @@
|
||||
"b8c9b486c83b5778": "Hide ad",
|
||||
"b9670c85a4ab939e": "Route",
|
||||
"b9af2de88d903be7": "Proxy address",
|
||||
"ba2e93e73037c71e": "Restore default",
|
||||
"ba5865fbc734e672": "For example: Primary model",
|
||||
"ba6403d22876d626": "Cooling down",
|
||||
"bac36835ace45f3a": "Commit settings",
|
||||
"baff6c144180b185": "Connectivity tests completed: {successful} succeeded, {failed} failed",
|
||||
"bb2b7736433ae867": "Cursor tracing",
|
||||
"bb7efdcb6af6e805": "Default dark",
|
||||
@@ -330,6 +334,7 @@
|
||||
"d7e266bdc8064193": "Group name",
|
||||
"d86fa42c3848c680": "Use system proxy",
|
||||
"d8c47e9776cf1082": "Main menu",
|
||||
"d8c589c455675b46": "Prompt settings saved",
|
||||
"da521d1c1cbd36af": "Authorization is required to install the certificate",
|
||||
"da7ae985487c38e6": "Last hour",
|
||||
"daede9881787abe7": "Notes",
|
||||
@@ -354,6 +359,7 @@
|
||||
"e24096c81b1a8af4": "Authorization was denied or failed.",
|
||||
"e24ebe4a866d69bf": "Test failed: {error}",
|
||||
"e25bf3f419bb68f0": "Call history",
|
||||
"e2ebc59779f012ed": "Generation model",
|
||||
"e3fee05f688708b4": "LLM calls",
|
||||
"e4760c6a1df24f17": "Complete request URL",
|
||||
"e5043c7a2b408271": "Last 10 minutes",
|
||||
@@ -387,6 +393,7 @@
|
||||
"f9615d05d8e18595": "Clear {label} filter",
|
||||
"f9aa11dbb15ce647": "Saturday",
|
||||
"f9b55ca75425161b": "Response content was not recorded. Enable detailed records and try again.",
|
||||
"fa2352729a82e74b": "Direct uses Cursor's original channel; pick a model configured on the Cursor page to generate locally.",
|
||||
"fa5b4b8a751c7d1b": "The local proxy port used by Cursor. Enter 0 to select a random port at startup.",
|
||||
"fad86bf65f72c747": "Download progress",
|
||||
"fb11aa6f29827095": "Checking…",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"028c60a8a8e30a1b": "第 {page} / {total} 页",
|
||||
"03ff62ab4b818492": "缓存写入:{tokens} × ${price}/1M = {cost}",
|
||||
"051836569928a9f9": "编辑",
|
||||
"0525054436acdb6e": "提交信息提示词",
|
||||
"05468af47054d488": "模型 {model} 连通性测试成功({duration} ms)",
|
||||
"0580e0a99a6f1afc": "工件数",
|
||||
"06619f339fa0ab46": "正在准备插件运行时",
|
||||
@@ -40,6 +41,7 @@
|
||||
"1813d362a82fd437": "最大化窗口",
|
||||
"18165f8865eacc91": "还没有安装插件",
|
||||
"19658d9fa9aa8de4": "安装中…",
|
||||
"19bb071f8c362695": "提示词设置",
|
||||
"1a3f0617d6de8e52": "用户名",
|
||||
"1a60c9eb3cf1dbb5": "导入完成:新增 {added},更新 {updated}",
|
||||
"1aa65c55c6cc6163": "设备验证码",
|
||||
@@ -287,8 +289,10 @@
|
||||
"b8c9b486c83b5778": "不再显示广告",
|
||||
"b9670c85a4ab939e": "路由",
|
||||
"b9af2de88d903be7": "代理地址",
|
||||
"ba2e93e73037c71e": "恢复默认",
|
||||
"ba5865fbc734e672": "例如:主力模型",
|
||||
"ba6403d22876d626": "冷却中",
|
||||
"bac36835ace45f3a": "Commit 设置",
|
||||
"baff6c144180b185": "连通性测试完成:成功 {successful},失败 {failed}",
|
||||
"bb2b7736433ae867": "Cursor 追踪",
|
||||
"bb7efdcb6af6e805": "默认暗色",
|
||||
@@ -330,6 +334,7 @@
|
||||
"d7e266bdc8064193": "分组名称",
|
||||
"d86fa42c3848c680": "使用系统代理",
|
||||
"d8c47e9776cf1082": "主菜单",
|
||||
"d8c589c455675b46": "提示词设置已保存",
|
||||
"da521d1c1cbd36af": "需要授权安装证书",
|
||||
"da7ae985487c38e6": "近1小时",
|
||||
"daede9881787abe7": "备注",
|
||||
@@ -354,6 +359,7 @@
|
||||
"e24096c81b1a8af4": "授权被拒绝或已失败。",
|
||||
"e24ebe4a866d69bf": "测试失败:{error}",
|
||||
"e25bf3f419bb68f0": "调用详细",
|
||||
"e2ebc59779f012ed": "生成模型",
|
||||
"e3fee05f688708b4": "LLM 调用",
|
||||
"e4760c6a1df24f17": "完整请求 URL",
|
||||
"e5043c7a2b408271": "近10分钟",
|
||||
@@ -387,6 +393,7 @@
|
||||
"f9615d05d8e18595": "清除{label}筛选",
|
||||
"f9aa11dbb15ce647": "周六",
|
||||
"f9b55ca75425161b": "未记录响应内容,请开启详细记录后重试。",
|
||||
"fa2352729a82e74b": "直连走 Cursor 原有通道;选择 Cursor 页已配置的模型后由本地生成。",
|
||||
"fa5b4b8a751c7d1b": "Cursor 使用的本地代理端口;填写 0 时启动时随机选择。",
|
||||
"fad86bf65f72c747": "下载进度",
|
||||
"fb11aa6f29827095": "检查中…",
|
||||
|
||||
@@ -150,6 +150,15 @@ export interface DesktopSettings {
|
||||
show_dock_icon: boolean;
|
||||
}
|
||||
|
||||
export interface CommitSettings {
|
||||
model_id: string;
|
||||
prompt: string;
|
||||
}
|
||||
|
||||
export interface CommitSettingsView extends CommitSettings {
|
||||
default_prompt: string;
|
||||
}
|
||||
|
||||
export type PluginRuntimeState = "uninitialized" | "initializing" | "ready" | "failed" | "unsupported";
|
||||
export type PluginRuntimePhase = "checking" | "downloading" | "verifying" | "installing" | "validating";
|
||||
|
||||
@@ -508,4 +517,6 @@ export const api = {
|
||||
setTabSettings: (settings: TabSettings) => request<TabSettings>("/settings/tab", { method: "PUT", body: JSON.stringify(settings) }),
|
||||
desktopSettings: () => request<DesktopSettings>("/settings/desktop"),
|
||||
setDesktopSettings: (settings: DesktopSettings) => request<DesktopSettings>("/settings/desktop", { method: "PUT", body: JSON.stringify(settings) }),
|
||||
commitSettings: () => request<CommitSettingsView>("/settings/commit"),
|
||||
setCommitSettings: (settings: CommitSettings) => request<CommitSettingsView>("/settings/commit", { method: "PUT", body: JSON.stringify(settings) }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user