dashboard-shell-shell 3.0.5-test.3 → 3.0.5-test.30

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 (153) hide show
  1. package/assets/icons/iconfont.css +4 -1
  2. package/assets/images/pl/dark/logo.png +0 -0
  3. package/assets/styles/all.scss +21 -1
  4. package/assets/styles/base/_variables.scss +5 -5
  5. package/assets/styles/fonts/_icons.scss +3 -2
  6. package/assets/styles/global/_button.scss +8 -8
  7. package/assets/styles/global/_select.scss +1 -1
  8. package/assets/styles/global/_tooltip.scss +9 -5
  9. package/assets/styles/themes/_light.scss +3 -1
  10. package/assets/styles/vendor/vue-select.scss +2 -1
  11. package/assets/translations/zh-hans.yaml +150 -13
  12. package/components/ActionDropdown.vue +1 -1
  13. package/components/ButtonDropdown.vue +3 -1
  14. package/components/CodeMirror.vue +6 -4
  15. package/components/ContainerResourceLimit.vue +2 -2
  16. package/components/CopyToClipboard.vue +15 -0
  17. package/components/Drawer/Chrome.vue +2 -2
  18. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +30 -27
  19. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  20. package/components/Drawer/ResourceDetailDrawer/index.vue +5 -4
  21. package/components/ExplorerMembers.vue +28 -4
  22. package/components/GlobalRoleBindings.vue +48 -112
  23. package/components/PodSecurityAdmission.vue +2 -2
  24. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  25. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  26. package/components/Resource/Detail/Metadata/index.vue +3 -1
  27. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  28. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  29. package/components/Resource/Detail/TitleBar/composables.ts +16 -1
  30. package/components/Resource/Detail/TitleBar/index.vue +123 -25
  31. package/components/ResourceDetail/Masthead/index.vue +1 -1
  32. package/components/ResourceDetail/Masthead/latest.vue +1 -1
  33. package/components/ResourceDetail/Masthead/legacy.vue +239 -167
  34. package/components/ResourceDetail/legacy.vue +44 -28
  35. package/components/ResourceList/Masthead.vue +14 -15
  36. package/components/SideNav.vue +21 -21
  37. package/components/SortableTable/THead.vue +21 -1
  38. package/components/SortableTable/index.vue +21 -6
  39. package/components/Tabbed/index.vue +6 -1
  40. package/components/auth/Principal.vue +42 -13
  41. package/components/auth/RoleDetailEdit.vue +11 -7
  42. package/components/breadcrumb/index.vue +119 -0
  43. package/components/form/ArrayList.vue +164 -147
  44. package/components/form/ArrayListGrouped.vue +3 -1
  45. package/components/form/ChangePassword.vue +1 -1
  46. package/components/form/Command.vue +4 -5
  47. package/components/form/Conditions.vue +15 -1
  48. package/components/form/Footer.vue +1 -0
  49. package/components/form/HealthCheck.vue +0 -2
  50. package/components/form/HookOption.vue +87 -58
  51. package/components/form/InputWithSelect.vue +8 -7
  52. package/components/form/KeyValue.vue +20 -2
  53. package/components/form/LabeledSelect.vue +6 -3
  54. package/components/form/Labels.vue +2 -2
  55. package/components/form/MatchExpressions.vue +3 -4
  56. package/components/form/Members/ClusterMembershipEditor.vue +1 -1
  57. package/components/form/Members/ClusterPermissionsEditor.vue +5 -5
  58. package/components/form/Members/MembershipEditor.vue +2 -2
  59. package/components/form/NameNsDescription.vue +1 -1
  60. package/components/form/Networking.vue +6 -9
  61. package/components/form/NodeAffinity.vue +29 -28
  62. package/components/form/PodAffinity.vue +23 -23
  63. package/components/form/Probe.vue +15 -11
  64. package/components/form/ResourceQuota/Namespace.vue +4 -4
  65. package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
  66. package/components/form/ResourceQuota/Project.vue +4 -4
  67. package/components/form/ResourceQuota/ProjectRow.vue +36 -30
  68. package/components/form/ResourceSelector.vue +1 -1
  69. package/components/form/Security.vue +1 -3
  70. package/components/form/Select.vue +6 -1
  71. package/components/form/ServiceNameSelect.vue +2 -5
  72. package/components/form/ServicePorts.vue +149 -75
  73. package/components/form/Taints.vue +2 -1
  74. package/components/form/Tolerations.vue +12 -9
  75. package/components/form/ValueFromResource.vue +110 -96
  76. package/components/form/WorkloadPorts.vue +143 -123
  77. package/components/formatter/WorkloadHealthScale.vue +4 -3
  78. package/components/nav/Group.vue +6 -0
  79. package/components/nav/Header.vue +7 -4
  80. package/components/nav/NamespaceFilter.vue +15 -21
  81. package/components/nav/TopLevelMenu.vue +99 -125
  82. package/components/nav/Type.vue +15 -3
  83. package/config/menuRouteMap.js +10 -0
  84. package/config/product/explorer.js +5 -1
  85. package/config/router/navigation-guards/index.js +61 -3
  86. package/detail/node.vue +28 -23
  87. package/dialog/AddCustomBadgeDialog.vue +17 -9
  88. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
  89. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
  90. package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
  91. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
  92. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
  93. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
  94. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
  95. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
  96. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
  97. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
  98. package/edit/configmap.vue +4 -0
  99. package/edit/networking.k8s.io.ingress/Certificate.vue +7 -5
  100. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  101. package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
  102. package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
  103. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
  104. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
  105. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
  106. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  107. package/edit/persistentvolume/index.vue +3 -1
  108. package/edit/persistentvolumeclaim.vue +2 -0
  109. package/edit/secret/index.vue +2 -2
  110. package/edit/service.vue +4 -1
  111. package/edit/storage.k8s.io.storageclass/index.vue +10 -8
  112. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
  113. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
  114. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
  115. package/edit/workload/Job.vue +31 -34
  116. package/edit/workload/Upgrading.vue +5 -5
  117. package/edit/workload/index.vue +22 -18
  118. package/edit/workload/storage/Mount.vue +1 -0
  119. package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
  120. package/edit/workload/storage/azureDisk.vue +14 -10
  121. package/edit/workload/storage/azureFile.vue +9 -7
  122. package/edit/workload/storage/csi/index.vue +6 -9
  123. package/edit/workload/storage/emptyDir.vue +7 -5
  124. package/edit/workload/storage/gcePersistentDisk.vue +9 -7
  125. package/edit/workload/storage/hostPath.vue +7 -5
  126. package/edit/workload/storage/nfs.vue +8 -6
  127. package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
  128. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
  129. package/edit/workload/storage/secret.vue +9 -6
  130. package/edit/workload/storage/vsphereVolume.vue +11 -7
  131. package/initialize/app-extended.js +7 -1
  132. package/models/provisioning.cattle.io.cluster.js +19 -18
  133. package/package.json +1 -1
  134. package/pages/account/index.vue +95 -115
  135. package/pages/auth/setup.vue +35 -16
  136. package/pages/c/_cluster/auth/roles/index.vue +38 -5
  137. package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
  138. package/pages/c/_cluster/explorer/tools/index.vue +6 -6
  139. package/pages/home.vue +3 -4
  140. package/pkg/tsconfig.json +9 -9
  141. package/pkg/vue.config.js +1 -1
  142. package/plugins/dashboard-store/resource-class.js +28 -27
  143. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  144. package/rancher-components/Banner/Banner.vue +4 -1
  145. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
  146. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  147. package/scripts/publish-shell.sh +1 -1
  148. package/store/i18n.js +4 -0
  149. package/store/type-map.js +1 -1
  150. package/types/shell/index.d.ts +4 -30
  151. package/utils/error.js +3 -1
  152. package/utils/errorTranslate.json +351 -2
  153. package/vue.config.js +1 -1
