@liujitcn/kratos-admin-system 0.0.26 → 0.0.28

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 (71) hide show
  1. package/dist/package/declarations/src/api/system/base_i18n.d.ts +10 -0
  2. package/dist/package/declarations/src/api/system/code_gen_i18n.d.ts +1 -1
  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/DynamicTranslationCell.vue.d.ts +3 -3
  6. package/dist/package/declarations/src/components/dynamicTranslation.d.ts +1 -1
  7. package/dist/package/declarations/src/locales/generated.d.ts +1057 -0
  8. package/dist/package/declarations/src/rpc/common/v1/enum.d.ts +15 -6
  9. package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +10 -1
  10. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +4 -4
  11. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +5 -5
  12. package/dist/package/declarations/src/rpc/system/admin/v1/{base_translation.d.ts → base_i18n.d.ts} +3 -3
  13. package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +3 -3
  14. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +1 -1
  15. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +1 -1
  16. package/dist/package/declarations/src/rpc/system/admin/v1/ops_monitoring.d.ts +4 -0
  17. package/dist/package/declarations/src/rpc/system/admin/v1/project_document.d.ts +6 -0
  18. package/dist/package/declarations/src/rpc/system/admin/v1/runtime_log.d.ts +96 -0
  19. package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue.d.ts +1 -1
  20. package/dist/package/declarations/src/views/tool/runtime-log/index.vue.d.ts +3 -0
  21. package/dist/package/src/api/base/sse.ts +3 -2
  22. package/dist/package/src/api/system/{base_translation.ts → base_i18n.ts} +5 -5
  23. package/dist/package/src/api/system/code_gen_i18n.ts +1 -1
  24. package/dist/package/src/api/system/runtime_log.ts +80 -0
  25. package/dist/package/src/api/system/runtime_log_sse.ts +40 -0
  26. package/dist/package/src/components/Ai.vue +9 -2
  27. package/dist/package/src/components/DynamicTranslationCell.vue +9 -9
  28. package/dist/package/src/components/DynamicTranslationEditor.vue +3 -3
  29. package/dist/package/src/components/dynamicTranslation.ts +1 -1
  30. package/dist/package/src/locales/en-US.json +33 -2
  31. package/dist/package/src/locales/generated.ts +2 -0
  32. package/dist/package/src/locales/ja-JP.json +964 -0
  33. package/dist/package/src/locales/zh-CN.json +33 -2
  34. package/dist/package/src/locales/zh-TW.json +33 -2
  35. package/dist/package/src/rpc/common/v1/enum.ts +16 -6
  36. package/dist/package/src/rpc/system/admin/v1/base_api.ts +11 -1
  37. package/dist/package/src/rpc/system/admin/v1/base_config.ts +4 -4
  38. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +5 -5
  39. package/dist/package/src/rpc/system/admin/v1/{base_translation.ts → base_i18n.ts} +4 -4
  40. package/dist/package/src/rpc/system/admin/v1/base_menu.ts +3 -3
  41. package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +1 -1
  42. package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +1 -1
  43. package/dist/package/src/rpc/system/admin/v1/ops_monitoring.ts +4 -0
  44. package/dist/package/src/rpc/system/admin/v1/project_document.ts +6 -0
  45. package/dist/package/src/rpc/system/admin/v1/runtime_log.ts +113 -0
  46. package/dist/package/src/views/ai/chat/message.ts +12 -2
  47. package/dist/package/src/views/base/api/index.vue +20 -20
  48. package/dist/package/src/views/base/config/index.vue +11 -11
  49. package/dist/package/src/views/base/dept/index.vue +8 -8
  50. package/dist/package/src/views/base/dict/index.vue +9 -9
  51. package/dist/package/src/views/base/dict/item.vue +9 -9
  52. package/dist/package/src/views/base/job/index.vue +11 -11
  53. package/dist/package/src/views/base/language/index.vue +9 -9
  54. package/dist/package/src/views/base/menu/index.vue +14 -9
  55. package/dist/package/src/views/base/post/index.vue +8 -8
  56. package/dist/package/src/views/base/role/index.vue +8 -8
  57. package/dist/package/src/views/base/tenant/index.vue +8 -8
  58. package/dist/package/src/views/base/user/index.vue +8 -8
  59. package/dist/package/src/views/tool/api-doc/index.vue +14 -6
  60. package/dist/package/src/views/tool/code-gen/code-preview/index.vue +17 -0
  61. package/dist/package/src/views/tool/code-gen/columns/index.vue +8 -53
  62. package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +97 -15
  63. package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +3 -12
  64. package/dist/package/src/views/tool/code-gen/preview/index.vue +3 -6
  65. package/dist/package/src/views/tool/code-gen/proto/index.vue +7 -8
  66. package/dist/package/src/views/tool/code-gen/table/index.vue +34 -2
  67. package/dist/package/src/views/tool/ops-monitoring/index.vue +153 -49
  68. package/dist/package/src/views/tool/project-doc/index.vue +9 -4
  69. package/dist/package/src/views/tool/runtime-log/index.vue +883 -0
  70. package/package.json +2 -2
  71. package/dist/package/declarations/src/api/system/base_translation.d.ts +0 -10
