From 9c60c8fb782381aeb7cbf99461dda06019e30fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Wed, 17 Jun 2026 03:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84:=20Settings=E6=8B=864?= =?UTF-8?q?=E5=AD=90=E7=BB=84=E4=BB=B6(Provider/Connection/General/Knowled?= =?UTF-8?q?ge=C2=B71042=E8=A1=8C=E7=98=A6=E8=BA=AB=E9=9B=B6=E8=A1=8C?= =?UTF-8?q?=E4=B8=BA=E5=8F=98=E5=8C=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/settings/ConnectionPanel.vue | 262 +++++ src/components/settings/GeneralPanel.vue | 322 +++++ src/components/settings/KnowledgePanel.vue | 213 ++++ src/components/settings/ProviderPanel.vue | 458 ++++++++ src/views/Settings.vue | 1170 +------------------ 5 files changed, 1296 insertions(+), 1129 deletions(-) create mode 100644 src/components/settings/ConnectionPanel.vue create mode 100644 src/components/settings/GeneralPanel.vue create mode 100644 src/components/settings/KnowledgePanel.vue create mode 100644 src/components/settings/ProviderPanel.vue diff --git a/src/components/settings/ConnectionPanel.vue b/src/components/settings/ConnectionPanel.vue new file mode 100644 index 0000000..f5a9424 --- /dev/null +++ b/src/components/settings/ConnectionPanel.vue @@ -0,0 +1,262 @@ + + + + + diff --git a/src/components/settings/GeneralPanel.vue b/src/components/settings/GeneralPanel.vue new file mode 100644 index 0000000..19cbb57 --- /dev/null +++ b/src/components/settings/GeneralPanel.vue @@ -0,0 +1,322 @@ + + + + + diff --git a/src/components/settings/KnowledgePanel.vue b/src/components/settings/KnowledgePanel.vue new file mode 100644 index 0000000..a8b6792 --- /dev/null +++ b/src/components/settings/KnowledgePanel.vue @@ -0,0 +1,213 @@ + + + + + diff --git a/src/components/settings/ProviderPanel.vue b/src/components/settings/ProviderPanel.vue new file mode 100644 index 0000000..85839b2 --- /dev/null +++ b/src/components/settings/ProviderPanel.vue @@ -0,0 +1,458 @@ + + + + + diff --git a/src/views/Settings.vue b/src/views/Settings.vue index d7936c6..179c452 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -20,453 +20,47 @@
- -
-
-

{{ $t('settings.panelAiProvider') }}

- -
-
-
-
-
- {{ p.name }} - {{ $t('settings.badgeDefault') }} - {{ $t('settings.badgePoolDisabled') }} -
-
- - - -
-
-
-
- {{ $t('settings.detailBaseUrl') }} - {{ p.base_url }} -
-
- {{ $t('settings.detailModel') }} - {{ p.default_model }} -
-
- {{ $t('settings.detailApiKey') }} - {{ maskKey(p.api_key) }} -
- -
- {{ $t('settings.detailPoolEnabled') }} -
- -
-
-
- {{ $t('settings.detailPoolWeight') }} -
- - 0-100 -
-
-
-
-
-
{{ $t('settings.emptyProvider') }}
-
+ + - -
-
-

{{ providerForm.editId ? $t('settings.editProviderTitle') : $t('settings.addProviderTitle') }}

- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - {{ $t('settings.fetchHintSaveFirst') }} -
+ + - -
- -
-
-
- - {{ m.model_id }} -
- {{ $t('settings.tagModality.' + md) }} - {{ $t('settings.tagCapability.' + cap) }} - {{ $t('settings.tagCost.' + m.cost_tier) }} - {{ $t('settings.tagIntel.' + m.intelligence) }} - {{ $t('settings.tagSource.' + m.probe_source) }} -
-
-
- - -
-
-
-
{{ $t('settings.modelListHint') }}
-
-
-
+ + - -
-
-

{{ $t('settings.panelConnection') }}

- -
-
-
-
- {{ typeIcon(conn.type) }} -
-
- {{ conn.name }} - {{ typeLabel(conn.type) }} -
- {{ conn.host }}{{ conn.port ? ':' + conn.port : '' }} - {{ conn.user }} -
-
-
- - -
-
-
-
{{ $t('settings.emptyConnection') }}
-
- - -
-
-

{{ connForm.editId ? $t('settings.editConnectionTitle') : $t('settings.addConnectionTitle') }}

- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - -
-
-

{{ $t('settings.panelGeneral') }}

-
-
-
-
- {{ $t('settings.labelTheme') }} - {{ $t('settings.descTheme') }} -
-
- -
-
-
-
- {{ $t('settings.labelLanguage') }} - {{ $t('settings.descLanguage') }} -
-
- -
-
-
-
- {{ $t('settings.labelAiLanguage') }} - {{ $t('settings.descAiLanguage') }} -
-
- -
-
-
-
- {{ $t('settings.labelAutoExecute') }} - {{ $t('settings.descAutoExecute') }} -
-
- -
-
-
-
- {{ $t('settings.labelLogLevel') }} - {{ $t('settings.descLogLevel') }} -
-
- -
-
-
-
- {{ $t('settings.labelShowTokenUsage') }} - {{ $t('settings.descShowTokenUsage') }} -
-
- -
-
-
-
- {{ $t('settings.labelGlobalConcurrency') }} - {{ $t('settings.descGlobalConcurrency') }} -
-
- -
-
-
-
- {{ $t('settings.labelPerConvConcurrency') }} - {{ $t('settings.descPerConvConcurrency') }} -
-
- -
-
-
-
- {{ $t('settings.labelAgentMaxIterations') }} - {{ $t('settings.descAgentMaxIterations') }} -
-
- -
-
-
-
- {{ $t('settings.labelAgentMaxRetries') }} - {{ $t('settings.descAgentMaxRetries') }} -
-
- -
-
-
-
- -
-
-

{{ $t('settings.panelKnowledge') }}

-
-
-
-
- {{ $t('settings.labelAutoExtract') }} - {{ $t('settings.descAutoExtract') }} -
-
- -
-
-
-
- {{ $t('settings.labelTriggerMode') }} - {{ $t('settings.descTriggerMode') }} -
-
- -
-
-
-
- {{ $t('settings.labelMinMessages') }} - {{ $t('settings.descMinMessages') }} -
-
- -
-
-
-
- {{ $t('settings.labelIdleTimeout') }} - {{ $t('settings.descIdleTimeout') }} -
-
- -
-
-
-
- {{ $t('settings.labelAutoInject') }} - {{ $t('settings.descAutoInject') }} -
-
- -
-
-
-
- {{ $t('settings.labelVectorEnabled') }} - {{ $t('settings.descVectorEnabled') }} -
-
- -
-
-
-
- {{ $t('settings.labelEmbeddingProvider') }} - {{ $t('settings.descEmbeddingProvider') }} -
-
- -
-
-
-
- {{ $t('settings.labelEmbeddingModel') }} - {{ $t('settings.descEmbeddingModel') }} -
-
- -
-
-
-
+ +
@@ -1027,17 +169,6 @@ onUnmounted(() => { .btn-ghost:hover { background: var(--df-bg-card); color: var(--df-text); } .btn-sm { padding: 4px 12px; font-size: 12px; } -.btn-link { - background: none; - border: none; - color: var(--df-accent); - font-size: 12px; - cursor: pointer; - padding: 2px 6px; -} -.btn-link:hover { text-decoration: underline; } -.btn-link-danger { color: var(--df-danger); } - /* ===== 设置网格 ===== */ .settings-grid { display: flex; @@ -1045,226 +176,7 @@ onUnmounted(() => { gap: var(--df-gap-grid); } -/* ===== 面板 ===== */ -.panel { - background: var(--df-bg-card); - border: 0.5px solid var(--df-border); - border-radius: var(--df-radius-lg); - padding: var(--df-pad-panel); -} -.panel-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: var(--df-gap-head); -} -.panel-header h2 { font-size: 15px; font-weight: 500; } - -.empty-hint { - font-size: 13px; - color: var(--df-text-dim); - padding: 12px 0; -} - -/* ===== Provider 卡片 ===== */ -.provider-list { display: flex; flex-direction: column; gap: 12px; } -.provider-card { - background: var(--df-bg); - border: 0.5px solid var(--df-border); - border-radius: var(--df-radius); - padding: 14px 16px; -} -.provider-card--default { - border-color: var(--df-accent); - box-shadow: inset 3px 0 0 var(--df-accent); -} -.provider-top { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 10px; -} -.provider-info { display: flex; align-items: center; gap: 8px; } -.provider-name { font-size: 14px; font-weight: 500; color: var(--df-text); } -.default-badge { - font-size: 10px; - padding: 1px 6px; - border-radius: var(--df-radius-xs); - background: rgba(100,255,218,0.15); - color: var(--df-success); - font-weight: 500; -} -.provider-actions { display: flex; gap: 4px; } - -.provider-detail { display: flex; flex-direction: column; gap: 6px; } -.detail-row { display: flex; align-items: flex-start; gap: 12px; } -.detail-label { - font-size: 12px; - color: var(--df-text-dim); - min-width: 60px; -} -.detail-value { - font-size: 12px; - color: var(--df-text-secondary); - font-family: var(--df-font-mono); -} -.detail-value.mask { color: var(--df-text-dim); letter-spacing: 1px; } - -/* ===== 表单 ===== */ -.form-grid { - display: flex; - flex-direction: column; - gap: 14px; -} -.form-field { - display: flex; - flex-direction: column; - gap: 4px; -} -.form-label { - font-size: 12px; - font-weight: 500; - color: var(--df-text-secondary); -} -.form-actions { - display: flex; - justify-content: flex-end; - padding-top: 4px; -} - -/* ===== 连接卡片 ===== */ -.connection-list { display: flex; flex-direction: column; gap: 8px; } -.connection-card { - display: flex; - justify-content: space-between; - align-items: center; - padding: 12px 14px; - background: var(--df-bg); - border: 0.5px solid var(--df-border); - border-radius: var(--df-radius); -} -.conn-left { display: flex; align-items: center; gap: 10px; } -.conn-icon { font-size: 18px; } -.conn-info { display: flex; flex-direction: column; gap: 2px; } -.conn-name-row { display: flex; align-items: center; gap: 8px; } -.conn-name { font-size: 14px; font-weight: 500; color: var(--df-text); } -.conn-type { - font-size: 10px; - padding: 2px 6px; - border-radius: var(--df-radius-sm); - font-weight: 500; -} -.type-mysql { background: rgba(100,181,246,0.15); color: var(--df-info); } -.type-ssh { background: rgba(108,99,255,0.15); color: var(--df-accent); } -.type-redis { background: rgba(255,107,107,0.15); color: var(--df-danger); } -.type-mongo { background: rgba(100,255,218,0.15); color: var(--df-success); } - -.conn-host, .conn-user { - font-size: 12px; - color: var(--df-text-dim); - font-family: var(--df-font-mono); -} -.conn-user { - background: rgba(90,99,128,0.2); - padding: 1px 6px; - border-radius: var(--df-radius-sm); -} -.conn-actions { display: flex; gap: 4px; } - -/* ===== 通用设置 ===== */ -.general-settings { display: flex; flex-direction: column; } -.setting-row { - display: flex; - justify-content: space-between; - align-items: center; - padding: 14px 0; - border-bottom: 0.5px solid var(--df-border); -} -.setting-row:last-child { border-bottom: none; } -.setting-info { display: flex; flex-direction: column; gap: 2px; } -.setting-label { font-size: 14px; font-weight: 500; color: var(--df-text); } -.setting-desc { font-size: 12px; color: var(--df-text-dim); } - -.setting-control { display: flex; align-items: center; } - -.setting-select { - padding: 6px 12px; - background: var(--df-bg); - border: 0.5px solid var(--df-border); - border-radius: var(--df-radius-sm); - color: var(--df-text); - font-size: 13px; - outline: none; - cursor: pointer; - min-width: 160px; -} -.setting-select:focus { border-color: var(--df-accent); } - -.setting-input { - padding: 6px 12px; - background: var(--df-bg); - border: 0.5px solid var(--df-border); - border-radius: var(--df-radius-sm); - color: var(--df-text); - font-size: 13px; - outline: none; - min-width: 260px; -} -.setting-input:focus { border-color: var(--df-accent); } - -/* ===== Toggle 开关 ===== */ -.toggle { - position: relative; - display: inline-block; - width: 40px; - height: 22px; - cursor: pointer; -} -.toggle input { opacity: 0; width: 0; height: 0; } -.toggle-slider { - position: absolute; - top: 0; left: 0; right: 0; bottom: 0; - background: var(--df-border); - border-radius: var(--df-radius-lg); - transition: background 0.2s; -} -.toggle-slider::before { - content: ''; - position: absolute; - width: 16px; - height: 16px; - left: 3px; - bottom: 3px; - background: var(--df-text-dim); - border-radius: 50%; - transition: transform 0.2s, background 0.2s; -} -.toggle input:checked + .toggle-slider { background: var(--df-accent); } -.toggle input:checked + .toggle-slider::before { - transform: translateX(18px); - background: #fff; -} -/* 小号 toggle(model 行 / 池开关) */ -.toggle--sm { width: 32px; height: 18px; } -.toggle--sm .toggle-slider::before { width: 12px; height: 12px; left: 3px; bottom: 3px; } -.toggle--sm input:checked + .toggle-slider::before { transform: translateX(14px); } - -/* 小号输入框(model 权重 / 池权重) */ -.setting-input--sm { min-width: 0; width: 70px; padding: 4px 8px; font-size: 12px; } - -/* Provider 卡片 disabled 态(F-260614-04c:enabled=false 视觉弱化) */ -.provider-card--disabled { opacity: 0.6; } -.pool-badge { - font-size: 10px; - padding: 1px 6px; - border-radius: var(--df-radius-xs); - background: rgba(255,107,107,0.15); - color: var(--df-danger); - font-weight: 500; -} - -/* 负载均衡池行(toggle / weight 控件) */ -.detail-row--pool { align-items: center; } -.detail-value--control { display: flex; align-items: center; gap: 8px; font-family: var(--df-font-mono); } -.pool-weight-hint { font-size: 11px; color: var(--df-text-dim); } +/* 注:.panel / .panel-header / .empty-hint 等子组件内元素的样式 + 已随功能域拆到各子组件 scoped(父 scoped 无法穿透命中子组件根 section), + 各子组件自带面板容器 + 按钮基础样式副本,确保零视觉变化。 */