diff --git a/frontend/src/views/settings/ModelSettings.vue b/frontend/src/views/settings/ModelSettings.vue
index a0ec6981..1964d165 100644
--- a/frontend/src/views/settings/ModelSettings.vue
+++ b/frontend/src/views/settings/ModelSettings.vue
@@ -41,34 +41,58 @@
-
handleMenuAction({ value }, model._modelType, model)">
-
-
- {{ typeLabel(model._modelType) }}
-
-
- {{ model.source === 'local' ? 'Ollama' : sourceLabel(model._modelType) }}
-
-
- {{ $t('modelSettings.builtinTag') }}
-
-
-
-
-
- {{ model.baseUrl }}
-
-
-
- Ollama local
-
-
- {{ $t('model.editor.dimensionLabel') }}: {{ model.dimension }}
-
-
-
+
+
+
+
+
+
+
+
+ {{ typeLabel(model._modelType) }}
+ ·
+
+ {{ model.source === 'local' ? 'Ollama' : sourceLabel(model._modelType) }}
+
+
+ ·
+ {{ $t('model.editor.dimensionLabel') }} {{ model.dimension }}
+
+
+
+ {{ model.baseUrl }}
+
+
+ Ollama local
+
+
+
@@ -99,7 +123,6 @@ import { MessagePlugin } from 'tdesign-vue-next'
import { AddIcon } from 'tdesign-icons-vue-next'
import { useI18n } from 'vue-i18n'
import ModelEditorDialog from '@/components/ModelEditorDialog.vue'
-import SettingCard from '@/components/settings/SettingCard.vue'
import { useConfirmDelete } from '@/components/settings/useConfirmDelete'
import { listModels, createModel, updateModel as updateModelAPI, deleteModel as deleteModelAPI, type ModelConfig } from '@/api/model'
import { useAuthStore } from '@/stores/auth'
@@ -174,6 +197,18 @@ const addModelOptions = computed(() => ([
{ content: t('modelSettings.typeShort.asr'), value: 'asr' }
]))
+// 类型徽章图标。沿用 TDesign 自带 icon name,避免再引第三方图标包。
+const typeIcon = (type: ModelType): string => {
+ const map: Record = {
+ chat: 'chat',
+ embedding: 'chart-bubble',
+ rerank: 'filter-sort',
+ vllm: 'image',
+ asr: 'sound',
+ }
+ return map[type]
+}
+
const typeLabel = (type: ModelType) => {
const map: Record = {
chat: t('modelSettings.typeShort.chat'),
@@ -557,52 +592,176 @@ onMounted(() => {
.model-grid {
display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 12px;
}
-.model-meta-item {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- max-width: 100%;
- overflow: hidden;
+// 模型卡片 —— 左侧类型徽章 + 标题 / 副标题 / baseUrl 三段式
+.model-card {
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+ padding: 14px 14px 14px 12px;
+ border: 1px solid var(--td-component-stroke);
+ border-radius: 10px;
+ background: var(--td-bg-color-container);
+ transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
+ min-width: 0;
- .model-meta-text {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ &:hover {
+ border-color: var(--td-brand-color-3, var(--td-brand-color));
+ box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
+ }
+
+ &--builtin {
+ background: var(--td-bg-color-secondarycontainer);
+
+ .model-card__title {
+ color: var(--td-text-color-secondary);
+ }
+
+ &:hover {
+ box-shadow: none;
+ border-color: var(--td-component-stroke);
+ }
}
}
-// 5 种模型类型各自的 tag 配色
-:deep(.model-type-tag) {
- &--chat {
- background: #E8F3FF;
- color: #0052D9;
- }
+.model-card__badge {
+ flex-shrink: 0;
+ width: 36px;
+ height: 36px;
+ border-radius: 9px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 1px;
+ // 默认底色,被 type 修饰覆盖
+ background: rgba(0, 82, 217, 0.1);
+ color: #0052D9;
+}
- &--embedding {
- background: #F0E9FF;
- color: #6235BB;
- }
+// 5 种类型的徽章配色 —— 比原 tag 配色饱和度低一档,避免炫光
+.model-card--chat .model-card__badge {
+ background: rgba(0, 82, 217, 0.1);
+ color: #0052D9;
+}
- &--rerank {
- background: #FEF3E6;
- color: #B85C00;
- }
+.model-card--embedding .model-card__badge {
+ background: rgba(98, 53, 187, 0.1);
+ color: #6235BB;
+}
- &--vllm {
- background: #FEECEC;
- color: #C93E3E;
- }
+.model-card--rerank .model-card__badge {
+ background: rgba(184, 92, 0, 0.1);
+ color: #B85C00;
+}
- &--asr {
- background: #E7F7F2;
- color: #118053;
+.model-card--vllm .model-card__badge {
+ background: rgba(201, 62, 62, 0.1);
+ color: #C93E3E;
+}
+
+.model-card--asr .model-card__badge {
+ background: rgba(17, 128, 83, 0.1);
+ color: #118053;
+}
+
+.model-card__body {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+
+.model-card__header {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ min-width: 0;
+}
+
+.model-card__title {
+ flex: 1;
+ min-width: 0;
+ margin: 0;
+ font-size: 14px;
+ font-weight: 600;
+ line-height: 1.4;
+ color: var(--td-text-color-primary);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.model-card__pill {
+ flex-shrink: 0;
+ padding: 1px 6px;
+ font-size: 11px;
+ font-weight: 500;
+ line-height: 16px;
+ color: var(--td-warning-color-7, #B85C00);
+ background: var(--td-warning-color-1, #FEF3E6);
+ border-radius: 3px;
+}
+
+.model-card__more {
+ flex-shrink: 0;
+ color: var(--td-text-color-placeholder);
+ padding: 2px;
+ opacity: 0;
+ transition: opacity 0.15s ease;
+
+ &:hover,
+ &:focus-visible {
+ background: var(--td-bg-color-secondarycontainer);
+ color: var(--td-text-color-primary);
}
}
+// Hover / 键盘焦点 / 菜单已展开 时显示,避免静态卡片上有"杂物"。
+.model-card:hover .model-card__more,
+.model-card:focus-within .model-card__more {
+ opacity: 1;
+}
+
+.model-card__subtitle {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 4px;
+ font-size: 12px;
+ line-height: 1.4;
+ color: var(--td-text-color-secondary);
+ min-width: 0;
+}
+
+.model-card__type {
+ font-weight: 500;
+ color: var(--td-text-color-secondary);
+}
+
+.model-card__sep {
+ color: var(--td-text-color-placeholder);
+}
+
+.model-card__url {
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
+ font-size: 11px;
+ line-height: 1.4;
+ color: var(--td-text-color-placeholder);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ min-width: 0;
+}
+
+.model-card__url--muted {
+ font-family: inherit;
+ font-style: italic;
+}
+
.empty-state {
padding: 64px 0;
text-align: center;
@@ -614,21 +773,4 @@ onMounted(() => {
}
}
-:deep(.t-tag) {
- border-radius: 3px;
- padding: 2px 8px;
- font-size: 11px;
- font-weight: 500;
- border: none;
-
- &.t-tag--theme-primary {
- background: var(--td-brand-color-light);
- color: var(--td-brand-color);
- }
-
- &.t-size-s {
- height: 20px;
- line-height: 16px;
- }
-}