@@ -479,6 +479,7 @@
479
479
  "system.ai.chat.action.collapse_sessions": "收起会话栏",
480
480
  "system.ai.chat.action.expand_sessions": "展开会话栏",
481
481
  "system.ai.chat.action.new_conversation": "新建会话",
482
+ "system.ai.chat.action.open_assistant": "打开AI助手",
482
483
  "system.ai.chat.action.conversation_menu": "会话操作",
483
484
  "system.ai.chat.action.rename": "重命名",
484
485
  "system.ai.chat.action.continue": "继续",
@@ -486,6 +487,7 @@
486
487
  "system.ai.chat.title.error_detail": "错误详情",
487
488
  "system.ai.chat.title.runtime": "运行明细",
488
489
  "system.ai.chat.title.recent_conversations": "最近对话",
490
+ "system.ai.chat.title.assistant": "AI助手",
489
491
  "system.ai.chat.field.input_tokens": "输入",
490
492
  "system.ai.chat.field.output_tokens": "输出",
491
493
  "system.ai.chat.field.cache_tokens": "缓存读取",
@@ -910,7 +912,12 @@
910
912
  "system.ops_monitoring.error_rate": "错误率",
911
913
  "system.ops_monitoring.status.label": "状态",
912
914
  "system.ops_monitoring.instance_resources": "实例资源",
913
- "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": "总计",
914
921
  "system.ops_monitoring.instance_count": "{count} 个实例",
915
922
  "system.ops_monitoring.alert_events": "告警事件",
916
923
  "system.ops_monitoring.alert_attention": "窗口内失败请求,需要运维关注的事件",
@@ -929,5 +936,29 @@
929
936
  "system.ops_monitoring.kpi.p95_latency": "P95 延迟",
930
937
  "system.ops_monitoring.kpi.error_rate": "错误率",
931
938
  "system.ops_monitoring.kpi.availability": "可用性",
932
- "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": "日志文件下载已开始"
933
964
  }
@@ -479,6 +479,7 @@
479
479
  "system.ai.chat.action.collapse_sessions": "收起會話欄",
480
480
  "system.ai.chat.action.expand_sessions": "展開會話欄",
481
481
  "system.ai.chat.action.new_conversation": "新建會話",
482
+ "system.ai.chat.action.open_assistant": "開啟 AI 助手",
482
483
  "system.ai.chat.action.conversation_menu": "會話操作",
483
484
  "system.ai.chat.action.rename": "重新命名",
484
485
  "system.ai.chat.action.continue": "繼續",
@@ -486,6 +487,7 @@
486
487
  "system.ai.chat.title.error_detail": "錯誤詳情",
487
488
  "system.ai.chat.title.runtime": "執行明細",
488
489
  "system.ai.chat.title.recent_conversations": "最近對話",
490
+ "system.ai.chat.title.assistant": "AI 助手",
489
491
  "system.ai.chat.field.input_tokens": "輸入",
490
492
  "system.ai.chat.field.output_tokens": "輸出",
491
493
  "system.ai.chat.field.cache_tokens": "快取讀取",
@@ -910,7 +912,12 @@
910
912
  "system.ops_monitoring.error_rate": "錯誤率",
