diff --git a/frontend/src/views/SettingsView.vue b/frontend/src/views/SettingsView.vue index 0f584eb..09148ba 100644 --- a/frontend/src/views/SettingsView.vue +++ b/frontend/src/views/SettingsView.vue @@ -298,24 +298,6 @@ function resetScheduler() { schedulerConfig.value = JSON.parse(JSON.stringify(originalSchedulerConfig.value)) } -// Provider 默认 URL -function getDefaultBaseUrl(provider: string): string { - switch (provider) { - case 'ollama': return 'http://localhost:11434' - case 'openai': return 'https://api.openai.com/v1' - case 'claude': return 'https://api.anthropic.com' - case 'deepseek': return 'https://api.deepseek.com/v1' - default: return '' - } -} - -// Provider 变化时自动填充 base_url -function onProviderChange(config: LLMModelConfig) { - if (!config.base_url || config.base_url === getDefaultBaseUrl(config.provider)) { - config.base_url = getDefaultBaseUrl(config.provider) - } -} - // Toast 提示 function showToast(message: string, type: 'success' | 'error' = 'success') { toast.value = { show: true, message, type } @@ -324,14 +306,6 @@ function showToast(message: string, type: 'success' | 'error' = 'success') { }, 3000) } - -// 获取模型显示名称 -function getModelName(config: LLMModelConfig): string { - if (config.name) return config.name - if (config.model) return config.model - return '未命名' -} - onMounted(loadSettings) @@ -721,171 +695,6 @@ onMounted(loadSettings) color: var(--accent-cyan); } -/* Model List */ -.model-list { - display: flex; - flex-direction: column; - gap: 12px; -} - -.model-item { - background: var(--bg-card); - border: 1px solid var(--border-mid); - border-radius: var(--radius-md); - padding: 14px; - transition: all var(--transition-fast); -} - -.model-item.disabled { - opacity: 0.5; -} - -.model-item:hover { - border-color: var(--border-mid); -} - -.model-header { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 12px; -} - -.model-name-group { - display: flex; - align-items: center; - gap: 12px; -} - -.model-name-input { - background: var(--bg-void); - border: 1px solid var(--border-dim); - border-radius: var(--radius-sm); - padding: 4px 8px; - color: var(--text-primary); - font-family: var(--font-mono); - font-size: 11px; - width: 150px; -} - -.model-name-input:focus { - outline: none; - border-color: var(--accent-cyan); -} - -.model-enabled { - display: flex; - align-items: center; - gap: 6px; - cursor: pointer; - font-family: var(--font-mono); - font-size: 10px; - color: var(--text-dim); -} - -.model-enabled input { - display: none; -} - -.checkbox-custom { - width: 14px; - height: 14px; - border: 1px solid var(--border-mid); - border-radius: 3px; - background: var(--bg-void); - position: relative; -} - -.model-enabled input:checked + .checkbox-custom { - background: var(--accent-cyan); - border-color: var(--accent-cyan); -} - -.model-enabled input:checked + .checkbox-custom::after { - content: '✓'; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - color: var(--bg-void); - font-size: 10px; -} - -.model-actions { - display: flex; - gap: 4px; -} - -.icon-btn { - width: 26px; - height: 26px; - display: flex; - align-items: center; - justify-content: center; - background: transparent; - border: 1px solid var(--border-mid); - border-radius: var(--radius-sm); - color: var(--text-dim); - cursor: pointer; - transition: all var(--transition-fast); -} - -.icon-btn:hover { - border-color: var(--accent-cyan); - color: var(--accent-cyan); -} - -.icon-btn.danger:hover { - border-color: var(--accent-red); - color: var(--accent-red); -} - -/* 保存按钮状态 */ -.icon-btn.has-changes { - border-color: var(--accent-cyan); - color: var(--accent-cyan); - position: relative; -} - -.icon-btn.is-saving { - opacity: 0.7; - cursor: not-allowed; -} - -.icon-btn.is-saved { - border-color: #10b981; - color: #10b981; -} - -.unsaved-dot { - position: absolute; - top: -3px; - right: -3px; - width: 6px; - height: 6px; - background: var(--accent-red); - border-radius: 50%; -} - -.btn-spinner-sm { - width: 12px; - height: 12px; - border: 2px solid var(--border-mid); - border-top-color: var(--accent-cyan); - border-radius: 50%; - animation: spin 0.8s linear infinite; -} - -@keyframes spin { - to { transform: rotate(360deg); } -} - -.model-footer { - margin-top: 10px; - padding-top: 10px; - border-top: 1px solid var(--border-dim); -} - /* LLM Type Section */ .llm-type-section { margin-bottom: 20px; @@ -929,11 +738,6 @@ onMounted(loadSettings) margin-bottom: 16px; } -/* Model Table */ -.model-table { - /* 表格容器 */ -} - /* Empty State */ .empty-state { display: flex;