| | |
| | | <ElCard class="art-table-card ai-param-runtime-summary-card !mb-5" shadow="never"> |
| | | <div class="mb-3 flex items-start justify-between gap-4"> |
| | | <div> |
| | | <h3 class="text-base font-semibold text-[var(--art-gray-900)]">运行时摘要</h3> |
| | | <p class="mt-0.5 text-xs text-[var(--art-gray-500)]">当前生效的模型、Prompt 与 MCP 挂载概况</p> |
| | | <h3 class="text-base font-semibold text-[var(--art-gray-900)]">{{ t('pages.system.aiParam.summary.title') }}</h3> |
| | | <p class="mt-0.5 text-xs text-[var(--art-gray-500)]">{{ t('pages.system.aiParam.summary.subtitle') }}</p> |
| | | </div> |
| | | <ElButton text :loading="loading" @click="loadSummary">刷新摘要</ElButton> |
| | | <ElButton text :loading="loading" @click="loadSummary">{{ t('pages.system.aiParam.summary.refresh') }}</ElButton> |
| | | </div> |
| | | |
| | | <ElAlert |
| | |
| | | <ArtSvgIcon icon="ri:robot-2-line" class="text-base" /> |
| | | </div> |
| | | <div class="min-w-0 flex-1"> |
| | | <p class="text-[11px] text-[var(--art-gray-500)]">当前模型</p> |
| | | <p class="text-[11px] text-[var(--art-gray-500)]">{{ t('pages.system.aiParam.summary.activeModel') }}</p> |
| | | <h4 class="truncate text-sm font-semibold text-[var(--art-gray-900)]"> |
| | | {{ summary.activeModel || '--' }} |
| | | </h4> |
| | |
| | | {{ validateMeta.text }} |
| | | </ElTag> |
| | | </div> |
| | | <p class="mt-1 text-[11px] text-[var(--art-gray-500)]">{{ summary.activeParamValidatedAt || '未校验' }}</p> |
| | | <p class="mt-1 text-[11px] text-[var(--art-gray-500)]">{{ summary.activeParamValidatedAt || t('pages.system.aiParam.validation.notTested') }}</p> |
| | | </div> |
| | | |
| | | <div class="rounded-2xl border border-[var(--art-border-color)] bg-[var(--art-main-bg-color)] px-3 py-3"> |
| | |
| | | <ArtSvgIcon icon="ri:lightbulb-flash-line" class="text-base" /> |
| | | </div> |
| | | <div class="min-w-0 flex-1"> |
| | | <p class="text-[11px] text-[var(--art-gray-500)]">当前 Prompt</p> |
| | | <p class="text-[11px] text-[var(--art-gray-500)]">{{ t('pages.system.aiParam.summary.activePrompt') }}</p> |
| | | <h4 class="truncate text-sm font-semibold text-[var(--art-gray-900)]"> |
| | | {{ summary.promptName || '--' }} |
| | | </h4> |
| | |
| | | {{ [summary.promptCode, summary.promptScene].filter(Boolean).join(' / ') || '--' }} |
| | | </p> |
| | | <p class="mt-1 text-[11px] text-[var(--art-gray-500)]"> |
| | | 最近更新时间 {{ summary.activePromptUpdatedAt || '--' }} |
| | | {{ t('pages.system.aiParam.summary.lastPromptUpdate', { value: summary.activePromptUpdatedAt || '--' }) }} |
| | | </p> |
| | | </div> |
| | | |
| | |
| | | <ArtSvgIcon icon="ri:plug-2-line" class="text-base" /> |
| | | </div> |
| | | <div class="min-w-0 flex-1"> |
| | | <p class="text-[11px] text-[var(--art-gray-500)]">已启用 MCP</p> |
| | | <p class="text-[11px] text-[var(--art-gray-500)]">{{ t('pages.system.aiParam.summary.enabledMcp') }}</p> |
| | | <h4 class="text-sm font-semibold text-[var(--art-gray-900)]"> |
| | | {{ summary.enabledMcpCount ?? 0 }} 个 |
| | | {{ t('pages.system.aiParam.summary.enabledMcpCount', { count: summary.enabledMcpCount ?? 0 }) }} |
| | | </h4> |
| | | </div> |
| | | </div> |
| | |
| | | > |
| | | {{ name }} |
| | | </ElTag> |
| | | <span v-if="!enabledMcpNames.length" class="text-xs text-[var(--art-gray-500)]">暂无挂载</span> |
| | | <span v-if="!enabledMcpNames.length" class="text-xs text-[var(--art-gray-500)]">{{ t('pages.system.aiParam.summary.noMcp') }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <script setup> |
| | | import { guardRequestWithMessage } from '@/utils/sys/requestGuard' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { fetchGetAiConfigSummary } from '@/api/ai-config' |
| | | import { getAiParamValidateStatusMeta } from '../aiParamPage.helpers' |
| | | |
| | |
| | | const loading = ref(false) |
| | | const summary = ref({}) |
| | | const errorMessage = ref('') |
| | | const { t } = useI18n() |
| | | |
| | | const validateMeta = computed(() => |
| | | getAiParamValidateStatusMeta(summary.value?.activeParamValidateStatus) |
| | |
| | | fetchGetAiConfigSummary(props.promptCode), |
| | | null, |
| | | { |
| | | timeoutMessage: '运行时摘要加载超时,已停止等待' |
| | | timeoutMessage: t('pages.system.aiParam.messages.summaryTimeout') |
| | | } |
| | | ) |
| | | loading.value = false |
| | | if (!data) { |
| | | errorMessage.value = '运行时摘要暂时不可用' |
| | | errorMessage.value = t('pages.system.aiParam.messages.summaryUnavailable') |
| | | summary.value = {} |
| | | return |
| | | } |