911
913
  "system.ops_monitoring.status.label": "狀態",
912
914
  "system.ops_monitoring.instance_resources": "執行個體資源",
913
- "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": "總計",
914
921
  "system.ops_monitoring.instance_count": "{count} 個執行個體",
915
922
  "system.ops_monitoring.alert_events": "告警事件",
916
923
  "system.ops_monitoring.alert_attention": "視窗內失敗請求,需要運維關注的事件",
@@ -929,5 +936,29 @@
929
936
  "system.ops_monitoring.kpi.p95_latency": "P95 延遲",
930
937
  "system.ops_monitoring.kpi.error_rate": "錯誤率",
931
938
  "system.ops_monitoring.kpi.availability": "可用性",
932
- "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": "日誌檔案下載已開始"
933
964
  }
@@ -8,10 +8,20 @@
8
8
 
9
9
  /** 状态 */
10
10
  export enum Status {
11
- /** UNKNOWN - 未知状态 */
12
- UNKNOWN = 0,
13
- /** ENABLE - 启用 */
14
- ENABLE = 1,
15
- /** DISABLE - 禁用 */
16
- DISABLE = 2,
11
+ /** STATUS_UNSPECIFIED - 未知状态 */
12
+ STATUS_UNSPECIFIED = 0,
13
+ /** STATUS_ENABLE - 启用 */
14
+ STATUS_ENABLE = 1,
15
+ /** STATUS_DISABLE - 禁用 */
16
+ STATUS_DISABLE = 2,
17
+ }
18
+
19
+ /** 定时任务日志状态 */
20
+ export enum BaseJobLogStatus {
21
+ /** BASE_JOB_LOG_STATUS_UNSPECIFIED - 未指定定时任务日志状态 */
22
+ BASE_JOB_LOG_STATUS_UNSPECIFIED = 0,
23
+ /** BASE_JOB_LOG_STATUS_SUCCESS - 成功 */
24
+ BASE_JOB_LOG_STATUS_SUCCESS = 1,
25
+ /** BASE_JOB_LOG_STATUS_FAIL - 失败 */
26
+ BASE_JOB_LOG_STATUS_FAIL = 2,
17
27
  }
