@liujitcn/kratos-admin-system 0.0.26 → 0.0.27
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_i18n.d.ts +10 -0
- package/dist/package/declarations/src/api/system/code_gen_i18n.d.ts +1 -1
- package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +3 -3
- package/dist/package/declarations/src/components/dynamicTranslation.d.ts +1 -1
- package/dist/package/declarations/src/locales/generated.d.ts +941 -0
- package/dist/package/declarations/src/rpc/common/v1/enum.d.ts +15 -6
- package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +10 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +4 -4
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +5 -5
- package/dist/package/declarations/src/rpc/system/admin/v1/{base_translation.d.ts → base_i18n.d.ts} +3 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +3 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +1 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +1 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/project_document.d.ts +8 -0
- package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue.d.ts +1 -1
- package/dist/package/src/api/base/sse.ts +3 -2
- package/dist/package/src/api/system/{base_translation.ts → base_i18n.ts} +5 -5
- package/dist/package/src/api/system/code_gen_i18n.ts +1 -1
- package/dist/package/src/components/Ai.vue +9 -2
- package/dist/package/src/components/DynamicTranslationCell.vue +9 -9
- package/dist/package/src/components/DynamicTranslationEditor.vue +3 -3
- package/dist/package/src/components/dynamicTranslation.ts +1 -1
- package/dist/package/src/locales/en-US.json +2 -0
- package/dist/package/src/locales/generated.ts +2 -0
- package/dist/package/src/locales/ja-JP.json +935 -0
- package/dist/package/src/locales/zh-CN.json +2 -0
- package/dist/package/src/locales/zh-TW.json +2 -0
- package/dist/package/src/rpc/common/v1/enum.ts +16 -6
- package/dist/package/src/rpc/system/admin/v1/base_api.ts +11 -1
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +4 -4
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +5 -5
- package/dist/package/src/rpc/system/admin/v1/{base_translation.ts → base_i18n.ts} +4 -4
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +3 -3
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/project_document.ts +9 -0
- package/dist/package/src/views/ai/chat/message.ts +12 -2
- package/dist/package/src/views/base/api/index.vue +20 -20
- package/dist/package/src/views/base/config/index.vue +11 -11
- package/dist/package/src/views/base/dept/index.vue +8 -8
- package/dist/package/src/views/base/dict/index.vue +9 -9
- package/dist/package/src/views/base/dict/item.vue +9 -9
- package/dist/package/src/views/base/job/index.vue +11 -11
- package/dist/package/src/views/base/language/index.vue +9 -9
- package/dist/package/src/views/base/menu/index.vue +14 -9
- package/dist/package/src/views/base/post/index.vue +8 -8
- package/dist/package/src/views/base/role/index.vue +8 -8
- package/dist/package/src/views/base/tenant/index.vue +8 -8
- package/dist/package/src/views/base/user/index.vue +8 -8
- package/dist/package/src/views/tool/code-gen/columns/index.vue +8 -53
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +1 -1
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +3 -12
- package/dist/package/src/views/tool/code-gen/preview/index.vue +3 -6
- package/dist/package/src/views/tool/code-gen/proto/index.vue +7 -8
- package/dist/package/src/views/tool/code-gen/table/index.vue +2 -2
- package/dist/package/src/views/tool/ops-monitoring/index.vue +23 -25
- package/package.json +2 -2
- package/dist/package/declarations/src/api/system/base_translation.d.ts +0 -10
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/** 状态 */
|
|
2
2
|
export declare enum Status {
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
3
|
+
/** STATUS_UNSPECIFIED - 未知状态 */
|
|
4
|
+
STATUS_UNSPECIFIED = 0,
|
|
5
|
+
/** STATUS_ENABLE - 启用 */
|
|
6
|
+
STATUS_ENABLE = 1,
|
|
7
|
+
/** STATUS_DISABLE - 禁用 */
|
|
8
|
+
STATUS_DISABLE = 2
|
|
9
|
+
}
|
|
10
|
+
/** 定时任务日志状态 */
|
|
11
|
+
export declare enum BaseJobLogStatus {
|
|
12
|
+
/** BASE_JOB_LOG_STATUS_UNSPECIFIED - 未指定定时任务日志状态 */
|
|
13
|
+
BASE_JOB_LOG_STATUS_UNSPECIFIED = 0,
|
|
14
|
+
/** BASE_JOB_LOG_STATUS_SUCCESS - 成功 */
|
|
15
|
+
BASE_JOB_LOG_STATUS_SUCCESS = 1,
|
|
16
|
+
/** BASE_JOB_LOG_STATUS_FAIL - 失败 */
|
|
17
|
+
BASE_JOB_LOG_STATUS_FAIL = 2
|
|
9
18
|
}
|
|
@@ -162,7 +162,7 @@ export interface OptionOpenApiServiceRequest {
|
|
|
162
162
|
}
|
|
163
163
|
/** OpenAPI业务服务选项响应 */
|
|
164
164
|
export interface OptionOpenApiServiceResponse {
|
|
165
|
-
/** OpenAPI
|
|
165
|
+
/** OpenAPI文档列表 */
|
|
166
166
|
list: OpenApiServiceOption[];
|
|
167
167
|
}
|
|
168
168
|
/** OpenAPI业务服务选项 */
|
|
@@ -171,6 +171,15 @@ export interface OpenApiServiceOption {
|
|
|
171
171
|
key: string;
|
|
172
172
|
/** OpenAPI文档名称 */
|
|
173
173
|
name: string;
|
|
174
|
+
/** OpenAPI接口列表 */
|
|
175
|
+
operations: OpenApiServiceOperation[];
|
|
176
|
+
}
|
|
177
|
+
/** OpenAPI业务服务接口 */
|
|
178
|
+
export interface OpenApiServiceOperation {
|
|
179
|
+
/** HTTP请求路径 */
|
|
180
|
+
path: string;
|
|
181
|
+
/** HTTP请求方法 */
|
|
182
|
+
method: string;
|
|
174
183
|
}
|
|
175
184
|
/** AdminAPI服务 */
|
|
176
185
|
export interface BaseApiService {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseConfigSite } from "../../../base/v1/config";
|
|
2
2
|
import type { Status } from "../../../common/v1/enum";
|
|
3
3
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
4
|
-
import type {
|
|
4
|
+
import type { BaseI18n } from "./base_i18n";
|
|
5
5
|
/** 系统配置类型。 */
|
|
6
6
|
export declare enum BaseConfigType {
|
|
7
7
|
/** BASE_CONFIG_TYPE_UNSPECIFIED - 未指定系统配置类型。 */
|
|
@@ -61,9 +61,9 @@ export interface BaseConfigForm {
|
|
|
61
61
|
/** 配置value */
|
|
62
62
|
value: string;
|
|
63
63
|
/** 配置名称多语言翻 */
|
|
64
|
-
name_translations:
|
|
64
|
+
name_translations: BaseI18n[];
|
|
65
65
|
/** 配置value文本/富文本配置值的多语言翻译 */
|
|
66
|
-
value_translations:
|
|
66
|
+
value_translations: BaseI18n[];
|
|
67
67
|
/** 状态 */
|
|
68
68
|
status: Status;
|
|
69
69
|
}
|
|
@@ -113,7 +113,7 @@ export interface BaseConfig {
|
|
|
113
113
|
/** 更新时间 */
|
|
114
114
|
updated_at: string;
|
|
115
115
|
/** 配置名称及文本/富文本配置值的多语言翻译 */
|
|
116
|
-
translations:
|
|
116
|
+
translations: BaseI18n[];
|
|
117
117
|
}
|
|
118
118
|
/** Admin系统配置服务 */
|
|
119
119
|
export interface BaseConfigService {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Status } from "../../../common/v1/enum";
|
|
2
2
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BaseI18n } from "./base_i18n";
|
|
4
4
|
/** 字典选项查询条件 */
|
|
5
5
|
export interface OptionBaseDictRequest {
|
|
6
6
|
}
|
|
@@ -81,7 +81,7 @@ export interface BaseDictForm {
|
|
|
81
81
|
/** 字典名称 */
|
|
82
82
|
name: string;
|
|
83
83
|
/** 非主语言翻译 */
|
|
84
|
-
translations:
|
|
84
|
+
translations: BaseI18n[];
|
|
85
85
|
/** 状态 */
|
|
86
86
|
status: Status;
|
|
87
87
|
}
|
|
@@ -105,7 +105,7 @@ export interface BaseDictItemForm {
|
|
|
105
105
|
/** 排序 */
|
|
106
106
|
sort: number;
|
|
107
107
|
/** 非主语言翻译 */
|
|
108
|
-
translations:
|
|
108
|
+
translations: BaseI18n[];
|
|
109
109
|
/** 状态 */
|
|
110
110
|
status: Status;
|
|
111
111
|
}
|
|
@@ -168,7 +168,7 @@ export interface BaseDict {
|
|
|
168
168
|
/** 更新时间 */
|
|
169
169
|
updated_at: string;
|
|
170
170
|
/** 非主语言翻译 */
|
|
171
|
-
translations:
|
|
171
|
+
translations: BaseI18n[];
|
|
172
172
|
}
|
|
173
173
|
/** 字典项 */
|
|
174
174
|
export interface BaseDictItem {
|
|
@@ -191,7 +191,7 @@ export interface BaseDictItem {
|
|
|
191
191
|
/** 更新时间 */
|
|
192
192
|
updated_at: string;
|
|
193
193
|
/** 非主语言翻译 */
|
|
194
|
-
translations:
|
|
194
|
+
translations: BaseI18n[];
|
|
195
195
|
}
|
|
196
196
|
/** Admin字典服务 */
|
|
197
197
|
export interface BaseDictService {
|
package/dist/package/declarations/src/rpc/system/admin/v1/{base_translation.d.ts → base_i18n.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
2
|
-
/** 统一翻译表目标类型,和
|
|
2
|
+
/** 统一翻译表目标类型,和 base_i18n.target_type 的值一一对应。 */
|
|
3
3
|
export declare enum TranslationTargetType {
|
|
4
4
|
/** TRANSLATION_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
|
|
5
5
|
TRANSLATION_TARGET_TYPE_UNSPECIFIED = 0,
|
|
@@ -47,7 +47,7 @@ export interface UpdateBaseTranslationRequest {
|
|
|
47
47
|
name: string;
|
|
48
48
|
}
|
|
49
49
|
/** 国际化翻译信息 */
|
|
50
|
-
export interface
|
|
50
|
+
export interface BaseI18n {
|
|
51
51
|
/** 翻译记录ID */
|
|
52
52
|
id: number;
|
|
53
53
|
/** 翻译目标类型 */
|
|
@@ -67,7 +67,7 @@ export interface CodeGenLocaleConfig {
|
|
|
67
67
|
left_tree_comment: string;
|
|
68
68
|
}
|
|
69
69
|
/** 国际化翻译信息服务。 */
|
|
70
|
-
export interface
|
|
70
|
+
export interface BaseI18nService {
|
|
71
71
|
/** 翻译单个文本。 */
|
|
72
72
|
DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse>;
|
|
73
73
|
/** 修改国际化翻译信息 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TreeOptionResponse } from "../../../common/v1/common";
|
|
2
2
|
import type { Status } from "../../../common/v1/enum";
|
|
3
3
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
4
|
-
import type {
|
|
4
|
+
import type { BaseI18n } from "./base_i18n";
|
|
5
5
|
import type { BaseMenuType } from "./common";
|
|
6
6
|
/** 菜单选项查询条件 */
|
|
7
7
|
export interface OptionBaseMenuRequest {
|
|
@@ -50,7 +50,7 @@ export interface BaseMenuForm {
|
|
|
50
50
|
/** 分配的API列表 */
|
|
51
51
|
api: string[];
|
|
52
52
|
/** 非主语言翻译 */
|
|
53
|
-
translations:
|
|
53
|
+
translations: BaseI18n[];
|
|
54
54
|
/** 排序 */
|
|
55
55
|
sort: number;
|
|
56
56
|
/** 状态 */
|
|
@@ -109,7 +109,7 @@ export interface BaseMenu {
|
|
|
109
109
|
/** 是否存在子节点 */
|
|
110
110
|
has_children: boolean;
|
|
111
111
|
/** 非主语言翻译 */
|
|
112
|
-
translations:
|
|
112
|
+
translations: BaseI18n[];
|
|
113
113
|
}
|
|
114
114
|
/** 菜单元信息 */
|
|
115
115
|
export interface BaseMenuMeta {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
2
|
-
import type { CodeGenLocaleConfig } from "./
|
|
2
|
+
import type { CodeGenLocaleConfig } from "./base_i18n";
|
|
3
3
|
/** 代码生成字段配置查询条件 */
|
|
4
4
|
export interface ListCodeGenColumnRequest {
|
|
5
5
|
/** 代码生成表配置ID */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
2
|
-
import type { CodeGenLocaleConfig } from "./
|
|
2
|
+
import type { CodeGenLocaleConfig } from "./base_i18n";
|
|
3
3
|
/** 代码生成表状态。 */
|
|
4
4
|
export declare enum CodeGenTableStatus {
|
|
5
5
|
/** CODE_GEN_TABLE_STATUS_UNSPECIFIED - 未指定代码生成表状态。 */
|
|
@@ -54,6 +54,14 @@ export interface ProjectDocument {
|
|
|
54
54
|
path: string;
|
|
55
55
|
/** Markdown文档内容 */
|
|
56
56
|
content: string;
|
|
57
|
+
/** 按语言标识索引的Markdown翻译内容 */
|
|
58
|
+
locale: Map<string, string>;
|
|
59
|
+
/** Markdown文件更新时间,RFC3339格式 */
|
|
60
|
+
updated_at: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ProjectDocument_LocaleEntry {
|
|
63
|
+
key: string;
|
|
64
|
+
value: string;
|
|
57
65
|
}
|
|
58
66
|
/** 项目文档服务 */
|
|
59
67
|
export interface ProjectDocumentService {
|
package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeGenLocaleConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/
|
|
1
|
+
import type { CodeGenLocaleConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
2
2
|
/** 代码生成多语言编辑器属性。 */
|
|
3
3
|
interface CodeGenLocaleEditorProps {
|
|
4
4
|
/** 按语言区域索引的生成配置。 */
|
|
@@ -74,9 +74,10 @@ export class SseServiceImpl {
|
|
|
74
74
|
|
|
75
75
|
/** 构建 SSE 订阅地址。 */
|
|
76
76
|
private buildSubscribeURL(request: SubscribeSseRequest) {
|
|
77
|
-
const url = new URL(
|
|
77
|
+
const url = new URL(SSE_URL, window.location.origin);
|
|
78
|
+
url.searchParams.set("stream", request.stream);
|
|
78
79
|
if (request.channel_id) {
|
|
79
|
-
url.searchParams.set("
|
|
80
|
+
url.searchParams.set("channel", request.channel_id);
|
|
80
81
|
}
|
|
81
82
|
return url.toString();
|
|
82
83
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import service from "@liujitcn/kratos-admin-core/request";
|
|
2
2
|
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
3
3
|
import type {
|
|
4
|
-
|
|
4
|
+
BaseI18nService,
|
|
5
5
|
DraftBaseTranslationRequest,
|
|
6
6
|
DraftBaseTranslationResponse,
|
|
7
7
|
UpdateBaseTranslationRequest
|
|
8
|
-
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/
|
|
8
|
+
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
9
9
|
|
|
10
10
|
const BASE_TRANSLATION_URL = "/v1/admin/base/translation";
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
export class
|
|
12
|
+
/** BaseI18nServiceImpl Admin 单条动态翻译服务。 */
|
|
13
|
+
export class BaseI18nServiceImpl implements BaseI18nService {
|
|
14
14
|
/** DraftBaseTranslation 翻译请求中的单个文本。 */
|
|
15
15
|
DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse> {
|
|
16
16
|
return service<DraftBaseTranslationRequest, DraftBaseTranslationResponse>({
|
|
@@ -30,4 +30,4 @@ export class BaseTranslationServiceImpl implements BaseTranslationService {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export const
|
|
33
|
+
export const defBaseI18nService = new BaseI18nServiceImpl();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeGenLocaleConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/
|
|
1
|
+
import type { CodeGenLocaleConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
2
2
|
|
|
3
3
|
/** 代码生成国际化配置的 JSON 兼容形态。 */
|
|
4
4
|
type CodeGenLocaleConfigRecord = Record<string, CodeGenLocaleConfig>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-tooltip
|
|
3
|
-
|
|
2
|
+
<el-tooltip
|
|
3
|
+
v-if="aiRoute"
|
|
4
|
+
effect="dark"
|
|
5
|
+
:content="t('system.ai.chat.title.assistant')"
|
|
6
|
+
placement="bottom"
|
|
7
|
+
:show-after="200"
|
|
8
|
+
>
|
|
9
|
+
<button class="ai" type="button" :aria-label="t('system.ai.chat.action.open_assistant')" @click="openAi">
|
|
4
10
|
<el-icon><ChatDotRound /></el-icon>
|
|
5
11
|
</button>
|
|
6
12
|
</el-tooltip>
|
|
@@ -10,6 +16,7 @@
|
|
|
10
16
|
import { ChatDotRound } from "@element-plus/icons-vue";
|
|
11
17
|
import { computed } from "vue";
|
|
12
18
|
import { useRouter } from "vue-router";
|
|
19
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
13
20
|
import { useAuthStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
14
21
|
import { navigateTo } from "@liujitcn/kratos-admin-core/navigation";
|
|
15
22
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:title="displaySource"
|
|
9
9
|
width="760px"
|
|
10
10
|
append-to-body
|
|
11
|
+
:show-footer="false"
|
|
11
12
|
:destroy-on-close="true"
|
|
12
13
|
@closed="handleDialogClosed"
|
|
13
14
|
>
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
</span>
|
|
30
31
|
</template>
|
|
31
32
|
</el-table-column>
|
|
32
|
-
<el-table-column :label="t('common.field.operation')" width="
|
|
33
|
+
<el-table-column :label="t('common.field.operation')" width="200" fixed="right">
|
|
33
34
|
<template #default="{ row }">
|
|
34
35
|
<el-button v-if="!row.editing" link type="primary" :icon="EditPen" @click="startEdit(row)">
|
|
35
36
|
{{ t("common.action.edit") }}
|
|
@@ -55,9 +56,9 @@ import { Check, Close, EditPen } from "@element-plus/icons-vue";
|
|
|
55
56
|
import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
|
|
56
57
|
import { t, useLocaleStore } from "@liujitcn/kratos-admin-core";
|
|
57
58
|
import { loadEnabledBaseLanguages, useEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/base_language";
|
|
58
|
-
import {
|
|
59
|
-
import type {
|
|
60
|
-
import { TranslationTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/
|
|
59
|
+
import { defBaseI18nService } from "@liujitcn/kratos-admin-system/api/system/base_i18n";
|
|
60
|
+
import type { BaseI18n } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
61
|
+
import { TranslationTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
61
62
|
import { getLanguageLabel } from "./dynamicTranslation";
|
|
62
63
|
|
|
63
64
|
/** DynamicTranslationCellProps 动态翻译列表单元格属性。 */
|
|
@@ -69,7 +70,7 @@ interface DynamicTranslationCellProps {
|
|
|
69
70
|
/** 目标资源编号。 */
|
|
70
71
|
targetId?: number;
|
|
71
72
|
/** 资源列表返回的非主语言翻译。 */
|
|
72
|
-
translations?:
|
|
73
|
+
translations?: BaseI18n[];
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
const props = defineProps<DynamicTranslationCellProps>();
|
|
@@ -132,13 +133,13 @@ async function loadTranslations() {
|
|
|
132
133
|
const missingRows = rows.filter(row => !row.text);
|
|
133
134
|
if (missingRows.length === 0) return;
|
|
134
135
|
if (!props.source) return;
|
|
135
|
-
const draft = await
|
|
136
|
+
const draft = await defBaseI18nService.DraftBaseTranslation({ source: props.source });
|
|
136
137
|
const translations = new Map(draft.translations.map(item => [item.locale, item.translation]));
|
|
137
138
|
const results = await Promise.allSettled(
|
|
138
139
|
missingRows.map(async row => {
|
|
139
140
|
const translation = translations.get(row.locale);
|
|
140
141
|
if (!translation) throw new Error("translation not found");
|
|
141
|
-
await
|
|
142
|
+
await defBaseI18nService.UpdateBaseTranslation({
|
|
142
143
|
id: row.id,
|
|
143
144
|
target_type: targetType,
|
|
144
145
|
target_id: targetId,
|
|
@@ -203,7 +204,7 @@ async function saveTranslation(row: DynamicTranslationRow) {
|
|
|
203
204
|
}
|
|
204
205
|
row.saving = true;
|
|
205
206
|
try {
|
|
206
|
-
await
|
|
207
|
+
await defBaseI18nService.UpdateBaseTranslation({
|
|
207
208
|
id: row.id,
|
|
208
209
|
target_type: targetType,
|
|
209
210
|
target_id: targetId,
|
|
@@ -235,7 +236,6 @@ function handleDialogClosed() {
|
|
|
235
236
|
min-width: 0;
|
|
236
237
|
max-width: 100%;
|
|
237
238
|
}
|
|
238
|
-
|
|
239
239
|
.dynamic-translation-cell__source {
|
|
240
240
|
min-width: 0;
|
|
241
241
|
overflow: hidden;
|
|
@@ -49,7 +49,7 @@ import { computed, ref, watch } from "vue";
|
|
|
49
49
|
import { ElMessage } from "element-plus";
|
|
50
50
|
import { Promotion } from "@element-plus/icons-vue";
|
|
51
51
|
import { t, useLocaleStore } from "@liujitcn/kratos-admin-core";
|
|
52
|
-
import {
|
|
52
|
+
import { defBaseI18nService } from "@liujitcn/kratos-admin-system/api/system/base_i18n";
|
|
53
53
|
import { getLanguageLabel, type DynamicTranslationValue } from "./dynamicTranslation";
|
|
54
54
|
|
|
55
55
|
/** DynamicTranslationEditorProps 动态翻译编辑器属性。 */
|
|
@@ -95,7 +95,7 @@ async function handleBatchTranslate() {
|
|
|
95
95
|
translating.value = true;
|
|
96
96
|
try {
|
|
97
97
|
const pending = localValues.value.filter(item => !item.text && item.locale !== currentLocale.value);
|
|
98
|
-
const response = await
|
|
98
|
+
const response = await defBaseI18nService.DraftBaseTranslation({ source: props.source });
|
|
99
99
|
const translations = new Map(response.translations.map(item => [item.locale, item.translation]));
|
|
100
100
|
const failed = pending.filter(item => !translations.has(item.locale)).length;
|
|
101
101
|
if (translations.size) {
|
|
@@ -129,7 +129,7 @@ async function handleTranslate(locale: string) {
|
|
|
129
129
|
if (!item || item.text || item.locale === currentLocale.value || !props.source || translating.value || translatingLocale.value) return;
|
|
130
130
|
translatingLocale.value = locale;
|
|
131
131
|
try {
|
|
132
|
-
const response = await
|
|
132
|
+
const response = await defBaseI18nService.DraftBaseTranslation({ source: props.source, locale });
|
|
133
133
|
const translation = response.translations.find(item => item.locale === locale)?.translation;
|
|
134
134
|
if (!translation) throw new Error("translation not found");
|
|
135
135
|
const values = localValues.value.map(value => (value.locale === locale ? { ...value, text: translation } : value));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/base_language";
|
|
2
|
-
import type { TranslationTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/
|
|
2
|
+
import type { TranslationTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
3
3
|
|
|
4
4
|
/** DynamicTranslationValue 动态资源单语言翻译编辑状态。 */
|
|
5
5
|
export interface DynamicTranslationValue {
|
|
@@ -479,6 +479,7 @@
|
|
|
479
479
|
"system.ai.chat.action.collapse_sessions": "Collapse conversations",
|
|
480
480
|
"system.ai.chat.action.expand_sessions": "Expand conversations",
|
|
481
481
|
"system.ai.chat.action.new_conversation": "New conversation",
|
|
482
|
+
"system.ai.chat.action.open_assistant": "Open AI assistant",
|
|
482
483
|
"system.ai.chat.action.conversation_menu": "Conversation actions",
|
|
483
484
|
"system.ai.chat.action.rename": "Rename",
|
|
484
485
|
"system.ai.chat.action.continue": "Continue",
|
|
@@ -486,6 +487,7 @@
|
|
|
486
487
|
"system.ai.chat.title.error_detail": "Error details",
|
|
487
488
|
"system.ai.chat.title.runtime": "Runtime details",
|
|
488
489
|
"system.ai.chat.title.recent_conversations": "Recent conversations",
|
|
490
|
+
"system.ai.chat.title.assistant": "AI assistant",
|
|
489
491
|
"system.ai.chat.field.input_tokens": "Input",
|
|
490
492
|
"system.ai.chat.field.output_tokens": "Output",
|
|
491
493
|
"system.ai.chat.field.cache_tokens": "Cache read",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/* 此文件由 scripts/sync_locales.py 生成,请勿手工修改。 */
|
|
2
2
|
import localeZhCn from './zh-CN.json'
|
|
3
3
|
import localeEnUs from './en-US.json'
|
|
4
|
+
import localeJaJp from './ja-JP.json'
|
|
4
5
|
import localeZhTw from './zh-TW.json'
|
|
5
6
|
|
|
6
7
|
export const LOCALE_MESSAGES = {
|
|
7
8
|
'zh-CN': localeZhCn,
|
|
8
9
|
'en-US': localeEnUs,
|
|
10
|
+
'ja-JP': localeJaJp,
|
|
9
11
|
'zh-TW': localeZhTw,
|
|
10
12
|
} as const satisfies Record<string, Record<string, string>>
|
|
11
13
|
|