@liujitcn/kratos-admin-system 0.0.93 → 0.0.95

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.
@@ -140,6 +140,8 @@ export interface OpsServiceStatus {
140
140
  message: string;
141
141
  /** 探测耗时,单位毫秒 */
142
142
  latency_ms: number;
143
+ /** 服务运行指标 */
144
+ metrics: OpsMetric[];
143
145
  }
144
146
  /** 数据存储状态。 */
145
147
  export interface OpsStorage {
@@ -106,6 +106,11 @@ export function useTenantProjectScope(options: TenantProjectScopeOptions = {}):
106
106
  return result;
107
107
  }
108
108
 
109
+ // SearchFormItem 会把 v-model 的 onUpdate 处理器透传给函数式渲染组件并合并触发,原始选择对象会覆盖
110
+ // 下方回调写入的字符串值,导致选中后回显 [object Object],这里固定单一渲染入口并关闭 attrs 透传。
111
+ const renderScopeSearch = (scope: SearchRenderScope) => renderTenantProjectSearch(scope, loadOptions, treeOptions, allLabel.value);
112
+ (renderScopeSearch as unknown as { inheritAttrs?: boolean }).inheritAttrs = false;
113
+
109
114
  const column = computed<ColumnProps>(() => ({
110
115
  prop: options.projectField ?? "project_id",
111
116
  label: scopeLabel.value,
@@ -120,7 +125,7 @@ export function useTenantProjectScope(options: TenantProjectScopeOptions = {}):
120
125
  search: {
121
126
  key: options.searchKey ?? "tenant_project_tree_value",
122
127
  order: options.order ?? 1,
123
- render: (scope: SearchRenderScope) => renderTenantProjectSearch(scope, loadOptions, treeOptions, allLabel.value)
128
+ render: renderScopeSearch
124
129
  },
125
130
  enum: async () => ({ data: await loadOptions() }),
126
131
  isFilterEnum: false
@@ -166,6 +166,8 @@ export interface OpsServiceStatus {
166
166
  message: string;
167
167
  /** 探测耗时,单位毫秒 */
168
168
  latency_ms: number;
169
+ /** 服务运行指标 */
170
+ metrics: OpsMetric[];
169
171
  }
170
172
 
171
173
  /** 数据存储状态。 */
@@ -96,8 +96,15 @@
96
96
  </template>
97
97
  <div class="ops-summary-list">
98
98
  <div v-for="item in availabilityItems" :key="item.label" class="ops-summary-row">
99
- <span>{{ item.label }}</span>
100
- <strong :class="`is-${item.tone}`"><i />{{ item.value }}</strong>
99
+ <div class="ops-summary-main">
100
+ <span>{{ item.label }}</span>
101
+ <strong :class="`is-${item.tone}`"><i />{{ item.value }}</strong>
102
+ </div>
103
+ <div v-if="item.metrics.length" class="ops-summary-metrics">
104
+ <span v-for="metric in item.metrics" :key="metric.label">
105
+ <b>{{ metric.label }}</b><em>{{ metric.value }}</em>
106
+ </span>
107
+ </div>
101
108
  </div>
102
109
  </div>
103
110
  </el-card>
@@ -229,6 +236,7 @@ import type {
229
236
  OpsNode,
230
237
  OpsAlertsResponse,
231
238
  OpsEndpointsResponse,
239
+ OpsMetric,
232
240
  OpsServicesResponse,
233
241
  OpsStorage,
234
242
  OpsStorageResponse,
@@ -333,6 +341,8 @@ interface AvailabilityItem {
333
341
  value: string;
334
342
  /** 状态颜色。 */
335
343
  tone: "ok" | "warn";
344
+ /** 服务运行指标。 */
345
+ metrics: OpsMetric[];
336
346
  }
337
347
 
338
348
  const loading = ref(false);
@@ -442,7 +452,8 @@ const availabilityItems = computed<AvailabilityItem[]>(() =>
442
452
  (services.value?.services ?? []).map(service => ({
443
453
  label: service.name,
444
454
  value: translateStatus(service.status),
445
- tone: isNormalStatus(service.status) ? "ok" : "warn"
455
+ tone: isNormalStatus(service.status) ? "ok" : "warn",
456
+ metrics: service.metrics ?? []
446
457
  }))
447
458
  );
448
459
 
@@ -916,11 +927,10 @@ onBeforeUnmount(stopMonitoring);
916
927
  margin-top: 5px;
917
928
  }
918
929
  .ops-summary-row {
919
- display: flex;
920
- gap: 10px;
921
- align-items: center;
922
- justify-content: space-between;
930
+ display: grid;
931
+ gap: 6px;
923
932
  min-height: 40px;
933
+ padding: 9px 0;
924
934
  font-size: 12px;
925
935
  color: var(--ops-text-secondary);
926
936
  border-bottom: 1px solid var(--el-border-color-lighter);
@@ -947,6 +957,30 @@ onBeforeUnmount(stopMonitoring);
947
957
  .ops-summary-row strong.is-warn {
948
958
  color: var(--el-color-warning);
949
959
  }
960
+ .ops-summary-main {
961
+ display: flex;
962
+ gap: 10px;
963
+ align-items: center;
964
+ justify-content: space-between;
965
+ }
966
+ .ops-summary-metrics {
967
+ display: flex;
968
+ flex-wrap: wrap;
969
+ gap: 4px 12px;
970
+ color: var(--ops-text-placeholder);
971
+ font-size: 11px;
972
+ }
973
+ .ops-summary-metrics span {
974
+ display: inline-flex;
975
+ gap: 4px;
976
+ }
977
+ .ops-summary-metrics b {
978
+ font-weight: 500;
979
+ }
980
+ .ops-summary-metrics em {
981
+ font-style: normal;
982
+ color: var(--ops-text-secondary);
983
+ }
950
984
  .ops-storage-section {
951
985
  margin-bottom: 10px;
952
986
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@liujitcn/kratos-admin-system",
3
3
  "private": false,
4
- "version": "0.0.93",
4
+ "version": "0.0.95",
5
5
  "type": "module",
6
6
  "description": "kratos-admin system management module",
7
7
  "license": "MIT",
@@ -16,7 +16,7 @@
16
16
  "sortablejs": "^1.15.2",
17
17
  "swagger-ui-dist": "^5.32.15",
18
18
  "vue-element-plus-x": "^2.0.3",
19
- "@liujitcn/kratos-admin-core": "0.0.93"
19
+ "@liujitcn/kratos-admin-core": "0.0.95"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@element-plus/icons-vue": "^2.3.1",