dashboard-shell-shell 3.0.5-test.2 → 3.0.5-test.21

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 (145) 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 +3 -1
  4. package/assets/styles/base/_variables.scss +5 -5
  5. package/assets/styles/global/_button.scss +8 -8
  6. package/assets/styles/global/_select.scss +1 -1
  7. package/assets/styles/global/_tooltip.scss +9 -5
  8. package/assets/styles/themes/_light.scss +3 -1
  9. package/assets/styles/vendor/vue-select.scss +2 -1
  10. package/assets/translations/zh-hans.yaml +140 -11
  11. package/components/ActionDropdown.vue +1 -1
  12. package/components/ButtonDropdown.vue +3 -1
  13. package/components/CodeMirror.vue +6 -4
  14. package/components/ContainerResourceLimit.vue +2 -2
  15. package/components/CopyToClipboard.vue +15 -0
  16. package/components/Drawer/Chrome.vue +2 -2
  17. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +30 -27
  18. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  19. package/components/Drawer/ResourceDetailDrawer/index.vue +5 -4
  20. package/components/ExplorerMembers.vue +28 -4
  21. package/components/GlobalRoleBindings.vue +48 -112
  22. package/components/PodSecurityAdmission.vue +1 -1
  23. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  24. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  25. package/components/Resource/Detail/Metadata/index.vue +3 -1
  26. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  27. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  28. package/components/Resource/Detail/TitleBar/composables.ts +16 -1
  29. package/components/Resource/Detail/TitleBar/index.vue +113 -25
  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 +236 -165
  33. package/components/ResourceDetail/legacy.vue +44 -28
  34. package/components/ResourceList/Masthead.vue +11 -15
  35. package/components/SideNav.vue +1 -1
  36. package/components/SortableTable/index.vue +9 -4
  37. package/components/Tabbed/index.vue +6 -1
  38. package/components/auth/Principal.vue +42 -13
  39. package/components/auth/RoleDetailEdit.vue +11 -7
  40. package/components/breadcrumb/index.vue +124 -0
  41. package/components/form/ArrayList.vue +164 -147
  42. package/components/form/ArrayListGrouped.vue +3 -1
  43. package/components/form/ChangePassword.vue +1 -1
  44. package/components/form/Command.vue +4 -5
  45. package/components/form/Footer.vue +1 -0
  46. package/components/form/HealthCheck.vue +0 -2
  47. package/components/form/HookOption.vue +87 -58
  48. package/components/form/InputWithSelect.vue +8 -7
  49. package/components/form/KeyValue.vue +20 -2
  50. package/components/form/LabeledSelect.vue +6 -3
  51. package/components/form/Labels.vue +2 -2
  52. package/components/form/MatchExpressions.vue +3 -4
  53. package/components/form/Members/ClusterMembershipEditor.vue +1 -1
  54. package/components/form/Members/ClusterPermissionsEditor.vue +5 -5
  55. package/components/form/Members/MembershipEditor.vue +2 -2
  56. package/components/form/NameNsDescription.vue +1 -1
  57. package/components/form/Networking.vue +6 -9
  58. package/components/form/NodeAffinity.vue +29 -28
  59. package/components/form/PodAffinity.vue +23 -23
  60. package/components/form/Probe.vue +15 -11
  61. package/components/form/ResourceQuota/Namespace.vue +4 -4
  62. package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
  63. package/components/form/ResourceQuota/Project.vue +4 -4
  64. package/components/form/ResourceQuota/ProjectRow.vue +36 -30
  65. package/components/form/ResourceSelector.vue +1 -1
  66. package/components/form/Security.vue +1 -3
  67. package/components/form/Select.vue +6 -1
  68. package/components/form/ServiceNameSelect.vue +2 -5
  69. package/components/form/ServicePorts.vue +149 -75
  70. package/components/form/Taints.vue +2 -1
  71. package/components/form/Tolerations.vue +12 -9
  72. package/components/form/ValueFromResource.vue +110 -96
  73. package/components/form/WorkloadPorts.vue +143 -123
  74. package/components/nav/Header.vue +3 -4
  75. package/components/nav/NamespaceFilter.vue +15 -21
  76. package/components/nav/TopLevelMenu.vue +99 -125
  77. package/components/nav/Type.vue +3 -3
  78. package/config/product/explorer.js +4 -1
  79. package/config/router/navigation-guards/index.js +52 -3
  80. package/detail/node.vue +28 -23
  81. package/dialog/AddCustomBadgeDialog.vue +17 -9
  82. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
  83. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
  84. package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
  85. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
  86. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
  87. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
  88. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
  89. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
  90. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
  91. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
  92. package/edit/networking.k8s.io.ingress/Certificate.vue +7 -5
  93. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  94. package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
  95. package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
  96. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
  97. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
  98. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
  99. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  100. package/edit/persistentvolume/index.vue +3 -1
  101. package/edit/persistentvolumeclaim.vue +2 -0
  102. package/edit/secret/index.vue +2 -2
  103. package/edit/service.vue +4 -1
  104. package/edit/storage.k8s.io.storageclass/index.vue +10 -8
  105. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
  106. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
  107. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
  108. package/edit/workload/Job.vue +31 -34
  109. package/edit/workload/Upgrading.vue +5 -5
  110. package/edit/workload/index.vue +21 -17
  111. package/edit/workload/storage/Mount.vue +1 -0
  112. package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
  113. package/edit/workload/storage/azureDisk.vue +14 -10
  114. package/edit/workload/storage/azureFile.vue +9 -7
  115. package/edit/workload/storage/csi/index.vue +6 -9
  116. package/edit/workload/storage/emptyDir.vue +7 -5
  117. package/edit/workload/storage/gcePersistentDisk.vue +9 -7
  118. package/edit/workload/storage/hostPath.vue +7 -5
  119. package/edit/workload/storage/nfs.vue +8 -6
  120. package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
  121. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
  122. package/edit/workload/storage/secret.vue +9 -6
  123. package/edit/workload/storage/vsphereVolume.vue +11 -7
  124. package/initialize/app-extended.js +7 -1
  125. package/package.json +1 -1
  126. package/pages/account/index.vue +95 -115
  127. package/pages/auth/setup.vue +35 -16
  128. package/pages/c/_cluster/auth/roles/index.vue +38 -5
  129. package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
  130. package/pages/c/_cluster/explorer/tools/index.vue +6 -6
  131. package/pages/home.vue +3 -4
  132. package/pkg/tsconfig.json +9 -9
  133. package/pkg/vue.config.js +1 -1
  134. package/plugins/dashboard-store/resource-class.js +28 -27
  135. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  136. package/rancher-components/Banner/Banner.vue +6 -3
  137. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
  138. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  139. package/scripts/publish-shell.sh +1 -1
  140. package/store/i18n.js +4 -0
  141. package/store/type-map.js +1 -1
  142. package/types/shell/index.d.ts +4 -30
  143. package/utils/error.js +3 -1
  144. package/utils/errorTranslate.json +247 -2
  145. package/vue.config.js +1 -1
