fix(frontend): polish model settings UI and fix disabled brand color

- Fix global `--td-brand-color-disabled` to use correct muted green instead of bright green
- Unify `variant="text"` buttons (refresh, download, check dimension) in model settings to inherit standard TDesign styles
- Adjust WeKnora Cloud credential status layout and change reconfigure button to outline
- Fix font size of external doc links in model settings hint blocks
- Increase font weight of KB chunking debug trigger for better visibility
This commit is contained in:
wizardchen
2026-05-07 21:48:55 +08:00
committed by lyingbug
parent c77cef5a69
commit 6019c4b661
6 changed files with 59 additions and 47 deletions
File diff suppressed because one or more lines are too long
+19 -24
View File
@@ -13,7 +13,7 @@
<!-- 模型来源 -->
<div class="form-item">
<label class="form-label required">{{ $t('model.editor.sourceLabel') }}</label>
<t-radio-group v-model="formData.source">
<t-radio-group v-model="formData.source" class="source-select">
<t-radio-button
value="local"
:disabled="ollamaServiceStatus === false || modelType === 'rerank'"
@@ -36,10 +36,10 @@
<t-button
variant="text"
size="small"
theme="primary"
@click="goToOllamaSettings"
class="tip-link"
>
<template #icon><t-icon name="jump" /></template>
{{ $t('model.editor.goToOllamaSettings') }}
</t-button>
</div>
@@ -168,10 +168,10 @@
<t-button
variant="text"
size="small"
theme="primary"
@click="goToWeKnoraCloudSettings"
style="padding: 0; height: auto;"
>
<template #icon><t-icon name="jump" /></template>
{{ $t('settings.weknoraCloud.goToSettings') }}
</t-button>
</div>
@@ -298,7 +298,7 @@
<!-- Ollama 本地模型:自动检测维度按钮 -->
<t-button
v-if="formData.source === 'local' && formData.modelName"
variant="outline"
variant="text"
size="small"
:loading="checking"
@click="checkOllamaDimension"
@@ -1275,7 +1275,7 @@ const handleCancel = () => {
// 表单项样式
.form-item {
margin-bottom: 20px;
margin-bottom: 16px;
&:last-child {
margin-bottom: 0;
@@ -1284,8 +1284,8 @@ const handleCancel = () => {
.form-label {
display: block;
margin-bottom: 8px;
font-size: 14px;
margin-bottom: 6px;
font-size: 13px;
font-weight: 500;
color: var(--td-text-color-primary);
@@ -1293,7 +1293,18 @@ const handleCancel = () => {
content: '*';
color: var(--td-error-color);
margin-left: 4px;
font-weight: 600;
font-weight: 500;
}
}
// 模型来源分段:两个选项等分宽度
.source-select {
display: flex;
width: 100%;
:deep(.t-radio-button) {
flex: 1;
text-align: center;
}
}
@@ -1483,25 +1494,10 @@ const handleCancel = () => {
.t-select {
flex: 1;
}
:deep(.t-button) {
height: 32px;
font-size: 13px;
border-radius: 6px;
flex-shrink: 0;
}
}
.refresh-btn {
margin-top: 0;
font-size: 13px;
color: var(--td-text-color-secondary);
flex-shrink: 0;
&:hover {
color: var(--td-brand-color);
background: rgba(7, 192, 95, 0.04);
}
}
@keyframes spin {
@@ -1522,7 +1518,6 @@ const handleCancel = () => {
.dimension-check-btn {
flex-shrink: 0;
font-size: 12px;
}
.dimension-hint {
@@ -368,6 +368,7 @@ const tierTheme = (tier: StrategyTier) => {
--td-bg-color-container-hover: transparent;
padding-left: 0;
padding-right: 0;
font-weight: 600;
&:hover,
&:focus,
@@ -475,6 +475,10 @@ onMounted(() => {
color: var(--td-text-color-secondary);
}
.builtin-models-hint .doc-link {
font-size: 13px;
}
.section-header__top {
display: flex;
align-items: flex-start;
+11 -3
View File
@@ -48,7 +48,7 @@
</t-tag>
<t-button
size="small"
variant="outline"
variant="text"
:loading="testing"
@click="testConnection"
>
@@ -109,13 +109,16 @@
:placeholder="$t('ollamaSettings.download.placeholder')"
style="flex: 1;"
/>
<t-button
theme="primary"
<t-button
variant="base"
theme="default"
size="small"
class="download-btn"
:loading="downloading"
:disabled="!downloadModelName.trim()"
@click="downloadModel"
>
<template #icon><t-icon name="download" /></template>
{{ $t('ollamaSettings.download.download') }}
</t-button>
</div>
@@ -557,6 +560,11 @@ onMounted(async () => {
display: flex;
gap: 8px;
align-items: center;
.download-btn {
flex-shrink: 0;
height: 32px;
}
}
.download-progress {
@@ -2,16 +2,18 @@
<div class="weknoracloud-settings">
<div class="section-header">
<h2>{{ $t('settings.weknoraCloud.title') }}</h2>
<p class="section-description">{{ $t('settings.weknoraCloud.description') }}</p>
<a
class="doc-link"
href="https://developers.weixin.qq.com/doc/aispeech/knowledge/atomic_capability/atomic_interface.html"
target="_blank"
rel="noopener noreferrer"
>
{{ $t('settings.weknoraCloud.viewDocs') }}
<t-icon name="link" class="link-icon" />
</a>
<p class="section-description">
{{ $t('settings.weknoraCloud.description') }}
<a
class="doc-link"
href="https://developers.weixin.qq.com/doc/aispeech/knowledge/atomic_capability/atomic_interface.html"
target="_blank"
rel="noopener noreferrer"
>
{{ $t('settings.weknoraCloud.viewDocs') }}
<t-icon name="link" class="link-icon" />
</a>
</p>
</div>
<!-- 未配置 -->
@@ -31,15 +33,16 @@
<!-- 已配置正常 -->
<div v-else-if="credentialState === 'configured'" class="credential-status success">
<t-icon name="check-circle" style="font-size: 16px; color: var(--td-success-color); flex-shrink: 0;" />
<t-icon name="check-circle" style="font-size: 16px; color: var(--td-brand-color); flex-shrink: 0;" />
<span class="status-text">{{ $t('settings.weknoraCloud.configured') }}</span>
<t-button
v-if="!formExpanded"
variant="text"
variant="outline"
theme="default"
size="small"
theme="primary"
@click="formExpanded = true"
>
<template #icon><t-icon name="edit" /></template>
{{ $t('settings.weknoraCloud.reconfigure') }}
</t-button>
</div>
@@ -224,9 +227,10 @@ onMounted(() => {
}
&.success {
background: var(--td-success-color-light);
border: 1px solid var(--td-success-color-focus);
color: var(--td-success-color);
padding: 0;
background: transparent;
border: none;
color: var(--td-text-color-secondary);
}
.status-text {