dashboard-shell-shell 3.0.5-test.9 → 3.0.5-tsh.2

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 (164) hide show
  1. package/assets/brand/csp/favicon.png +0 -0
  2. package/assets/icons/iconfont.css +4 -1
  3. package/assets/images/pl/dark/logo.png +0 -0
  4. package/assets/styles/all.scss +23 -3
  5. package/assets/styles/base/_variables.scss +2 -2
  6. package/assets/styles/fonts/_icons.scss +3 -2
  7. package/assets/styles/global/_button.scss +1 -1
  8. package/assets/styles/global/_form.scss +1 -0
  9. package/assets/styles/global/_select.scss +1 -1
  10. package/assets/styles/global/_tooltip.scss +5 -1
  11. package/assets/styles/themes/_light.scss +3 -3
  12. package/assets/styles/vendor/vue-select.scss +2 -1
  13. package/assets/translations/en-us.yaml +60 -0
  14. package/assets/translations/zh-hans.yaml +164 -21
  15. package/components/ButtonDropdown.vue +3 -1
  16. package/components/ClusterIconMenu.vue +1 -1
  17. package/components/CodeMirror.vue +6 -4
  18. package/components/ConsumptionGauge.vue +1 -1
  19. package/components/ContainerResourceLimit.vue +2 -2
  20. package/components/CruResource.vue +3 -2
  21. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -19
  22. package/components/Drawer/ResourceDetailDrawer/index.vue +3 -3
  23. package/components/ExplorerMembers.vue +10 -1
  24. package/components/GlobalRoleBindings.vue +52 -112
  25. package/components/PodSecurityAdmission.vue +1 -1
  26. package/components/PromptRemove.vue +23 -1
  27. package/components/RelatedResources.vue +3 -0
  28. package/components/Resource/Detail/TitleBar/composables.ts +16 -1
  29. package/components/Resource/Detail/TitleBar/index.vue +37 -24
  30. package/components/ResourceDetail/Masthead/index.vue +1 -1
  31. package/components/ResourceDetail/Masthead/latest.vue +1 -1
  32. package/components/ResourceDetail/Masthead/legacy.vue +8 -7
  33. package/components/ResourceDetail/legacy.vue +15 -15
  34. package/components/ResourceList/Masthead.vue +11 -15
  35. package/components/ResourceTable.vue +16 -0
  36. package/components/SideNav.vue +21 -21
  37. package/components/SingleClusterInfo.vue +2 -1
  38. package/components/SortableTable/THead.vue +46 -1
  39. package/components/SortableTable/index.vue +54 -18
  40. package/components/Tabbed/index.vue +6 -1
  41. package/components/auth/Principal.vue +16 -8
  42. package/components/auth/RoleDetailEdit.vue +11 -7
  43. package/components/breadcrumb/index.vue +13 -210
  44. package/components/form/ArrayList.vue +164 -147
  45. package/components/form/ArrayListGrouped.vue +5 -3
  46. package/components/form/ChangePassword.vue +1 -1
  47. package/components/form/ClusterAppearance.vue +4 -3
  48. package/components/form/Command.vue +4 -5
  49. package/components/form/Conditions.vue +15 -1
  50. package/components/form/Footer.vue +1 -0
  51. package/components/form/HealthCheck.vue +0 -2
  52. package/components/form/HookOption.vue +87 -58
  53. package/components/form/InputWithSelect.vue +8 -7
  54. package/components/form/KeyValue.vue +20 -2
  55. package/components/form/LabeledSelect.vue +3 -1
  56. package/components/form/Labels.vue +2 -2
  57. package/components/form/MatchExpressions.vue +4 -4
  58. package/components/form/Members/ClusterMembershipEditor.vue +1 -1
  59. package/components/form/Members/ClusterPermissionsEditor.vue +31 -28
  60. package/components/form/Members/MembershipEditor.vue +3 -3
  61. package/components/form/Members/ProjectMembershipEditor.vue +1 -1
  62. package/components/form/NameNsDescription.vue +4 -2
  63. package/components/form/Networking.vue +6 -9
  64. package/components/form/NodeAffinity.vue +29 -28
  65. package/components/form/PodAffinity.vue +23 -23
  66. package/components/form/Probe.vue +15 -11
  67. package/components/form/ProjectMemberEditor.vue +28 -25
  68. package/components/form/ResourceQuota/Namespace.vue +4 -4
  69. package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
  70. package/components/form/ResourceQuota/Project.vue +4 -4
  71. package/components/form/ResourceQuota/ProjectRow.vue +36 -30
  72. package/components/form/ResourceSelector.vue +1 -1
  73. package/components/form/Security.vue +1 -3
  74. package/components/form/Select.vue +7 -1
  75. package/components/form/ServiceNameSelect.vue +2 -5
  76. package/components/form/ServicePorts.vue +149 -75
  77. package/components/form/Tolerations.vue +13 -9
  78. package/components/form/ValueFromResource.vue +110 -96
  79. package/components/formatter/WorkloadHealthScale.vue +4 -3
  80. package/components/nav/Group.vue +6 -0
  81. package/components/nav/Header.vue +17 -137
  82. package/components/nav/NamespaceFilter.vue +14 -19
  83. package/components/nav/TopLevelMenu.vue +99 -125
  84. package/components/nav/Type.vue +11 -3
  85. package/config/menuRouteMap.js +10 -0
  86. package/config/product/explorer.js +32 -10
  87. package/config/product/manager.js +28 -17
  88. package/config/router/navigation-guards/index.js +61 -3
  89. package/detail/node.vue +28 -23
  90. package/dialog/AddCustomBadgeDialog.vue +17 -9
  91. package/dialog/RollbackWorkloadDialog.vue +1 -1
  92. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
  93. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
  94. package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
  95. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
  96. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
  97. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
  98. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
  99. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
  100. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
  101. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
  102. package/edit/configmap.vue +4 -0
  103. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +32 -8
  104. package/edit/monitoring.coreos.com.alertmanagerconfig/types/dingding.vue +32 -0
  105. package/edit/monitoring.coreos.com.alertmanagerconfig/types/message.vue +52 -0
  106. package/edit/monitoring.coreos.com.alertmanagerconfig/types/snmp.vue +45 -0
  107. package/edit/monitoring.coreos.com.alertmanagerconfig/types/work.vue +31 -0
  108. package/edit/networking.k8s.io.ingress/Certificate.vue +14 -5
  109. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  110. package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
  111. package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
  112. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
  113. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
  114. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
  115. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  116. package/edit/persistentvolume/index.vue +3 -1
  117. package/edit/persistentvolumeclaim.vue +2 -0
  118. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -1
  119. package/edit/secret/index.vue +2 -2
  120. package/edit/service.vue +4 -1
  121. package/edit/storage.k8s.io.storageclass/index.vue +10 -8
  122. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
  123. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
  124. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
  125. package/edit/workload/Job.vue +31 -34
  126. package/edit/workload/Upgrading.vue +5 -5
  127. package/edit/workload/index.vue +19 -15
  128. package/edit/workload/storage/Mount.vue +1 -0
  129. package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
  130. package/edit/workload/storage/azureDisk.vue +14 -10
  131. package/edit/workload/storage/azureFile.vue +9 -7
  132. package/edit/workload/storage/csi/index.vue +6 -9
  133. package/edit/workload/storage/emptyDir.vue +7 -5
  134. package/edit/workload/storage/gcePersistentDisk.vue +9 -7
  135. package/edit/workload/storage/hostPath.vue +7 -5
  136. package/edit/workload/storage/nfs.vue +8 -6
  137. package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
  138. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
  139. package/edit/workload/storage/secret.vue +9 -6
  140. package/edit/workload/storage/vsphereVolume.vue +11 -7
  141. package/initialize/app-extended.js +7 -1
  142. package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +8 -6
  143. package/mixins/create-edit-view/impl.js +10 -0
  144. package/models/provisioning.cattle.io.cluster.js +19 -18
  145. package/models/workload.js +2 -2
  146. package/package.json +1 -1
  147. package/pages/account/index.vue +93 -58
  148. package/pages/auth/login.vue +1 -1
  149. package/pages/auth/setup.vue +36 -17
  150. package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
  151. package/pages/c/_cluster/explorer/index.vue +2 -1
  152. package/pages/c/_cluster/explorer/tools/index.vue +6 -6
  153. package/pages/home.vue +55 -13
  154. package/plugins/dashboard-store/actions.js +1 -1
  155. package/rancher-components/Banner/Banner.vue +14 -2
  156. package/rancher-components/Form/Radio/RadioGroup.vue +9 -1
  157. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
  158. package/scripts/build-pkg.sh +18 -23
  159. package/scripts/publish-shell.sh +1 -1
  160. package/store/i18n.js +1 -0
  161. package/store/type-map.js +0 -2
  162. package/utils/error.js +23 -3
  163. package/utils/errorTranslate.json +377 -8
  164. package/utils/errorTranslateNew.json +39 -0