@@ -208,7 +208,7 @@ export interface OptionOpenApiServiceRequest {
208
208
 
209
209
  /** OpenAPI业务服务选项响应 */
210
210
  export interface OptionOpenApiServiceResponse {
211
- /** OpenAPI文档选项列表 */
211
+ /** OpenAPI文档列表 */
212
212
  list: OpenApiServiceOption[];
213
213
  }
214
214
 
@@ -218,6 +218,16 @@ export interface OpenApiServiceOption {
218
218
  key: string;
219
219
  /** OpenAPI文档名称 */
220
220
  name: string;
221
+ /** OpenAPI接口列表 */
222
+ operations: OpenApiServiceOperation[];
223
+ }
224
+
225
+ /** OpenAPI业务服务接口 */
226
+ export interface OpenApiServiceOperation {
227
+ /** HTTP请求路径 */
228
+ path: string;
229
+ /** HTTP请求方法 */
230
+ method: string;
221
231
  }
222
232
 
223
233
  /** AdminAPI服务 */
@@ -8,7 +8,7 @@
8
8
  import type { BaseConfigSite } from "../../../base/v1/config";
9
9
  import type { Status } from "../../../common/v1/enum";
10
10
  import type { Empty } from "../../../google/protobuf/empty";
11
- import type { BaseTranslation } from "./base_translation";
11
+ import type { BaseI18n } from "./base_i18n";
12
12
 
13
13
  /** 系统配置类型。 */
14
14
  export enum BaseConfigType {
@@ -83,9 +83,9 @@ export interface BaseConfigForm {
83
83
  /** 配置value */
84
84
  value: string;
85
85
  /** 配置名称多语言翻 */
86
- name_translations: BaseTranslation[];
86
+ name_translations: BaseI18n[];
87
87
  /** 配置value文本/富文本配置值的多语言翻译 */
88
- value_translations: BaseTranslation[];
88
+ value_translations: 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: BaseTranslation[];
144
+ translations: BaseI18n[];
145
145
  }
146
146
 
147
147
  /** Admin系统配置服务 */
@@ -7,7 +7,7 @@
7
7
  /* eslint-disable */
8
8
  import type { Status } from "../../../common/v1/enum";
9
9
  import type { Empty } from "../../../google/protobuf/empty";
10
- import type { BaseTranslation } from "./base_translation";
10
+ import type { BaseI18n } from "./base_i18n";
11
11
 
12
12
  /** 字典选项查询条件 */
13
13
  export interface OptionBaseDictRequest {
@@ -102,7 +102,7 @@ export interface BaseDictForm {
102
102
  /** 字典名称 */
103
103
  name: string;
104
104
  /** 非主语言翻译 */
105
- translations: BaseTranslation[];
105
+ translations: 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: BaseTranslation[];
131
+ translations: 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: BaseTranslation[];
203
+ translations: 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: BaseTranslation[];
227
+ translations: BaseI18n[];
228
228
  }
229
229
 
230
230
  /** Admin字典服务 */
@@ -2,12 +2,12 @@
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.11.8
4
4
  // protoc unknown
5
- // source: system/admin/v1/base_translation.proto
5
+ // source: system/admin/v1/base_i18n.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import type { Empty } from "../../../google/protobuf/empty";
9
9
 
10
- /** 统一翻译表目标类型,和 base_translation.target_type 的值一一对应。 */
10
+ /** 统一翻译表目标类型,和 base_i18n.target_type 的值一一对应。 */
11
11
  export enum TranslationTargetType {
12
12
  /** TRANSLATION_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
13
13
  TRANSLATION_TARGET_TYPE_UNSPECIFIED = 0,
@@ -60,7 +60,7 @@ export interface UpdateBaseTranslationRequest {
60
60
  }
61
61
 
62
62
  /** 国际化翻译信息 */
63
- export interface BaseTranslation {
63
+ export interface BaseI18n {
64
64
  /** 翻译记录ID */
65
65
  id: number;
66
66
  /** 翻译目标类型 */
@@ -82,7 +82,7 @@ export interface CodeGenLocaleConfig {
82
82
  }
83
83
 
84
84
  /** 国际化翻译信息服务。 */
85
- export interface BaseTranslationService {
85
+ export interface BaseI18nService {
86
86
  /** 翻译单个文本。 */
87
87
  DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse>;
88
88
  /** 修改国际化翻译信息 */
@@ -8,7 +8,7 @@
8
8
  import type { TreeOptionResponse } from "../../../common/v1/common";
9
9
  import type { Status } from "../../../common/v1/enum";
10
10
  import type { Empty } from "../../../google/protobuf/empty";
11
- import type { BaseTranslation } from "./base_translation";
11
+ import type { BaseI18n } from "./base_i18n";
12
12
  import type { BaseMenuType } from "./common";
13
13
 
14
14
  /** 菜单选项查询条件 */
@@ -72,7 +72,7 @@ export interface BaseMenuForm {
72
72
  /** 分配的API列表 */
73
73
  api: string[];
74
74
  /** 非主语言翻译 */
75
- translations: BaseTranslation[];
75
+ translations: 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: BaseTranslation[];
141
+ translations: BaseI18n[];
142
142
  }
143
143
 
144
144
  /** 菜单元信息 */
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* eslint-disable */
8
8
  import type { Empty } from "../../../google/protobuf/empty";
9
- import type { CodeGenLocaleConfig } from "./base_translation";
9
+ import type { CodeGenLocaleConfig } from "./base_i18n";
10
10
 
11
11
  /** 代码生成字段配置查询条件 */
12
12
  export interface ListCodeGenColumnRequest {
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* eslint-disable */
8
8
  import type { Empty } from "../../../google/protobuf/empty";
9
- import type { CodeGenLocaleConfig } from "./base_translation";
9
+ import type { CodeGenLocaleConfig } from "./base_i18n";
10
10
 
11
11
  /** 代码生成表状态。 */
12
12
  export enum CodeGenTableStatus {
@@ -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,8 +68,12 @@ 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;
75
+ /** Markdown文件更新时间,RFC3339格式 */
76
+ updated_at: string;
71
77
  }
72
78
 
73
79
  /** 项目文档服务 */
@@ -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
+ }
@@ -15,6 +15,7 @@ import type { AiStreamPayload, AIFlowBlock, ChatMessageItem, ReplySourceTag } fr
15
15
  const THINKING_MESSAGE_ID_PREFIX = "ai-thinking";
16
16
  const LOCAL_USER_MESSAGE_ID_PREFIX = "ai-user-local";
17
17
  const PENDING_STREAM_MESSAGE_ID = "pending";
18
+ const DEFAULT_SESSION_TITLES = new Set(["新对话", "新對話", "New conversation"]);
18
19
  const thinkingMessageContent = () => t("system.ai.chat.message.thinking");
19
20
 
20
21
  /** 生成流式消息分组键,确保同一轮回复只更新当前占位气泡。 */
@@ -44,13 +45,22 @@ export function resolveTimestamp(timestamp?: { seconds?: number; nanos?: number
44
45
  export function normalizeSession(session?: Partial<AiSession> | null): AiSession {
45
46
  return {
46
47
  id: String(session?.id ?? ""),
47
- title: String(session?.title ?? t("system.ai.chat.value.new_conversation")),
48
- summary: String(session?.summary ?? ""),
48
+ title: resolveSessionText(session?.title, true),
49
+ summary: resolveSessionText(session?.summary, false),
49
50
  updated_at: session?.updated_at,
50
51
  terminal: Number(session?.terminal ?? Terminal.TERMINAL_ADMIN)
51
52
  };
52
53
  }
53
54
 
55
+ /** 将服务端生成的默认会话文案切换到当前语言,兼容历史数据。 */
56
+ function resolveSessionText(value: unknown, fallbackWhenEmpty: boolean) {
57
+ const text = String(value ?? "");
58
+ if ((fallbackWhenEmpty && !text) || DEFAULT_SESSION_TITLES.has(text)) {
59
+ return t("system.ai.chat.value.new_conversation");
60
+ }
61
+ return text;
62
+ }
63
+
54
64
  /** 将会话列表收敛成可安全渲染的数组。 */
55
65
  export function normalizeSessionList(list?: AiSession[] | null) {
56
66
  if (!Array.isArray(list)) return [];
@@ -172,8 +172,8 @@ const editForm = reactive({
172
172
  id: 0,
173
173
  tool_name: "",
174
174
  tool_prompts: [] as string[],
175
- mcp_status: Status.ENABLE,
176
- agent_status: Status.ENABLE
175
+ mcp_status: Status.STATUS_ENABLE,
176
+ agent_status: Status.STATUS_ENABLE
177
177
  });
178
178
 
179
179
  const requestBodyRows = computed(() => schemaRows(detailDoc.value?.request_body));
@@ -202,8 +202,8 @@ const editFields = computed<ProFormField[]>(() => [
202
202
  label: t("system.base.api.field.mcp_status"),
203
203
  component: "switch",
204
204
  props: {
205
- activeValue: Status.ENABLE,
206
- inactiveValue: Status.DISABLE,
205
+ activeValue: Status.STATUS_ENABLE,
206
+ inactiveValue: Status.STATUS_DISABLE,
207
207
  activeText: t("common.status.enabled"),
208
208
  inactiveText: t("common.status.disabled")
209
209
  }
@@ -213,8 +213,8 @@ const editFields = computed<ProFormField[]>(() => [
213
213
  label: t("system.base.api.field.agent_status"),
214
214
  component: "switch",
215
215
  props: {
216
- activeValue: Status.ENABLE,
217
- inactiveValue: Status.DISABLE,
216
+ activeValue: Status.STATUS_ENABLE,
217
+ inactiveValue: Status.STATUS_DISABLE,
218
218
  activeText: t("common.status.enabled"),
219
219
  inactiveText: t("common.status.disabled")
220
220
  }
@@ -222,8 +222,8 @@ const editFields = computed<ProFormField[]>(() => [
222
222
  ]);
223
223
 
224
224
  const statusOptions = computed(() => [
225
- { label: t("common.status.enabled"), value: Status.ENABLE },
226
- { label: t("common.status.disabled"), value: Status.DISABLE }
225
+ { label: t("common.status.enabled"), value: Status.STATUS_ENABLE },
226
+ { label: t("common.status.disabled"), value: Status.STATUS_DISABLE }
227
227
  ]);
228
228
 
229
229
  /** API 表格列配置。 */
@@ -250,8 +250,8 @@ const columns = computed<ColumnProps[]>(() => [
250
250
  search: { el: "select" },
251
251
  cellType: "status",
252
252
  statusProps: {
253
- activeValue: Status.ENABLE,
254
- inactiveValue: Status.DISABLE,
253
+ activeValue: Status.STATUS_ENABLE,
254
+ inactiveValue: Status.STATUS_DISABLE,
255
255
  activeText: t("common.status.enabled"),
256
256
  inactiveText: t("common.status.disabled"),
257
257
  disabled: () => !BUTTONS.value["base:api:mcp-status"],
@@ -266,8 +266,8 @@ const columns = computed<ColumnProps[]>(() => [
266
266
  search: { el: "select" },
267
267
  cellType: "status",
268
268
  statusProps: {
269
- activeValue: Status.ENABLE,
270
- inactiveValue: Status.DISABLE,
269
+ activeValue: Status.STATUS_ENABLE,
270
+ inactiveValue: Status.STATUS_DISABLE,
271
271
  activeText: t("common.status.enabled"),
272
272
  inactiveText: t("common.status.disabled"),
273
273
  disabled: () => !BUTTONS.value["base:api:agent-status"],
@@ -358,8 +358,8 @@ function handleCloseEditDialog() {
358
358
  editForm.id = 0;
359
359
  editForm.tool_name = "";
360
360
  editForm.tool_prompts = [];
361
- editForm.mcp_status = Status.ENABLE;
362
- editForm.agent_status = Status.ENABLE;
361
+ editForm.mcp_status = Status.STATUS_ENABLE;
362
+ editForm.agent_status = Status.STATUS_ENABLE;
363
363
  editDialogRef.value?.clearValidate();
364
364
  }
365
365
 
@@ -383,8 +383,8 @@ async function handleSubmitEdit() {
383
383
  * MCP 工具状态切换前进行二次确认,并调用状态接口完成持久化。
384
384
  */
385
385
  async function handleBeforeSetMcpStatus(row: BaseApi) {
386
- const nextStatus = row.mcp_status === Status.ENABLE ? Status.DISABLE : Status.ENABLE;
387
- const action = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
386
+ const nextStatus = row.mcp_status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE;
387
+ const action = t(nextStatus === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled");
388
388
  const apiName = row.desc || row.operation || `ID:${row.id}`;
389
389
  try {
390
390
  await ElMessageBox.confirm(t("system.base.api.message.confirm_mcp_status", { action, api: apiName }), t("common.title.notice"), {
@@ -405,8 +405,8 @@ async function handleBeforeSetMcpStatus(row: BaseApi) {
405
405
  * Agent 工具状态切换前进行二次确认,并调用状态接口完成持久化。
406
406
  */
407
407
  async function handleBeforeSetAgentStatus(row: BaseApi) {
408
- const nextStatus = row.agent_status === Status.ENABLE ? Status.DISABLE : Status.ENABLE;
409
- const action = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
408
+ const nextStatus = row.agent_status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE;
409
+ const action = t(nextStatus === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled");
410
410
  const apiName = row.desc || row.operation || `ID:${row.id}`;
411
411
  try {
412
412
  await ElMessageBox.confirm(t("system.base.api.message.confirm_agent_status", { action, api: apiName }), t("common.title.notice"), {
@@ -435,8 +435,8 @@ function formatToolPrompts(prompts: string[]) {
435
435
  * 格式化 API 工具状态。
436
436
  */
437
437
  function formatStatus(status: Status) {
438
- if (status === Status.ENABLE) return t("common.status.enabled");
439
- if (status === Status.DISABLE) return t("common.status.disabled");
438
+ if (status === Status.STATUS_ENABLE) return t("common.status.enabled");
439
+ if (status === Status.STATUS_DISABLE) return t("common.status.disabled");
440
440
  return t("common.value.unknown");
441
441
  }
442
442