@liujitcn/kratos-admin-system 0.0.27 → 0.0.29

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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/package/declarations/src/api/system/base_i18n.d.ts +5 -5
  3. package/dist/package/declarations/src/api/system/runtime_log.d.ts +13 -0
  4. package/dist/package/declarations/src/api/system/runtime_log_sse.d.ts +8 -0
  5. package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +16 -0
  6. package/dist/package/declarations/src/components/DynamicI18nEditor.vue.d.ts +20 -0
  7. package/dist/package/declarations/src/components/dynamicI18n.d.ts +38 -0
  8. package/dist/package/declarations/src/locales/generated.d.ts +168 -52
  9. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +3 -3
  10. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +4 -4
  11. package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +23 -23
  12. package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +2 -2
  13. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +1 -1
  14. package/dist/package/declarations/src/rpc/system/admin/v1/ops_monitoring.d.ts +4 -0
  15. package/dist/package/declarations/src/rpc/system/admin/v1/project_document.d.ts +4 -6
  16. package/dist/package/declarations/src/rpc/system/admin/v1/runtime_log.d.ts +96 -0
  17. package/dist/package/declarations/src/views/tool/runtime-log/index.vue.d.ts +3 -0
  18. package/dist/package/src/api/system/base_i18n.ts +12 -12
  19. package/dist/package/src/api/system/runtime_log.ts +80 -0
  20. package/dist/package/src/api/system/runtime_log_sse.ts +40 -0
  21. package/dist/package/src/components/{DynamicTranslationCell.vue → DynamicI18nCell.vue} +50 -50
  22. package/dist/package/src/components/{DynamicTranslationEditor.vue → DynamicI18nEditor.vue} +45 -45
  23. package/dist/package/src/components/{dynamicTranslation.ts → dynamicI18n.ts} +15 -15
  24. package/dist/package/src/locales/README.md +1 -1
  25. package/dist/package/src/locales/en-US.json +46 -17
  26. package/dist/package/src/locales/ja-JP.json +44 -15
  27. package/dist/package/src/locales/zh-CN.json +44 -15
  28. package/dist/package/src/locales/zh-TW.json +44 -15
  29. package/dist/package/src/rpc/system/admin/v1/base_config.ts +3 -3
  30. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +4 -4
  31. package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +23 -23
  32. package/dist/package/src/rpc/system/admin/v1/base_menu.ts +2 -2
  33. package/dist/package/src/rpc/system/admin/v1/code_gen.ts +1 -1
  34. package/dist/package/src/rpc/system/admin/v1/ops_monitoring.ts +4 -0
  35. package/dist/package/src/rpc/system/admin/v1/project_document.ts +4 -7
  36. package/dist/package/src/rpc/system/admin/v1/runtime_log.ts +113 -0
  37. package/dist/package/src/views/base/config/index.vue +38 -38
  38. package/dist/package/src/views/base/dict/index.vue +23 -23
  39. package/dist/package/src/views/base/dict/item.vue +25 -25
  40. package/dist/package/src/views/base/menu/index.vue +23 -23
  41. package/dist/package/src/views/tool/api-doc/index.vue +14 -6
  42. package/dist/package/src/views/tool/code-gen/code-preview/index.vue +23 -6
  43. package/dist/package/src/views/tool/code-gen/columns/index.vue +1 -1
  44. package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +96 -14
  45. package/dist/package/src/views/tool/code-gen/table/index.vue +33 -1
  46. package/dist/package/src/views/tool/ops-monitoring/index.vue +130 -24
  47. package/dist/package/src/views/tool/project-doc/index.vue +9 -4
  48. package/dist/package/src/views/tool/runtime-log/index.vue +883 -0
  49. package/package.json +2 -2
  50. package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +0 -16
  51. package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +0 -20
  52. package/dist/package/declarations/src/components/dynamicTranslation.d.ts +0 -38
@@ -248,17 +248,17 @@
248
248
  "system.base.user.message.confirm_delete_selected": "確認刪除已選中的使用者嗎?",
249
249
  "system.base.user.message.delete_success": "刪除使用者成功",
