@liujitcn/kratos-admin-system 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package/declarations/src/api/system/base_language.d.ts +5 -4
- package/dist/package/declarations/src/api/system/base_translation.d.ts +7 -4
- package/dist/package/declarations/src/api/system/ops_monitoring.d.ts +19 -0
- package/dist/package/declarations/src/api/system/ops_monitoring_sse.d.ts +12 -0
- package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +9 -32
- package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +3 -6
- package/dist/package/declarations/src/components/dynamicTranslation.d.ts +11 -17
- package/dist/package/declarations/src/locales/generated.d.ts +6536 -0
- package/dist/package/declarations/src/rpc/base/v1/ai_session.d.ts +12 -2
- package/dist/package/declarations/src/rpc/base/v1/ai_tool.d.ts +9 -1
- package/dist/package/declarations/src/rpc/base/v1/config.d.ts +35 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +1 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +23 -7
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +7 -77
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +9 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_language.d.ts +7 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +5 -40
- package/dist/package/declarations/src/rpc/system/admin/v1/base_migration.d.ts +6 -6
- package/dist/package/declarations/src/rpc/system/admin/v1/base_role.d.ts +13 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_translation.d.ts +54 -81
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +11 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +11 -11
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +11 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/common.d.ts +13 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/ops_monitoring.d.ts +222 -0
- package/dist/package/declarations/src/views/tool/ops-monitoring/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/ai_message.ts +2 -2
- package/dist/package/src/api/system/base_language.ts +13 -15
- package/dist/package/src/api/system/base_translation.ts +17 -6
- package/dist/package/src/api/system/ops_monitoring.ts +88 -0
- package/dist/package/src/api/system/ops_monitoring_sse.ts +49 -0
- package/dist/package/src/components/DynamicTranslationCell.vue +199 -126
- package/dist/package/src/components/DynamicTranslationEditor.vue +109 -78
- package/dist/package/src/components/dynamicTranslation.ts +11 -31
- package/dist/package/src/locales/README.md +7 -5
- package/dist/package/src/locales/en-US.json +876 -872
- package/dist/package/src/locales/es-ES.json +900 -895
- package/dist/package/src/locales/fr-FR.json +896 -891
- package/dist/package/src/locales/generated.ts +22 -0
- package/dist/package/src/locales/ja-JP.json +876 -872
- package/dist/package/src/locales/ko-KR.json +881 -876
- package/dist/package/src/locales/zh-CN.json +876 -872
- package/dist/package/src/locales/zh-TW.json +876 -871
- package/dist/package/src/module.ts +3 -17
- package/dist/package/src/rpc/base/v1/ai_session.ts +13 -2
- package/dist/package/src/rpc/base/v1/ai_tool.ts +10 -1
- package/dist/package/src/rpc/base/v1/config.ts +47 -0
- package/dist/package/src/rpc/system/admin/v1/auth.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +24 -7
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +7 -79
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -1
- package/dist/package/src/rpc/system/admin/v1/base_language.ts +8 -2
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +5 -41
- package/dist/package/src/rpc/system/admin/v1/base_migration.ts +8 -8
- package/dist/package/src/rpc/system/admin/v1/base_role.ts +14 -1
- package/dist/package/src/rpc/system/admin/v1/base_translation.ts +54 -81
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +12 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +11 -11
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +12 -1
- package/dist/package/src/rpc/system/admin/v1/common.ts +21 -0
- package/dist/package/src/rpc/system/admin/v1/ops_monitoring.ts +255 -0
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +36 -36
- package/dist/package/src/views/ai/chat/components/SessionPanel.vue +6 -6
- package/dist/package/src/views/ai/chat/components/XSender.vue +20 -20
- package/dist/package/src/views/ai/chat/index.vue +33 -32
- package/dist/package/src/views/ai/chat/message.ts +16 -15
- package/dist/package/src/views/base/api/index.vue +55 -56
- package/dist/package/src/views/base/area/index.vue +18 -19
- package/dist/package/src/views/base/config/index.vue +143 -133
- package/dist/package/src/views/base/dept/index.vue +42 -43
- package/dist/package/src/views/base/dict/index.vue +49 -45
- package/dist/package/src/views/base/dict/item.vue +54 -49
- package/dist/package/src/views/base/job/index.vue +51 -52
- package/dist/package/src/views/base/job/log.vue +18 -18
- package/dist/package/src/views/{tool → base}/language/index.vue +51 -47
- package/dist/package/src/views/base/log/index.vue +40 -40
- package/dist/package/src/views/base/menu/index.vue +220 -177
- package/dist/package/src/views/base/migration/index.vue +24 -24
- package/dist/package/src/views/base/post/index.vue +42 -43
- package/dist/package/src/views/base/role/index.vue +54 -55
- package/dist/package/src/views/base/tenant/index.vue +42 -43
- package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
- package/dist/package/src/views/base/user/index.vue +69 -71
- package/dist/package/src/views/profile/components/base.vue +9 -9
- package/dist/package/src/views/profile/components/password.vue +19 -20
- package/dist/package/src/views/profile/components/security.vue +20 -20
- package/dist/package/src/views/profile/index.vue +3 -3
- package/dist/package/src/views/tool/api-doc/index.vue +1 -1
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +13 -13
- package/dist/package/src/views/tool/code-gen/columns/index.vue +89 -89
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +5 -5
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +21 -21
- package/dist/package/src/views/tool/code-gen/components/CodePreviewPane.vue +5 -5
- package/dist/package/src/views/tool/code-gen/config.ts +60 -60
- package/dist/package/src/views/tool/code-gen/preview/data.ts +2 -2
- package/dist/package/src/views/tool/code-gen/preview/index.vue +30 -31
- package/dist/package/src/views/tool/code-gen/proto/index.vue +43 -43
- package/dist/package/src/views/tool/code-gen/table/index.vue +95 -95
- package/dist/package/src/views/tool/ops-monitoring/index.vue +1175 -0
- package/dist/package/src/views/tool/project-doc/index.vue +7 -7
- package/package.json +2 -2
- package/dist/package/declarations/src/rpc/base/v1/enum.d.ts +0 -43
- package/dist/package/declarations/src/rpc/system/common/v1/enum.d.ts +0 -67
- package/dist/package/src/rpc/base/v1/enum.ts +0 -54
- package/dist/package/src/rpc/system/common/v1/enum.ts +0 -80
- /package/dist/package/declarations/src/views/{tool → base}/language/index.vue.d.ts +0 -0
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
type AiToken
|
|
8
8
|
} from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
9
9
|
import type { AiAction } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_message";
|
|
10
|
-
import { AiMessageStatus
|
|
10
|
+
import { AiMessageStatus } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
11
|
+
import { Terminal } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_tool";
|
|
11
12
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
12
13
|
import type { AiStreamPayload, AIFlowBlock, ChatMessageItem, ReplySourceTag } from "./types";
|
|
13
14
|
|
|
@@ -43,7 +44,7 @@ export function resolveTimestamp(timestamp?: { seconds?: number; nanos?: number
|
|
|
43
44
|
export function normalizeSession(session?: Partial<AiSession> | null): AiSession {
|
|
44
45
|
return {
|
|
45
46
|
id: String(session?.id ?? ""),
|
|
46
|
-
title: String(session?.title ?? t("system.ai.chat.value.
|
|
47
|
+
title: String(session?.title ?? t("system.ai.chat.value.new_conversation")),
|
|
47
48
|
summary: String(session?.summary ?? ""),
|
|
48
49
|
updated_at: session?.updated_at,
|
|
49
50
|
terminal: Number(session?.terminal ?? Terminal.TERMINAL_ADMIN)
|
|
@@ -169,17 +170,17 @@ export function mapMessageItem(message: AiMessage, role: "user" | "ai"): ChatMes
|
|
|
169
170
|
step: role === "ai" ? outputContent.step : "",
|
|
170
171
|
blocksJson: role === "ai" ? outputContent.blocks_json : "",
|
|
171
172
|
blocks: role === "ai" ? markFlowBlocksDisabled(parseFlowBlocks(outputContent.blocks_json), String(message.id ?? "")) : [],
|
|
172
|
-
status: Number(message.status ?? AiMessageStatus.
|
|
173
|
+
status: Number(message.status ?? AiMessageStatus.AI_MESSAGE_STATUS_SUCCESS),
|
|
173
174
|
token: normalizeToken(message.token),
|
|
174
175
|
tools: Array.isArray(message.tools) ? message.tools : [],
|
|
175
176
|
variant: role === "user" ? "filled" : "borderless",
|
|
176
177
|
shape: "corner",
|
|
177
178
|
progressState:
|
|
178
|
-
message.status === AiMessageStatus.
|
|
179
|
+
message.status === AiMessageStatus.AI_MESSAGE_STATUS_GENERATING
|
|
179
180
|
? role === "user"
|
|
180
181
|
? "idle"
|
|
181
182
|
: "streaming"
|
|
182
|
-
: message.status === AiMessageStatus.
|
|
183
|
+
: message.status === AiMessageStatus.AI_MESSAGE_STATUS_FAILED
|
|
183
184
|
? "failed"
|
|
184
185
|
: "idle",
|
|
185
186
|
maxWidth: role === "user" ? "380px" : "100%"
|
|
@@ -210,7 +211,7 @@ export function createLocalUserMessage(payload: { text: string; attachments: AiA
|
|
|
210
211
|
seconds: Math.floor(now.getTime() / 1000),
|
|
211
212
|
nanos: (now.getTime() % 1000) * 1_000_000
|
|
212
213
|
},
|
|
213
|
-
status: AiMessageStatus.
|
|
214
|
+
status: AiMessageStatus.AI_MESSAGE_STATUS_GENERATING,
|
|
214
215
|
token: normalizeToken(),
|
|
215
216
|
tools: [],
|
|
216
217
|
first_token_ms: 0,
|
|
@@ -251,7 +252,7 @@ export function createThinkingMessage(options?: { sessionID?: string; messageID?
|
|
|
251
252
|
seconds: Math.floor(now.getTime() / 1000),
|
|
252
253
|
nanos: (now.getTime() % 1000) * 1_000_000
|
|
253
254
|
},
|
|
254
|
-
status: AiMessageStatus.
|
|
255
|
+
status: AiMessageStatus.AI_MESSAGE_STATUS_GENERATING,
|
|
255
256
|
token: normalizeToken(),
|
|
256
257
|
tools: [],
|
|
257
258
|
first_token_ms: 0,
|
|
@@ -300,7 +301,7 @@ export function markAIMessageRegenerating(current: ChatMessageItem[], sessionID:
|
|
|
300
301
|
duration_ms: 0,
|
|
301
302
|
progressState: "streaming",
|
|
302
303
|
replySourceTag: { text: t("system.ai.chat.status.thinking"), tone: "info" },
|
|
303
|
-
status: AiMessageStatus.
|
|
304
|
+
status: AiMessageStatus.AI_MESSAGE_STATUS_GENERATING,
|
|
304
305
|
streamKey
|
|
305
306
|
};
|
|
306
307
|
});
|
|
@@ -355,16 +356,16 @@ export function markThinkingMessageFailed(current: ChatMessageItem[], options?:
|
|
|
355
356
|
return {
|
|
356
357
|
...item,
|
|
357
358
|
progressState: "failed",
|
|
358
|
-
status: AiMessageStatus.
|
|
359
|
+
status: AiMessageStatus.AI_MESSAGE_STATUS_FAILED
|
|
359
360
|
};
|
|
360
361
|
}
|
|
361
362
|
if (item.progressState !== "streaming") return item;
|
|
362
363
|
return {
|
|
363
364
|
...item,
|
|
364
365
|
progressState: "failed",
|
|
365
|
-
status: AiMessageStatus.
|
|
366
|
-
content: t("system.ai.chat.message.
|
|
367
|
-
replySourceTag: { text: t("system.ai.chat.status.
|
|
366
|
+
status: AiMessageStatus.AI_MESSAGE_STATUS_FAILED,
|
|
367
|
+
content: t("system.ai.chat.message.reply_failed"),
|
|
368
|
+
replySourceTag: { text: t("system.ai.chat.status.send_failed"), tone: "warning" }
|
|
368
369
|
};
|
|
369
370
|
});
|
|
370
371
|
}
|
|
@@ -401,9 +402,9 @@ export function markStreamingError(current: ChatMessageItem[], payload: AiStream
|
|
|
401
402
|
return {
|
|
402
403
|
...item,
|
|
403
404
|
progressState: "failed",
|
|
404
|
-
status: AiMessageStatus.
|
|
405
|
-
content: t("system.ai.chat.message.
|
|
406
|
-
replySourceTag: { text: t("system.ai.chat.status.
|
|
405
|
+
status: AiMessageStatus.AI_MESSAGE_STATUS_FAILED,
|
|
406
|
+
content: t("system.ai.chat.message.reply_failed"),
|
|
407
|
+
replySourceTag: { text: t("system.ai.chat.status.send_failed"), tone: "warning" }
|
|
407
408
|
};
|
|
408
409
|
});
|
|
409
410
|
}
|
|
@@ -3,34 +3,34 @@
|
|
|
3
3
|
<div class="table-box">
|
|
4
4
|
<ProTable ref="proTable" row-key="id" :columns="columns" :request-api="requestBaseApiTable" />
|
|
5
5
|
|
|
6
|
-
<el-drawer v-model="detailDrawer.visible" :title="t('system.api.title.detail')" size="70%" @close="handleCloseDetail">
|
|
6
|
+
<el-drawer v-model="detailDrawer.visible" :title="t('system.base.api.title.detail')" size="70%" @close="handleCloseDetail">
|
|
7
7
|
<el-descriptions v-if="detailData" :column="1" border>
|
|
8
|
-
<el-descriptions-item :label="t('system.api.field.
|
|
9
|
-
<el-descriptions-item :label="t('system.api.field.
|
|
8
|
+
<el-descriptions-item :label="t('system.base.api.field.tool_name')">{{ detailData.tool_name }}</el-descriptions-item>
|
|
9
|
+
<el-descriptions-item :label="t('system.base.api.field.tool_prompts')">
|
|
10
10
|
<div class="tool-prompts">
|
|
11
11
|
<el-tag v-for="prompt in detailToolPrompts" :key="prompt" effect="plain">{{ prompt }}</el-tag>
|
|
12
12
|
<span v-if="!detailToolPrompts.length">--</span>
|
|
13
13
|
</div>
|
|
14
14
|
</el-descriptions-item>
|
|
15
|
-
<el-descriptions-item :label="t('system.api.field.
|
|
16
|
-
<el-descriptions-item :label="t('system.api.field.
|
|
15
|
+
<el-descriptions-item :label="t('system.base.api.field.service_name')">{{ detailData.service_name }}</el-descriptions-item>
|
|
16
|
+
<el-descriptions-item :label="t('system.base.api.field.service_description')">{{
|
|
17
17
|
detailData.service_desc
|
|
18
18
|
}}</el-descriptions-item>
|
|
19
|
-
<el-descriptions-item :label="t('system.api.field.description')">{{ detailData.desc }}</el-descriptions-item>
|
|
20
|
-
<el-descriptions-item :label="t('system.api.field.operation')">{{ detailData.operation }}</el-descriptions-item>
|
|
21
|
-
<el-descriptions-item :label="t('system.api.field.method')">{{ detailData.method }}</el-descriptions-item>
|
|
22
|
-
<el-descriptions-item :label="t('system.api.field.path')">{{ detailData.path }}</el-descriptions-item>
|
|
23
|
-
<el-descriptions-item :label="t('system.api.field.
|
|
19
|
+
<el-descriptions-item :label="t('system.base.api.field.description')">{{ detailData.desc }}</el-descriptions-item>
|
|
20
|
+
<el-descriptions-item :label="t('system.base.api.field.operation')">{{ detailData.operation }}</el-descriptions-item>
|
|
21
|
+
<el-descriptions-item :label="t('system.base.api.field.method')">{{ detailData.method }}</el-descriptions-item>
|
|
22
|
+
<el-descriptions-item :label="t('system.base.api.field.path')">{{ detailData.path }}</el-descriptions-item>
|
|
23
|
+
<el-descriptions-item :label="t('system.base.api.field.mcp_tool')">{{
|
|
24
24
|
formatStatus(detailData.mcp_status)
|
|
25
25
|
}}</el-descriptions-item>
|
|
26
|
-
<el-descriptions-item :label="t('system.api.field.
|
|
26
|
+
<el-descriptions-item :label="t('system.base.api.field.agent_tool')">{{
|
|
27
27
|
formatStatus(detailData.agent_status)
|
|
28
28
|
}}</el-descriptions-item>
|
|
29
29
|
</el-descriptions>
|
|
30
30
|
|
|
31
31
|
<div v-if="detailDoc" class="api-doc">
|
|
32
32
|
<section class="api-doc-section">
|
|
33
|
-
<div class="api-doc-title">{{ t("system.api.section.parameters") }}</div>
|
|
33
|
+
<div class="api-doc-title">{{ t("system.base.api.section.parameters") }}</div>
|
|
34
34
|
<el-table
|
|
35
35
|
v-if="detailParameters.length > 0"
|
|
36
36
|
:data="detailParameters"
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
default-expand-all
|
|
39
39
|
:tree-props="{ children: 'children' }"
|
|
40
40
|
>
|
|
41
|
-
<el-table-column prop="path" :label="t('system.api.doc.field.name')" min-width="220" />
|
|
42
|
-
<el-table-column prop="in" :label="t('system.api.doc.field.location')" width="90" />
|
|
43
|
-
<el-table-column :label="t('system.api.doc.field.type')" min-width="180">
|
|
41
|
+
<el-table-column prop="path" :label="t('system.base.api.doc.field.name')" min-width="220" />
|
|
42
|
+
<el-table-column prop="in" :label="t('system.base.api.doc.field.location')" width="90" />
|
|
43
|
+
<el-table-column :label="t('system.base.api.doc.field.type')" min-width="180">
|
|
44
44
|
<template #default="{ row }">{{ formatSchemaType(row) }}</template>
|
|
45
45
|
</el-table-column>
|
|
46
|
-
<el-table-column :label="t('system.api.doc.field.required')" width="80" align="center">
|
|
47
|
-
<template #default="{ row }">{{ t(row.required ? "
|
|
46
|
+
<el-table-column :label="t('system.base.api.doc.field.required')" width="80" align="center">
|
|
47
|
+
<template #default="{ row }">{{ t(row.required ? "common.value.yes" : "common.value.no") }}</template>
|
|
48
48
|
</el-table-column>
|
|
49
49
|
<el-table-column
|
|
50
50
|
prop="description"
|
|
51
|
-
:label="t('system.api.doc.field.description')"
|
|
51
|
+
:label="t('system.base.api.doc.field.description')"
|
|
52
52
|
min-width="240"
|
|
53
53
|
show-overflow-tooltip
|
|
54
54
|
/>
|
|
55
55
|
</el-table>
|
|
56
|
-
<el-empty v-else :description="t('system.api.message.
|
|
56
|
+
<el-empty v-else :description="t('system.base.api.message.no_parameters')" :image-size="72" />
|
|
57
57
|
</section>
|
|
58
58
|
|
|
59
59
|
<section class="api-doc-section">
|
|
60
|
-
<div class="api-doc-title">{{ t("system.api.section.
|
|
60
|
+
<div class="api-doc-title">{{ t("system.base.api.section.request_body") }}</div>
|
|
61
61
|
<el-table
|
|
62
62
|
v-if="requestBodyRows.length > 0"
|
|
63
63
|
:data="requestBodyRows"
|
|
@@ -65,25 +65,25 @@
|
|
|
65
65
|
default-expand-all
|
|
66
66
|
:tree-props="{ children: 'children' }"
|
|
67
67
|
>
|
|
68
|
-
<el-table-column prop="path" :label="t('system.api.doc.field.name')" min-width="220" />
|
|
69
|
-
<el-table-column :label="t('system.api.doc.field.type')" min-width="180">
|
|
68
|
+
<el-table-column prop="path" :label="t('system.base.api.doc.field.name')" min-width="220" />
|
|
69
|
+
<el-table-column :label="t('system.base.api.doc.field.type')" min-width="180">
|
|
70
70
|
<template #default="{ row }">{{ formatSchemaType(row) }}</template>
|
|
71
71
|
</el-table-column>
|
|
72
|
-
<el-table-column :label="t('system.api.doc.field.required')" width="80" align="center">
|
|
73
|
-
<template #default="{ row }">{{ t(row.required ? "
|
|
72
|
+
<el-table-column :label="t('system.base.api.doc.field.required')" width="80" align="center">
|
|
73
|
+
<template #default="{ row }">{{ t(row.required ? "common.value.yes" : "common.value.no") }}</template>
|
|
74
74
|
</el-table-column>
|
|
75
75
|
<el-table-column
|
|
76
76
|
prop="description"
|
|
77
|
-
:label="t('system.api.doc.field.description')"
|
|
77
|
+
:label="t('system.base.api.doc.field.description')"
|
|
78
78
|
min-width="240"
|
|
79
79
|
show-overflow-tooltip
|
|
80
80
|
/>
|
|
81
81
|
</el-table>
|
|
82
|
-
<el-empty v-else :description="t('system.api.message.
|
|
82
|
+
<el-empty v-else :description="t('system.base.api.message.no_request_body')" :image-size="72" />
|
|
83
83
|
</section>
|
|
84
84
|
|
|
85
85
|
<section class="api-doc-section">
|
|
86
|
-
<div class="api-doc-title">{{ t("system.api.section.responses") }}</div>
|
|
86
|
+
<div class="api-doc-title">{{ t("system.base.api.section.responses") }}</div>
|
|
87
87
|
<el-collapse v-if="detailResponses.length > 0">
|
|
88
88
|
<el-collapse-item v-for="response in detailResponses" :key="response.status" :name="response.status">
|
|
89
89
|
<template #title>
|
|
@@ -96,21 +96,21 @@
|
|
|
96
96
|
default-expand-all
|
|
97
97
|
:tree-props="{ children: 'children' }"
|
|
98
98
|
>
|
|
99
|
-
<el-table-column prop="path" :label="t('system.api.doc.field.name')" min-width="220" />
|
|
100
|
-
<el-table-column :label="t('system.api.doc.field.type')" min-width="180">
|
|
99
|
+
<el-table-column prop="path" :label="t('system.base.api.doc.field.name')" min-width="220" />
|
|
100
|
+
<el-table-column :label="t('system.base.api.doc.field.type')" min-width="180">
|
|
101
101
|
<template #default="{ row }">{{ formatSchemaType(row) }}</template>
|
|
102
102
|
</el-table-column>
|
|
103
103
|
<el-table-column
|
|
104
104
|
prop="description"
|
|
105
|
-
:label="t('system.api.doc.field.description')"
|
|
105
|
+
:label="t('system.base.api.doc.field.description')"
|
|
106
106
|
min-width="240"
|
|
107
107
|
show-overflow-tooltip
|
|
108
108
|
/>
|
|
109
109
|
</el-table>
|
|
110
|
-
<el-empty v-else :description="t('system.api.message.
|
|
110
|
+
<el-empty v-else :description="t('system.base.api.message.no_response_body')" :image-size="72" />
|
|
111
111
|
</el-collapse-item>
|
|
112
112
|
</el-collapse>
|
|
113
|
-
<el-empty v-else :description="t('system.api.message.
|
|
113
|
+
<el-empty v-else :description="t('system.base.api.message.no_responses')" :image-size="72" />
|
|
114
114
|
</section>
|
|
115
115
|
</div>
|
|
116
116
|
</el-drawer>
|
|
@@ -118,11 +118,10 @@
|
|
|
118
118
|
<FormDialog
|
|
119
119
|
v-model="editDialog.visible"
|
|
120
120
|
ref="editDialogRef"
|
|
121
|
-
:title="t('system.api.title.edit')"
|
|
121
|
+
:title="t('system.base.api.title.edit')"
|
|
122
122
|
width="760px"
|
|
123
123
|
:model="editForm"
|
|
124
124
|
:fields="editFields"
|
|
125
|
-
label-width="120px"
|
|
126
125
|
@confirm="handleSubmitEdit"
|
|
127
126
|
@close="handleCloseEditDialog"
|
|
128
127
|
/>
|
|
@@ -188,19 +187,19 @@ const detailToolPrompts = computed(() => detailData.value?.tool_prompts ?? []);
|
|
|
188
187
|
const editFields = computed<ProFormField[]>(() => [
|
|
189
188
|
{
|
|
190
189
|
prop: "tool_name",
|
|
191
|
-
label: t("system.api.field.
|
|
190
|
+
label: t("system.base.api.field.tool_name"),
|
|
192
191
|
component: "input",
|
|
193
192
|
props: { disabled: true }
|
|
194
193
|
},
|
|
195
194
|
{
|
|
196
195
|
prop: "tool_prompts",
|
|
197
|
-
label: t("system.api.field.
|
|
196
|
+
label: t("system.base.api.field.tool_prompts"),
|
|
198
197
|
component: "dynamic-list",
|
|
199
|
-
props: { inputProps: { placeholder: t("system.api.placeholder.
|
|
198
|
+
props: { inputProps: { placeholder: t("system.base.api.placeholder.tool_prompt") } }
|
|
200
199
|
},
|
|
201
200
|
{
|
|
202
201
|
prop: "mcp_status",
|
|
203
|
-
label: t("system.api.field.
|
|
202
|
+
label: t("system.base.api.field.mcp_status"),
|
|
204
203
|
component: "switch",
|
|
205
204
|
props: {
|
|
206
205
|
activeValue: Status.ENABLE,
|
|
@@ -211,7 +210,7 @@ const editFields = computed<ProFormField[]>(() => [
|
|
|
211
210
|
},
|
|
212
211
|
{
|
|
213
212
|
prop: "agent_status",
|
|
214
|
-
label: t("system.api.field.
|
|
213
|
+
label: t("system.base.api.field.agent_status"),
|
|
215
214
|
component: "switch",
|
|
216
215
|
props: {
|
|
217
216
|
activeValue: Status.ENABLE,
|
|
@@ -229,23 +228,23 @@ const statusOptions = computed(() => [
|
|
|
229
228
|
|
|
230
229
|
/** API 表格列配置。 */
|
|
231
230
|
const columns = computed<ColumnProps[]>(() => [
|
|
232
|
-
{ prop: "tool_name", label: t("system.api.field.
|
|
231
|
+
{ prop: "tool_name", label: t("system.base.api.field.tool_name"), minWidth: 260, search: { el: "input" } },
|
|
233
232
|
{
|
|
234
233
|
prop: "tool_prompts",
|
|
235
|
-
label: t("system.api.field.
|
|
234
|
+
label: t("system.base.api.field.tool_prompts"),
|
|
236
235
|
minWidth: 240,
|
|
237
236
|
search: { el: "input", key: "tool_prompt" },
|
|
238
237
|
render: scope => formatToolPrompts((scope.row as BaseApi).tool_prompts)
|
|
239
238
|
},
|
|
240
|
-
{ prop: "service_name", label: t("system.api.field.
|
|
241
|
-
{ prop: "service_desc", label: t("system.api.field.
|
|
242
|
-
{ prop: "desc", label: t("system.api.field.description"), minWidth: 180, search: { el: "input" } },
|
|
243
|
-
{ prop: "operation", label: t("system.api.field.operation"), minWidth: 260, search: { el: "input" } },
|
|
244
|
-
{ prop: "method", label: t("system.api.field.method"), width: 110, search: { el: "input" } },
|
|
245
|
-
{ prop: "path", label: t("system.api.field.path"), minWidth: 260, search: { el: "input" } },
|
|
239
|
+
{ prop: "service_name", label: t("system.base.api.field.service_name"), minWidth: 180, search: { el: "input" } },
|
|
240
|
+
{ prop: "service_desc", label: t("system.base.api.field.service_description"), minWidth: 180, search: { el: "input" } },
|
|
241
|
+
{ prop: "desc", label: t("system.base.api.field.description"), minWidth: 180, search: { el: "input" } },
|
|
242
|
+
{ prop: "operation", label: t("system.base.api.field.operation"), minWidth: 260, search: { el: "input" } },
|
|
243
|
+
{ prop: "method", label: t("system.base.api.field.method"), width: 110, search: { el: "input" } },
|
|
244
|
+
{ prop: "path", label: t("system.base.api.field.path"), minWidth: 260, search: { el: "input" } },
|
|
246
245
|
{
|
|
247
246
|
prop: "mcp_status",
|
|
248
|
-
label: t("system.api.field.
|
|
247
|
+
label: t("system.base.api.field.mcp_status"),
|
|
249
248
|
width: 120,
|
|
250
249
|
enum: statusOptions.value,
|
|
251
250
|
search: { el: "select" },
|
|
@@ -261,7 +260,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
261
260
|
},
|
|
262
261
|
{
|
|
263
262
|
prop: "agent_status",
|
|
264
|
-
label: t("system.api.field.
|
|
263
|
+
label: t("system.base.api.field.agent_status"),
|
|
265
264
|
width: 130,
|
|
266
265
|
enum: statusOptions.value,
|
|
267
266
|
search: { el: "select" },
|
|
@@ -277,7 +276,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
277
276
|
},
|
|
278
277
|
{
|
|
279
278
|
prop: "operation",
|
|
280
|
-
label: t("
|
|
279
|
+
label: t("common.field.action"),
|
|
281
280
|
width: 210,
|
|
282
281
|
fixed: "right",
|
|
283
282
|
cellType: "actions",
|
|
@@ -375,7 +374,7 @@ async function handleSubmitEdit() {
|
|
|
375
374
|
mcp_status: editForm.mcp_status,
|
|
376
375
|
agent_status: editForm.agent_status
|
|
377
376
|
});
|
|
378
|
-
ElMessage.success(t("system.api.message.
|
|
377
|
+
ElMessage.success(t("system.base.api.message.save_success"));
|
|
379
378
|
handleCloseEditDialog();
|
|
380
379
|
refreshTable();
|
|
381
380
|
}
|
|
@@ -388,13 +387,13 @@ async function handleBeforeSetMcpStatus(row: BaseApi) {
|
|
|
388
387
|
const action = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
389
388
|
const apiName = row.desc || row.operation || `ID:${row.id}`;
|
|
390
389
|
try {
|
|
391
|
-
await ElMessageBox.confirm(t("system.api.message.
|
|
390
|
+
await ElMessageBox.confirm(t("system.base.api.message.confirm_mcp_status", { action, api: apiName }), t("common.title.notice"), {
|
|
392
391
|
confirmButtonText: t("common.action.confirm"),
|
|
393
392
|
cancelButtonText: t("common.action.cancel"),
|
|
394
393
|
type: "warning"
|
|
395
394
|
});
|
|
396
395
|
await defBaseApiService.SetBaseApiMcpStatus({ id: row.id, mcp_status: nextStatus });
|
|
397
|
-
ElMessage.success(t("
|
|
396
|
+
ElMessage.success(t("common.message.status_success", { action }));
|
|
398
397
|
refreshTable();
|
|
399
398
|
return true;
|
|
400
399
|
} catch {
|
|
@@ -410,13 +409,13 @@ async function handleBeforeSetAgentStatus(row: BaseApi) {
|
|
|
410
409
|
const action = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
411
410
|
const apiName = row.desc || row.operation || `ID:${row.id}`;
|
|
412
411
|
try {
|
|
413
|
-
await ElMessageBox.confirm(t("system.api.message.
|
|
412
|
+
await ElMessageBox.confirm(t("system.base.api.message.confirm_agent_status", { action, api: apiName }), t("common.title.notice"), {
|
|
414
413
|
confirmButtonText: t("common.action.confirm"),
|
|
415
414
|
cancelButtonText: t("common.action.cancel"),
|
|
416
415
|
type: "warning"
|
|
417
416
|
});
|
|
418
417
|
await defBaseApiService.SetBaseApiAgentStatus({ id: row.id, agent_status: nextStatus });
|
|
419
|
-
ElMessage.success(t("
|
|
418
|
+
ElMessage.success(t("common.message.status_success", { action }));
|
|
420
419
|
refreshTable();
|
|
421
420
|
return true;
|
|
422
421
|
} catch {
|
|
@@ -438,7 +437,7 @@ function formatToolPrompts(prompts: string[]) {
|
|
|
438
437
|
function formatStatus(status: Status) {
|
|
439
438
|
if (status === Status.ENABLE) return t("common.status.enabled");
|
|
440
439
|
if (status === Status.DISABLE) return t("common.status.disabled");
|
|
441
|
-
return t("
|
|
440
|
+
return t("common.value.unknown");
|
|
442
441
|
}
|
|
443
442
|
|
|
444
443
|
/**
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
:model="formData"
|
|
23
23
|
:fields="formFields"
|
|
24
24
|
:rules="rules"
|
|
25
|
-
label-width="100px"
|
|
26
25
|
@confirm="handleSubmit"
|
|
27
26
|
@close="handleCloseDialog"
|
|
28
27
|
/>
|
|
@@ -56,7 +55,7 @@ const proTable = ref<ProTableInstance>();
|
|
|
56
55
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
57
56
|
|
|
58
57
|
const dialog = reactive({
|
|
59
|
-
titleKey: "system.area.action.create",
|
|
58
|
+
titleKey: "system.base.area.action.create",
|
|
60
59
|
visible: false
|
|
61
60
|
});
|
|
62
61
|
|
|
@@ -70,19 +69,19 @@ const rules = computed<FormRules>(() => ({
|
|
|
70
69
|
parent_id: [
|
|
71
70
|
{
|
|
72
71
|
required: true,
|
|
73
|
-
message: t("
|
|
72
|
+
message: t("common.validation.required_select", { field: t("system.base.area.field.parent") }),
|
|
74
73
|
trigger: "change"
|
|
75
74
|
}
|
|
76
75
|
],
|
|
77
76
|
name: [
|
|
78
77
|
{
|
|
79
78
|
required: true,
|
|
80
|
-
message: t("
|
|
79
|
+
message: t("common.validation.required_input", { field: t("system.base.area.field.name") }),
|
|
81
80
|
trigger: "blur"
|
|
82
81
|
},
|
|
83
82
|
{
|
|
84
83
|
max: 50,
|
|
85
|
-
message: t("
|
|
84
|
+
message: t("common.validation.max_length", { field: t("system.base.area.field.name"), max: 50 }),
|
|
86
85
|
trigger: "blur"
|
|
87
86
|
}
|
|
88
87
|
]
|
|
@@ -120,7 +119,7 @@ void loadFormOptions();
|
|
|
120
119
|
const formFields = computed<ProFormField[]>(() => [
|
|
121
120
|
{
|
|
122
121
|
prop: "parent_id",
|
|
123
|
-
label: t("system.area.field.parent"),
|
|
122
|
+
label: t("system.base.area.field.parent"),
|
|
124
123
|
component: "tree-select",
|
|
125
124
|
options: parentIdFormOptions.value,
|
|
126
125
|
props: {
|
|
@@ -133,19 +132,19 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
133
132
|
},
|
|
134
133
|
{
|
|
135
134
|
prop: "name",
|
|
136
|
-
label: t("system.area.field.name"),
|
|
135
|
+
label: t("system.base.area.field.name"),
|
|
137
136
|
component: "input",
|
|
138
|
-
props: { placeholder: t("
|
|
137
|
+
props: { placeholder: t("common.validation.required_input", { field: t("system.base.area.field.name") }) }
|
|
139
138
|
}
|
|
140
139
|
]);
|
|
141
140
|
|
|
142
141
|
/** 行政区域表格列配置。 */
|
|
143
142
|
const columns = computed<ColumnProps[]>(() => [
|
|
144
143
|
{ type: "selection", width: 55 },
|
|
145
|
-
{ prop: "name", label: t("system.area.field.name"), align: "left", search: { el: "input" } },
|
|
144
|
+
{ prop: "name", label: t("system.base.area.field.name"), align: "left", search: { el: "input" } },
|
|
146
145
|
{
|
|
147
146
|
prop: "operation",
|
|
148
|
-
label: t("
|
|
147
|
+
label: t("common.field.operation"),
|
|
149
148
|
width: 150,
|
|
150
149
|
fixed: "right",
|
|
151
150
|
cellType: "actions",
|
|
@@ -205,7 +204,7 @@ async function loadAreaChildren(row: BaseArea, _treeNode: unknown, resolve: (dat
|
|
|
205
204
|
const data = await defBaseAreaService.TreeBaseArea({ parent_id: row.id, lazy: true });
|
|
206
205
|
resolve(data.base_areas ?? []);
|
|
207
206
|
} catch {
|
|
208
|
-
ElMessage.error(t("
|
|
207
|
+
ElMessage.error(t("common.message.load_children_failed", { resource: t("system.base.area.resource") }));
|
|
209
208
|
resolve([]);
|
|
210
209
|
}
|
|
211
210
|
}
|
|
@@ -222,7 +221,7 @@ async function loadFormOptions() {
|
|
|
222
221
|
typeof defBaseAreaService.OptionBaseArea
|
|
223
222
|
>[0]);
|
|
224
223
|
parentIdFormOptions.value = [
|
|
225
|
-
{ label: t("system.area.value.root"), value: 0 },
|
|
224
|
+
{ label: t("system.base.area.value.root"), value: 0 },
|
|
226
225
|
...normalizeLazyTreeOptions((parentIdFormResponse.list ?? []) as GeneratedTreeOption[]).filter(
|
|
227
226
|
option => Number(option.value) !== 0
|
|
228
227
|
)
|
|
@@ -235,7 +234,7 @@ async function loadFormOptions() {
|
|
|
235
234
|
async function handleOpenDialog(id?: number) {
|
|
236
235
|
resetForm();
|
|
237
236
|
await loadFormOptions();
|
|
238
|
-
dialog.titleKey = id ? "system.area.action.edit" : "system.area.action.create";
|
|
237
|
+
dialog.titleKey = id ? "system.base.area.action.edit" : "system.base.area.action.create";
|
|
239
238
|
dialog.visible = true;
|
|
240
239
|
if (!id) return;
|
|
241
240
|
|
|
@@ -272,8 +271,8 @@ function handleSubmit() {
|
|
|
272
271
|
: defBaseAreaService.CreateBaseArea({ base_area: payload });
|
|
273
272
|
request.then(() => {
|
|
274
273
|
ElMessage.success(
|
|
275
|
-
t(payload.id ? "
|
|
276
|
-
resource: t("system.area.resource")
|
|
274
|
+
t(payload.id ? "common.message.update_success" : "common.message.create_success", {
|
|
275
|
+
resource: t("system.base.area.resource")
|
|
277
276
|
})
|
|
278
277
|
);
|
|
279
278
|
handleCloseDialog();
|
|
@@ -295,11 +294,11 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
295
294
|
rowList.length ? rowList.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>)
|
|
296
295
|
).join(",");
|
|
297
296
|
if (!ids) {
|
|
298
|
-
ElMessage.warning(t("
|
|
297
|
+
ElMessage.warning(t("common.message.select_delete_item"));
|
|
299
298
|
return;
|
|
300
299
|
}
|
|
301
300
|
|
|
302
|
-
const confirmMessage = t(rowList.length === 1 ? "system.area.message.
|
|
301
|
+
const confirmMessage = t(rowList.length === 1 ? "system.base.area.message.delete_single" : "system.base.area.message.delete_batch");
|
|
303
302
|
ElMessageBox.confirm(confirmMessage, t("common.title.warning"), {
|
|
304
303
|
confirmButtonText: t("common.action.confirm"),
|
|
305
304
|
cancelButtonText: t("common.action.cancel"),
|
|
@@ -307,12 +306,12 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
307
306
|
}).then(
|
|
308
307
|
() => {
|
|
309
308
|
defBaseAreaService.DeleteBaseArea({ ids }).then(() => {
|
|
310
|
-
ElMessage.success(t("
|
|
309
|
+
ElMessage.success(t("common.message.delete_success", { resource: t("system.base.area.resource") }));
|
|
311
310
|
refreshTable();
|
|
312
311
|
});
|
|
313
312
|
},
|
|
314
313
|
() => {
|
|
315
|
-
ElMessage.info(t("
|
|
314
|
+
ElMessage.info(t("common.dialog.cancel_delete", { resource: t("system.base.area.resource") }));
|
|
316
315
|
}
|
|
317
316
|
);
|
|
318
317
|
}
|