dashboard-shell-shell 3.0.5-test.6 → 3.0.5-test.8

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 (215) hide show
  1. package/assets/brand/harvester/favicon.png +0 -0
  2. package/assets/brand/suse/favicon.png +0 -0
  3. package/assets/icons/demo.css +539 -0
  4. package/assets/icons/demo.css:Zone.Identifier +0 -0
  5. package/assets/icons/demo_index.html +1131 -0
  6. package/assets/icons/demo_index.html:Zone.Identifier +0 -0
  7. package/assets/icons/iconfont.css +216 -0
  8. package/assets/icons/iconfont.css:Zone.Identifier +0 -0
  9. package/assets/icons/iconfont.js +1 -0
  10. package/assets/icons/iconfont.js:Zone.Identifier +0 -0
  11. package/assets/icons/iconfont.json +324 -0
  12. package/assets/icons/iconfont.json:Zone.Identifier +0 -0
  13. package/assets/icons/iconfont.ttf +0 -0
  14. package/assets/icons/iconfont.ttf:Zone.Identifier +0 -0
  15. package/assets/icons/iconfont.woff +0 -0
  16. package/assets/icons/iconfont.woff2 +0 -0
  17. package/assets/icons/iconfont.woff2:Zone.Identifier +0 -0
  18. package/assets/icons/iconfont.woff:Zone.Identifier +0 -0
  19. package/assets/images/API.svg +3 -0
  20. package/assets/images/action.svg +6 -0
  21. package/assets/images/login/password.svg +20 -0
  22. package/assets/images/login/user.svg +6 -0
  23. package/assets/images/login-bg.png +0 -0
  24. package/assets/images/login-left.png +0 -0
  25. package/assets/images/login-logo.svg +19 -0
  26. package/assets/images/logo.png +0 -0
  27. package/assets/images/pl/half-logo.svg +2 -23
  28. package/assets/images/pl/harvester.png +0 -0
  29. package/assets/images/pl/logo.png +0 -0
  30. package/assets/images/promp-yellow.svg +5 -0
  31. package/assets/images/user.png +0 -0
  32. package/assets/styles/all.scss +63 -0
  33. package/assets/styles/app.scss +4 -0
  34. package/assets/styles/base/_basic.scss +2 -2
  35. package/assets/styles/base/_mixins.scss +1 -1
  36. package/assets/styles/base/_typography.scss +2 -1
  37. package/assets/styles/base/_variables.scss +14 -7
  38. package/assets/styles/global/_button.scss +43 -25
  39. package/assets/styles/global/_columns.scss +3 -1
  40. package/assets/styles/global/_form.scss +45 -13
  41. package/assets/styles/global/_labeled-input.scss +54 -26
  42. package/assets/styles/global/_layout.scss +8 -3
  43. package/assets/styles/global/_select.scss +25 -17
  44. package/assets/styles/global/_table.scss +7 -1
  45. package/assets/styles/global/_tooltip.scss +56 -8
  46. package/assets/styles/themes/_dark.scss +3 -0
  47. package/assets/styles/themes/_light.scss +66 -43
  48. package/assets/styles/vendor/vue-select.scss +22 -9
  49. package/assets/translations/en-us.yaml +28 -4
  50. package/assets/translations/zh-hans.yaml +452 -189
  51. package/components/ActionDropdown.vue +2 -1
  52. package/components/ActionMenu.vue +2 -2
  53. package/components/ActionMenuShell.vue +2 -0
  54. package/components/AppModal.vue +46 -5
  55. package/components/BrandImage.vue +1 -0
  56. package/components/ButtonDropdown.vue +26 -4
  57. package/components/ButtonMultiAction.vue +1 -0
  58. package/components/ClusterIconMenu.vue +1 -1
  59. package/components/CodeMirror.vue +20 -6
  60. package/components/ConsumptionGauge.vue +24 -5
  61. package/components/CopyToClipboard.vue +15 -0
  62. package/components/CruResource.vue +9 -8
  63. package/components/CruResourceFooter.vue +2 -2
  64. package/components/DashboardOptions.vue +29 -17
  65. package/components/DotState.vue +84 -0
  66. package/components/Drawer/Chrome.vue +2 -2
  67. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -22
  68. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  69. package/components/Drawer/ResourceDetailDrawer/index.vue +2 -1
  70. package/components/ExplorerMembers.vue +18 -3
  71. package/components/ExplorerProjectsNamespaces.vue +19 -5
  72. package/components/GlobalRoleBindings.vue +112 -48
  73. package/components/GrafanaDashboard.vue +4 -4
  74. package/components/GrowlManager.vue +3 -1
  75. package/components/HardwareResourceGauge.vue +39 -3
  76. package/components/IndentedPanel.vue +4 -10
  77. package/components/InfoBox.vue +3 -3
  78. package/components/InputOrDisplay.vue +28 -2
  79. package/components/LabelValue.vue +20 -1
  80. package/components/ModalWithCard.vue +12 -3
  81. package/components/PodSecurityAdmission.vue +1 -1
  82. package/components/PromptModal.vue +1 -1
  83. package/components/PromptRemove.vue +30 -11
  84. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  85. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  86. package/components/Resource/Detail/Metadata/index.vue +3 -1
  87. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  88. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  89. package/components/Resource/Detail/TitleBar/index.vue +109 -24
  90. package/components/ResourceDetail/Masthead/legacy.vue +181 -38
  91. package/components/ResourceDetail/legacy.vue +32 -14
  92. package/components/ResourceList/Masthead.vue +226 -54
  93. package/components/ResourceList/ResourceLoadingIndicator.vue +5 -2
  94. package/components/ResourceTable.vue +24 -2
  95. package/components/SideNav.vue +74 -20
  96. package/components/SortableTable/THead.vue +33 -3
  97. package/components/SortableTable/index.vue +1016 -463
  98. package/components/SortableTable/paging.js +26 -16
  99. package/components/SortableTable/selection.js +2 -2
  100. package/components/Tabbed/Tab.vue +3 -3
  101. package/components/Tabbed/index.vue +47 -29
  102. package/components/YamlEditor.vue +0 -1
  103. package/components/auth/Principal.vue +37 -13
  104. package/components/auth/RoleDetailEdit.vue +58 -7
  105. package/components/auth/SelectPrincipal.vue +1 -0
  106. package/components/breadcrumb/index.vue +316 -0
  107. package/components/form/ArrayList.vue +41 -33
  108. package/components/form/ArrayListGrouped.vue +10 -2
  109. package/components/form/ArrayListSelect.vue +1 -1
  110. package/components/form/BannerSettings.vue +64 -59
  111. package/components/form/ChangePassword.vue +4 -4
  112. package/components/form/ColorInput.vue +32 -8
  113. package/components/form/Footer.vue +11 -8
  114. package/components/form/InputWithSelect.vue +8 -5
  115. package/components/form/KeyValue.vue +47 -7
  116. package/components/form/LabeledSelect.vue +214 -242
  117. package/components/form/Labels.vue +3 -3
  118. package/components/form/MatchExpressions.vue +24 -7
  119. package/components/form/Members/ClusterPermissionsEditor.vue +1 -2
  120. package/components/form/Members/MembershipEditor.vue +1 -1
  121. package/components/form/NameNsDescription.vue +59 -20
  122. package/components/form/Password.vue +16 -7
  123. package/components/form/PodAffinity.vue +4 -5
  124. package/components/form/ResourceQuota/Namespace.vue +4 -4
  125. package/components/form/ResourceQuota/NamespaceRow.vue +18 -17
  126. package/components/form/ResourceQuota/Project.vue +4 -4
  127. package/components/form/ResourceQuota/ProjectRow.vue +3 -6
  128. package/components/form/Select.vue +5 -2
  129. package/components/form/SimpleSecretSelector.vue +29 -9
  130. package/components/form/Taints.vue +2 -1
  131. package/components/form/UnitInput.vue +8 -3
  132. package/components/form/WorkloadPorts.vue +143 -123
  133. package/components/formatter/BadgeStateFormatter.vue +8 -5
  134. package/components/formatter/LiveDate.vue +3 -3
  135. package/components/nav/Favorite.vue +5 -1
  136. package/components/nav/Group.vue +132 -99
  137. package/components/nav/Header.vue +124 -27
  138. package/components/nav/HeaderPageActionMenu.vue +1 -0
  139. package/components/nav/NamespaceFilter.vue +20 -17
  140. package/components/nav/TopLevelMenu.vue +182 -119
  141. package/components/nav/Type.vue +63 -41
  142. package/composables/useClickOutside.ts +1 -1
  143. package/config/private-label.js +15 -11
  144. package/config/product/auth.js +17 -7
  145. package/config/product/settings.js +19 -9
  146. package/config/settings.ts +28 -0
  147. package/config/table-headers.js +3 -2
  148. package/dialog/ForceMachineRemoveDialog.vue +2 -2
  149. package/dialog/ScalePoolDownDialog.vue +2 -2
  150. package/edit/management.cattle.io.user.vue +17 -4
  151. package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +19 -19
  152. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +31 -31
  153. package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +36 -12
  154. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +6 -6
  155. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +10 -10
  156. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +4 -4
  157. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +4 -4
  158. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +1 -1
  159. package/edit/monitoring.coreos.com.receiver/types/email.vue +6 -6
  160. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +10 -10
  161. package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +5 -5
  162. package/edit/monitoring.coreos.com.receiver/types/slack.vue +4 -4
  163. package/edit/namespace.vue +1 -2
  164. package/edit/token.vue +31 -12
  165. package/edit/workload/index.vue +4 -4
  166. package/list/management.cattle.io.setting.vue +22 -13
  167. package/list/management.cattle.io.user.vue +7 -3
  168. package/list/namespace.vue +3 -0
  169. package/list/provisioning.cattle.io.cluster.vue +6 -7
  170. package/mixins/brand.js +17 -0
  171. package/package.json +1 -1
  172. package/pages/account/pri.vue +229 -0
  173. package/pages/auth/login.vue +220 -52
  174. package/pages/auth/setup.vue +142 -19
  175. package/pages/c/_cluster/_product/namespaces.vue +5 -5
  176. package/pages/c/_cluster/auth/roles/index.vue +56 -5
  177. package/pages/c/_cluster/monitoring/monitor/index.vue +2 -2
  178. package/pages/c/_cluster/settings/banners.vue +174 -102
  179. package/pages/c/_cluster/settings/brand.vue +350 -302
  180. package/pages/c/_cluster/settings/performance.vue +61 -38
  181. package/pages/home.vue +70 -30
  182. package/pages/prefs.vue +27 -25
  183. package/plugins/dashboard-store/resource-class.js +28 -27
  184. package/promptRemove/mixin/roleDeletionCheck.js +2 -2
  185. package/public/index.html +4 -4
  186. package/rancher-components/BadgeState/BadgeState.vue +38 -55
  187. package/rancher-components/Banner/Banner.vue +12 -8
  188. package/rancher-components/Card/Card.vue +7 -8
  189. package/rancher-components/Form/Checkbox/Checkbox.vue +4 -0
  190. package/rancher-components/Form/LabeledInput/LabeledInput.vue +42 -3
  191. package/rancher-components/Form/Radio/RadioButton.vue +35 -11
  192. package/rancher-components/Form/Radio/RadioGroup.vue +13 -5
  193. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +3 -3
  194. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +1 -0
  195. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +12 -4
  196. package/rancher-components/RcDropdown/RcDropdown.vue +35 -7
  197. package/rancher-components/RcDropdown/RcDropdownItem.vue +2 -2
  198. package/rancher-components/RcDropdown/RcDropdownMenu.vue +12 -6
  199. package/rancher-components/RcDropdown/types.ts +1 -0
  200. package/rancher-components/StringList/StringList.vue +1 -1
  201. package/scripts/publish-shell.sh +1 -1
  202. package/static/favicon.ico +0 -0
  203. package/static/favicon.png +0 -0
  204. package/static/loading-indicator.html +3 -3
  205. package/store/i18n.js +5 -2
  206. package/store/modal.ts +3 -3
  207. package/store/prefs.js +11 -4
  208. package/store/type-map.js +32 -2
  209. package/types/shell/index.d.ts +78 -97
  210. package/utils/error.js +89 -8
  211. package/utils/errorTranslate.json +1351 -0
  212. package/utils/router.js +21 -0
  213. package/utils/select.js +26 -3
  214. package/utils/string.js +8 -5
  215. package/utils/title.ts +1 -1