250
250
  "system.base.user.message.delete_canceled": "已取消刪除使用者",
251
- "system.base.translation.field.translations": "多語言翻譯",
252
- "system.base.translation.field.name_translations": "名稱翻譯",
253
- "system.base.translation.field.value_translations": "值翻譯",
254
- "system.base.translation.placeholder.text": "請輸入{language}譯文",
255
- "system.base.translation.action.translate": "翻譯",
256
- "system.base.translation.action.batch_translate": "批量翻譯",
257
- "system.base.translation.message.translate_success": "{language}翻譯完成",
258
- "system.base.translation.message.translate_failed": "{language}翻譯失敗",
259
- "system.base.translation.message.batch_translate_success": "已完成 {count} 個語言的翻譯",
260
- "system.base.translation.message.batch_translate_partial": "已完成 {success} 個語言的翻譯,{failed} 個語言翻譯失敗",
261
- "system.base.translation.message.batch_translate_failed": "批量翻譯失敗",
251
+ "system.base.i18n.field.i18ns": "多語言翻譯",
252
+ "system.base.i18n.field.name_i18ns": "名稱翻譯",
253
+ "system.base.i18n.field.value_i18ns": "值翻譯",
254
+ "system.base.i18n.placeholder.text": "請輸入{language}譯文",
255
+ "system.base.i18n.action.translate": "翻譯",
256
+ "system.base.i18n.action.batch_translate": "批量翻譯",
257
+ "system.base.i18n.message.translate_success": "{language}翻譯完成",
258
+ "system.base.i18n.message.translate_failed": "{language}翻譯失敗",
259
+ "system.base.i18n.message.batch_translate_success": "已完成 {count} 個語言的翻譯",
260
+ "system.base.i18n.message.batch_translate_partial": "已完成 {success} 個語言的翻譯,{failed} 個語言翻譯失敗",
261
+ "system.base.i18n.message.batch_translate_failed": "批量翻譯失敗",
262
262
  "system.base.menu.title.list": "選單列表",
263
263
  "system.base.menu.action.create": "新增選單",
264
264
  "system.base.menu.action.edit": "修改選單",
@@ -626,7 +626,7 @@
626
626
  "system.code.gen.validation.left_tree_parent_required": "請選擇左樹父欄位",
627
627
  "system.code.gen.validation.left_tree_label_required": "請選擇左樹顯示欄位",
628
628
  "system.code.gen.validation.left_tree_value_required": "請選擇左樹值欄位",
629
- "system.code.gen.i18n.field.translations": "非主語言描述",
629
+ "system.code.gen.i18n.field.i18ns": "非主語言描述",
630
630
  "system.code.gen.i18n.action.edit_column": "編輯非主語言欄位描述",
631
631
  "system.code.gen.i18n.status.complete": "已填寫",
632
632
  "system.code.gen.i18n.status.missing": "缺失",
@@ -881,7 +881,7 @@
881
881
  "system.code.gen.preview.message.create_success": "新增成功",
882
882
  "system.code.gen.preview.message.update_success": "修改成功",
883
883
  "system.code.gen.preview.message.delete_success": "刪除成功",
884
- "system.code.gen.preview.message.missing_translations": "正式生成前還需補齊:{items}",
884
+ "system.code.gen.preview.message.missing_i18ns": "正式生成前還需補齊:{items}",
885
885
  "system.code.gen.preview.value.list_separator": "、",
886
886
  "system.project.document.title.navigation": "專案文件目錄",
887
887
  "system.project.document.placeholder.search": "搜尋專案或路徑",
@@ -912,7 +912,12 @@
912
912
  "system.ops_monitoring.error_rate": "錯誤率",
913
913
  "system.ops_monitoring.status.label": "狀態",
914
914
  "system.ops_monitoring.instance_resources": "執行個體資源",
