@liujitcn/kratos-admin-system 0.0.20 → 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/README.md +51 -50
- package/dist/package/declarations/src/api/system/base_language.d.ts +52 -0
- package/dist/package/declarations/src/api/system/base_translation.d.ts +10 -0
- package/dist/package/declarations/src/api/system/code_gen_i18n.d.ts +8 -0
- 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 +16 -0
- package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +20 -0
- package/dist/package/declarations/src/components/dynamicTranslation.d.ts +38 -0
- 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 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +9 -0
- 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 +119 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +6 -1
- 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 +75 -0
- 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 +13 -11
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +7 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +24 -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/base/language/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue.d.ts +23 -0
- package/dist/package/declarations/src/views/tool/code-gen/config.d.ts +7 -7
- package/dist/package/declarations/src/views/tool/ops-monitoring/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/ai_message.ts +7 -12
- package/dist/package/src/api/base/sse.ts +3 -1
- package/dist/package/src/api/system/base_language.ts +135 -0
- package/dist/package/src/api/system/base_translation.ts +33 -0
- package/dist/package/src/api/system/code_gen_column.ts +17 -3
- package/dist/package/src/api/system/code_gen_i18n.ts +18 -0
- package/dist/package/src/api/system/code_gen_table.ts +12 -4
- 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 +249 -0
- package/dist/package/src/components/DynamicTranslationEditor.vue +197 -0
- package/dist/package/src/components/dynamicTranslation.ts +66 -0
- package/dist/package/src/locales/README.md +30 -0
- package/dist/package/src/locales/en-US.json +933 -0
- package/dist/package/src/locales/es-ES.json +933 -0
- package/dist/package/src/locales/fr-FR.json +933 -0
- package/dist/package/src/locales/generated.ts +22 -0
- package/dist/package/src/locales/ja-JP.json +933 -0
- package/dist/package/src/locales/ko-KR.json +933 -0
- package/dist/package/src/locales/zh-CN.json +933 -0
- package/dist/package/src/locales/zh-TW.json +933 -0
- package/dist/package/src/module.ts +6 -2
- 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 -2
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +9 -0
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -1
- package/dist/package/src/rpc/system/admin/v1/base_language.ts +141 -0
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +6 -1
- 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 +90 -0
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +12 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +16 -12
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +8 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +27 -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/AiMarkdown.vue +1 -6
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +75 -58
- package/dist/package/src/views/ai/chat/components/SessionPanel.vue +20 -9
- package/dist/package/src/views/ai/chat/components/XSender.vue +36 -23
- package/dist/package/src/views/ai/chat/index.vue +58 -41
- package/dist/package/src/views/ai/chat/message.ts +29 -27
- package/dist/package/src/views/base/api/index.vue +121 -84
- package/dist/package/src/views/base/area/index.vue +81 -32
- package/dist/package/src/views/base/config/index.vue +300 -96
- package/dist/package/src/views/base/dept/index.vue +110 -62
- package/dist/package/src/views/base/dict/index.vue +145 -62
- package/dist/package/src/views/base/dict/item.vue +155 -64
- package/dist/package/src/views/base/job/index.vue +134 -82
- package/dist/package/src/views/base/job/log.vue +24 -25
- package/dist/package/src/views/base/language/index.vue +260 -0
- package/dist/package/src/views/base/log/index.vue +68 -46
- package/dist/package/src/views/base/menu/index.vue +344 -200
- package/dist/package/src/views/base/migration/index.vue +49 -29
- package/dist/package/src/views/base/post/index.vue +128 -60
- package/dist/package/src/views/base/role/index.vue +145 -79
- package/dist/package/src/views/base/tenant/index.vue +132 -64
- package/dist/package/src/views/base/user/components/dept-tree.vue +2 -1
- package/dist/package/src/views/base/user/index.vue +194 -116
- package/dist/package/src/views/profile/components/base.vue +45 -28
- package/dist/package/src/views/profile/components/password.vue +45 -30
- package/dist/package/src/views/profile/components/security.vue +90 -54
- package/dist/package/src/views/profile/index.vue +10 -9
- package/dist/package/src/views/tool/api-doc/index.vue +6 -2
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +32 -16
- package/dist/package/src/views/tool/code-gen/columns/index.vue +382 -273
- package/dist/package/src/views/tool/code-gen/columns/option-copy.ts +1 -6
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +118 -0
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +65 -36
- package/dist/package/src/views/tool/code-gen/components/CodePreviewPane.vue +8 -5
- package/dist/package/src/views/tool/code-gen/config.ts +116 -79
- package/dist/package/src/views/tool/code-gen/preview/data.ts +19 -17
- package/dist/package/src/views/tool/code-gen/preview/index.vue +96 -59
- package/dist/package/src/views/tool/code-gen/proto/index.vue +110 -62
- package/dist/package/src/views/tool/code-gen/table/index.vue +201 -121
- package/dist/package/src/views/tool/ops-monitoring/index.vue +1175 -0
- package/dist/package/src/views/tool/project-doc/index.vue +17 -15
- package/package.json +6 -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
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<span class="api-doc-page__document-key">{{ document.key }}</span>
|
|
16
16
|
</button>
|
|
17
17
|
</div>
|
|
18
|
-
<el-empty v-else :image-size="56" description="
|
|
18
|
+
<el-empty v-else :image-size="56" :description="t('system.base.api.doc.message.empty')" />
|
|
19
19
|
</el-card>
|
|
20
20
|
<el-card class="code-gen-sub-card api-doc-page__card" shadow="never">
|
|
21
21
|
<div ref="swaggerRootRef" class="api-doc-page__swagger" />
|
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
28
|
import SwaggerUIBundle from "swagger-ui-dist/swagger-ui-bundle.js";
|
|
29
29
|
import "swagger-ui-dist/swagger-ui.css";
|
|
30
|
-
import { getRequestAccessToken } from "@liujitcn/kratos-admin-core/request";
|
|
30
|
+
import { getLocaleRequestHeaders, getRequestAccessToken } from "@liujitcn/kratos-admin-core/request";
|
|
31
31
|
import { defBaseApiService } from "@liujitcn/kratos-admin-system/api/system/base_api";
|
|
32
32
|
import type { OpenApiServiceOption } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api";
|
|
33
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
33
34
|
|
|
34
35
|
const swaggerRootRef = ref<HTMLElement>();
|
|
35
36
|
const loading = ref(true);
|
|
@@ -63,8 +64,11 @@ function initializeSwaggerUI(documentKey: string) {
|
|
|
63
64
|
if (accessToken) {
|
|
64
65
|
request.headers = {
|
|
65
66
|
...request.headers,
|
|
67
|
+
...getLocaleRequestHeaders(),
|
|
66
68
|
Authorization: accessToken
|
|
67
69
|
};
|
|
70
|
+
} else {
|
|
71
|
+
request.headers = { ...request.headers, ...getLocaleRequestHeaders() };
|
|
68
72
|
}
|
|
69
73
|
return request;
|
|
70
74
|
}
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
<el-card class="code-gen-sub-card" shadow="never">
|
|
5
5
|
<div v-if="BUTTONS['tool:code-gen-table:generate']" class="code-gen-toolbar">
|
|
6
6
|
<div class="code-gen-code-preview-actions">
|
|
7
|
-
<el-button :icon="Clock" :disabled="!progressTaskAvailable" @click="handleOpenProgress"
|
|
8
|
-
|
|
7
|
+
<el-button :icon="Clock" :disabled="!progressTaskAvailable" @click="handleOpenProgress">
|
|
8
|
+
{{ t("system.code.gen.action.recent_task") }}
|
|
9
|
+
</el-button>
|
|
10
|
+
<el-button :icon="Promotion" type="primary" :loading="generating" @click="handleGenerate">
|
|
11
|
+
{{ t("system.code.gen.action.generate") }}
|
|
12
|
+
</el-button>
|
|
9
13
|
</div>
|
|
10
14
|
</div>
|
|
11
15
|
|
|
12
16
|
<el-alert v-if="previewError" class="code-gen-code-preview-alert" :title="previewError" type="warning" :closable="false" />
|
|
13
17
|
<CodePreviewPane v-if="loading || files.length" class="code-gen-code-preview-table" :files="files" :loading="loading" />
|
|
14
|
-
<el-empty v-else class="code-gen-code-preview-empty" description="
|
|
18
|
+
<el-empty v-else class="code-gen-code-preview-empty" :description="t('system.code.gen.preview.message.empty_files')" />
|
|
15
19
|
</el-card>
|
|
16
20
|
|
|
17
21
|
<CodeGenProgressDialog
|
|
@@ -28,13 +32,14 @@
|
|
|
28
32
|
import { computed, ref, watch } from "vue";
|
|
29
33
|
import { Clock, Promotion } from "@element-plus/icons-vue";
|
|
30
34
|
import { useRoute } from "vue-router";
|
|
35
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
31
36
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
32
37
|
import { useTabsStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
33
38
|
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/code_gen";
|
|
34
39
|
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
35
40
|
import type { CodeGenPreviewFile } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen";
|
|
36
41
|
import type { CodeGenTableForm } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
37
|
-
import { CodeGenTableStatus } from "@liujitcn/kratos-admin-system/rpc/system/
|
|
42
|
+
import { CodeGenTableStatus } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
38
43
|
import CodeGenProgressDialog from "../components/CodeGenProgressDialog.vue";
|
|
39
44
|
import CodePreviewPane from "../components/CodePreviewPane.vue";
|
|
40
45
|
|
|
@@ -46,7 +51,7 @@ defineOptions({
|
|
|
46
51
|
const codeGenTaskStorageKey = "code-gen-progress-task-id";
|
|
47
52
|
const codeGenProgressDialogVisibleStorageKey = "code-gen-progress-dialog-visible";
|
|
48
53
|
const codeGenProgressSelectedTableIdsStorageKey = "code-gen-progress-selected-table-ids";
|
|
49
|
-
const codeGenStatusDisabled = CodeGenTableStatus.
|
|
54
|
+
const codeGenStatusDisabled = CodeGenTableStatus.CODE_GEN_TABLE_STATUS_DISABLED;
|
|
50
55
|
|
|
51
56
|
const route = useRoute();
|
|
52
57
|
const tabsStore = useTabsStore();
|
|
@@ -55,6 +60,7 @@ const table = ref<CodeGenTableForm>();
|
|
|
55
60
|
const files = ref<CodeGenPreviewFile[]>([]);
|
|
56
61
|
const loading = ref(false);
|
|
57
62
|
const previewError = ref("");
|
|
63
|
+
const missingTranslations = ref<string[]>([]);
|
|
58
64
|
const progressTaskId = ref(typeof window === "undefined" ? "" : (window.sessionStorage.getItem(codeGenTaskStorageKey) ?? ""));
|
|
59
65
|
const progressDialogVisible = ref(
|
|
60
66
|
!!progressTaskId.value &&
|
|
@@ -72,7 +78,7 @@ const tableId = computed(() => {
|
|
|
72
78
|
});
|
|
73
79
|
|
|
74
80
|
/** 当前代码预览页标题。 */
|
|
75
|
-
const pageTitle = computed(() => table.value?.comment || table.value?.name || "
|
|
81
|
+
const pageTitle = computed(() => table.value?.comment || table.value?.name || t("system.code.gen.preview.title.code"));
|
|
76
82
|
|
|
77
83
|
// 路由生成对象变化时重新载入对应代码预览。
|
|
78
84
|
watch(
|
|
@@ -88,6 +94,7 @@ async function loadCodePreview() {
|
|
|
88
94
|
table.value = undefined;
|
|
89
95
|
files.value = [];
|
|
90
96
|
previewError.value = "";
|
|
97
|
+
missingTranslations.value = [];
|
|
91
98
|
if (!tableId.value) return;
|
|
92
99
|
loading.value = true;
|
|
93
100
|
try {
|
|
@@ -96,10 +103,16 @@ async function loadCodePreview() {
|
|
|
96
103
|
try {
|
|
97
104
|
const preview = await defCodeGenService.PreviewCodeGen({ table_id: tableId.value, output_paths: undefined });
|
|
98
105
|
files.value = preview.files ?? [];
|
|
99
|
-
|
|
106
|
+
missingTranslations.value = preview.missing_translations ?? [];
|
|
107
|
+
if (missingTranslations.value.length) {
|
|
108
|
+
previewError.value = t("system.code.gen.preview.message.missing_translations", {
|
|
109
|
+
items: missingTranslations.value.join(t("system.code.gen.preview.value.list_separator"))
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (!files.value.length && !previewError.value) previewError.value = t("system.code.gen.preview.message.no_preview_files");
|
|
100
113
|
} catch {
|
|
101
114
|
// 预览错误在页面内转成可操作提示,避免全局错误弹窗只显示“系统出错”。
|
|
102
|
-
previewError.value = "
|
|
115
|
+
previewError.value = t("system.code.gen.preview.message.load_failed");
|
|
103
116
|
}
|
|
104
117
|
syncWorkspaceTitle();
|
|
105
118
|
} finally {
|
|
@@ -109,7 +122,7 @@ async function loadCodePreview() {
|
|
|
109
122
|
|
|
110
123
|
/** 同步代码预览页签和浏览器标题。 */
|
|
111
124
|
function syncWorkspaceTitle() {
|
|
112
|
-
const title =
|
|
125
|
+
const title = t("system.code.gen.preview.title.workspace", { table: pageTitle.value });
|
|
113
126
|
tabsStore.setTabsTitle(title);
|
|
114
127
|
document.title = `${title} - ${import.meta.env.VITE_GLOB_APP_TITLE}`;
|
|
115
128
|
}
|
|
@@ -118,15 +131,19 @@ function syncWorkspaceTitle() {
|
|
|
118
131
|
async function handleGenerate() {
|
|
119
132
|
if (!table.value) return;
|
|
120
133
|
if (table.value.status === codeGenStatusDisabled) {
|
|
121
|
-
ElMessage.warning(
|
|
134
|
+
ElMessage.warning(t("system.code.gen.table.message.disabled", { name: table.value.name }));
|
|
122
135
|
return;
|
|
123
136
|
}
|
|
124
137
|
try {
|
|
125
|
-
await ElMessageBox.confirm(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
await ElMessageBox.confirm(
|
|
139
|
+
t("system.code.gen.table.dialog.generate_one", { name: table.value.name }),
|
|
140
|
+
t("common.title.notice"),
|
|
141
|
+
{
|
|
142
|
+
confirmButtonText: t("common.action.confirm"),
|
|
143
|
+
cancelButtonText: t("common.action.cancel"),
|
|
144
|
+
type: "warning"
|
|
145
|
+
}
|
|
146
|
+
);
|
|
130
147
|
} catch {
|
|
131
148
|
return;
|
|
132
149
|
}
|
|
@@ -177,7 +194,6 @@ function handleProgressUnavailable() {
|
|
|
177
194
|
window.sessionStorage.removeItem(codeGenProgressSelectedTableIdsStorageKey);
|
|
178
195
|
window.sessionStorage.removeItem(codeGenTaskStorageKey);
|
|
179
196
|
}
|
|
180
|
-
|
|
181
197
|
</script>
|
|
182
198
|
|
|
183
199
|
<style scoped lang="scss">
|