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:
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@
|
|||||||
<!-- 模型来源 -->
|
<!-- 模型来源 -->
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
<label class="form-label required">{{ $t('model.editor.sourceLabel') }}</label>
|
<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
|
<t-radio-button
|
||||||
value="local"
|
value="local"
|
||||||
:disabled="ollamaServiceStatus === false || modelType === 'rerank'"
|
:disabled="ollamaServiceStatus === false || modelType === 'rerank'"
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
<t-button
|
<t-button
|
||||||
variant="text"
|
variant="text"
|
||||||
size="small"
|
size="small"
|
||||||
theme="primary"
|
|
||||||
@click="goToOllamaSettings"
|
@click="goToOllamaSettings"
|
||||||
class="tip-link"
|
class="tip-link"
|
||||||
>
|
>
|
||||||
|
<template #icon><t-icon name="jump" /></template>
|
||||||
{{ $t('model.editor.goToOllamaSettings') }}
|
{{ $t('model.editor.goToOllamaSettings') }}
|
||||||
</t-button>
|
</t-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -168,10 +168,10 @@
|
|||||||
<t-button
|
<t-button
|
||||||
variant="text"
|
variant="text"
|
||||||
size="small"
|
size="small"
|
||||||
theme="primary"
|
|
||||||
@click="goToWeKnoraCloudSettings"
|
@click="goToWeKnoraCloudSettings"
|
||||||
style="padding: 0; height: auto;"
|
style="padding: 0; height: auto;"
|
||||||
>
|
>
|
||||||
|
<template #icon><t-icon name="jump" /></template>
|
||||||
{{ $t('settings.weknoraCloud.goToSettings') }}
|
{{ $t('settings.weknoraCloud.goToSettings') }}
|
||||||
</t-button>
|
</t-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -298,7 +298,7 @@
|
|||||||
<!-- Ollama 本地模型:自动检测维度按钮 -->
|
<!-- Ollama 本地模型:自动检测维度按钮 -->
|
||||||
<t-button
|
<t-button
|
||||||
v-if="formData.source === 'local' && formData.modelName"
|
v-if="formData.source === 'local' && formData.modelName"
|
||||||
variant="outline"
|
variant="text"
|
||||||
size="small"
|
size="small"
|
||||||
:loading="checking"
|
:loading="checking"
|
||||||
@click="checkOllamaDimension"
|
@click="checkOllamaDimension"
|
||||||
@@ -1275,7 +1275,7 @@ const handleCancel = () => {
|
|||||||
|
|
||||||
// 表单项样式
|
// 表单项样式
|
||||||
.form-item {
|
.form-item {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 16px;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -1284,8 +1284,8 @@ const handleCancel = () => {
|
|||||||
|
|
||||||
.form-label {
|
.form-label {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 6px;
|
||||||
font-size: 14px;
|
font-size: 13px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--td-text-color-primary);
|
color: var(--td-text-color-primary);
|
||||||
|
|
||||||
@@ -1293,7 +1293,18 @@ const handleCancel = () => {
|
|||||||
content: '*';
|
content: '*';
|
||||||
color: var(--td-error-color);
|
color: var(--td-error-color);
|
||||||
margin-left: 4px;
|
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 {
|
.t-select {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.t-button) {
|
|
||||||
height: 32px;
|
|
||||||
font-size: 13px;
|
|
||||||
border-radius: 6px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.refresh-btn {
|
.refresh-btn {
|
||||||
margin-top: 0;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--td-text-color-secondary);
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--td-brand-color);
|
|
||||||
background: rgba(7, 192, 95, 0.04);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
@@ -1522,7 +1518,6 @@ const handleCancel = () => {
|
|||||||
|
|
||||||
.dimension-check-btn {
|
.dimension-check-btn {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
font-size: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dimension-hint {
|
.dimension-hint {
|
||||||
|
|||||||
@@ -368,6 +368,7 @@ const tierTheme = (tier: StrategyTier) => {
|
|||||||
--td-bg-color-container-hover: transparent;
|
--td-bg-color-container-hover: transparent;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus,
|
&:focus,
|
||||||
|
|||||||
@@ -475,6 +475,10 @@ onMounted(() => {
|
|||||||
color: var(--td-text-color-secondary);
|
color: var(--td-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.builtin-models-hint .doc-link {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
.section-header__top {
|
.section-header__top {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
</t-tag>
|
</t-tag>
|
||||||
<t-button
|
<t-button
|
||||||
size="small"
|
size="small"
|
||||||
variant="outline"
|
variant="text"
|
||||||
:loading="testing"
|
:loading="testing"
|
||||||
@click="testConnection"
|
@click="testConnection"
|
||||||
>
|
>
|
||||||
@@ -109,13 +109,16 @@
|
|||||||
:placeholder="$t('ollamaSettings.download.placeholder')"
|
:placeholder="$t('ollamaSettings.download.placeholder')"
|
||||||
style="flex: 1;"
|
style="flex: 1;"
|
||||||
/>
|
/>
|
||||||
<t-button
|
<t-button
|
||||||
theme="primary"
|
variant="base"
|
||||||
|
theme="default"
|
||||||
size="small"
|
size="small"
|
||||||
|
class="download-btn"
|
||||||
:loading="downloading"
|
:loading="downloading"
|
||||||
:disabled="!downloadModelName.trim()"
|
:disabled="!downloadModelName.trim()"
|
||||||
@click="downloadModel"
|
@click="downloadModel"
|
||||||
>
|
>
|
||||||
|
<template #icon><t-icon name="download" /></template>
|
||||||
{{ $t('ollamaSettings.download.download') }}
|
{{ $t('ollamaSettings.download.download') }}
|
||||||
</t-button>
|
</t-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -557,6 +560,11 @@ onMounted(async () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
.download-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.download-progress {
|
.download-progress {
|
||||||
|
|||||||
@@ -2,16 +2,18 @@
|
|||||||
<div class="weknoracloud-settings">
|
<div class="weknoracloud-settings">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<h2>{{ $t('settings.weknoraCloud.title') }}</h2>
|
<h2>{{ $t('settings.weknoraCloud.title') }}</h2>
|
||||||
<p class="section-description">{{ $t('settings.weknoraCloud.description') }}</p>
|
<p class="section-description">
|
||||||
<a
|
{{ $t('settings.weknoraCloud.description') }}
|
||||||
class="doc-link"
|
<a
|
||||||
href="https://developers.weixin.qq.com/doc/aispeech/knowledge/atomic_capability/atomic_interface.html"
|
class="doc-link"
|
||||||
target="_blank"
|
href="https://developers.weixin.qq.com/doc/aispeech/knowledge/atomic_capability/atomic_interface.html"
|
||||||
rel="noopener noreferrer"
|
target="_blank"
|
||||||
>
|
rel="noopener noreferrer"
|
||||||
{{ $t('settings.weknoraCloud.viewDocs') }}
|
>
|
||||||
<t-icon name="link" class="link-icon" />
|
{{ $t('settings.weknoraCloud.viewDocs') }}
|
||||||
</a>
|
<t-icon name="link" class="link-icon" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 未配置 -->
|
<!-- 未配置 -->
|
||||||
@@ -31,15 +33,16 @@
|
|||||||
|
|
||||||
<!-- 已配置正常 -->
|
<!-- 已配置正常 -->
|
||||||
<div v-else-if="credentialState === 'configured'" class="credential-status success">
|
<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>
|
<span class="status-text">{{ $t('settings.weknoraCloud.configured') }}</span>
|
||||||
<t-button
|
<t-button
|
||||||
v-if="!formExpanded"
|
v-if="!formExpanded"
|
||||||
variant="text"
|
variant="outline"
|
||||||
|
theme="default"
|
||||||
size="small"
|
size="small"
|
||||||
theme="primary"
|
|
||||||
@click="formExpanded = true"
|
@click="formExpanded = true"
|
||||||
>
|
>
|
||||||
|
<template #icon><t-icon name="edit" /></template>
|
||||||
{{ $t('settings.weknoraCloud.reconfigure') }}
|
{{ $t('settings.weknoraCloud.reconfigure') }}
|
||||||
</t-button>
|
</t-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -224,9 +227,10 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.success {
|
&.success {
|
||||||
background: var(--td-success-color-light);
|
padding: 0;
|
||||||
border: 1px solid var(--td-success-color-focus);
|
background: transparent;
|
||||||
color: var(--td-success-color);
|
border: none;
|
||||||
|
color: var(--td-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-text {
|
.status-text {
|
||||||
|
|||||||
Reference in New Issue
Block a user