@@ -1841,7 +1841,7 @@ export default {
1841
1841
  class="paging"
1842
1842
  >
1843
1843
  <div style="height: 100%; align-content: center;">
1844
- 共 {{ filteredRows.length }} 条
1844
+ 共 {{ filteredRows ? filteredRows.length : 0 }} 条
1845
1845
  </div>
1846
1846
 
1847
1847
  <button
@@ -2186,7 +2186,7 @@ export default {
2186
2186
  border-collapse: collapse;
2187
2187
  min-width: 400px;
2188
2188
  border-radius: 5px 5px 0 0;
2189
- border-bottom: 1px solid var(--border);
2189
+ border-bottom: 1px solid var(--border) !important;
2190
2190
  /* outline: 1px solid var(--border); */
2191
2191
  background: var(--sortable-table-bg);
2192
2192
  border-radius: 4px;
@@ -2201,6 +2201,9 @@ export default {
2201
2201
  td {
2202
2202
  padding: 8px 5px;
2203
2203
  border: 0;
2204
+ white-space: normal;
2205
+ word-break: break-all;
2206
+ overflow-wrap: break-word;
2204
2207
 
2205
2208
  &:first-child {
2206
2209
  padding-left: 10px;
@@ -2217,7 +2220,7 @@ export default {
2217
2220
 
2218
2221
  tbody {
2219
2222
  tr {
2220
- border-bottom: 1px solid var(--sortable-table-top-divider);
2223
+ border-bottom: 1px solid var(--sortable-table-top-divider) !important;
2221
2224
  background-color: var(--sortable-table-row-bg);
2222
2225
 
2223
2226
  &.main-row.has-sub-row {
@@ -2658,7 +2661,9 @@ export default {
2658
2661
 
2659
2662
  .pageSelect{
2660
2663
  &:deep() .vs__actions:after{
2661
- padding-top: 10px;
2664
+ // padding-top: 10px;
2665
+ display: flex;
2666
+ align-items: center;
2662
2667
  }
2663
2668
  }
2664
2669
  .sort-table-div{
@@ -384,12 +384,13 @@ export default {
384
384
 
385
385
  &.horizontal {
386
386
  border: solid thin var(--border);
387
- border-bottom: 0;
387
+ // border-bottom: 0;
388
388
  display: flex;
389
389
  flex-direction: row;
390
390
 
391
391
  + .tab-container {
392
392
  border: solid thin var(--border);
393
+ border-top: 0px;
393
394
  }
394
395
 
395
396
  .tab.active {
@@ -504,6 +505,8 @@ margin: 0px -20px;
504
505
  display: flex;
505
506
  border-bottom:1px solid #d7d7d7;
506
507
  padding: 0 0 0 20px;
508
+ // overflow: auto;
509
+ // overflow-y: hidden;
507
510
  /* flex: 1 0; */
508
511
  /* flex-direction: column; */
509
512
 
@@ -571,6 +574,8 @@ margin: 0px -20px;
571
574
  li {
572
575
  display: flex;
573
576
  flex: 1;
577
+ border-left: 1px solid var(--border);
578
+ border-right: 1px solid var(--border);
574
579
 
575
580
  .btn {
576
581
  flex: 1 1;
@@ -16,7 +16,15 @@ export default {
16
16
  showLabels: {
17
17
  type: Boolean,
18
18
  default: false,
19
- }
19
+ },
20
+ isShowPass: {
21
+ type: Boolean,
22
+ default: false,
23
+ },
24
+ userLogoSize: {
25
+ type: Number,
26
+ default: 20,
27
+ },
20
28
  },
21
29
 
22
30
  async fetch() {
@@ -86,9 +94,10 @@ export default {
86
94
  </template>
87
95
 
88
96
  <template v-else-if="principal">
89
- <div class="avatar">
97
+ <div :style="userLogoSize === 79 ? { width: '287px' } : {}" class="avatar">
90
98
  <img
91
- :src="principal.avatarSrc"
99
+ :style="{ width: userLogoSize + 'px', height: userLogoSize + 'px' }"
100
+ src="@shell/assets/images/user.png"
92
101
  :class="{'round': principal.roundAvatar}"
93
102
  :alt="t('principal.alt.avatar')"
94
103
  >
@@ -98,11 +107,19 @@ export default {
98
107
  class="name"
99
108
  >
100
109
  <table>
101
- <tbody>
102
- <tr><th>{{ t('principal.name') }}: </th><td>{{ principal.name || principal.loginName }}</td></tr>
103
- <tr><th>{{ t('principal.loginName') }}: </th><td>{{ principal.loginName }}</td></tr>
104
- <tr><th>{{ t('principal.type') }}: </th><td>{{ principal.displayType }}</td></tr>
105
- </tbody>
110
+ <tr class="mb-10">
111
+ <td>{{ t('principal.name') }}: </td><td>{{ principal.name || principal.loginName }}</td>
112
+ </tr>
113
+ <tr class="mb-10">
114
+ <td>{{ t('principal.loginName') }}: </td><td>{{ principal.loginName }}</td>
115
+ </tr>
116
+ <tr
117
+ v-if="isShowPass"
118
+ class="mb-10"
119
+ >
120
+ <td>修改密码: </td><td>****** <slot name="edit" /></td>
121
+ </tr>
122
+ <tr><td>{{ t('principal.type') }}: </td><td>{{ principal.displayType }}</td></tr>
106
123
  </table>
107
124
  </div>
108
125
  <template v-else>
@@ -172,23 +189,35 @@ export default {
172
189
  }
173
190
 
174
191
  &.showLabels {
175
- grid-template-areas:
192
+ /* grid-template-areas:
176
193
  "avatar name";
177
194
  grid-template-columns: 60px auto;
178
195
  grid-template-rows: 60px;
179
- column-gap: 0;
196
+ column-gap: 0; */
197
+ display: flex;
198
+ column-gap:0;
180
199
  .name {
200
+ display: flex;
181
201
  line-height: unset;
182
202
  }
183
-
203
+ table tr {
204
+ display: block;
205
+ }
184
206
  table tr td:not(:first-of-type) {
185
207
  padding-left: 10px;
186
208
  }
209
+ table tr td:not(:last-of-type) {
210
+ width: 100px;
211
+ }
187
212
  }
188
213
 
189
214
  .avatar {
190
- grid-area: avatar;
191
- text-align: center;
215
+ /* grid-area: avatar;
216
+ text-align: center; */
217
+ // width: 287px;
218
+ display: flex;
219
+ justify-content: center;
220
+ align-items: center;
192
221
 
193
222
  DIV.empty {
194
223
  border: 1px solid var(--border);
@@ -152,7 +152,7 @@ export default {
152
152
  });
153
153
  }
154
154
 
155
- if (this.value?.metadata?.name && !this.value.displayName) {
155
+ if (this.value?.metadata?.name && !this.value?.displayName) {
156
156
  this.value['displayName'] = this.value.metadata.name;
157
157
  }
158
158
 
@@ -705,12 +705,12 @@ export default {
705
705
  <!-- 列表头部 -->
706
706
  <template #column-headers>
707
707
  <div class="column-headers row">
708
- <div :class="ruleClass">
708
+ <div class="arrayListCls" :class="ruleClass">
709
709
  <span class="text-label">{{ t('rbac.roletemplate.tabs.grantResources.tableHeaders.verbs') }}
710
710
  <span class="required">*</span>
711
711
  </span>
712
712
  </div>
713
- <div :class="ruleClass">
713
+ <div class="arrayListCls" :class="ruleClass">
714
714
  <span class="text-label">
715
715
  {{ t('rbac.roletemplate.tabs.grantResources.tableHeaders.resources') }}
716
716
  <i
@@ -723,7 +723,7 @@ export default {
723
723
  >*</span>
724
724
  </span>
725
725
  </div>
726
- <div :class="ruleClass">
726
+ <div class="arrayListCls" :class="ruleClass">
727
727
  <span class="text-label">{{ t('rbac.roletemplate.tabs.grantResources.tableHeaders.apiGroups') }}</span>
728
728
  </div>
729
729
  <div
@@ -740,7 +740,7 @@ export default {
740
740
  <div class="columns row mr-20">
741
741
 
742
742
  <!-- 动作(verbs)选择 -->
743
- <div :class="ruleClass">
743
+ <div class="arrayListCls" :class="ruleClass">
744
744
  <!-- Select verbs -->
745
745
  <Select
746
746
  :value="props.row.value.verbs"
@@ -758,7 +758,7 @@ export default {
758
758
  </div>
759
759
 
760
760
  <!-- 资源(resources)选择 -->
761
- <div :class="ruleClass">
761
+ <div class="arrayListCls" :class="ruleClass">
762
762
  <Select
763
763
  style="width: auto;"
764
764
  :value="getRule('resources', props.row.value)"
@@ -776,7 +776,7 @@ export default {
776
776
  </div>
777
777
 
778
778
  <!-- API Groups 输入 -->
779
- <div :class="ruleClass">
779
+ <div class="arrayListCls" :class="ruleClass">
780
780
  <LabeledInput
781
781
  :value="getRule('apiGroups', props.row.value)"
782
782
  :disabled="isBuiltin"
@@ -788,6 +788,7 @@ export default {
788
788
 
789
789
  <!-- 非命名空间 URL 输入(仅非命名空间模式显示) -->
790
790
  <div
791
+ class="arrayListCls"
791
792
  v-if="!isNamespaced"
792
793
  :class="ruleClass"
793
794
  >
@@ -859,6 +860,9 @@ export default {
859
860
  </template>
860
861
 
861
862
  <style lang="scss" scoped>
863
+ .arrayListCls {
864
+ min-width: 360px;
865
+ }
862
866
  .ruleCls {
863
867
  margin-right: 10px;
864
868
  }
@@ -0,0 +1,124 @@
1
+ <script>
2
+ import { get } from '@shell/utils/object';;
3
+ import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
4
+ import { useStore } from 'vuex';
5
+
6
+ export default {
7
+
8
+ name: 'MastheadBreadcrumb',
9
+
10
+ components: {
11
+ },
12
+ props: {
13
+ resourceTypeLabel: {
14
+ type: String,
15
+ default: ''
16
+ },
17
+
18
+ resource: {
19
+ type: String,
20
+ default: null,
21
+ },
22
+
23
+ realMode: {
24
+ type: String,
25
+ default: 'view',
26
+ }
27
+
28
+ },
29
+
30
+ setup() {
31
+ const store = useStore();
32
+ const { featureDropdownMenu } = useRuntimeFlag(store);
33
+
34
+ return { featureDropdownMenu };
35
+ },
36
+
37
+ data() {
38
+ return {
39
+ };
40
+ },
41
+
42
+ computed: {
43
+
44
+ demoDisplay() {
45
+
46
+ const resources = this.$route.params?.resource || ''
47
+ console.log(resources, 'resources')
48
+
49
+ const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], resources);
50
+
51
+ if (productId === undefined) {
52
+ return '';
53
+ }
54
+ const parts = productId.split('::');
55
+ const newString = 'root';
56
+
57
+ if (!parts?.includes(newString)) {
58
+ parts.unshift(newString); // 将字符串添加到数组第一位
59
+ }
60
+
61
+ const partsEn = parts.map((item) => {
62
+ return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
63
+ });
64
+
65
+ return partsEn;
66
+ },
67
+
68
+ },
69
+
70
+ methods: {
71
+ get,
72
+ }
73
+ };
74
+ </script>
75
+
76
+ <template>
77
+ <div class="masthead">
78
+ <div class="title">
79
+ <!-- 标题区域 -->
80
+ <div
81
+ class="excram-list"
82
+ >
83
+ <span
84
+ v-for="(item,index) in demoDisplay"
85
+ :key="index"
86
+ >
87
+ <span>{{ item }}</span>
88
+ <span>/</span>
89
+ </span>
90
+ <span class="excram-last-name">
91
+ {{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + resourceTypeLabel }}
92
+ </span>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </template>
97
+
98
+ <style lang='scss' scoped>
99
+
100
+ .excram-list{
101
+ font-size: 14px;
102
+ margin-bottom: 20px;
103
+ }
104
+ .excram-last-name{
105
+ color: var(--link);
106
+ }
107
+
108
+ .detailIcon-span{
109
+ width: 24px;
110
+ height: 24px;
111
+ display: inline-block;
112
+ position: relative;
113
+ background: var(--primary);
114
+ margin-right: 10px;
115
+ }
116
+ .detailIcon{
117
+ position: absolute;
118
+ color: #fff;
119
+ font-size: 38px;
120
+ left: 4px;
121
+ top: -2px;
122
+ }
123
+
124
+ </style>