@@ -118,8 +118,8 @@
provider icon
@@ -443,6 +443,37 @@ const filteredModels = computed(() => { return filtered }) +// 新增:按照getProviderIcon顺序排列的提供商统计 +const sortedProviderStats = computed(() => { + if (!modelsData.value?.groupedByProvider) { + return [] + } + + // 定义提供商顺序(与getProviderIcon中的顺序一致) + const providerOrder = ['openai', 'anthropic', 'google', 'deepseek', 'doubao', 'qianwen', 'other'] + + const stats = [] + + // 按照预定义顺序添加存在的提供商 + for (const provider of providerOrder) { + if (modelsData.value.groupedByProvider[provider]) { + stats.push({ + provider, + models: modelsData.value.groupedByProvider[provider] + }) + } + } + + // 添加不在预定义列表中的其他提供商 + for (const [provider, models] of Object.entries(modelsData.value.groupedByProvider)) { + if (!providerOrder.includes(provider)) { + stats.push({ provider, models }) + } + } + + return stats +}) + // 辅助函数 const getProviderName = (provider: string) => { const names: Record = { @@ -637,7 +668,7 @@ onMounted(() => { + \ No newline at end of file From 5b9878b356f122270ce48c51d9458dc31a81d9a3 Mon Sep 17 00:00:00 2001 From: suifeng <369202865@qq.com> Date: Thu, 14 Aug 2025 22:37:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[dev]=20sf-chain=E6=A1=86=E6=9E=B6=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E6=97=A5=E5=BF=97=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/AICallLogViewer.vue | 998 ++++++++++++ prompto-lab-ui/src/components/JsonViewer.vue | 569 +++++++ .../src/components/LogDetailModal.vue | 1408 +++++++++++++++++ prompto-lab-ui/src/services/aiCallLogApi.ts | 53 + prompto-lab-ui/src/services/systemApi.ts | 37 + 5 files changed, 3065 insertions(+) create mode 100644 prompto-lab-ui/src/components/AICallLogViewer.vue create mode 100644 prompto-lab-ui/src/components/JsonViewer.vue create mode 100644 prompto-lab-ui/src/components/LogDetailModal.vue create mode 100644 prompto-lab-ui/src/services/aiCallLogApi.ts create mode 100644 prompto-lab-ui/src/services/systemApi.ts diff --git a/prompto-lab-ui/src/components/AICallLogViewer.vue b/prompto-lab-ui/src/components/AICallLogViewer.vue new file mode 100644 index 0000000..c09b73b --- /dev/null +++ b/prompto-lab-ui/src/components/AICallLogViewer.vue @@ -0,0 +1,998 @@ + + + + + diff --git a/prompto-lab-ui/src/components/JsonViewer.vue b/prompto-lab-ui/src/components/JsonViewer.vue new file mode 100644 index 0000000..e6092ca --- /dev/null +++ b/prompto-lab-ui/src/components/JsonViewer.vue @@ -0,0 +1,569 @@ + + + + + diff --git a/prompto-lab-ui/src/components/LogDetailModal.vue b/prompto-lab-ui/src/components/LogDetailModal.vue new file mode 100644 index 0000000..8af13e1 --- /dev/null +++ b/prompto-lab-ui/src/components/LogDetailModal.vue @@ -0,0 +1,1408 @@ + + + + + diff --git a/prompto-lab-ui/src/services/aiCallLogApi.ts b/prompto-lab-ui/src/services/aiCallLogApi.ts new file mode 100644 index 0000000..d15085a --- /dev/null +++ b/prompto-lab-ui/src/services/aiCallLogApi.ts @@ -0,0 +1,53 @@ +import { API_CONFIG } from './apiConfig' +import { apiJsonRequest } from './apiUtils' +import type { AICallLogSummary, AICallLog, LogStatistics, ApiResponse } from '@/types/system' + +export const aiCallLogApi = { + // 获取所有日志摘要(轻量级) + async getAllLogSummaries(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/ai-logs`, { + method: 'GET', + requireAuth: true + }) + }, + + // 根据调用ID获取完整日志详情 + async getFullLog(callId: string): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/ai-logs/${encodeURIComponent(callId)}`, { + method: 'GET', + requireAuth: true + }) + }, + + // 根据操作类型获取日志摘要 + async getLogSummariesByOperation(operationType: string): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/ai-logs/operation/${encodeURIComponent(operationType)}`, { + method: 'GET', + requireAuth: true + }) + }, + + // 根据模型名称获取日志摘要 + async getLogSummariesByModel(modelName: string): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/ai-logs/model/${encodeURIComponent(modelName)}`, { + method: 'GET', + requireAuth: true + }) + }, + + // 获取统计信息 + async getStatistics(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/ai-logs/statistics`, { + method: 'GET', + requireAuth: true + }) + }, + + // 清空所有日志 + async clearLogs(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/ai-logs`, { + method: 'DELETE', + requireAuth: true + }) + } +} diff --git a/prompto-lab-ui/src/services/systemApi.ts b/prompto-lab-ui/src/services/systemApi.ts new file mode 100644 index 0000000..c5eea45 --- /dev/null +++ b/prompto-lab-ui/src/services/systemApi.ts @@ -0,0 +1,37 @@ +import { API_CONFIG } from './apiConfig' +import { apiJsonRequest } from './apiUtils' +import type { SystemOverview, ApiResponse } from '@/types/system' + +export const systemApi = { + // 获取系统概览信息 + async getSystemOverview(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/system/overview`, { + method: 'GET', + requireAuth: true + }) + }, + + // 创建系统配置备份 + async createBackup(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/system/backup`, { + method: 'POST', + requireAuth: true + }) + }, + + // 刷新系统配置 + async refreshSystem(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/system/refresh`, { + method: 'POST', + requireAuth: true + }) + }, + + // 重置系统配置 + async resetSystem(): Promise { + return apiJsonRequest(`${API_CONFIG.BASE_URL}/sf/api/system/reset`, { + method: 'POST', + requireAuth: true + }) + } +} \ No newline at end of file From 5d815eac6689775cbee87bb5caa187ef9b80d934 Mon Sep 17 00:00:00 2001 From: suifeng <369202865@qq.com> Date: Thu, 14 Aug 2025 22:37:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[dev]=20sf-chain=E6=A1=86=E6=9E=B6=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E6=97=A5=E5=BF=97=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prompto-lab-ui/src/assets/icons/deepseek.svg | 2 +- .../src/components/AiNodeConfig.vue | 543 ++++++++++-------- .../src/components/ApiInfoConfig.vue | 427 ++++++++------ 3 files changed, 563 insertions(+), 409 deletions(-) diff --git a/prompto-lab-ui/src/assets/icons/deepseek.svg b/prompto-lab-ui/src/assets/icons/deepseek.svg index 536b7a2..6e2cac4 100644 --- a/prompto-lab-ui/src/assets/icons/deepseek.svg +++ b/prompto-lab-ui/src/assets/icons/deepseek.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/prompto-lab-ui/src/components/AiNodeConfig.vue b/prompto-lab-ui/src/components/AiNodeConfig.vue index bdcb89f..e00337f 100644 --- a/prompto-lab-ui/src/components/AiNodeConfig.vue +++ b/prompto-lab-ui/src/components/AiNodeConfig.vue @@ -685,31 +685,47 @@ refreshData() diff --git a/prompto-lab-ui/src/components/ApiInfoConfig.vue b/prompto-lab-ui/src/components/ApiInfoConfig.vue index 63c857f..33b21d7 100644 --- a/prompto-lab-ui/src/components/ApiInfoConfig.vue +++ b/prompto-lab-ui/src/components/ApiInfoConfig.vue @@ -668,7 +668,7 @@ onMounted(() => { +