refactor(frontend): unify Model/WebSearch/MCP settings pages with shared card + drawer
Aligns the three list-style settings pages (ModelSettings, WebSearchSettings,
McpSettings) under a consistent visual language, and replaces the modal editors
with right-side drawers for a calmer editing flow.
- Extract shared building blocks under frontend/src/components/settings/:
SettingCard (list-item card), SettingDrawer (500px right drawer with a
pinned footer), and useConfirmDelete (a single DialogPlugin.confirm path
that replaces the mix of window.confirm / t-popconfirm / ad-hoc dialogs).
- Swap the old bespoke overlay / t-dialog shells in ModelEditorDialog and
McpServiceDialog for SettingDrawer. Form logic is untouched.
- Model settings now use a single t-tabs filter (All/Chat/Embedding/ReRank/
Vision/Speech with per-type counts) and decouple "Add model" from the tab
state via a dropdown in the header. Type tags get a 5-color palette so
categories read at a glance. The list is a two-column grid.
- Web search and MCP lists are likewise rendered as two-column grids, with
richer cards: transport type / provider, on-off and default state, plus a
compact meta row showing base URL, proxy or service URL.
- Introduce modelSettings.typeShort.{chat,embedding,rerank,vllm,asr} in all
four locales for the shortened category labels.
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<t-dialog
|
||||
v-model:visible="dialogVisible"
|
||||
:header="mode === 'add' ? t('mcpServiceDialog.addTitle') : t('mcpServiceDialog.editTitle')"
|
||||
width="700px"
|
||||
:on-confirm="handleSubmit"
|
||||
:on-cancel="handleClose"
|
||||
:confirm-btn="{ content: t('common.save'), loading: submitting }"
|
||||
<SettingDrawer
|
||||
:visible="dialogVisible"
|
||||
:title="mode === 'add' ? t('mcpServiceDialog.addTitle') : t('mcpServiceDialog.editTitle')"
|
||||
:confirm-loading="submitting"
|
||||
@update:visible="(v: boolean) => dialogVisible = v"
|
||||
@confirm="handleSubmit"
|
||||
@cancel="handleClose"
|
||||
>
|
||||
<t-form
|
||||
ref="formRef"
|
||||
:data="formData"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-align="top"
|
||||
>
|
||||
<t-form-item :label="t('mcpServiceDialog.name')" name="name">
|
||||
<t-input v-model="formData.name" :placeholder="t('mcpServiceDialog.namePlaceholder')" />
|
||||
@@ -95,7 +95,7 @@
|
||||
</t-collapse-panel>
|
||||
</t-collapse>
|
||||
</t-form>
|
||||
</t-dialog>
|
||||
</SettingDrawer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -108,6 +108,7 @@ import {
|
||||
updateMCPService,
|
||||
type MCPService
|
||||
} from '@/api/mcp-service'
|
||||
import SettingDrawer from '@/components/settings/SettingDrawer.vue'
|
||||
|
||||
interface Props {
|
||||
visible: boolean
|
||||
|
||||
Reference in New Issue
Block a user