@@ -13,6 +13,8 @@ import { _CONFIG, _GRAPH, AS } from '@shell/config/query-params';
13
13
  import ButtonGroup from '@shell/components/ButtonGroup';
14
14
  import { ExtensionPoint, PanelLocation } from '@shell/core/types';
15
15
  import ExtensionPanel from '@shell/components/ExtensionPanel.vue';
16
+ import breadcrumb from '@shell/components/breadcrumb/index.vue'
17
+ import { useDefaultConfigTabProps } from '@shell/components/Drawer/ResourceDetailDrawer/composables';
16
18
 
17
19
  export interface Badge {
18
20
  color: 'bg-success' | 'bg-error' | 'bg-warning' | 'bg-info';
@@ -36,6 +38,7 @@ export interface TitleBarProps {
36
38
  showViewOptions?: boolean;
37
39
 
38
40
  onShowConfiguration?: (returnFocusSelector: string) => void;
41
+ parentRouteOverride?: string;
39
42
  }
40
43
 
41
44
  const showConfigurationIcon = require(`@shell/assets/images/icons/document.svg`);
@@ -43,9 +46,10 @@ const showConfigurationIcon = require(`@shell/assets/images/icons/document.svg`)
43
46
 
44
47
  <script setup lang="ts">
45
48
  const {
46
- resource, resourceTypeLabel, resourceTo, resourceName, description, badge, showViewOptions, onShowConfiguration,
49
+ parentRouteOverride, resource, resourceTypeLabel, resourceTo, resourceName, description, badge, showViewOptions, onShowConfiguration,
47
50
  } = defineProps<TitleBarProps>();
48
51
 
52
+
49
53
  const store = useStore();
50
54
  const i18n = useI18n(store);
51
55
  const router = useRouter();
@@ -54,6 +58,10 @@ const emit = defineEmits(['show-configuration']);
54
58
  const showConfigurationDataTestId = 'show-configuration-cta';
55
59
  const showConfigurationReturnFocusSelector = computed(() => `[data-testid="${ showConfigurationDataTestId }"]`);
56
60
 
61
+
62
+ const configTabProps = useDefaultConfigTabProps(resource);
63
+
64
+
57
65
  const currentView = ref(router?.currentRoute?.value?.query?.as || _CONFIG);
58
66
  const viewOptions = computed(() => {
59
67
  if (!showViewOptions) {
@@ -72,6 +80,45 @@ const viewOptions = computed(() => {
72
80
  ];
73
81
  });
74
82
 
83
+ const Svg = require('~shell/assets/images/API.svg')
84
+
85
+ const parent = computed(() => {
86
+
87
+ const product = store.getters['currentProduct'].name;
88
+
89
+ const defaultLocation = {
90
+ name: 'c-cluster-product-resource',
91
+ params: {
92
+ resource,
93
+ product,
94
+ }
95
+ };
96
+
97
+ const location = resource?.parentLocationOverride || defaultLocation;
98
+
99
+ if (parentRouteOverride) {
100
+ location.name = parentRouteOverride;
101
+ }
102
+
103
+ return { location };
104
+ });
105
+
106
+ const menuIcon = computed(() => {
107
+ const product = store.getters['productId'];
108
+ const resources = parent.value.location?.params?.resource || '';
109
+ return store.getters['type-map/groupsForVirTypes'](product, resources) || 'default menuIcon';
110
+ });
111
+
112
+ const hiddenTypes = [
113
+ 'harvesterhci.io.virtualmachinebackup',
114
+ ];
115
+
116
+ const shouldShowConfiguration = computed(() =>
117
+ onShowConfiguration &&
118
+ configTabProps &&
119
+ !hiddenTypes.includes(resource?.type)
120
+ );
121
+
75
122
  watch(
76
123
  () => currentView.value,
77
124
  () => {
@@ -82,33 +129,58 @@ watch(
82
129
 
83
130
  <template>
84
131
  <div class="title-bar">
132
+ <breadcrumb :resourceTypeLabel="resourceTypeLabel" :resource="resource"/>
85
133
  <Top>
86
134
  <Title class="title">
135
+ <span class="detailIcon-span">
136
+ <img
137
+ v-if="parentRouteOverride === 'account' && resource=== 'token'"
138
+ :src="Svg"
139
+ style="margin-top: 4px; margin-left: 5px;"
140
+ >
141
+ <i
142
+ v-else
143
+ :class="'icon-'+ menuIcon + ' detailIcon'"
144
+ />
145
+ </span>
146
+ <div class="resourceTypeLabelCls">
147
+ {{ resourceTypeLabel }}名称:
148
+ </div>
149
+ <span class="resource-name masthead-resource-title">
150
+ {{ resourceName }}
151
+ </span>
152
+ <BadgeState
153
+ v-if="badge"
154
+ class="badge-state"
155
+ :color="badge.color"
156
+ :label="badge.label"
157
+ />
158
+ <span
159
+ class="valid"
160
+ >|</span>
87
161
  <TabTitle :show-child="false">
88
- {{ resourceTypeLabel }}
162
+ 返回
89
163
  </TabTitle>
90
164
  <router-link
91
165
  v-if="resourceTo"
92
166
  :to="resourceTo"
93
167
  class="resource-link"
94
168
  >
95
- {{ resourceTypeLabel }}:
169
+ 返回
96
170
  </router-link>
97
171
  <span
98
172
  v-else
99
173
  class="resource-text"
100
174
  >
101
- {{ resourceTypeLabel }}:
175
+ 返回
102
176
  </span>
103
- <span class="resource-name masthead-resource-title">
104
- {{ resourceName }}
105
- </span>
106
- <BadgeState
107
- v-if="badge"
108
- class="badge-state"
109
- :color="badge.color"
110
- :label="badge.label"
111
- />
177
+ <div
178
+ v-if="description"
179
+ style="font-size: 12px;margin-left: 16px;"
180
+ class="bottom description text-deemphasized"
181
+ >
182
+ ( {{ description }} )
183
+ </div>
112
184
  </Title>
113
185
  <div class="actions">
114
186
  <!-- Please don't expand this pattern, this was a quick fix to resolve a conflict between the new masthead and fleet. -->
@@ -118,7 +190,7 @@ watch(
118
190
  :options="viewOptions"
119
191
  />
120
192
  <RcButton
121
- v-if="onShowConfiguration"
193
+ v-if="shouldShowConfiguration"
122
194
  :data-testid="showConfigurationDataTestId"
123
195
  class="show-configuration"
124
196
  :primary="true"
@@ -134,6 +206,7 @@ watch(
134
206
  </RcButton>
135
207
  <ActionMenu
136
208
  v-if="actionMenuResource"
209
+ :showIcon="true"
137
210
  button-role="multiAction"
138
211
  :resource="actionMenuResource"
139
212
  data-testid="masthead-action-menu"
@@ -141,12 +214,6 @@ watch(
141
214
  />
142
215
  </div>
143
216
  </Top>
144
- <div
145
- v-if="description"
146
- class="bottom description text-deemphasized"
147
- >
148
- {{ description }}
149
- </div>
150
217
  <ExtensionPanel
151
218
  :resource="resource"
152
219
  :type="ExtensionPoint.PANEL"
@@ -156,12 +223,39 @@ watch(
156
223
  </template>
157
224
 
158
225
  <style lang="scss" scoped>
226
+
227
+ .detailIcon-span{
228
+ width: 24px;
229
+ height: 24px;
230
+ display: inline-block;
231
+ position: relative;
232
+ background: var(--primary);
233
+ margin-right: 10px;
234
+ }
235
+ .detailIcon{
236
+ position: absolute;
237
+ color: #fff;
238
+ font-size: 38px;
239
+ left: 4px;
240
+ top: -2px;
241
+ }
242
+
243
+ .detailIcon-span-title{
244
+ font-weight: bold;
245
+ }
246
+ .resourceTypeLabelCls {
247
+ font-weight: 700;
248
+ }
249
+ .valid{
250
+ color: #d7d7d7;
251
+ margin: 0px 10px;
252
+ }
159
253
  .title-bar {
160
254
  min-width: 740px;
161
255
 
162
256
  .badge-state {
163
257
  font-size: 16px;
164
- margin-left: 12px;
258
+ margin-left: 5px;
165
259
  position: relative;
166
260
  }
167
261
 
@@ -170,15 +264,19 @@ watch(
170
264
  }
171
265
 
172
266
  &:deep() button[data-testid="masthead-action-menu"] {
173
- border-radius: 4px;
174
- width: 35px;
175
- height: 40px;
176
- margin-left: 16px;
267
+ border-radius: 2px;
268
+ width: 32px;
269
+ height: 32px;
270
+ margin-left: 10px;
177
271
 
178
272
  display: inline-flex;
179
273
  flex-direction: row;
180
274
  justify-content: center;
181
275
  align-items: center;
276
+
277
+ a{
278
+ color: #fff;
279
+ }
182
280
  }
183
281
 
184
282
  .description {
@@ -60,6 +60,6 @@ const showLatestMasthead = computed(() => isNewDetailPageEnabled.value && isView
60
60
  <style lang="scss" scoped>
61
61
  .new.state-banner {
62
62
  margin: 0;
63
- margin-top: 16px;
63
+ margin-bottom: 20px;
64
64
  }
65
65
  </style>
@@ -39,6 +39,6 @@ const bannerProps = useResourceDetailBannerProps(props.value);
39
39
  <style lang="scss" scoped>
40
40
  .new.state-banner {
41
41
  margin: 0;
42
- margin-top: 16px;
42
+ margin-bottom: 20px;
43
43
  }
44
44
  </style>