Skip to content

Commit 152d112

Browse files
committed
refactor: 优化 ModelSelector 和 ProxySettings 组件,移除不必要的帮助信息,调整付费检测状态显示
refactor: 更新 KeyLogModal 组件,优化模型选择和付费检测状态的显示方式 refactor: 清理 en.json 和 zh.json 中的多余文本,简化用户界面提示 style: 调整组件样式,优化响应式布局和状态指示器的样式
1 parent 9305523 commit 152d112

File tree

7 files changed

+132
-90
lines changed

7 files changed

+132
-90
lines changed

src/components/features/ApiConfig/ModelSelector.jsx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,23 @@ const ModelSelector = () => {
120120

121121
return (
122122
<div className="space-y-sm">
123-
<label className="text-sm font-medium text-primary">
124-
{t('selectModel')}
125-
{state.detectedModels.size > 0 && (
126-
<span className="text-xs text-success ml-xs">
127-
{' '}({t('detected')} {state.detectedModels.size} {t('models')})
128-
</span>
123+
<div className="flex items-center gap-md">
124+
<label className="text-sm font-medium text-primary">
125+
{t('selectModel')}
126+
{state.detectedModels.size > 0 && (
127+
<span className="text-xs text-success ml-xs">
128+
{' '}({t('detected')} {state.detectedModels.size} {t('models')})
129+
</span>
130+
)}
131+
</label>
132+
133+
{/* 付费检测状态信息 */}
134+
{state.apiType === 'gemini' && state.enablePaidDetection && (
135+
<small className="form-info enabled text-xs">
136+
{t('paidDetectionEnabled')}
137+
</small>
129138
)}
130-
</label>
139+
</div>
131140
<div className="flex gap-xs">
132141
{!isCustomModel ? (
133142
<select
@@ -176,17 +185,6 @@ const ModelSelector = () => {
176185
</button>
177186
</div>
178187

179-
<small className="form-help">{t('modelHelp')}</small>
180-
181-
{/* 付费检测状态信息 */}
182-
{state.apiType === 'gemini' && (
183-
<div className="paid-detection-status">
184-
<small className={`form-info ${state.enablePaidDetection ? 'enabled' : 'disabled'}`}>
185-
{state.enablePaidDetection ? t('paidDetectionEnabled') : t('paidDetectionDisabled')}
186-
</small>
187-
</div>
188-
)}
189-
190188
<PaidDetectionPrompt
191189
isOpen={showPaidDetectionPrompt}
192190
onClose={() => setShowPaidDetectionPrompt(false)}

src/components/features/ApiConfig/ProxySettings.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const ProxySettings = () => {
3131
onChange={handleProxyChange}
3232
/>
3333
</div>
34-
<small className="form-help">{t('proxyHelp')}</small>
3534
</div>
3635
);
3736
};

src/components/features/LogsPreview/KeyLogModal.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ const KeyLogModal = () => {
216216
<div className="text-xs text-secondary">
217217
{(t('selectApi') || '选择 API 类型') + ': ' + (logEntry.apiType || '-')}
218218
</div>
219-
<div className="text-xs text-secondary">
220-
{(t('selectModel') || '测试模型') + ': ' + (logEntry.model || '-')}
219+
<div className="flex items-center gap-md text-xs text-secondary">
220+
<span>{(t('selectModel') || '测试模型') + ': ' + (logEntry.model || '-')}</span>
221+
{metadata.enablePaidDetection ? (
222+
<span>{t('paidDetectionEnabled') || '已开启付费检测'}</span>
223+
) : null}
221224
</div>
222225
{metadata.proxyUrl ? (
223226
<div className="text-xs text-secondary">Proxy: {metadata.proxyUrl}</div>
224227
) : null}
225-
{metadata.enablePaidDetection ? (
226-
<div className="text-xs text-secondary">{t('paidDetectionEnabled') || '已开启付费检测'}</div>
227-
) : null}
228228
</Card>
229229
</div>
230230

src/locales/en.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
"selectModel": "Test Model",
44
"customModel": "Custom",
55
"presetModel": "Preset",
6-
"modelHelp": "Choose preset model or enter custom model name",
76
"modelInputPlaceholder": "Enter custom model name",
87
"detectedModelsTitle": "Detected Models",
98
"detecting": "Detecting...",
109
"detected": "Detected",
1110
"proxyUrl": "Proxy Server URL (Optional)",
12-
"proxyHelp": "Leave empty to use default proxy",
1311
"concurrencyControl": "Concurrency Control",
1412
"retryControl": "Retry Control",
1513
"retryHelp": "Number of retries when encountering temporary errors (like 403), helps improve detection accuracy",

src/locales/zh.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
"selectModel": "测试模型",
44
"customModel": "自定义",
55
"presetModel": "预设",
6-
"modelHelp": "可以选择预设模型或输入自定义模型名",
76
"modelInputPlaceholder": "输入自定义模型名",
87
"detectedModelsTitle": "检测到的模型",
98
"detecting": "检测中",
109
"detected": "检测到",
1110
"proxyUrl": "代理服务器 URL (可选)",
12-
"proxyHelp": "留空使用默认代理",
1311
"concurrencyControl": "并发控制",
1412
"retryControl": "重试控制",
1513
"retryHelp": "遇到临时错误(如403)时重试次数,有助于提高检测准确性",

src/styles/components.css

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
}
117117

118118
/* 只对textarea类型的form-field应用特殊样式 */
119-
.form-field.textarea,
119+
.form-field.textarea,
120120
textarea.form-field {
121121
resize: vertical;
122122
min-height: 120px;
@@ -219,16 +219,16 @@ textarea.form-field {
219219
border-radius: 50%;
220220
}
221221

222-
.switch-input:checked + .switch-slider {
222+
.switch-input:checked+.switch-slider {
223223
background: var(--primary-color);
224224
border-color: var(--primary-color);
225225
}
226226

227-
.switch-input:focus + .switch-slider {
227+
.switch-input:focus+.switch-slider {
228228
box-shadow: 0 0 0 2px var(--primary-color-alpha);
229229
}
230230

231-
.switch-input:checked + .switch-slider:before {
231+
.switch-input:checked+.switch-slider:before {
232232
left: 22px;
233233
background: white;
234234
}
@@ -296,11 +296,11 @@ textarea.form-field {
296296
.mobile-hidden {
297297
display: none !important;
298298
}
299-
299+
300300
.mobile-full-width {
301301
width: 100% !important;
302302
}
303-
303+
304304
.mobile-stack {
305305
flex-direction: column !important;
306306
}
@@ -335,16 +335,16 @@ textarea.form-field {
335335
background: var(--text-secondary);
336336
}
337337

338-
.dark-theme .switch-input:checked + .switch-slider {
338+
.dark-theme .switch-input:checked+.switch-slider {
339339
background: var(--primary-color);
340340
border-color: var(--primary-color);
341341
}
342342

343-
.dark-theme .switch-input:focus + .switch-slider {
343+
.dark-theme .switch-input:focus+.switch-slider {
344344
box-shadow: 0 0 0 2px var(--primary-color-alpha);
345345
}
346346

347-
.dark-theme .switch-input:checked + .switch-slider:before {
347+
.dark-theme .switch-input:checked+.switch-slider:before {
348348
background: white;
349349
}
350350

@@ -380,8 +380,8 @@ textarea.form-field {
380380
border: 2px solid #e9ecef;
381381
border-radius: 12px;
382382
padding: 16px;
383-
max-height: 392px;
384-
min-height: 392px;
383+
max-height: 340px;
384+
min-height: 340px;
385385
}
386386

387387
/* 结果内容区域 */
@@ -526,5 +526,4 @@ textarea.form-field {
526526
border: 1px solid var(--border-color);
527527
margin-bottom: var(--spacing-md);
528528
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
529-
}
530-
529+
}

0 commit comments

Comments
 (0)