915
- "system.ops_monitoring.current_recent_sample": "目前程序最近取樣",
915
+ "system.ops_monitoring.current_recent_sample": "目前執行個體資源最近取樣",
916
+ "system.ops_monitoring.node_metric.heap_memory": "堆積記憶體",
917
+ "system.ops_monitoring.node_metric.memory": "記憶體",
918
+ "system.ops_monitoring.node_metric.disk": "磁碟",
919
+ "system.ops_monitoring.node_metric.current": "目前",
920
+ "system.ops_monitoring.node_metric.total": "總計",
916
921
  "system.ops_monitoring.instance_count": "{count} 個執行個體",
917
922
  "system.ops_monitoring.alert_events": "告警事件",
918
923
  "system.ops_monitoring.alert_attention": "視窗內失敗請求,需要運維關注的事件",
@@ -931,5 +936,29 @@
931
936
  "system.ops_monitoring.kpi.p95_latency": "P95 延遲",
932
937
  "system.ops_monitoring.kpi.error_rate": "錯誤率",
933
938
  "system.ops_monitoring.kpi.availability": "可用性",
934
- "system.ops_monitoring.kpi.current_window": "目前視窗"
939
+ "system.ops_monitoring.kpi.current_window": "目前視窗",
940
+ "system.runtime.log.section.sources": "日誌來源",
941
+ "system.runtime.log.section.history_files": "歷史日誌",
942
+ "system.runtime.log.section.viewer": "日誌檢視器",
943
+ "system.runtime.log.value.live_console": "即時主控台",
944
+ "system.runtime.log.value.instance": "執行個體 {id}",
945
+ "system.runtime.log.value.entry_count": "{count} 筆",
946
+ "system.runtime.log.placeholder.search_file": "搜尋日誌檔案",
947
+ "system.runtime.log.placeholder.search_content": "搜尋日誌內容",
948
+ "system.runtime.log.placeholder.level": "日誌層級",
949
+ "system.runtime.log.action.resume": "繼續",
950
+ "system.runtime.log.action.pause": "暫停",
951
+ "system.runtime.log.action.auto_scroll": "自動捲動",
952
+ "system.runtime.log.action.download": "下載原始檔案",
953
+ "system.runtime.log.action.load_older": "載入更早日誌",
954
+ "system.runtime.log.empty.files": "暫無歷史日誌檔案",
955
+ "system.runtime.log.empty.entries": "暫無符合的日誌",
956
+ "system.runtime.log.status.connecting": "連線中",
957
+ "system.runtime.log.status.live": "即時",
958
+ "system.runtime.log.status.paused": "已暫停",
959
+ "system.runtime.log.status.disconnected": "未連線",
960
+ "system.runtime.log.status.loading": "正在讀取日誌",
961
+ "system.runtime.log.message.gap": "即時日誌過快,已略過 {count} 筆,請查詢歷史檔案補全",
962
+ "system.runtime.log.message.file_changed": "日誌檔案已輪替或截斷,已重新從檔案尾端讀取",
963
+ "system.runtime.log.message.download_started": "日誌檔案下載已開始"
935
964
  }
@@ -83,9 +83,9 @@ export interface BaseConfigForm {
83
83
  /** 配置value */
84
84
  value: string;
85
85
  /** 配置名称多语言翻 */
86
- name_translations: BaseI18n[];
86
+ name_i18ns: BaseI18n[];
87
87
  /** 配置value文本/富文本配置值的多语言翻译 */
88
- value_translations: BaseI18n[];
88
+ value_i18ns: BaseI18n[];
89
89
  /** 状态 */
90
90
  status: Status;
91
91
  }
@@ -141,7 +141,7 @@ export interface BaseConfig {
141
141
  /** 更新时间 */
142
142
  updated_at: string;
143
143
  /** 配置名称及文本/富文本配置值的多语言翻译 */
144
- translations: BaseI18n[];
144
+ i18ns: BaseI18n[];
145
145
  }
146
146
 
147
147
  /** Admin系统配置服务 */
@@ -102,7 +102,7 @@ export interface BaseDictForm {
102
102
  /** 字典名称 */
103
103
  name: string;
104
104
  /** 非主语言翻译 */
105
- translations: BaseI18n[];
105
+ i18ns: BaseI18n[];
106
106
  /** 状态 */
107
107
  status: Status;
108
108
  }
