From 4829934377f01a83b332c0e09f407f53236f5d1a Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Fri, 22 May 2026 19:56:29 +0800 Subject: [PATCH 1/4] feat: home-page --- ui/src/api/home-page/home.ts | 110 +++++++++ ui/src/assets/home/icon_create-agent.svg | 5 + .../MobileVoteReasonDrawer.vue | 4 +- .../operation-button/VoteReasonContent.vue | 4 +- ui/src/components/app-icon/icons/menu.ts | 41 +++- .../layout/layout-header/top-menu/index.vue | 2 +- ui/src/locales/lang/en-US/ai-chat.ts | 1 - ui/src/locales/lang/en-US/common.ts | 4 +- ui/src/locales/lang/en-US/layout.ts | 17 ++ ui/src/locales/lang/en-US/views/chat-log.ts | 1 - ui/src/locales/lang/en-US/workflow.ts | 2 - ui/src/locales/lang/zh-CN/ai-chat.ts | 1 - ui/src/locales/lang/zh-CN/common.ts | 1 + ui/src/locales/lang/zh-CN/layout.ts | 17 ++ ui/src/locales/lang/zh-CN/views/chat-log.ts | 1 - ui/src/locales/lang/zh-CN/workflow.ts | 2 - ui/src/locales/lang/zh-Hant/ai-chat.ts | 1 - ui/src/locales/lang/zh-Hant/common.ts | 4 +- ui/src/locales/lang/zh-Hant/layout.ts | 17 ++ .../zh-Hant/views/application-overview.ts | 1 - ui/src/locales/lang/zh-Hant/views/chat-log.ts | 1 - ui/src/locales/lang/zh-Hant/workflow.ts | 2 - ui/src/router/modules/application.ts | 2 +- ui/src/router/modules/knowledge.ts | 2 +- ui/src/router/modules/model.ts | 2 +- ui/src/router/modules/tool.ts | 2 +- ui/src/router/routes.ts | 30 ++- ui/src/styles/element-plus.scss | 5 + ui/src/utils/common.ts | 2 +- ui/src/views/application/index.vue | 1 - ui/src/views/chat-log/index.vue | 2 +- ui/src/views/home/component/QuickCreate.vue | 157 +++++++++++++ ui/src/views/home/component/Ranking.vue | 182 +++++++++++++++ .../home/component/ResourceAggregation.vue | 165 ++++++++++++++ .../views/home/component/StatisticsCharts.vue | 213 ++++++++++++++++++ ui/src/views/home/index.vue | 160 +++++++++++++ ui/src/workflow/common/data.ts | 12 +- 37 files changed, 1140 insertions(+), 36 deletions(-) create mode 100644 ui/src/api/home-page/home.ts create mode 100644 ui/src/assets/home/icon_create-agent.svg create mode 100644 ui/src/views/home/component/QuickCreate.vue create mode 100644 ui/src/views/home/component/Ranking.vue create mode 100644 ui/src/views/home/component/ResourceAggregation.vue create mode 100644 ui/src/views/home/component/StatisticsCharts.vue create mode 100644 ui/src/views/home/index.vue diff --git a/ui/src/api/home-page/home.ts b/ui/src/api/home-page/home.ts new file mode 100644 index 00000000000..3e6b62e0795 --- /dev/null +++ b/ui/src/api/home-page/home.ts @@ -0,0 +1,110 @@ +import { Result } from '@/request/Result' +import { get, post, del, put, exportFile } from '@/request/index' +import { type Ref } from 'vue' +import type { pageRequest } from '@/api/type/common' + +import useStore from '@/stores' +const prefix: any = { _value: '/workspace/' } +Object.defineProperty(prefix, 'value', { + get: function () { + const { user } = useStore() + return this._value + user.getWorkspaceId() + '/homepage' + }, +}) + +/** + * 应用聚合 + * @params + */ +const getApplicationAggregation: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix.value}/application/aggregation`, undefined, loading) +} +/** + * 知识库聚合 + * @params + */ +const getKnowledgeAggregation: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix.value}/knowledge/aggregation`, undefined, loading) +} +/** + * 工具聚合 + * @params + */ +const getToolAggregation: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix.value}/tool/aggregation`, undefined, loading) +} +/** + * 模型聚合 + * @params + */ +const getModelAggregation: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix.value}/model/aggregation`, undefined, loading) +} + +/** + * Tokens 消耗 + * @params + */ +const getTokensRanking: (page: pageRequest, loading?: Ref) => Promise> = ( + page, + loading, +) => { + return get( + `${prefix.value}/application/tokens_ranking/${page.current_page}/${page.page_size}`, + undefined, + loading, + ) +} +/** + * 提问次数 + * @params + */ +const getQuestionsRanking: (page: pageRequest, loading?: Ref) => Promise> = ( + page, + loading, +) => { + return get( + `${prefix.value}/application/question_ranking/${page.current_page}/${page.page_size}`, + undefined, + loading, + ) +} +/** + * 用户消耗token + * @params + */ +const getUserTokensRanking: (page: pageRequest, loading?: Ref) => Promise> = ( + page, + loading, +) => { + return get( + `${prefix.value}/application/user_tokens_ranking/${page.current_page}/${page.page_size}`, + undefined, + loading, + ) +} + +/** + * 与对话有关的统计趋势 + * @params + */ +const getMonitorAggregation: (page: pageRequest, loading?: Ref) => Promise> = ( + page, + loading, +) => { + return get( + `${prefix.value}/monitor_aggregation/${page.current_page}/${page.page_size}`, + undefined, + loading, + ) +} + +export default { + getApplicationAggregation, + getKnowledgeAggregation, + getToolAggregation, + getModelAggregation, + getTokensRanking, + getQuestionsRanking, + getUserTokensRanking, +} diff --git a/ui/src/assets/home/icon_create-agent.svg b/ui/src/assets/home/icon_create-agent.svg new file mode 100644 index 00000000000..a078282dfb9 --- /dev/null +++ b/ui/src/assets/home/icon_create-agent.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/components/ai-chat/component/operation-button/MobileVoteReasonDrawer.vue b/ui/src/components/ai-chat/component/operation-button/MobileVoteReasonDrawer.vue index 09043ed1ff2..dedf62120a8 100644 --- a/ui/src/components/ai-chat/component/operation-button/MobileVoteReasonDrawer.vue +++ b/ui/src/components/ai-chat/component/operation-button/MobileVoteReasonDrawer.vue @@ -78,13 +78,13 @@ const isSubmitDisabled = computed(() => { const LIKE_REASONS = [ { label: t('chat.vote.accurate'), value: 'accurate' }, { label: t('chat.vote.complete'), value: 'complete' }, - { label: t('chat.vote.other'), value: 'other' }, + { label: t('common.other'), value: 'other' }, ] const OPPOSE_REASONS = [ { label: t('chat.vote.inaccurate'), value: 'inaccurate' }, { label: t('chat.vote.irrelevantAnswer'), value: 'incomplete' }, - { label: t('chat.vote.other'), value: 'other' }, + { label: t('common.other'), value: 'other' }, ] const title = computed(() => { diff --git a/ui/src/components/ai-chat/component/operation-button/VoteReasonContent.vue b/ui/src/components/ai-chat/component/operation-button/VoteReasonContent.vue index 617515dd042..abbf10031c9 100644 --- a/ui/src/components/ai-chat/component/operation-button/VoteReasonContent.vue +++ b/ui/src/components/ai-chat/component/operation-button/VoteReasonContent.vue @@ -71,13 +71,13 @@ const isSubmitDisabled = computed(() => { const LIKE_REASONS = [ { label: t('chat.vote.accurate'), value: 'accurate' }, { label: t('chat.vote.complete'), value: 'complete' }, - { label: t('chat.vote.other'), value: 'other' }, + { label: t('common.other'), value: 'other' }, ] const OPPOSE_REASONS = [ { label: t('chat.vote.inaccurate'), value: 'inaccurate' }, { label: t('chat.vote.irrelevantAnswer'), value: 'incomplete' }, - { label: t('chat.vote.other'), value: 'other' }, + { label: t('common.other'), value: 'other' }, ] const title = computed(() => { diff --git a/ui/src/components/app-icon/icons/menu.ts b/ui/src/components/app-icon/icons/menu.ts index b180953eb68..1e2f087d445 100644 --- a/ui/src/components/app-icon/icons/menu.ts +++ b/ui/src/components/app-icon/icons/menu.ts @@ -491,7 +491,46 @@ export default { d: 'M0.666748 6.07278C0.666748 5.71259 1.0361 5.47056 1.36635 5.61435L6.95893 8.04931C7.14136 8.12874 7.25933 8.30877 7.25933 8.50774V14.5055C7.25933 14.8817 6.85964 15.1231 6.5267 14.9481L0.915073 11.9985C0.840862 11.9578 0.778897 11.8989 0.735342 11.8276C0.691787 11.7564 0.668161 11.6753 0.666813 11.5924L0.666748 11.585V6.07278ZM14.6312 5.60774C14.9618 5.46158 15.3334 5.70361 15.3334 6.06503V11.585C15.3334 11.6691 15.3104 11.7518 15.2668 11.8244C15.2231 11.8971 15.1604 11.9571 15.0851 11.9985L9.47345 14.9481C9.14051 15.1231 8.74081 14.8817 8.74082 14.5055L8.74083 8.53793C8.74083 8.33999 8.8576 8.16069 9.03863 8.08064L14.6312 5.60774ZM7.76 1.39457C7.83327 1.35437 7.91597 1.33325 8.00008 1.33325C8.0842 1.33325 8.16689 1.35437 8.24016 1.39457L13.55 3.75304C13.9482 3.92991 13.9454 4.49602 13.5455 4.66894L8.19851 6.98075C8.07189 7.0355 7.92827 7.0355 7.80165 6.98075L2.45469 4.66894C2.05476 4.49602 2.05196 3.92991 2.45016 3.75304L7.76 1.39457Z', fill: 'currentColor', }), - + ], + ), + ]) + }, + }, + 'app-home': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M487.381333 114.474667a42.666667 42.666667 0 0 1 49.237334 0l362.666666 256a42.666667 42.666667 0 0 1 18.048 34.858666v469.333334a42.666667 42.666667 0 0 1-42.666666 42.666666H554.666667v-256a42.666667 42.666667 0 1 0-85.333334 0v256H149.333333a42.666667 42.666667 0 0 1-42.666666-42.666666v-469.333334a42.666667 42.666667 0 0 1 18.048-34.858666l362.666666-256zM640 832h192v-404.565333L512 201.557333l-320 225.877334V832H384v-170.666667a128 128 0 1 1 256 0v170.666667z', + fill: 'currentColor', + }), + ], + ), + ]) + }, + }, + 'app-home-active': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M487.381333 114.474667a42.666667 42.666667 0 0 1 49.237334 0l362.666666 256a42.666667 42.666667 0 0 1 18.048 34.858666v469.333334a42.666667 42.666667 0 0 1-42.666666 42.666666H597.333333v-213.333333a85.333333 85.333333 0 1 0-170.666666 0v213.333333H149.333333a42.666667 42.666667 0 0 1-42.666666-42.666666v-469.333334a42.666667 42.666667 0 0 1 18.048-34.858666l362.666666-256z', + fill: 'currentColor', + }), ], ), ]) diff --git a/ui/src/layout/layout-header/top-menu/index.vue b/ui/src/layout/layout-header/top-menu/index.vue index d249d4f7af3..e35ce075b4a 100644 --- a/ui/src/layout/layout-header/top-menu/index.vue +++ b/ui/src/layout/layout-header/top-menu/index.vue @@ -16,7 +16,7 @@ import { hasPermission, set_next_route } from '@/utils/permission/index' import MenuItem from './MenuItem.vue' const topMenuList = computed(() => { - const menu = getChildRouteListByPathAndName('/', 'home').filter( + const menu = getChildRouteListByPathAndName('/', 'root').filter( (item) => item.meta?.menu && (item.meta.permission ? hasPermission(item.meta.permission as any, 'OR') : true), diff --git a/ui/src/locales/lang/en-US/ai-chat.ts b/ui/src/locales/lang/en-US/ai-chat.ts index 3459580779f..85e303da122 100644 --- a/ui/src/locales/lang/en-US/ai-chat.ts +++ b/ui/src/locales/lang/en-US/ai-chat.ts @@ -45,7 +45,6 @@ export default { inaccurate: 'Answer is inaccurate', complete: 'Content is complete', irrelevantAnswer: 'Answer is irrelevant', - other: 'Other', placeholder: 'Tell us more about your relevant experiences', }, tip: { diff --git a/ui/src/locales/lang/en-US/common.ts b/ui/src/locales/lang/en-US/common.ts index d05e958f096..1c24a52d691 100644 --- a/ui/src/locales/lang/en-US/common.ts +++ b/ui/src/locales/lang/en-US/common.ts @@ -151,6 +151,8 @@ export default { subTitle: 'View Execution Record', }, sourceType: 'Source type', - knowledgeImportTip: 'Knowledge base imported successfully. Documents have not been vectorized yet. Please configure the embedding model and vectorize the documents.', + knowledgeImportTip: + 'Knowledge base imported successfully. Documents have not been vectorized yet. Please configure the embedding model and vectorize the documents.', import: 'Import', + other: 'Other', } diff --git a/ui/src/locales/lang/en-US/layout.ts b/ui/src/locales/lang/en-US/layout.ts index 237d303bcef..c3767b5d021 100644 --- a/ui/src/locales/lang/en-US/layout.ts +++ b/ui/src/locales/lang/en-US/layout.ts @@ -8,6 +8,23 @@ export default { language: 'Language', isExpire: 'License not uploaded or expired', crossSettings: 'Cross-Origin Settings', + home: { + title: 'Home', + rank: 'Ranking', + consume: 'Consumption', + quickCreate: 'Quick Create', + createAgent: 'Create Agent', + createAgentDescribe: 'From template or blank', + resource: 'Resources', + llm: 'Large Language Model', + embedding: 'Embedding', + chat: 'Chat', + average‌: 'Average', + activeUsers: 'Active Users', + wheel: 'Wheel', + person: 'Person', + questions: 'Questions', + }, about: { title: 'About', expiredTime: 'Expiration Date', diff --git a/ui/src/locales/lang/en-US/views/chat-log.ts b/ui/src/locales/lang/en-US/views/chat-log.ts index 7ccee3eefc3..878f891bd87 100644 --- a/ui/src/locales/lang/en-US/views/chat-log.ts +++ b/ui/src/locales/lang/en-US/views/chat-log.ts @@ -10,7 +10,6 @@ export default { }, table: { abstract: 'Title', - username: 'User', chat_record_count: 'Total Messages', user: 'User', feedback: { diff --git a/ui/src/locales/lang/en-US/workflow.ts b/ui/src/locales/lang/en-US/workflow.ts index 61111fb3ba9..9760fcd85c4 100644 --- a/ui/src/locales/lang/en-US/workflow.ts +++ b/ui/src/locales/lang/en-US/workflow.ts @@ -118,7 +118,6 @@ export default { classify: { aiCapability: 'AI capability', businessLogic: 'Business logic', - other: 'Other', dataProcessing: 'Data Processing', }, startNode: { @@ -451,7 +450,6 @@ You are a master of problem optimization, adept at accurately inferring user int intentNode: { label: 'IntentNode', text: 'Match user questions with user-defined intent classifications', - other: 'other', error2: 'Repeated intent', placeholder: 'Please choose a classification option', classify: { diff --git a/ui/src/locales/lang/zh-CN/ai-chat.ts b/ui/src/locales/lang/zh-CN/ai-chat.ts index 068b87149ec..ec033d55c6b 100644 --- a/ui/src/locales/lang/zh-CN/ai-chat.ts +++ b/ui/src/locales/lang/zh-CN/ai-chat.ts @@ -45,7 +45,6 @@ export default { inaccurate: '回答不准确', complete: '内容完善', irrelevantAnswer: '回答不相关', - other: '其他', placeholder: '告诉我们更多关于你的相关体验', }, tip: { diff --git a/ui/src/locales/lang/zh-CN/common.ts b/ui/src/locales/lang/zh-CN/common.ts index b4e4390c101..fa476047e2b 100644 --- a/ui/src/locales/lang/zh-CN/common.ts +++ b/ui/src/locales/lang/zh-CN/common.ts @@ -155,4 +155,5 @@ export default { knowledgeImportTip: '导入创建知识库成功,文档数据未向量化,请先设置知识库的向量模型,并对文档进行向量化操作', import: '导入', + other: '其他', } diff --git a/ui/src/locales/lang/zh-CN/layout.ts b/ui/src/locales/lang/zh-CN/layout.ts index 34ed7534ff7..e33ae913183 100644 --- a/ui/src/locales/lang/zh-CN/layout.ts +++ b/ui/src/locales/lang/zh-CN/layout.ts @@ -8,6 +8,23 @@ export default { language: '语言', isExpire: '未上传 License 或 License 已过期。', crossSettings: '跨域设置', + home: { + title: '首页', + rank: '排行榜', + consume: '消耗', + quickCreate: '快速创建', + createAgent: '创建智能体', + createAgentDescribe: '从模板或空白创建', + resource: '资源', + llm: '大语言', + embedding: '向量', + chat: '对话', + average‌: '均', + activeUsers: '活跃用户', + wheel: '轮', + person: '人', + questions: '提问', + }, about: { title: '关于', expiredTime: '到期时间', diff --git a/ui/src/locales/lang/zh-CN/views/chat-log.ts b/ui/src/locales/lang/zh-CN/views/chat-log.ts index fda7fed4fc1..12b27c591af 100644 --- a/ui/src/locales/lang/zh-CN/views/chat-log.ts +++ b/ui/src/locales/lang/zh-CN/views/chat-log.ts @@ -10,7 +10,6 @@ export default { }, table: { abstract: '摘要', - username: '用户', chat_record_count: '对话提问数', user: '用户', feedback: { diff --git a/ui/src/locales/lang/zh-CN/workflow.ts b/ui/src/locales/lang/zh-CN/workflow.ts index 15b68955bf7..8f0e0db8616 100644 --- a/ui/src/locales/lang/zh-CN/workflow.ts +++ b/ui/src/locales/lang/zh-CN/workflow.ts @@ -118,7 +118,6 @@ export default { classify: { aiCapability: 'AI 能力', businessLogic: '业务逻辑', - other: '其他', dataProcessing: '数据处理', }, startNode: { @@ -443,7 +442,6 @@ export default { intentNode: { label: '意图识别', text: '将用户问题与用户预设的意图分类进行匹配', - other: '其他', error2: '意图重复', placeholder: '请选择分类项', classify: { diff --git a/ui/src/locales/lang/zh-Hant/ai-chat.ts b/ui/src/locales/lang/zh-Hant/ai-chat.ts index 9b61f374aa6..e0c61671abe 100644 --- a/ui/src/locales/lang/zh-Hant/ai-chat.ts +++ b/ui/src/locales/lang/zh-Hant/ai-chat.ts @@ -45,7 +45,6 @@ export default { inaccurate: '回答不準確', complete: '內容完善', irrelevantAnswer: '回答不相關', - other: '其他', placeholder: '告訴我們更多關於你的相關體驗', }, tip: { diff --git a/ui/src/locales/lang/zh-Hant/common.ts b/ui/src/locales/lang/zh-Hant/common.ts index 008377c4daf..ce292c2b97c 100644 --- a/ui/src/locales/lang/zh-Hant/common.ts +++ b/ui/src/locales/lang/zh-Hant/common.ts @@ -150,6 +150,8 @@ export default { subTitle: '查看執行記錄', }, sourceType: '資源類型', - knowledgeImportTip: '匯入建立知識庫成功,文件資料尚未向量化,請先設定知識庫的向量模型,並對文件進行向量化操作', + knowledgeImportTip: + '匯入建立知識庫成功,文件資料尚未向量化,請先設定知識庫的向量模型,並對文件進行向量化操作', import: '导入', + other: '其他', } diff --git a/ui/src/locales/lang/zh-Hant/layout.ts b/ui/src/locales/lang/zh-Hant/layout.ts index 825a0b19aca..b81beafca55 100644 --- a/ui/src/locales/lang/zh-Hant/layout.ts +++ b/ui/src/locales/lang/zh-Hant/layout.ts @@ -8,6 +8,23 @@ export default { language: '語言', isExpire: '未上傳 License 或 License 已過期。', crossSettings: '跨域設定', + home: { + title: '首頁', + rank: '排行榜', + consume: '消耗', + quickCreate: '快速創建', + createAgent: '創建智能體', + createAgentDescribe: '從模板或空白創建', + resource: '資源', + llm: '大語言', + embedding: '向量', + chat: '對話', + average‌: '均', + activeUsers: '活躍用戶', + wheel: '輪', + person: '人', + questions: '提問', + }, about: { title: '關於', expiredTime: '到期時間', diff --git a/ui/src/locales/lang/zh-Hant/views/application-overview.ts b/ui/src/locales/lang/zh-Hant/views/application-overview.ts index 2666205c99d..c9deff7babb 100644 --- a/ui/src/locales/lang/zh-Hant/views/application-overview.ts +++ b/ui/src/locales/lang/zh-Hant/views/application-overview.ts @@ -87,7 +87,6 @@ export default { past30Days: '過去30天', past90Days: '過去90天', past183Days: '過去半年', - other: '自訂义', }, charts: { customerTotal: '用戶總數', diff --git a/ui/src/locales/lang/zh-Hant/views/chat-log.ts b/ui/src/locales/lang/zh-Hant/views/chat-log.ts index 453f638f170..6a70427c465 100644 --- a/ui/src/locales/lang/zh-Hant/views/chat-log.ts +++ b/ui/src/locales/lang/zh-Hant/views/chat-log.ts @@ -10,7 +10,6 @@ export default { }, table: { abstract: '摘要', - username: '用戶', chat_record_count: '對話提問數', user: '用戶', feedback: { diff --git a/ui/src/locales/lang/zh-Hant/workflow.ts b/ui/src/locales/lang/zh-Hant/workflow.ts index a9a33338734..ab470b02a49 100644 --- a/ui/src/locales/lang/zh-Hant/workflow.ts +++ b/ui/src/locales/lang/zh-Hant/workflow.ts @@ -118,7 +118,6 @@ export default { classify: { aiCapability: 'AI 能力', businessLogic: '業務邏輯', - other: '其他', dataProcessing: '數據處理', }, startNode: { @@ -443,7 +442,6 @@ export default { intentNode: { label: '意圖識別', text: '將用戶問題與用戶預設的意圖分類進行匹配', - other: '其他', error2: '意圖重複', placeholder: '請選擇分類項', classify: { diff --git a/ui/src/router/modules/application.ts b/ui/src/router/modules/application.ts index 09339a29042..a58cf21eac7 100644 --- a/ui/src/router/modules/application.ts +++ b/ui/src/router/modules/application.ts @@ -14,7 +14,7 @@ const applicationRouter = { icon: 'app-agent', iconActive: 'app-agent-active', group: 'workspace', - order: 1, + order: 2, }, redirect: '/application', component: () => import('@/layout/layout-template/SimpleLayout.vue'), diff --git a/ui/src/router/modules/knowledge.ts b/ui/src/router/modules/knowledge.ts index ad3865d5d3c..ce49f673bd4 100644 --- a/ui/src/router/modules/knowledge.ts +++ b/ui/src/router/modules/knowledge.ts @@ -14,7 +14,7 @@ const ModelRouter = { icon: 'app-knowledge', iconActive: 'app-knowledge-active', group: 'workspace', - order: 2, + order: 3, }, redirect: '/knowledge', component: () => import('@/layout/layout-template/SimpleLayout.vue'), diff --git a/ui/src/router/modules/model.ts b/ui/src/router/modules/model.ts index 91df5758bda..a138d0ca25c 100644 --- a/ui/src/router/modules/model.ts +++ b/ui/src/router/modules/model.ts @@ -14,7 +14,7 @@ const ModelRouter = { icon: 'app-model', iconActive: 'app-model-active', group: 'workspace', - order: 4, + order: 5, }, redirect: '/model', component: () => import('@/layout/layout-template/SimpleLayout.vue'), diff --git a/ui/src/router/modules/tool.ts b/ui/src/router/modules/tool.ts index c2fef203fcf..ef3111ea7f2 100644 --- a/ui/src/router/modules/tool.ts +++ b/ui/src/router/modules/tool.ts @@ -14,7 +14,7 @@ const ModelRouter = { icon: 'app-tool', iconActive: 'app-tool-active', group: 'workspace', - order: 3, + order: 4, }, redirect: '/tool', component: () => import('@/layout/layout-template/SimpleLayout.vue'), diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index b0a08e9f182..a6fecab47d2 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -7,10 +7,36 @@ const rolesRoutes: RouteRecordRaw[] = [...Object.keys(modules).map((key) => modu export const routes: Array = [ { path: '/', - name: 'home', - redirect: '/application', + name: 'root', + redirect: '/home', children: [ ...rolesRoutes, + { + path: '/home', + name: 'home', + redirect: '/home', + meta: { + title: 'layout.home.title', + menu: true, + order: 1, + icon: 'app-home', + iconActive: 'app-home-active', + group: 'workspace', + }, + children: [ + { + path: '/home', + name: 'home-index', + meta: { + title: 'layout.home.title', + activeMenu: '/home', + sameRoute: 'home', + }, + component: () => import('@/views/home/index.vue'), + }, + ], + component: () => import('@/layout/layout-template/SimpleLayout.vue'), + }, { path: '/no-permission', name: 'noPermission', diff --git a/ui/src/styles/element-plus.scss b/ui/src/styles/element-plus.scss index fde8e8cd2b9..5b3eb62b937 100644 --- a/ui/src/styles/element-plus.scss +++ b/ui/src/styles/element-plus.scss @@ -427,3 +427,8 @@ border: 1px solid var(--app-border-color-dark); background: var(--app-border-color-dark); } + +// el-progress +.el-progress-bar__inner { + background: linear-gradient(90deg, #adc6ff 0%, #3370ff 100%); +} diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.ts index b2148247ff1..8e04ef3a14c 100644 --- a/ui/src/utils/common.ts +++ b/ui/src/utils/common.ts @@ -11,7 +11,7 @@ export function toThousands(num: any) { } export function numberFormat(num: number) { - return num < 1000 ? toThousands(num) : toThousands((num / 1000).toFixed(1)) + 'k' + return num < 1000 ? toThousands(num): toThousands((num / 1000).toFixed(1)) + 'k' } export function filesize(size: number) { diff --git a/ui/src/views/application/index.vue b/ui/src/views/application/index.vue index 0a574957730..fe934476153 100644 --- a/ui/src/views/application/index.vue +++ b/ui/src/views/application/index.vue @@ -423,7 +423,6 @@ import {EditionConst, PermissionConst, RoleConst} from '@/utils/permission/data' import ResourceMappingDrawer from '@/components/resource_mapping/index.vue' import useStore from '@/stores' import {t} from '@/locales' -import {loadSharedApi} from "@/utils/dynamics-api/shared-api.ts"; const router = useRouter() diff --git a/ui/src/views/chat-log/index.vue b/ui/src/views/chat-log/index.vue index 2a8e7f832e3..0be56562d2b 100644 --- a/ui/src/views/chat-log/index.vue +++ b/ui/src/views/chat-log/index.vue @@ -13,7 +13,7 @@ style="width: 75px" > - + + + + + +
+
+ +
+

{{ $t('layout.home.createAgent') }}

+

+ {{ $t('layout.home.createAgentDescribe') }} +

+
+
+ +
+
+ +
+
+
+ + + + diff --git a/ui/src/views/home/component/Ranking.vue b/ui/src/views/home/component/Ranking.vue new file mode 100644 index 00000000000..8739e698d94 --- /dev/null +++ b/ui/src/views/home/component/Ranking.vue @@ -0,0 +1,182 @@ + + + diff --git a/ui/src/views/home/component/ResourceAggregation.vue b/ui/src/views/home/component/ResourceAggregation.vue new file mode 100644 index 00000000000..1d49c7a0a8c --- /dev/null +++ b/ui/src/views/home/component/ResourceAggregation.vue @@ -0,0 +1,165 @@ + + + diff --git a/ui/src/views/home/component/StatisticsCharts.vue b/ui/src/views/home/component/StatisticsCharts.vue new file mode 100644 index 00000000000..6736e6621ee --- /dev/null +++ b/ui/src/views/home/component/StatisticsCharts.vue @@ -0,0 +1,213 @@ + + + diff --git a/ui/src/views/home/index.vue b/ui/src/views/home/index.vue new file mode 100644 index 00000000000..d938cd3b555 --- /dev/null +++ b/ui/src/views/home/index.vue @@ -0,0 +1,160 @@ + + + diff --git a/ui/src/workflow/common/data.ts b/ui/src/workflow/common/data.ts index a726ae9ed5a..0a8f3707fed 100644 --- a/ui/src/workflow/common/data.ts +++ b/ui/src/workflow/common/data.ts @@ -794,7 +794,7 @@ export const knowledgeMenuNodes = [ ], }, { - label: t('workflow.nodes.classify.other'), + label: t('common.other'), list: [mcpNode, toolNode], }, ] @@ -833,7 +833,7 @@ export const menuNodes = [ ], }, { - label: t('workflow.nodes.classify.other'), + label: t('common.other'), list: [mcpNode, toolNode], }, ] @@ -871,7 +871,7 @@ export const applicationLoopMenuNodes = [ ], }, { - label: t('workflow.nodes.classify.other'), + label: t('common.other'), list: [mcpNode, toolNode], }, ] @@ -913,7 +913,7 @@ export const knowledgeLoopMenuNodes = [ ], }, { - label: t('workflow.nodes.classify.other'), + label: t('common.other'), list: [mcpNode, toolNode], }, ] @@ -955,7 +955,7 @@ export const toolLoopMenuNodes = [ ], }, { - label: t('workflow.nodes.classify.other'), + label: t('common.other'), list: [mcpNode, toolNode], }, ] @@ -999,7 +999,7 @@ const toolMenuNodes = [ ], }, { - label: t('workflow.nodes.classify.other'), + label: t('common.other'), list: [mcpNode, toolNode], }, ] From 9091fec6adecd507c6ed46ce1be9fcfe106a23f7 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 25 May 2026 13:46:08 +0800 Subject: [PATCH 2/4] feat: home --- ui/src/assets/home/icon_create-agent.svg | 11 +- ui/src/assets/home/icon_create-knowledge.svg | 6 + ui/src/assets/home/icon_create-model.svg | 6 + ui/src/assets/home/icon_create-tool.svg | 7 + ui/src/locales/lang/zh-CN/layout.ts | 6 + ui/src/views/home/component/QuickCreate.vue | 436 +++++++++++++++++- .../views/tool/DataSourceToolFormDrawer.vue | 2 +- ui/src/views/tool/McpToolFormDrawer.vue | 2 +- ui/src/views/tool/SkillToolFormDrawer.vue | 7 +- ui/src/views/tool/ToolFormDrawer.vue | 2 +- ui/src/views/tool/WorkflowFormDialog.vue | 38 +- 11 files changed, 485 insertions(+), 38 deletions(-) create mode 100644 ui/src/assets/home/icon_create-knowledge.svg create mode 100644 ui/src/assets/home/icon_create-model.svg create mode 100644 ui/src/assets/home/icon_create-tool.svg diff --git a/ui/src/assets/home/icon_create-agent.svg b/ui/src/assets/home/icon_create-agent.svg index a078282dfb9..86c6de8676e 100644 --- a/ui/src/assets/home/icon_create-agent.svg +++ b/ui/src/assets/home/icon_create-agent.svg @@ -1,5 +1,8 @@ - - - - + + + + + + + diff --git a/ui/src/assets/home/icon_create-knowledge.svg b/ui/src/assets/home/icon_create-knowledge.svg new file mode 100644 index 00000000000..46e5921672a --- /dev/null +++ b/ui/src/assets/home/icon_create-knowledge.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/ui/src/assets/home/icon_create-model.svg b/ui/src/assets/home/icon_create-model.svg new file mode 100644 index 00000000000..24ec4caf309 --- /dev/null +++ b/ui/src/assets/home/icon_create-model.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/ui/src/assets/home/icon_create-tool.svg b/ui/src/assets/home/icon_create-tool.svg new file mode 100644 index 00000000000..99eebd88194 --- /dev/null +++ b/ui/src/assets/home/icon_create-tool.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ui/src/locales/lang/zh-CN/layout.ts b/ui/src/locales/lang/zh-CN/layout.ts index e33ae913183..91a8570465b 100644 --- a/ui/src/locales/lang/zh-CN/layout.ts +++ b/ui/src/locales/lang/zh-CN/layout.ts @@ -15,6 +15,12 @@ export default { quickCreate: '快速创建', createAgent: '创建智能体', createAgentDescribe: '从模板或空白创建', + createKnowledge: '创建知识库', + createKnowledgeDescribe: '上传文档或 Web 站点', + createTool: '添加工具', + createToolDescribe: '脚本工具或工作流工具', + createModel: '添加模型', + createModelDescribe: '配置大语言/向量等模型', resource: '资源', llm: '大语言', embedding: '向量', diff --git a/ui/src/views/home/component/QuickCreate.vue b/ui/src/views/home/component/QuickCreate.vue index 6d64f9f1399..2f0ed4beb01 100644 --- a/ui/src/views/home/component/QuickCreate.vue +++ b/ui/src/views/home/component/QuickCreate.vue @@ -1,5 +1,5 @@

{{ $t('layout.home.createAgent') }}

-

+

{{ $t('layout.home.createAgentDescribe') }}

@@ -26,7 +26,7 @@ diff --git a/ui/src/views/tool/DataSourceToolFormDrawer.vue b/ui/src/views/tool/DataSourceToolFormDrawer.vue index 9bde5a75ca4..b3a417b67c8 100644 --- a/ui/src/views/tool/DataSourceToolFormDrawer.vue +++ b/ui/src/views/tool/DataSourceToolFormDrawer.vue @@ -472,7 +472,7 @@ const submit = async (formEl: FormInstance | undefined) => { }) } else { const obj = { - folder_id: folder.currentFolder?.id, + folder_id: folder.currentFolder?.id || user.getWorkspaceId() || 'default', ...form.value, } loadSharedApi({ type: 'tool', systemType: apiType.value }) diff --git a/ui/src/views/tool/McpToolFormDrawer.vue b/ui/src/views/tool/McpToolFormDrawer.vue index 67956aef4d6..fbca9bfcaa9 100644 --- a/ui/src/views/tool/McpToolFormDrawer.vue +++ b/ui/src/views/tool/McpToolFormDrawer.vue @@ -272,7 +272,7 @@ const submit = async (formEl: FormInstance | undefined) => { }) } else { const obj = { - folder_id: folder.currentFolder?.id, + folder_id: folder.currentFolder?.id || user.getWorkspaceId() || 'default', ...form.value, } loadSharedApi({ type: 'tool', systemType: apiType.value }) diff --git a/ui/src/views/tool/SkillToolFormDrawer.vue b/ui/src/views/tool/SkillToolFormDrawer.vue index 88b866737cd..ea440e34428 100644 --- a/ui/src/views/tool/SkillToolFormDrawer.vue +++ b/ui/src/views/tool/SkillToolFormDrawer.vue @@ -385,7 +385,10 @@ const downloadZip = () => { MsgError(t('views.tool.skill.noFileTip')) return } - const fileName = form.value.fileList && form.value.fileList[0] ? form.value.fileList[0].name : `${form.value.name}.zip` + const fileName = + form.value.fileList && form.value.fileList[0] + ? form.value.fileList[0].name + : `${form.value.name}.zip` loadSharedApi({ type: 'tool', systemType: apiType.value }) .downloadSkillFile(form.value.id as string) .then((res: any) => { @@ -421,7 +424,7 @@ const submit = async (formEl: FormInstance | undefined) => { }) } else { const obj = { - folder_id: folder.currentFolder?.id, + folder_id: folder.currentFolder?.id || user.getWorkspaceId() || 'default', ...form.value, } loadSharedApi({ type: 'tool', systemType: apiType.value }) diff --git a/ui/src/views/tool/ToolFormDrawer.vue b/ui/src/views/tool/ToolFormDrawer.vue index 3491114ae7f..0e9f9cd6ab9 100644 --- a/ui/src/views/tool/ToolFormDrawer.vue +++ b/ui/src/views/tool/ToolFormDrawer.vue @@ -440,7 +440,7 @@ const submit = async (formEl: FormInstance | undefined) => { }) } else { const obj = { - folder_id: folder.currentFolder?.id, + folder_id: folder.currentFolder?.id || user.getWorkspaceId() || 'default', ...form.value, } loadSharedApi({ type: 'tool', systemType: apiType.value }) diff --git a/ui/src/views/tool/WorkflowFormDialog.vue b/ui/src/views/tool/WorkflowFormDialog.vue index 67b4917c336..2c71b99eff2 100644 --- a/ui/src/views/tool/WorkflowFormDialog.vue +++ b/ui/src/views/tool/WorkflowFormDialog.vue @@ -30,10 +30,10 @@ :size="32" style="background: none" > - + - + - + - + From 097ad98c2001d63f4c9e420d769339cd9791f0ae Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 25 May 2026 18:36:51 +0800 Subject: [PATCH 3/4] perf: home --- ui/src/api/home-page/home.ts | 50 +-- ui/src/locales/lang/zh-CN/layout.ts | 1 + ui/src/views/home/component/Ranking.vue | 321 +++++++++++------- ui/src/views/home/component/RankingDrawer.vue | 195 +++++++++++ .../views/home/component/StatisticsCharts.vue | 269 ++++++++------- ui/src/views/home/index.vue | 72 +--- 6 files changed, 579 insertions(+), 329 deletions(-) create mode 100644 ui/src/views/home/component/RankingDrawer.vue diff --git a/ui/src/api/home-page/home.ts b/ui/src/api/home-page/home.ts index 3e6b62e0795..df195b8ef97 100644 --- a/ui/src/api/home-page/home.ts +++ b/ui/src/api/home-page/home.ts @@ -43,58 +43,61 @@ const getModelAggregation: (loading?: Ref) => Promise> = (l /** * Tokens 消耗 - * @params + * @params {end_time,start_time} */ -const getTokensRanking: (page: pageRequest, loading?: Ref) => Promise> = ( - page, - loading, -) => { +const getTokensRanking: ( + page: pageRequest, + params: any, + loading?: Ref, +) => Promise> = (page, params, loading) => { return get( `${prefix.value}/application/tokens_ranking/${page.current_page}/${page.page_size}`, - undefined, + params, loading, ) } /** * 提问次数 - * @params + * @params {end_time,start_time} */ -const getQuestionsRanking: (page: pageRequest, loading?: Ref) => Promise> = ( - page, - loading, -) => { +const getQuestionsRanking: ( + page: pageRequest, + params: any, + loading?: Ref, +) => Promise> = (page, params, loading) => { return get( `${prefix.value}/application/question_ranking/${page.current_page}/${page.page_size}`, - undefined, + params, loading, ) } /** * 用户消耗token - * @params + * @params {end_time,start_time} */ -const getUserTokensRanking: (page: pageRequest, loading?: Ref) => Promise> = ( - page, - loading, -) => { +const getUserTokensRanking: ( + page: pageRequest, + params: any, + loading?: Ref, +) => Promise> = (page, params, loading) => { return get( `${prefix.value}/application/user_tokens_ranking/${page.current_page}/${page.page_size}`, - undefined, + params, loading, ) } /** * 与对话有关的统计趋势 - * @params + * @params {application_id, end_time, start_time} */ -const getMonitorAggregation: (page: pageRequest, loading?: Ref) => Promise> = ( - page, +const getMonitorAggregation: (params: any, loading?: Ref) => Promise> = ( + params, loading, ) => { return get( - `${prefix.value}/monitor_aggregation/${page.current_page}/${page.page_size}`, - undefined, + `${prefix.value}/monitoring/aggregation`, + params, loading, ) } @@ -107,4 +110,5 @@ export default { getTokensRanking, getQuestionsRanking, getUserTokensRanking, + getMonitorAggregation, } diff --git a/ui/src/locales/lang/zh-CN/layout.ts b/ui/src/locales/lang/zh-CN/layout.ts index 91a8570465b..3411b7e1fb9 100644 --- a/ui/src/locales/lang/zh-CN/layout.ts +++ b/ui/src/locales/lang/zh-CN/layout.ts @@ -11,6 +11,7 @@ export default { home: { title: '首页', rank: '排行榜', + rankDetail: '排行榜详情', consume: '消耗', quickCreate: '快速创建', createAgent: '创建智能体', diff --git a/ui/src/views/home/component/Ranking.vue b/ui/src/views/home/component/Ranking.vue index 8739e698d94..2ba4c83e9c2 100644 --- a/ui/src/views/home/component/Ranking.vue +++ b/ui/src/views/home/component/Ranking.vue @@ -1,133 +1,167 @@ diff --git a/ui/src/views/home/component/StatisticsCharts.vue b/ui/src/views/home/component/StatisticsCharts.vue index 6736e6621ee..37224b57626 100644 --- a/ui/src/views/home/component/StatisticsCharts.vue +++ b/ui/src/views/home/component/StatisticsCharts.vue @@ -1,78 +1,141 @@ - + diff --git a/ui/src/views/home/index.vue b/ui/src/views/home/index.vue index d938cd3b555..d2f608b95bf 100644 --- a/ui/src/views/home/index.vue +++ b/ui/src/views/home/index.vue @@ -15,43 +15,11 @@ + + + + - -

- {{ $t('views.applicationOverview.monitor.monitoringStatistics') }} -

-
- - - - -
-
- -
-
- -

{{ $t('layout.home.rank') }} TOP5

- -

@@ -61,11 +29,11 @@ import { ref, computed, onMounted, shallowRef, nextTick } from 'vue' import { useRoute } from 'vue-router' -import StatisticsCharts from '@/views/application-overview/component/StatisticsCharts.vue' +import StatisticsCharts from './component/StatisticsCharts.vue' import QuickCreate from './component/QuickCreate.vue' import ResourceAggregation from './component/ResourceAggregation.vue' import Ranking from './component/Ranking.vue' -import { nowDate, beforeDay } from '@/utils/time' + import { MsgSuccess, MsgConfirm } from '@/utils/message' import { t } from '@/locales' import { loadSharedApi } from '@/utils/dynamics-api/shared-api' @@ -79,34 +47,6 @@ const detail = ref(null) const loading = ref(false) -const dayOptions = [ - { - value: 7, - label: t('views.applicationOverview.monitor.pastDayOptions.past7Days'), - }, - { - value: 30, - label: t('views.applicationOverview.monitor.pastDayOptions.past30Days'), - }, - { - value: 90, - label: t('views.applicationOverview.monitor.pastDayOptions.past90Days'), - }, - { - value: 183, - label: t('views.applicationOverview.monitor.pastDayOptions.past183Days'), - }, - { - value: 'other', - label: t('common.custom'), - }, -] - -const history_day = ref(7) - -// 日期组件时间 -const daterangeValue = ref('') - const statisticsLoading = ref(false) const statisticsData = ref([]) const tokenUsage = ref([]) From ccd6a30d1e5a18243bc5d5c7504600cd4f77401c Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 25 May 2026 23:54:41 +0800 Subject: [PATCH 4/4] perf: home --- ui/src/locales/lang/en-US/layout.ts | 13 +- .../locales/lang/en-US/views/application.ts | 7 +- ui/src/locales/lang/zh-CN/layout.ts | 6 +- .../locales/lang/zh-CN/views/application.ts | 1 + ui/src/locales/lang/zh-Hant/layout.ts | 17 +- .../locales/lang/zh-Hant/views/application.ts | 4 +- ui/src/styles/app.scss | 26 +++ ui/src/views/home/component/Ranking.vue | 36 +--- ui/src/views/home/component/RankingDrawer.vue | 197 +++++++++++++++++- ui/src/views/home/index.vue | 46 +--- 10 files changed, 260 insertions(+), 93 deletions(-) diff --git a/ui/src/locales/lang/en-US/layout.ts b/ui/src/locales/lang/en-US/layout.ts index c3767b5d021..fcf3bccae49 100644 --- a/ui/src/locales/lang/en-US/layout.ts +++ b/ui/src/locales/lang/en-US/layout.ts @@ -10,11 +10,19 @@ export default { crossSettings: 'Cross-Origin Settings', home: { title: 'Home', - rank: 'Ranking', + rankingList: 'Ranking List', + rank: 'Rank', + rankDetail: 'Ranking Detail', consume: 'Consumption', quickCreate: 'Quick Create', createAgent: 'Create Agent', createAgentDescribe: 'From template or blank', + createKnowledge: 'Create Knowledge Base', + createKnowledgeDescribe: 'Upload documents or websites', + createTool: 'Add Tool', + createToolDescribe: 'Script tools or workflow tools', + createModel: 'Add Model', + createModelDescribe: 'Configure large language/vector models', resource: 'Resources', llm: 'Large Language Model', embedding: 'Embedding', @@ -24,6 +32,9 @@ export default { wheel: 'Wheel', person: 'Person', questions: 'Questions', + proportion: 'Proportion', + perDialogueRounds: 'Average Dialogue Rounds', + commonlyAgents: 'Commonly Used Agents', }, about: { title: 'About', diff --git a/ui/src/locales/lang/en-US/views/application.ts b/ui/src/locales/lang/en-US/views/application.ts index b5ce367b8cd..a2821ab266f 100644 --- a/ui/src/locales/lang/en-US/views/application.ts +++ b/ui/src/locales/lang/en-US/views/application.ts @@ -40,10 +40,12 @@ export default { setting: 'Long-term Memory Settings', triggerType: 'Trigger Type', roundTrigger: 'Round-based Trigger', - roundTriggerTip: 'After accumulating N rounds, automatically extract N rounds of conversation to generate memory', + roundTriggerTip: + 'After accumulating N rounds, automatically extract N rounds of conversation to generate memory', triggerInterval: 'Trigger Interval', scheduledTrigger: 'Scheduled Trigger', - scheduledTriggerTip: 'After reaching the set time, automatically extract all conversations within the cycle to generate memory', + scheduledTriggerTip: + 'After reaching the set time, automatically extract all conversations within the cycle to generate memory', cronExpressionInvalid: 'Cron expression is invalid', tips1: `After enabling, new conversations will be recorded from the activation time and memory will be generated periodically, which can be called through`, tips2: `variables in the system prompt. @@ -51,6 +53,7 @@ After disabling, the long-term memory of the conversation users will be cleared, }, form: { appName: { + label: 'Agent name', placeholder: 'Please enter the agent name', requiredMessage: 'Agent name is required', }, diff --git a/ui/src/locales/lang/zh-CN/layout.ts b/ui/src/locales/lang/zh-CN/layout.ts index 3411b7e1fb9..b67dfd4c71b 100644 --- a/ui/src/locales/lang/zh-CN/layout.ts +++ b/ui/src/locales/lang/zh-CN/layout.ts @@ -10,7 +10,8 @@ export default { crossSettings: '跨域设置', home: { title: '首页', - rank: '排行榜', + rankingList: '排行榜', + rank: '排名', rankDetail: '排行榜详情', consume: '消耗', quickCreate: '快速创建', @@ -31,6 +32,9 @@ export default { wheel: '轮', person: '人', questions: '提问', + proportion: '占比', + perDialogueRounds: '人均对话轮次', + commonlyAgents: '常用智能体', }, about: { title: '关于', diff --git a/ui/src/locales/lang/zh-CN/views/application.ts b/ui/src/locales/lang/zh-CN/views/application.ts index ca12ea71d6b..ec6daff87cf 100644 --- a/ui/src/locales/lang/zh-CN/views/application.ts +++ b/ui/src/locales/lang/zh-CN/views/application.ts @@ -48,6 +48,7 @@ export default { }, form: { appName: { + label: '智能体名称', placeholder: '请输入智能体名称', requiredMessage: '请输入智能体名称', }, diff --git a/ui/src/locales/lang/zh-Hant/layout.ts b/ui/src/locales/lang/zh-Hant/layout.ts index b81beafca55..61b881f7824 100644 --- a/ui/src/locales/lang/zh-Hant/layout.ts +++ b/ui/src/locales/lang/zh-Hant/layout.ts @@ -10,20 +10,31 @@ export default { crossSettings: '跨域設定', home: { title: '首頁', - rank: '排行榜', + rankingList: '排行榜', + rank: '排名', + rankDetail: '排行榜詳情', consume: '消耗', quickCreate: '快速創建', createAgent: '創建智能體', createAgentDescribe: '從模板或空白創建', + createKnowledge: '創建知識庫', + createKnowledgeDescribe: '上傳文檔或 Web 站點', + createTool: '添加工具', + createToolDescribe: '腳本工具或工作流工具', + createModel: '添加模型', + createModelDescribe: '配置大语言/向量等模型', resource: '資源', - llm: '大語言', + llm: '大语言', embedding: '向量', chat: '對話', average‌: '均', activeUsers: '活躍用戶', - wheel: '輪', + wheel: '轮', person: '人', questions: '提問', + proportion: '占比', + perDialogueRounds: '人均對話輪次', + commonlyAgents: '常用智能體', }, about: { title: '關於', diff --git a/ui/src/locales/lang/zh-Hant/views/application.ts b/ui/src/locales/lang/zh-Hant/views/application.ts index fb4287ef2ba..988d0958593 100644 --- a/ui/src/locales/lang/zh-Hant/views/application.ts +++ b/ui/src/locales/lang/zh-Hant/views/application.ts @@ -47,6 +47,7 @@ export default { }, form: { appName: { + label: '智能體名稱', placeholder: '請輸入智能體名稱', requiredMessage: '請輸入智能體名稱', }, @@ -73,8 +74,7 @@ export default { }, roleSettings: { label: '系統提示詞', - placeholder: - '', + placeholder: '', tooltip: '設定模型扮演的角色或遵循的指令', }, prompt: { diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss index 4a785c39c5a..ffff9a82027 100644 --- a/ui/src/styles/app.scss +++ b/ui/src/styles/app.scss @@ -613,3 +613,29 @@ h5 { max-width: 100%; } +// 排行榜 +.rank { + width: 20px; + height: 20px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-weight: 500px; + border: 2px solid #ffffff; +} +.rank-1 { + color: #c85719; + background: linear-gradient(180deg, #fee4b1 0%, #feca88 100%); + border-color: #ffe89d; +} +.rank-2 { + color: #2b5fd9; + background: linear-gradient(180deg, #c6d7ff 0%, #b6d2f7 100%); + border-color: #d6e2ff; +} +.rank-3 { + color: #cc710a; + background: linear-gradient(180deg, #ffe1cf 0%, #f4c5af 100%); + border-color: #ffe7cc; +} diff --git a/ui/src/views/home/component/Ranking.vue b/ui/src/views/home/component/Ranking.vue index 2ba4c83e9c2..9da85b00ecc 100644 --- a/ui/src/views/home/component/Ranking.vue +++ b/ui/src/views/home/component/Ranking.vue @@ -73,7 +73,11 @@ Top {{ $t('views.application.title') }} - + {{ $t('common.detail') }} @@ -118,7 +122,7 @@ Top {{ $t('views.chatLog.table.user') }} - + {{ $t('common.detail') }} @@ -238,30 +242,4 @@ onMounted(() => { changeDayHandle(history_day.value) }) - + diff --git a/ui/src/views/home/component/RankingDrawer.vue b/ui/src/views/home/component/RankingDrawer.vue index 8b6df752c73..766f808e0c2 100644 --- a/ui/src/views/home/component/RankingDrawer.vue +++ b/ui/src/views/home/component/RankingDrawer.vue @@ -54,21 +54,198 @@ :pagination-config="paginationConfig" @sizeChange="handleSizeChange" @changePage="getDetail" - :maxTableHeight="200" + :maxTableHeight="280" :row-key="(row: any) => row.id" v-loading="loading" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -77,10 +254,8 @@