@@ -67,16 +67,37 @@ export function init(store) {
67
67
  }
68
68
  });
69
69
 
70
+ const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS')
71
+
70
72
  basicType(['cluster-dashboard', 'cluster-tools']);
71
- basicType([
72
- 'cluster-dashboard',
73
- 'projects-namespaces',
74
- 'namespaces',
75
- NODE,
76
- VIRTUAL_TYPES.CLUSTER_MEMBERS,
77
- EVENT,
78
- 'c-cluster-explorer-tools'
79
- ], 'cluster');
73
+
74
+ if (topLevelPermissions && topLevelPermissions === 'superadmin') {
75
+ basicType([
76
+ 'cluster-dashboard',
77
+ 'projects-namespaces',
78
+ 'namespaces',
79
+ 'namespace',
80
+ NODE,
81
+ VIRTUAL_TYPES.CLUSTER_MEMBERS,
82
+ EVENT,
83
+ 'c-cluster-explorer-tools',
84
+ 'management.cattle.io.project',
85
+ 'management.cattle.io.clusterroletemplatebinding'
86
+ ], 'cluster');
87
+ } else {
88
+ basicType([
89
+ 'cluster-dashboard',
90
+ 'projects-namespaces',
91
+ 'namespaces',
92
+ 'namespace',
93
+ NODE,
94
+ VIRTUAL_TYPES.CLUSTER_MEMBERS,
95
+ EVENT,
96
+ 'management.cattle.io.project',
97
+ 'management.cattle.io.clusterroletemplatebinding'
98
+ ], 'cluster');
99
+ }
100
+
80
101
  basicType([
81
102
  LIMIT_RANGE,
82
103
  NETWORK_POLICY,
@@ -95,6 +116,7 @@ export function init(store) {
95
116
  STORAGE_CLASS,
96
117
  SECRET,
97
118
  VIRTUAL_TYPES.PROJECT_SECRETS,
119
+ VIRTUAL_TYPES.NAMESPACES,
98
120
  CONFIG_MAP
99
121
  ], 'storage');
100
122
  basicType([
@@ -633,7 +655,7 @@ export function init(store) {
633
655
  virtualType({
634
656
  label: store.getters['i18n/t'](`typeLabel.${ VIRTUAL_TYPES.PROJECT_SECRETS }`, { count: 2 }),
635
657
  group: 'storage',
636
- icon: 'globe',
658
+ icon: 'default',
637
659
  namespaced: false,
638
660
  ifRancherCluster: true,
639
661
  name: VIRTUAL_TYPES.PROJECT_SECRETS,
@@ -13,6 +13,7 @@ import { DSL } from '@shell/store/type-map';
13
13
  import { BLANK_CLUSTER } from '@shell/store/store-types.js';
14
14
 
15
15
  export const NAME = 'manager';
16
+ const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS')
16
17
 
17
18
  export function init(store) {
18
19
  const {
@@ -60,11 +61,17 @@ export function init(store) {
60
61
  route: { name: 'c-cluster-manager-cloudCredential' },
61
62
  });
62
63
 
63
- basicType([
64
- CAPI.RANCHER_CLUSTER,
65
- 'cloud-credentials',
66
- 'drivers',
67
- ]);
64
+ if (topLevelPermissions && topLevelPermissions === 'superadmin') {
65
+ basicType([
66
+ CAPI.RANCHER_CLUSTER,
67
+ 'cloud-credentials',
68
+ 'drivers',
69
+ ]);
70
+ } else {
71
+ basicType([
72
+ CAPI.RANCHER_CLUSTER,
73
+ ]);
74
+ }
68
75
 
69
76
  configureType(SNAPSHOT, { depaginate: true });
70
77
 
@@ -111,10 +118,12 @@ export function init(store) {
111
118
  exact: true
112
119
  });
113
120
 
114
- basicType([
115
- 'rke-kontainer-drivers',
116
- 'rke-node-drivers',
117
- ], 'drivers');
121
+ if (topLevelPermissions && topLevelPermissions === 'superadmin') {
122
+ basicType([
123
+ 'rke-kontainer-drivers',
124
+ 'rke-node-drivers',
125
+ ], 'drivers');
126
+ }
118
127
 
119
128
  weightType(CAPI.MACHINE_DEPLOYMENT, 4, true);
120
129
  weightType(CAPI.MACHINE_SET, 3, true);
@@ -123,14 +132,16 @@ export function init(store) {
123
132
  weightType(MANAGEMENT.PSA, 5, true);
124
133
  weightType(VIRTUAL_TYPES.JWT_AUTHENTICATION, 0, true);
125
134
 
126
- basicType([
127
- CAPI.MACHINE_DEPLOYMENT,
128
- CAPI.MACHINE_SET,
129
- CAPI.MACHINE,
130
- CATALOG.CLUSTER_REPO,
131
- MANAGEMENT.PSA,
132
- VIRTUAL_TYPES.JWT_AUTHENTICATION
133
- ], 'advanced');
135
+ if (topLevelPermissions && topLevelPermissions === 'superadmin') {
136
+ basicType([
137
+ CAPI.MACHINE_DEPLOYMENT,
138
+ CAPI.MACHINE_SET,
139
+ CAPI.MACHINE,
140
+ CATALOG.CLUSTER_REPO,
141
+ MANAGEMENT.PSA,
142
+ VIRTUAL_TYPES.JWT_AUTHENTICATION
143
+ ], 'advanced');
144
+ }
134
145
 
135
146
  weightGroup('advanced', -1, true);
136
147
 
@@ -11,13 +11,71 @@ import { install as installPageTitle } from '@shell/config/router/navigation-gua
11
11
  import { install as installServerUpgradeGrowl } from '@shell/config/router/navigation-guards/server-upgrade-growl';
12
12
 
13
13
  /**
14
- * Install our router navigation guards. i.e. router.beforeEach(), router.afterEach()
14
+ * Install router navigation guards
15
+ * 1. 保留原有导航守卫顺序
16
+ * 2. 不在 beforeEach 改 params,只在 push/replace & afterEach 改 URL
15
17
  */
16
18
  export function installNavigationGuards(router, context) {
17
- // NOTE: the order of the installation matters.
18
- // Be intentional when adding, removing or modifying the guards that are installed.
19
+ // 最早执行:保证进入逻辑时 params 始终是 harvester
20
+ router.beforeEach((to, from, next) => {
21
+ let changed = false;
22
+ const params = { ...to.params };
23
+
24
+ if (params?.product?.includes('cloud')) {
25
+ params.product = params.product.replace(/cloud/g, 'harvester');
26
+ changed = true;
27
+ }
28
+
29
+ if (params?.cluster?.includes('cloud')) {
30
+ params.cluster = params.cluster.replace(/cloud/g, 'harvester');
31
+ changed = true;
32
+ }
33
+
34
+ if (params?.resource?.includes('cloud')) {
35
+ params.resource = params.resource.replace(/cloud/g, 'harvester');
36
+ changed = true;
37
+ }
38
+
39
+ if (changed) {
40
+ // 触发路由重定向
41
+ return next({ ...to, params });
42
+ }
43
+
44
+ next();
45
+ });
46
+
19
47
 
20
48
  const navigationGuardInstallers = [installLoadInitialSettings, installAttemptFirstLogin, installAuthentication, installProducts, installClusters, installRuntimeExtensionRoute, installI18N, installHandleInstallRedirect, installPageTitle, installRecordLastRoute, installServerUpgradeGrowl];
21
49
 
22
50
  navigationGuardInstallers.forEach((installer) => installer(router, context));
51
+
52
+ // 🔹 最后执行:只改地址栏,不改内部
53
+ router.afterEach((to) => {
54
+ const base = router.options.history?.base || '';
55
+ const pathParts = to.path.split('/');
56
+
57
+ const newPathParts = pathParts.map((part) => {
58
+ // 只替换 cluster/product/resource 对应的 segment
59
+ for (const key of ['cluster', 'product', 'resource']) {
60
+ if (to.params[key] && to.params[key] === part) {
61
+ return part.replace(/harvester/g, 'cloud');
62
+ }
63
+ }
64
+ return part;
65
+ });
66
+
67
+ let cloudPath = newPathParts.join('/');
68
+ if (!cloudPath.startsWith(base)) {
69
+ cloudPath = base + cloudPath;
70
+ }
71
+
72
+ const currentLocation = window.location.pathname + window.location.search + window.location.hash;
73
+
74
+ if (cloudPath !== currentLocation) {
75
+ console.info('[URL Replace] Updating address bar:', currentLocation, '→', cloudPath);
76
+ window.history.replaceState({}, '', cloudPath);
77
+ }
78
+ });
79
+
23
80
  }
81
+
package/detail/node.vue CHANGED
@@ -196,28 +196,7 @@ export default {
196
196
  v-else
197
197
  class="node"
198
198
  >
199
- <div class="spacer" />
200
- <div class="alerts">
201
- <Alert
202
- class="mr-10"
203
- :status="pidPressureStatus"
204
- :message="t('node.detail.glance.pidPressure')"
205
- />
206
- <Alert
207
- class="mr-10"
208
- :status="diskPressureStatus"
209
- :message="t('node.detail.glance.diskPressure')"
210
- />
211
- <Alert
212
- class="mr-10"
213
- :status="memoryPressureStatus"
214
- :message="t('node.detail.glance.memoryPressure')"
215
- />
216
- <Alert
217
- :status="kubeletStatus"
218
- :message="t('node.detail.glance.kubelet')"
219
- />
220
- </div>
199
+ <div style="font-size: 14px;margin-bottom: 32px;">监控数据</div>
221
200
  <div class="mt-20 resources">
222
201
  <ConsumptionGauge
223
202
  :resource-name="t('node.detail.glance.consumptionGauge.cpu')"
@@ -237,7 +216,24 @@ export default {
237
216
  :used="value.podConsumed"
238
217
  />
239
218
  </div>
240
- <div class="spacer" />
219
+ <div class="alerts mt-10">
220
+ <Alert
221
+ :status="pidPressureStatus"
222
+ :message="t('node.detail.glance.pidPressure')"
223
+ />
224
+ <Alert
225
+ :status="diskPressureStatus"
226
+ :message="t('node.detail.glance.diskPressure')"
227
+ />
228
+ <Alert
229
+ :status="memoryPressureStatus"
230
+ :message="t('node.detail.glance.memoryPressure')"
231
+ />
232
+ <Alert
233
+ :status="kubeletStatus"
234
+ :message="t('node.detail.glance.kubelet')"
235
+ />
236
+ </div>
241
237
  <ResourceTabs
242
238
  :value="value"
243
239
  :mode="mode"
@@ -331,4 +327,13 @@ export default {
331
327
  width: 30%;
332
328
  }
333
329
  }
330
+ .alerts{
331
+ display: flex;
332
+ flex-wrap: wrap;
333
+ justify-content: space-between;
334
+ >div{
335
+ width: 30%;
336
+ margin-bottom: 10px;
337
+ }
338
+ }
334
339
  </style>
@@ -236,7 +236,7 @@ export default {
236
236
  <div class="badge-preview-header">
237
237
  <p> {{ t('clusterBadge.modal.previewHeader') }}</p>
238
238
  <div
239
- class="col span-12"
239
+ class="span-12"
240
240
  >
241
241
  <ClusterProviderIcon
242
242
  :cluster="{...previewCluster, badge: displayClusterPrevIcon}"
@@ -340,7 +340,7 @@ export default {
340
340
  display: flex;
341
341
  width: 100%;
342
342
  gap: 40px;
343
- padding: 10px 5px;
343
+ // padding: 10px 5px;
344
344
  margin-bottom: 30px;
345
345
  margin-top: 5px;
346
346
  background: var(--body-bg);
@@ -424,26 +424,34 @@ export default {
424
424
  }
425
425
 
426
426
  .badge-customisation {
427
- display: flex;
428
- gap: 10px;
427
+ // display: flex;
428
+ // gap: 10px;
429
429
 
430
- div {
430
+ >div {
431
431
  display: flex;
432
+ // align-items: flex-end;
433
+ margin-bottom: 30px;
432
434
  flex-direction: column;
433
- flex: 1;
434
- gap: 10px;
435
+ // flex: 1;
436
+ // gap: 10px;
435
437
 
436
438
  .color-input {
437
439
  display: flex;
438
440
  padding: 6px 10px;
439
441
  min-height: 61px;
440
442
  }
443
+
444
+ .checkbox-outer-container{
445
+ min-width: 160px;
446
+ margin-bottom: 10px;
447
+ // align-items: flex-start;
448
+ }
441
449
  }
442
450
 
443
451
  &-color {
444
452
  display: flex;
445
- flex-direction: column;
446
- gap: 10px;
453
+ // flex-direction: column;
454
+ // gap: 10px;
447
455
  }
448
456
  }
449
457
 
@@ -204,7 +204,7 @@ export default {
204
204
  >
205
205
  <template #title>
206
206
  <h4 class="text-default-text">
207
- {{ t('promptRollback.modalTitle', { workloadName }, true) }}
207
+ {{ t('promptRollback.modalTitle', { workloadName }) }}
208
208
  </h4>
209
209
  </template>
210
210
  <template #body>
@@ -41,7 +41,7 @@ export default {
41
41
 
42
42
  <template>
43
43
  <div>
44
- <div class="row mb-20">
44
+ <div class="row">
45
45
  <MetricTarget
46
46
  v-model:value="value.target"
47
47
  :mode="mode"
@@ -49,8 +49,8 @@ export default {
49
49
 
50
50
  <template>
51
51
  <div>
52
- <div class="row mb-20">
53
- <div class="col span-12">
52
+ <div class="row">
53
+ <div class="span-12">
54
54
  <ArrayListGrouped
55
55
  v-model:value="value.spec.behavior[type].policies"
56
56
  :add-label="t('hpa.scalingRule.addPolicy')"
@@ -59,7 +59,7 @@ export default {
59
59
  >
60
60
  <template #default="props">
61
61
  <div class="row">
62
- <div class="col span-4">
62
+ <div class="col">
63
63
  <LabeledSelect
64
64
  v-model:value="props.row.value.type"
65
65
  :mode="mode"
@@ -72,7 +72,9 @@ export default {
72
72
  :label="t('hpa.scalingRule.policy.type')"
73
73
  />
74
74
  </div>
75
- <div class="col span-4">
75
+ </div>
76
+ <div class="row">
77
+ <div class="col">
76
78
  <LabeledInput
77
79
  v-model:value.number="props.row.value.value"
78
80
  :mode="mode"
@@ -83,7 +85,9 @@ export default {
83
85
  :label="t('hpa.scalingRule.policy.value')"
84
86
  />
85
87
  </div>
86
- <div class="col span-4">
88
+ </div>
89
+ <div class="row">
90
+ <div class="col">
87
91
  <LabeledInput
88
92
  v-model:value.number="props.row.value.periodSeconds"
89
93
  :mode="mode"
@@ -125,6 +129,5 @@ export default {
125
129
  />
126
130
  </div>
127
131
  </div>
128
- <div class="row mb-40" />
129
132
  </div>
130
133
  </template>
@@ -215,7 +215,7 @@ export default {
215
215
  :label="t('hpa.tabs.target')"
216
216
  :weight="10"
217
217
  >
218
- <div class="row mb-20">
218
+ <div class="row">
219
219
  <div class="col span-6">
220
220
  <LabeledSelect
221
221
  v-model:value="value.spec.scaleTargetRef"
@@ -242,6 +242,8 @@ export default {
242
242
  type="number"
243
243
  />
244
244
  </div>
245
+ </div>
246
+ <div class="row">
245
247
  <div class="col span-6">
246
248
  <LabeledInput
247
249
  v-model:value.number="value.spec.maxReplicas"
@@ -51,8 +51,8 @@ export default {
51
51
 
52
52
  <template>
53
53
  <div class="col span-12">
54
- <div class="row mb-20">
55
- <div class="col span-6">
54
+ <div class="row">
55
+ <div class="col">
56
56
  <LabeledInput
57
57
  v-model:value="value.name"
58
58
  :mode="mode"
@@ -21,9 +21,9 @@ export default {
21
21
  </script>
22
22
 
23
23
  <template>
24
- <div class="col span-12">
25
- <div class="row mb-20">
26
- <div class="col span-6">
24
+ <div class="span-12">
25
+ <div class="row">
26
+ <div class="col">
27
27
  <LabeledInput
28
28
  v-model:value="value.apiVersion"
29
29
  :mode="mode"
@@ -33,7 +33,9 @@ export default {
33
33
  type="text"
34
34
  />
35
35
  </div>
36
- <div class="col span-6">
36
+ </div>
37
+ <div class="row">
38
+ <div class="col">
37
39
  <LabeledInput
38
40
  v-model:value="value.kind"
39
41
  :mode="mode"
@@ -45,7 +47,7 @@ export default {
45
47
  </div>
46
48
  </div>
47
49
  <div class="row">
48
- <div class="col span-6">
50
+ <div class="col">
49
51
  <LabeledInput
50
52
  v-model:value="value.name"
51
53
  :mode="mode"
@@ -149,7 +149,7 @@ export default {
149
149
  <template>
150
150
  <div class="metric-target">
151
151
  <div class="row">
152
- <div class="col span-6">
152
+ <div class="col">
153
153
  <LabeledSelect
154
154
  v-model:value="value.type"
155
155
  :mode="mode"
@@ -157,9 +157,11 @@ export default {
157
157
  :options="targetTypes"
158
158
  />
159
159
  </div>
160
+ </div>
161
+ <div class="row">
160
162
  <div
161
163
  v-if="isResourceMetricType"
162
- class="col span-6"
164
+ class="col"
163
165
  >
164
166
  <UnitInput
165
167
  v-if="value.type === 'Utilization'"
@@ -197,7 +199,7 @@ export default {
197
199
  </div>
198
200
  <div
199
201
  v-else
200
- class="col span-6"
202
+ class="col"
201
203
  >
202
204
  <LabeledInput
203
205
  v-model:value="quantity"
@@ -159,8 +159,8 @@ export default {
159
159
  :label="t('hpa.warnings.resource')"
160
160
  color="warning"
161
161
  />
162
- <div class="row mb-20">
163
- <div class="col span-6">
162
+ <div class="row">
163
+ <div class="col">
164
164
  <LabeledSelect
165
165
  v-model:value="value.type"
166
166
  :reduce="(val) => val.label"
@@ -48,14 +48,14 @@ export default {
48
48
 
49
49
  <template>
50
50
  <div>
51
- <div class="row mb-20">
51
+ <div class="row">
52
52
  <MetricTarget
53
53
  v-model:value="value.target"
54
54
  :mode="mode"
55
55
  metric-resource="object"
56
56
  />
57
57
  </div>
58
- <div class="row mb-20">
58
+ <div class="row">
59
59
  <MetricObjectReference
60
60
  v-model:value="value.describedObject"
61
61
  :mode="mode"
@@ -41,7 +41,7 @@ export default {
41
41
 
42
42
  <template>
43
43
  <div>
44
- <div class="row mb-20">
44
+ <div class="row">
45
45
  <MetricTarget
46
46
  v-model:value="value.target"
47
47
  :mode="mode"
@@ -43,8 +43,8 @@ export default {
43
43
 
44
44
  <template>
45
45
  <div class="resource-metric">
46
- <div class="row mb-20">
47
- <div class="col span-6">
46
+ <div class="row">
47
+ <div class="col">
48
48
  <LabeledSelect
49
49
  v-model:value="value.name"
50
50
  :mode="mode"
@@ -166,4 +166,8 @@ export default {
166
166
  .no-binary-data {
167
167
  opacity: 0.8;
168
168
  }
169
+
170
+ ::v-deep .CodeMirror-scroll {
171
+ min-height: auto;
172
+ }
169
173
  </style>
@@ -17,14 +17,38 @@ import { fetchAlertManagerConfigSpecs } from '@shell/utils/alertmanagerconfig';
17
17
  // i18n-uses monitoringReceiver.slack.*, monitoringReceiver.email.*, monitoringReceiver.pagerduty.*
18
18
  // i18n-uses monitoringReceiver.opsgenie.*, monitoringReceiver.webhook.*, monitoringReceiver.custom.*
19
19
  export const RECEIVERS_TYPES = [
20
- // {
21
- // name: 'slack',
22
- // label: 'monitoringReceiver.slack.label',
23
- // title: 'monitoringReceiver.slack.title',
24
- // info: 'monitoringReceiver.slack.info',
25
- // key: 'slackConfigs',
26
- // logo: require(`@shell/assets/images/vendor/slack.svg`)
27
- // },
20
+ {
21
+ name: 'message',
22
+ label: '短信',
23
+ title: '短信',
24
+ info: 'monitoringReceiver.slack.info',
25
+ key: 'slackConfigs',
26
+ logo: require(`@shell/assets/images/vendor/slack.svg`)
27
+ },
28
+ {
29
+ name: 'dingding',
30
+ label: '钉钉',
31
+ title: '钉钉',
32
+ info: 'monitoringReceiver.slack.info',
33
+ key: 'dingding',
34
+ logo: require(`@shell/assets/images/vendor/slack.svg`)
35
+ },
36
+ {
37
+ name: 'work',
38
+ label: '企业微信',
39
+ title: '企业微信',
40
+ info: 'monitoringReceiver.slack.info',
41
+ key: 'work',
42
+ logo: require(`@shell/assets/images/vendor/slack.svg`)
43
+ },
44
+ {
45
+ name: 'snmp',
46
+ label: 'SNMP',
47
+ title: 'SNMP',
48
+ info: 'monitoringReceiver.slack.info',
49
+ key: 'snmp',
50
+ logo: require(`@shell/assets/images/vendor/slack.svg`)
51
+ },
28
52
  {
29
53
  name: 'email',
30
54
  label: 'monitoringReceiver.email.label',
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div>
3
+ <div class="mb-20">
4
+ <LabeledInput
5
+ v-model:value="message"
6
+ :placeholder="'webhook地址'"
7
+ :label="'webhook地址'"
8
+ />
9
+ </div>
10
+ <div class="mb-20">
11
+ <LabeledInput
12
+ v-model:value="id"
13
+ :placeholder="'签名密钥'"
14
+ :label="'签名密钥'"
15
+ />
16
+ </div>
17
+ </div>
18
+ </template>
19
+ <script>
20
+ import { LabeledInput } from '@components/Form/LabeledInput';
21
+ export default {
22
+ components: { LabeledInput },
23
+ data() {
24
+ return {
25
+ message: '',
26
+ id: '',
27
+ scret: '',
28
+ templateId: ''
29
+ };
30
+ }
31
+ };
32
+ </script>