@@ -128,7 +128,7 @@ export interface BaseDictItemForm {
128
128
  /** 排序 */
129
129
  sort: number;
130
130
  /** 非主语言翻译 */
131
- translations: BaseI18n[];
131
+ i18ns: BaseI18n[];
132
132
  /** 状态 */
133
133
  status: Status;
134
134
  }
@@ -200,7 +200,7 @@ export interface BaseDict {
200
200
  /** 更新时间 */
201
201
  updated_at: string;
202
202
  /** 非主语言翻译 */
203
- translations: BaseI18n[];
203
+ i18ns: BaseI18n[];
204
204
  }
205
205
 
206
206
  /** 字典项 */
@@ -224,7 +224,7 @@ export interface BaseDictItem {
224
224
  /** 更新时间 */
225
225
  updated_at: string;
226
226
  /** 非主语言翻译 */
227
- translations: BaseI18n[];
227
+ i18ns: BaseI18n[];
228
228
  }
229
229
 
230
230
  /** Admin字典服务 */
@@ -8,23 +8,23 @@
8
8
  import type { Empty } from "../../../google/protobuf/empty";
9
9
 
10
10
  /** 统一翻译表目标类型,和 base_i18n.target_type 的值一一对应。 */
11
- export enum TranslationTargetType {
12
- /** TRANSLATION_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
13
- TRANSLATION_TARGET_TYPE_UNSPECIFIED = 0,
14
- /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
15
- TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
16
- /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
17
- TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME = 2,
18
- /** TRANSLATION_TARGET_TYPE_BASE_DICT - 字典名称。 */
19
- TRANSLATION_TARGET_TYPE_BASE_DICT = 3,
20
- /** TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
21
- TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM = 4,
22
- /** TRANSLATION_TARGET_TYPE_BASE_MENU - 菜单标题。 */
23
- TRANSLATION_TARGET_TYPE_BASE_MENU = 5,
11
+ export enum I18nTargetType {
12
+ /** I18N_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
13
+ I18N_TARGET_TYPE_UNSPECIFIED = 0,
14
+ /** I18N_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
15
+ I18N_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
16
+ /** I18N_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
17
+ I18N_TARGET_TYPE_BASE_CONFIG_NAME = 2,
18
+ /** I18N_TARGET_TYPE_BASE_DICT - 字典名称。 */
19
+ I18N_TARGET_TYPE_BASE_DICT = 3,
20
+ /** I18N_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
21
+ I18N_TARGET_TYPE_BASE_DICT_ITEM = 4,
22
+ /** I18N_TARGET_TYPE_BASE_MENU - 菜单标题。 */
23
+ I18N_TARGET_TYPE_BASE_MENU = 5,
24
24
  }
25
25
 
26
26
  /** 翻译单个文本请求。 */
27
- export interface DraftBaseTranslationRequest {
27
+ export interface DraftBaseI18nRequest {
28
28
  /** 待翻译文本 */
29
29
  source: string;
30
30
  /** 目标语言区域,不传时翻译所有启用的非主语言 */
@@ -32,25 +32,25 @@ export interface DraftBaseTranslationRequest {
32
32
  }
33
33
 
34
34
  /** 翻译单个文本响应。 */
35
- export interface DraftBaseTranslationResponse {
35
+ export interface DraftBaseI18nResponse {
36
36
  /** 翻译结果 */
37
- translations: DraftBaseTranslationItem[];
37
+ i18ns: DraftBaseI18nItem[];
38
38
  }
39
39
 
40
40
  /** 翻译单个文本响应。 */
41
- export interface DraftBaseTranslationItem {
41
+ export interface DraftBaseI18nItem {
42
42
  /** 目标语言区域 */
43
43
  locale: string;
44
44
  /** 翻译文本 */
45
- translation: string;
45
+ i18n: string;
46
46
  }
47
47
 
48
48
  /** 修改单个翻译信息请求。 */
49
- export interface UpdateBaseTranslationRequest {
49
+ export interface UpdateBaseI18nRequest {
50
50
  /** 翻译记录ID,大于零时优先按ID更新;ID不存在时根据目标信息更新或新增 */
51
51
  id: number;
52
52
  /** 翻译目标类型,ID为零时用于查询或新增 */
53
- target_type: TranslationTargetType;
53
+ target_type: I18nTargetType;
54
54
  /** 目标资源ID,ID为零时用于查询或新增 */
55
55
  target_id: number;
56
56
  /** 目标语言区域,ID为零时用于查询或新增 */
@@ -64,7 +64,7 @@ export interface BaseI18n {
64
64
  /** 翻译记录ID */
65
65
  id: number;
66
66
  /** 翻译目标类型 */
67
- target_type: TranslationTargetType;
67
+ target_type: I18nTargetType;
68
68
  /** 目标资源ID */
69
69
  target_id: number;
70
70
  /** 语言区域 */
@@ -84,7 +84,7 @@ export interface CodeGenLocaleConfig {
84
84
  /** 国际化翻译信息服务。 */
85
85
  export interface BaseI18nService {
86
86
  /** 翻译单个文本。 */
87
- DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse>;
87
+ DraftBaseI18n(request: DraftBaseI18nRequest): Promise<DraftBaseI18nResponse>;
88
88
  /** 修改国际化翻译信息 */
89
- UpdateBaseTranslation(request: UpdateBaseTranslationRequest): Promise<Empty>;
89
+ UpdateBaseI18n(request: UpdateBaseI18nRequest): Promise<Empty>;
90
90
  }
@@ -72,7 +72,7 @@ export interface BaseMenuForm {
72
72
  /** 分配的API列表 */
73
73
  api: string[];
74
74
  /** 非主语言翻译 */
75
- translations: BaseI18n[];
75
+ i18ns: BaseI18n[];
76
76
  /** 排序 */
77
77
  sort: number;
78
78
  /** 状态 */
@@ -138,7 +138,7 @@ export interface BaseMenu {
138
138
  /** 是否存在子节点 */
139
139
  has_children: boolean;
140
140
  /** 非主语言翻译 */
141
- translations: BaseI18n[];
141
+ i18ns: BaseI18n[];
142
142
  }
143
143
 
144
144
  /** 菜单元信息 */
@@ -82,7 +82,7 @@ export interface PreviewCodeGenResponse {
82
82
  | CodeGenOutputPaths
83
83
  | undefined;
84
84
  /** 正式生成前必须补齐的翻译配置 */
85
- missing_translations: string[];
85
+ missing_i18ns: string[];
86
86
  }
87
87
 
88
88
  /** 启动代码生成任务条件 */
@@ -222,6 +222,10 @@ export interface OpsNodeMetric {
222
222
  label: string;
223
223
  /** 指标使用百分比 */
224
224
  value: number;
225
+ /** 当前已用容量,单位字节 */
226
+ used_bytes: number;
227
+ /** 总容量,单位字节 */
228
+ total_bytes: number;
225
229
  }
226
230
 
227
231
  /** 告警事件。 */
@@ -28,6 +28,8 @@ export interface ProjectDocumentListItem {
28
28
  id: string;
29
29
  /** 项目内相对路径 */
30
30
  path: string;
31
+ /** 当前语言下的文档显示文件名 */
32
+ name: string;
31
33
  /** Markdown文件更新时间,RFC3339格式 */
32
34
  updated_at: string;
33
35
  }
@@ -66,19 +68,14 @@ export interface ProjectDocument {
66
68
  project_name: string;
67
69
  /** 项目内相对路径 */
68
70
  path: string;
71
+ /** 当前语言下的文档显示文件名 */
72
+ name: string;
69
73
  /** Markdown文档内容 */
70
74
  content: string;
71
- /** 按语言标识索引的Markdown翻译内容 */
72
- locale: Map<string, string>;
73
75
  /** Markdown文件更新时间,RFC3339格式 */
74
76
  updated_at: string;
75
77
  }
76
78
 
77
- export interface ProjectDocument_LocaleEntry {
78
- key: string;
79
- value: string;
80
- }
81
-
82
79
  /** 项目文档服务 */
83
80
  export interface ProjectDocumentService {
84
81
  /** 查询项目文档树 */
@@ -0,0 +1,113 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc unknown
5
+ // source: system/admin/v1/runtime_log.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** 历史日志文件列表查询条件。 */
10
+ export interface ListRuntimeLogFilesRequest {
11
+ }
12
+
13
+ /** 历史日志文件列表响应。 */
14
+ export interface ListRuntimeLogFilesResponse {
15
+ /** 历史日志文件列表 */
16
+ files: RuntimeLogFile[];
17
+ }
18
+
19
+ /** 历史日志文件信息。 */
20
+ export interface RuntimeLogFile {
21
+ /** 服务端签发的日志文件标识 */
22
+ file_id: string;
23
+ /** 日志文件名称 */
24
+ name: string;
25
+ /** 日志文件大小,单位字节 */
26
+ size_bytes: number;
27
+ /** 最后修改时间,RFC3339格式 */
28
+ modified_at: string;
29
+ /** 是否为Gzip压缩文件 */
30
+ is_compressed: boolean;
31
+ /** 是否为当前活动日志文件 */
32
+ is_active: boolean;
33
+ }
34
+
35
+ /** 历史日志文件读取条件。 */
36
+ export interface ReadRuntimeLogFileRequest {
37
+ /** 服务端签发的日志文件标识 */
38
+ file_id: string;
39
+ /** 向更早日志翻页的不透明游标,留空时从文件尾部读取 */
40
+ cursor: string;
41
+ /** 单次读取条数,0使用默认值,最大500 */
42
+ limit: number;
43
+ /** 日志内容搜索关键字 */
44
+ keyword: string;
45
+ /** 日志级别筛选列表 */
46
+ levels: string[];
47
+ }
48
+
49
+ /** 历史日志文件读取响应。 */
50
+ export interface ReadRuntimeLogFileResponse {
51
+ /** 按时间正序排列的日志条目 */
52
+ entries: RuntimeLogEntry[];
53
+ /** 继续读取更早日志的不透明游标 */
54
+ next_cursor: string;
55
+ /** 是否还有更早日志 */
56
+ has_more: boolean;
57
+ /** 读取期间日志文件是否已滚动或截断 */
58
+ file_changed: boolean;
59
+ }
60
+
61
+ /** 实时或历史日志条目。 */
62
+ export interface RuntimeLogEntry {
63
+ /** 当前进程内的日志序号,历史文件日志为空 */
64
+ sequence: string;
65
+ /** 日志时间 */
66
+ timestamp: string;
67
+ /** 日志级别 */
68
+ level: string;
69
+ /** 日志来源 */
70
+ source: string;
71
+ /** 日志消息 */
72
+ message: string;
73
+ /** 可直接展示的纯文本日志行 */
74
+ line: string;
75
+ /** 日志行是否因长度限制被截断 */
76
+ is_truncated: boolean;
77
+ }
78
+
79
+ /** 实时控制台开启条件。 */
80
+ export interface OpenRuntimeConsoleRequest {
81
+ /** 首次返回的最近日志条数,0使用默认值,最大500 */
82
+ backlog_limit: number;
83
+ }
84
+
85
+ /** 实时控制台开启响应。 */
86
+ export interface OpenRuntimeConsoleResponse {
87
+ /** SSE业务流标识 */
88
+ stream: string;
89
+ /** 当前用户专属SSE频道标识 */
90
+ channel_id: string;
91
+ /** 频道过期时间,RFC3339格式 */
92
+ expires_at: string;
93
+ /** 当前服务实例标识 */
94
+ instance_id: string;
95
+ /** 当前进程最新日志序号 */
96
+ latest_sequence: string;
97
+ /** 当前进程最近日志 */
98
+ entries: RuntimeLogEntry[];
99
+ }
100
+
101
+ /** 实时控制台丢失消息提示。 */
102
+ export interface RuntimeLogGap {
103
+ /** 本次丢弃的日志条数 */
104
+ dropped_count: number;
105
+ /** 发生丢弃时的最新日志序号 */
106
+ latest_sequence: string;
107
+ }
108
+
109
+ /** 历史日志文件下载条件。 */
110
+ export interface DownloadRuntimeLogFileRequest {
111
+ /** 服务端签发的日志文件标识 */
112
+ file_id: string;
113
+ }
@@ -56,16 +56,16 @@
56
56
  inline-prompt
57
57
  />
58
58
  </template>
59
- <template #nameTranslations>
60
- <DynamicTranslationEditor
61
- v-model="nameTranslationValues"
59
+ <template #nameI18ns>
60
+ <DynamicI18nEditor
61
+ v-model="nameI18nValues"
62
62
  :source="formData.name"
63
63
  :maxlength="100"
64
64
  />
65
65
  </template>
66
- <template #valueTranslations>
67
- <DynamicTranslationEditor
68
- v-model="valueTranslationValues"
66
+ <template #valueI18ns>
67
+ <DynamicI18nEditor
68
+ v-model="valueI18nValues"
69
69
  :source="formData.value"
70
70
  :maxlength="10000"
71
71
  multiline
@@ -99,15 +99,15 @@ import type { BaseI18n } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1
99
99
  import { BaseConfigSite } from "@liujitcn/kratos-admin-system/rpc/base/v1/config";
100
100
  import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
101
101
  import { BaseConfigType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_config";
102
- import { TranslationTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
102
+ import { I18nTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
103
103
  import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
104
104
  import { t } from "@liujitcn/kratos-admin-core";
105
- import DynamicTranslationEditor from "@liujitcn/kratos-admin-system/components/DynamicTranslationEditor.vue";
106
- import DynamicTranslationCell from "@liujitcn/kratos-admin-system/components/DynamicTranslationCell.vue";
105
+ import DynamicI18nEditor from "@liujitcn/kratos-admin-system/components/DynamicI18nEditor.vue";
106
+ import DynamicI18nCell from "@liujitcn/kratos-admin-system/components/DynamicI18nCell.vue";
107
107
  import {
108
108
  getEditableLanguageOptions,
109
- type DynamicTranslationValue
110
- } from "@liujitcn/kratos-admin-system/components/dynamicTranslation";
109
+ type DynamicI18nValue
110
+ } from "@liujitcn/kratos-admin-system/components/dynamicI18n";
111
111
 
112
112
  /** 系统配置编辑表单状态,新增时枚举字段保持为空,避免把未知值 0 显示为下拉文本。 */
113
113
  type BaseConfigFormState = Omit<BaseConfigForm, "site" | "type"> & {
@@ -147,16 +147,16 @@ const formData = reactive<BaseConfigFormState>({
147
147
  /** 状态 */
148
148
  status: Status.STATUS_ENABLE,
149
149
  /** 配置名称非主语言翻译。 */
150
- name_translations: [],
150
+ name_i18ns: [],
151
151
  /** 配置文本或富文本值的非主语言翻译。 */
152
- value_translations: []
152
+ value_i18ns: []
153
153
  });
154
154
 
155
155
  /** 将配置值翻译记录转换为编辑器值,缺少记录时保留可编辑的空行。 */
156
- function normalizeConfigTranslations(targetType: TranslationTargetType): DynamicTranslationValue[] {
157
- const records = targetType === TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME
158
- ? formData.name_translations
159
- : formData.value_translations;
156
+ function normalizeConfigI18ns(targetType: I18nTargetType): DynamicI18nValue[] {
157
+ const records = targetType === I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_NAME
158
+ ? formData.name_i18ns
159
+ : formData.value_i18ns;
160
160
  return getEditableLanguageOptions()
161
161
  .map(item => item.value)
162
162
  .map(locale => {
@@ -170,7 +170,7 @@ function normalizeConfigTranslations(targetType: TranslationTargetType): Dynamic
170
170
  }
171
171
 
172
172
  /** 保存指定目标类型的编辑器值,并保留其他字段的翻译。 */
173
- function updateConfigTranslations(targetType: TranslationTargetType, values: DynamicTranslationValue[]) {
173
+ function updateConfigI18ns(targetType: I18nTargetType, values: DynamicI18nValue[]) {
174
174
  const next = values.map(
175
175
  item =>
176
176
  ({
@@ -180,21 +180,21 @@ function updateConfigTranslations(targetType: TranslationTargetType, values: Dyn
180
180
  name: item.text
181
181
  }) as BaseI18n
182
182
  );
183
- if (targetType === TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME) {
184
- formData.name_translations = next;
183
+ if (targetType === I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_NAME) {
184
+ formData.name_i18ns = next;
185
185
  } else {
186
- formData.value_translations = next;
186
+ formData.value_i18ns = next;
187
187
  }
188
188
  }
189
189
 
190
- const nameTranslationValues = computed<DynamicTranslationValue[]>({
191
- get: () => normalizeConfigTranslations(TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME),
192
- set: values => updateConfigTranslations(TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME, values)
190
+ const nameI18nValues = computed<DynamicI18nValue[]>({
191
+ get: () => normalizeConfigI18ns(I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_NAME),
192
+ set: values => updateConfigI18ns(I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_NAME, values)
193
193
  });
194
194
 
195
- const valueTranslationValues = computed<DynamicTranslationValue[]>({
196
- get: () => normalizeConfigTranslations(TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE),
197
- set: values => updateConfigTranslations(TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE, values)
195
+ const valueI18nValues = computed<DynamicI18nValue[]>({
196
+ get: () => normalizeConfigI18ns(I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_VALUE),
197
+ set: values => updateConfigI18ns(I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_VALUE, values)
198
198
  });
199
199
 
200
200
  const rules = computed(() => ({
@@ -334,17 +334,17 @@ const formFields = computed<ProFormField[]>(() => [
334
334
  visible: model => model.type == BaseConfigType.BASE_CONFIG_TYPE_BOOLEAN
335
335
  },
336
336
  {
337
- prop: "translations",
338
- label: t("system.base.translation.field.name_translations"),
337
+ prop: "i18ns",
338
+ label: t("system.base.i18n.field.name_i18ns"),
339
339
  component: "slot",
340
- slotName: "nameTranslations",
340
+ slotName: "nameI18ns",
341
341
  colSpan: 24
342
342
  },
343
343
  {
344
- prop: "translations",
345
- label: t("system.base.translation.field.value_translations"),
344
+ prop: "i18ns",
345
+ label: t("system.base.i18n.field.value_i18ns"),
346
346
  component: "slot",
347
- slotName: "valueTranslations",
347
+ slotName: "valueI18ns",
348
348
  visible: model =>
349
349
  model.type == BaseConfigType.BASE_CONFIG_TYPE_TEXT || model.type == BaseConfigType.BASE_CONFIG_TYPE_RICH_TEXT,
350
350
  colSpan: 24
@@ -431,11 +431,11 @@ const columns = computed<ColumnProps[]>(() => [
431
431
 
432
432
  /** 渲染系统配置名称翻译预览。 */
433
433
  function renderConfigNameCell(row: BaseConfig) {
434
- return h(DynamicTranslationCell, {
434
+ return h(DynamicI18nCell, {
435
435
  source: row.name,
436
- targetType: TranslationTargetType.TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME,
436
+ targetType: I18nTargetType.I18N_TARGET_TYPE_BASE_CONFIG_NAME,
437
437
  targetId: row.id,
438
- translations: row.translations
438
+ i18ns: row.i18ns
439
439
  });
440
440
  }
441
441
 
@@ -573,8 +573,8 @@ function resetForm() {
573
573
  formData.type = undefined;
574
574
  formData.key = "";
575
575
  formData.value = "";
576
- formData.name_translations = [];
577
- formData.value_translations = [];
576
+ formData.name_i18ns = [];
577
+ formData.value_i18ns = [];
578
578
  formData.status = Status.STATUS_ENABLE;
579
579
  }
580
580