@@ -15,7 +15,8 @@ export default {
15
15
  },
16
16
 
17
17
  indexTo() {
18
- return Math.min(this.totalRows, this.indexFrom + this.perPage - 1);
18
+ // return Math.min(this.totalRows, this.indexFrom + this.perPage - 1);
19
+ return Math.min(this.totalRows, this.indexFrom + Number(this.perPage) - 1);
19
20
  },
20
21
 
21
22
  totalPages() {
@@ -23,17 +24,18 @@ export default {
23
24
  },
24
25
 
25
26
  showPaging() {
26
- if (!this.paging) {
27
- return false;
28
- }
27
+ // if (!this.paging) {
28
+ // return false;
29
+ // }
29
30
 
30
- const havePages = this.totalPages > 1;
31
+ // const havePages = this.totalPages > 1;
31
32
 
32
- if (this.altLoading) {
33
- return havePages;
34
- }
33
+ // if (this.altLoading) {
34
+ // return havePages;
35
+ // }
35
36
 
36
- return !this.loading && havePages;
37
+ // return !this.loading && havePages;
38
+ return !this.loading && this.paging && this.totalPages >= 1;
37
39
  },
38
40
 
39
41
  pagingDisplay() {
@@ -76,7 +78,9 @@ export default {
76
78
  },
77
79
 
78
80
  data() {
79
- return { page: 1 };
81
+ // const perPage = this.getPerPage();
82
+
83
+ return { page: 1, perPage:10 };
80
84
  },
81
85
 
82
86
  watch: {
@@ -91,17 +95,23 @@ export default {
91
95
  }
92
96
  },
93
97
 
94
- page() {
95
- this.debouncedPaginationChanged();
96
- },
98
+ // page() {
99
+ // this.debouncedPaginationChanged();
100
+ // },
97
101
 
98
- perPage() {
99
- this.debouncedPaginationChanged();
100
- },
102
+ // perPage() {
103
+ // this.debouncedPaginationChanged();
104
+ // },
101
105
 
102
106
  },
103
107
 
104
108
  methods: {
109
+
110
+ setgetPerPage(num) {
111
+ this.setPage(1);
112
+ this.perPage = num;
113
+ },
114
+
105
115
  setPage(num) {
106
116
  if (this.page === num) {
107
117
  return;
@@ -10,7 +10,7 @@ export const NONE = 'none';
10
10
 
11
11
  export default {
12
12
  mounted() {
13
- const table = this.$el.querySelector('TABLE');
13
+ const table = this.$el && this.$el.querySelector('TABLE');
14
14
 
15
15
  this._onRowClickBound = this.onRowClick.bind(this);
16
16
  this._onRowMousedownBound = this.onRowMousedown.bind(this);
@@ -22,7 +22,7 @@ export default {
22
22
  },
23
23
 
24
24
  beforeUnmount() {
25
- const table = this.$el.querySelector('TABLE');
25
+ const table = this.$el && this.$el.querySelector('TABLE');
26
26
 
27
27
  table.removeEventListener('click', this._onRowClickBound);
28
28
  table.removeEventListener('mousedown', this._onRowMousedownBound);
@@ -100,14 +100,14 @@ export default {
100
100
  v-if="shouldShowHeader"
101
101
  class="tab-header"
102
102
  >
103
- <h2>
103
+ <!-- <h2>
104
104
  {{ labelDisplay }}
105
105
  <i
106
106
  v-if="tooltip"
107
107
  v-clean-tooltip="tooltip"
108
108
  class="icon icon-info icon-lg"
109
109
  />
110
- </h2>
110
+ </h2> -->
111
111
  <slot name="tab-header-right" />
112
112
  </div>
113
113
  <slot v-bind="{active}" />
@@ -118,7 +118,7 @@ export default {
118
118
  .tab-header {
119
119
  display: flex;
120
120
  justify-content: space-between;
121
- margin-bottom: 15px;
121
+ /* margin-bottom: 15px; */
122
122
  align-items: center;
123
123
 
124
124
  h2 {
@@ -285,15 +285,15 @@ export default {
285
285
  :data-testid="tab.name"
286
286
  :class="{tab: true, active: tab.active, disabled: tab.disabled, error: (tab.error)}"
287
287
  role="presentation"
288
+ @click.prevent="select(tab.name, $event)"
289
+ @keyup.enter.space="select(tab.name, $event)"
288
290
  >
289
291
  <a
290
292
  :data-testid="`btn-${tab.name}`"
291
293
  :aria-controls="tab.name"
292
294
  :aria-selected="tab.active"
293
295
  :aria-label="tab.labelDisplay || ''"
294
- role="tab"
295
- @click.prevent="select(tab.name, $event)"
296
- @keyup.enter.space="select(tab.name, $event)"
296
+ role="tab"
297
297
  >
298
298
  <span>{{ tab.labelDisplay }}</span>
299
299
  <span
@@ -382,15 +382,6 @@ export default {
382
382
  margin: 0;
383
383
  padding: 0;
384
384
 
385
- &:focus-visible {
386
- outline: none;
387
-
388
- .tab.active {
389
- @include focus-outline;
390
- outline-offset: -2px;
391
- }
392
- }
393
-
394
385
  &.horizontal {
395
386
  border: solid thin var(--border);
396
387
  border-bottom: 0;
@@ -406,8 +397,12 @@ export default {
406
397
  }
407
398
  }
408
399
 
409
- &:focus .tab.active a span {
410
- text-decoration: underline;
400
+ &:focus {
401
+ outline: none;
402
+
403
+ & .tab.active a span {
404
+ text-decoration: none;
405
+ }
411
406
  }
412
407
 
413
408
  .tab {
@@ -424,7 +419,7 @@ export default {
424
419
  &:hover {
425
420
  text-decoration: none;
426
421
  span {
427
- text-decoration: underline;
422
+ text-decoration: none;
428
423
  }
429
424
  }
430
425
  }
@@ -494,45 +489,68 @@ export default {
494
489
 
495
490
  .side-tabs {
496
491
  display: flex;
497
- box-shadow: 0 0 20px var(--shadow);
492
+ flex-direction: column;
493
+ /* box-shadow: 0 0 20px var(--shadow);
498
494
  border-radius: calc(var(--border-radius) * 2);
499
- background-color: var(--tabbed-sidebar-bg);
500
-
495
+ background-color: var(--tabbed-sidebar-bg); */
496
+ margin: 0px -20px;
501
497
  .tab-container {
502
498
  padding: 20px;
503
499
  }
504
500
 
505
501
  & .tabs {
506
- width: $sideways-tabs-width;
507
- min-width: $sideways-tabs-width;
502
+ /* width: $sideways-tabs-width; */
503
+ /* min-width: $sideways-tabs-width; */
508
504
  display: flex;
509
- flex: 1 0;
510
- flex-direction: column;
505
+ border-bottom:1px solid #d7d7d7;
506
+ padding: 0 0 0 20px;
507
+ /* flex: 1 0; */
508
+ /* flex-direction: column; */
511
509
 
512
510
  // &.vertical {
513
511
  // .tab.active {
514
512
  // background-color: var(--tabbed-container-bg);
515
513
  // }
516
514
  // }
517
-
518
515
  & .tab {
519
- width: 100%;
520
- border-left: solid 5px transparent;
516
+ /* width: 100%; */
517
+ min-width: 120px;
518
+ height: 36px;
519
+ /* border-top: solid 5px transparent; */
520
+ display: flex;
521
+ justify-content: center;
522
+ padding: 8px 16px;
523
+ box-sizing: border-box;
524
+ border: 1px solid #d7d7d7;
525
+ border-bottom: 0px;
526
+ margin-right: 5px;
527
+ border-radius: 2px;
521
528
 
522
529
  &.toggle A {
523
530
  color: var(--primary);
531
+ padding: 0px;
524
532
  }
525
533
 
526
534
  A {
527
- color: var(--primary);
535
+ color: var(--input-label);
536
+ padding: 0px;
528
537
  }
529
538
 
530
539
  &.active {
531
540
  background-color: var(--body-bg);
532
- border-left: solid 5px var(--primary);
541
+ border-top: solid 2px var(--primary);
542
+ position: relative;
543
+ &.active::before{
544
+ position: absolute;
545
+ right: 0;
546
+ left: 0;
547
+ top: 34px;
548
+ border-bottom: 1px solid #fff;
549
+ content: '';
533
550
 
551
+ }
534
552
  & A {
535
- color: var(--input-label);
553
+ color: var(--primary);
536
554
  }
537
555
  }
538
556
 
@@ -576,7 +594,7 @@ export default {
576
594
  &
577
595
 
578
596
  .tab-container {
579
- width: calc(100% - #{$sideways-tabs-width});
597
+ /* width: calc(100% - #{$sideways-tabs-width}); */
580
598
  flex-grow: 1;
581
599
  background-color: var(--body-bg);
582
600
  }
@@ -247,7 +247,6 @@ export default {
247
247
  @onInput="onInput"
248
248
  @onReady="onReady"
249
249
  @onChanges="onChanges"
250
- @validationChanged="$emit('validationChanged', $event)"
251
250
  />
252
251
  <FileDiff
253
252
  v-else
@@ -16,6 +16,10 @@ export default {
16
16
  showLabels: {
17
17
  type: Boolean,
18
18
  default: false,
19
+ },
20
+ isShowPass: {
21
+ type: Boolean,
22
+ default: false,
19
23
  }
20
24
  },
21
25
 
@@ -88,7 +92,7 @@ export default {
88
92
  <template v-else-if="principal">
89
93
  <div class="avatar">
90
94
  <img
91
- :src="principal.avatarSrc"
95
+ src="@shell/assets/images/user.png"
92
96
  :class="{'round': principal.roundAvatar}"
93
97
  :alt="t('principal.alt.avatar')"
94
98
  >
@@ -98,11 +102,19 @@ export default {
98
102
  class="name"
99
103
  >
100
104
  <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>
105
+ <tr class="mb-10">
106
+ <td>{{ t('principal.name') }}: </td><td>{{ principal.name || principal.loginName }}</td>
107
+ </tr>
108
+ <tr class="mb-10">
109
+ <td>{{ t('principal.loginName') }}: </td><td>{{ principal.loginName }}</td>
110
+ </tr>
111
+ <tr
112
+ v-if="isShowPass"
113
+ class="mb-10"
114
+ >
115
+ <td>修改密码: </td><td>****** <slot name="edit" /></td>
116
+ </tr>
117
+ <tr><td>{{ t('principal.type') }}: </td><td>{{ principal.displayType }}</td></tr>
106
118
  </table>
107
119
  </div>
108
120
  <template v-else>
@@ -154,7 +166,7 @@ export default {
154
166
  </template>
155
167
 
156
168
  <style lang="scss" scoped>
157
- $size: 40px;
169
+ $size: 20px;
158
170
 
159
171
  .principal {
160
172
  display: grid;
@@ -162,7 +174,7 @@ export default {
162
174
  "avatar name"
163
175
  "avatar description";
164
176
  grid-template-columns: $size auto;
165
- grid-template-rows: auto math.div($size, 2);
177
+ // grid-template-rows: auto math.div($size, 2);
166
178
  column-gap: 10px;
167
179
 
168
180
  th {
@@ -172,23 +184,35 @@ export default {
172
184
  }
173
185
 
174
186
  &.showLabels {
175
- grid-template-areas:
187
+ /* grid-template-areas:
176
188
  "avatar name";
177
189
  grid-template-columns: 60px auto;
178
190
  grid-template-rows: 60px;
179
- column-gap: 0;
191
+ column-gap: 0; */
192
+ display: flex;
193
+ column-gap:0;
180
194
  .name {
195
+ display: flex;
181
196
  line-height: unset;
182
197
  }
183
-
198
+ table tr {
199
+ display: block;
200
+ }
184
201
  table tr td:not(:first-of-type) {
185
202
  padding-left: 10px;
186
203
  }
204
+ table tr td:not(:last-of-type) {
205
+ width: 100px;
206
+ }
187
207
  }
188
208
 
189
209
  .avatar {
190
- grid-area: avatar;
191
- text-align: center;
210
+ /* grid-area: avatar;
211
+ text-align: center; */
212
+ width: 287px;
213
+ display: flex;
214
+ justify-content: center;
215
+ align-items: center;
192
216
 
193
217
  DIV.empty {
194
218
  border: 1px solid var(--border);
@@ -333,7 +333,7 @@ export default {
333
333
  return this.value.listLocation;
334
334
  },
335
335
  ruleClass() {
336
- return `col ${ this.isNamespaced ? 'span-4' : 'span-3' }`;
336
+ return `ruleCls col ${ this.isNamespaced ? 'span-3' : 'span-3' }`;
337
337
  },
338
338
  // Detail View
339
339
  rules() {
@@ -546,7 +546,11 @@ export default {
546
546
  </script>
547
547
 
548
548
  <template>
549
+
550
+ <!-- 加载状态下显示 Loading 组件 -->
549
551
  <Loading v-if="$fetchState.pending" />
552
+
553
+ <!-- 主表单容器,基于 CruResource 封装 -->
550
554
  <CruResource
551
555
  v-else
552
556
  class="receiver"
@@ -560,7 +564,10 @@ export default {
560
564
  @finish="save"
561
565
  @cancel="cancel"
562
566
  >
567
+ <!-- ========== 详情模式显示规则表 ========== -->
563
568
  <template v-if="isDetail">
569
+
570
+ <!-- 当前规则列表 -->
564
571
  <SortableTable
565
572
  key-field="index"
566
573
  :rows="rules"
@@ -611,7 +618,11 @@ export default {
611
618
  />
612
619
  </div>
613
620
  </template>
621
+
622
+ <!-- ========== 表单编辑/创建模式 ========== -->
614
623
  <template v-else>
624
+
625
+ <!-- 名称 & 命名空间 & 描述输入 -->
615
626
  <NameNsDescription
616
627
  :value="value"
617
628
  :namespaced="isNamespaced"
@@ -622,11 +633,15 @@ export default {
622
633
  :rules="{ name: fvGetAndReportPathRules('displayName') }"
623
634
  @update:value="$emit('input', $event)"
624
635
  />
636
+
637
+ <!-- Rancher 相关的默认选项设置 -->
625
638
  <div
626
639
  v-if="isRancherType"
627
640
  class="row"
628
641
  >
629
642
  <div class="col span-6">
643
+
644
+ <!-- 默认角色选项 -->
630
645
  <RadioGroup
631
646
  v-model:value="defaultValue"
632
647
  name="storageSource"
@@ -637,6 +652,8 @@ export default {
637
652
  :mode="mode"
638
653
  />
639
654
  </div>
655
+
656
+ <!-- 锁定角色模板选项 -->
640
657
  <div
641
658
  v-if="isRancherRoleTemplate"
642
659
  class="col span-6"
@@ -653,17 +670,25 @@ export default {
653
670
  </div>
654
671
  </div>
655
672
  <div class="spacer" />
673
+
674
+ <!-- ========== 选项卡容器 ========== -->
656
675
  <Tabbed :side-tabs="true">
676
+
677
+ <!-- ---------- 授权资源 Tab ---------- -->
657
678
  <Tab
658
679
  name="grant-resources"
659
680
  :label="t('rbac.roletemplate.tabs.grantResources.label')"
660
681
  :weight="1"
661
682
  >
683
+
684
+ <!-- 校验错误展示 -->
662
685
  <Error
663
686
  :value="value.rules"
664
687
  :rules="fvGetAndReportPathRules('rules')"
665
688
  as-banner
666
689
  />
690
+
691
+ <!-- 规则编辑列表 -->
667
692
  <ArrayList
668
693
  v-model:value="value.rules"
669
694
  label="Resources"
@@ -673,9 +698,11 @@ export default {
673
698
  :default-add-value="defaultRule"
674
699
  :initial-empty-row="true"
675
700
  :show-header="true"
676
- add-label="Add Resource"
701
+ add-label="添加资源"
677
702
  :mode="mode"
678
703
  >
704
+
705
+ <!-- 列表头部 -->
679
706
  <template #column-headers>
680
707
  <div class="column-headers row">
681
708
  <div :class="ruleClass">
@@ -707,8 +734,12 @@ export default {
707
734
  </div>
708
735
  </div>
709
736
  </template>
737
+
738
+ <!-- 列内容渲染 -->
710
739
  <template #columns="props">
711
740
  <div class="columns row mr-20">
741
+
742
+ <!-- 动作(verbs)选择 -->
712
743
  <div :class="ruleClass">
713
744
  <!-- Select verbs -->
714
745
  <Select
@@ -725,8 +756,11 @@ export default {
725
756
  @update:value="updateSelectValue(props.row.value, 'verbs', $event)"
726
757
  />
727
758
  </div>
759
+
760
+ <!-- 资源(resources)选择 -->
728
761
  <div :class="ruleClass">
729
762
  <Select
763
+ style="width: auto;"
730
764
  :value="getRule('resources', props.row.value)"
731
765
  :disabled="isBuiltin"
732
766
  :options="resourceOptions"
@@ -740,6 +774,8 @@ export default {
740
774
  @createdListItem="setRule('resources', props.row.value, $event)"
741
775
  />
742
776
  </div>
777
+
778
+ <!-- API Groups 输入 -->
743
779
  <div :class="ruleClass">
744
780
  <LabeledInput
745
781
  :value="getRule('apiGroups', props.row.value)"
@@ -749,6 +785,8 @@ export default {
749
785
  @input="setRule('apiGroups', props.row.value, $event.target.value)"
750
786
  />
751
787
  </div>
788
+
789
+ <!-- 非命名空间 URL 输入(仅非命名空间模式显示) -->
752
790
  <div
753
791
  v-if="!isNamespaced"
754
792
  :class="ruleClass"
@@ -776,10 +814,12 @@ export default {
776
814
  </template>
777
815
  </ArrayList>
778
816
  </Tab>
817
+
818
+ <!-- ---------- 继承角色模板 Tab(仅 Rancher 角色模板可用) ---------- -->
779
819
  <Tab
780
820
  v-if="isRancherRoleTemplate"
781
821
  name="inherit-from"
782
- label="Inherit From"
822
+ label="继承表单"
783
823
  :weight="0"
784
824
  >
785
825
  <ArrayList
@@ -788,7 +828,7 @@ export default {
788
828
  :remove-allowed="!isBuiltin"
789
829
  :add-allowed="!isBuiltin"
790
830
  label="Resources"
791
- add-label="Add Resource"
831
+ add-label="添加资源"
792
832
  :mode="mode"
793
833
  >
794
834
  <template #columns="props">
@@ -819,13 +859,16 @@ export default {
819
859
  </template>
820
860
 
821
861
  <style lang="scss" scoped>
862
+ .ruleCls {
863
+ margin-right: 10px;
864
+ }
822
865
  .required {
823
866
  color: var(--error);
824
867
  }
825
868
 
826
869
  :deep() {
827
870
  .column-headers {
828
- margin-right: 75px;
871
+ margin-right: 95px;
829
872
  margin-bottom: 5px;
830
873
  }
831
874
 
@@ -835,7 +878,6 @@ export default {
835
878
  .remove {
836
879
  display: flex;
837
880
  flex-direction: column;
838
- justify-content: center;
839
881
  align-items: flex-end;
840
882
  }
841
883
  }
@@ -843,8 +885,17 @@ export default {
843
885
  .columns {
844
886
  .col > .unlabeled-select:not(.taggable) {
845
887
  // override the odd padding-top from shell/assets/styles/global/_select.scss
846
- padding: $unlabaled-select-padding
888
+ /* padding: $unlabaled-select-padding */
889
+ }
890
+ }
891
+ }
892
+
893
+ .columns {
894
+ :deep() {
895
+ .unlabeled-select {
896
+ width: auto;
847
897
  }
848
898
  }
899
+
849
900
  }
850
901
  </style>
@@ -212,6 +212,7 @@ export default {
212
212
  <Principal
213
213
  :value="option.label"
214
214
  :use-muted="false"
215
+ style="padding-top: 6px;"
215
216
  />
216
217
  </template>
217
218