dashboard-shell-shell 1.0.112 → 1.0.113

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 (161) hide show
  1. package/.DS_Store +0 -0
  2. package/assets/icons/demo.css +539 -0
  3. package/assets/icons/demo_index.html +1131 -0
  4. package/assets/icons/iconfont.css +200 -0
  5. package/assets/icons/iconfont.js +1 -0
  6. package/assets/icons/iconfont.json +296 -0
  7. package/assets/icons/iconfont.ttf +0 -0
  8. package/assets/icons/iconfont.woff +0 -0
  9. package/assets/icons/iconfont.woff2 +0 -0
  10. package/assets/images/API.svg +3 -0
  11. package/assets/images/login/password.svg +20 -0
  12. package/assets/images/login/user.svg +6 -0
  13. package/assets/images/login-bg.png +0 -0
  14. package/assets/images/login-left.png +0 -0
  15. package/assets/images/login-logo.svg +19 -0
  16. package/assets/images/logo.png +0 -0
  17. package/assets/images/pl/harvester.png +0 -0
  18. package/assets/images/promp-yellow.svg +5 -0
  19. package/assets/images/user.png +0 -0
  20. package/assets/styles/all.scss +63 -0
  21. package/assets/styles/app.scss +2 -0
  22. package/assets/styles/base/_basic.scss +8 -2
  23. package/assets/styles/base/_helpers.scss +4 -0
  24. package/assets/styles/base/_typography.scss +2 -1
  25. package/assets/styles/base/_variables.scss +10 -2
  26. package/assets/styles/global/_button.scss +37 -25
  27. package/assets/styles/global/_columns.scss +3 -1
  28. package/assets/styles/global/_form.scss +45 -13
  29. package/assets/styles/global/_labeled-input.scss +50 -25
  30. package/assets/styles/global/_layout.scss +9 -3
  31. package/assets/styles/global/_select.scss +20 -13
  32. package/assets/styles/global/_table.scss +1 -1
  33. package/assets/styles/global/_tooltip.scss +47 -6
  34. package/assets/styles/themes/_dark.scss +1 -0
  35. package/assets/styles/themes/_light.scss +59 -46
  36. package/assets/styles/themes/_suse.scss +1 -0
  37. package/assets/styles/vendor/vue-select.scss +18 -7
  38. package/assets/translations/en-us.yaml +93 -12
  39. package/assets/translations/zh-hans.yaml +278 -141
  40. package/components/ActionDropdown.vue +1 -1
  41. package/components/ActionDropdownShell.vue +71 -0
  42. package/components/ActionMenu.vue +2 -2
  43. package/components/ActionMenuShell.vue +1 -0
  44. package/components/AppModal.vue +78 -6
  45. package/components/AssignTo.vue +25 -11
  46. package/components/AsyncButton.vue +24 -7
  47. package/components/BannerGraphic.vue +1 -0
  48. package/components/ButtonDropdown.vue +26 -4
  49. package/components/ButtonGroup.vue +4 -0
  50. package/components/ButtonMultiAction.vue +1 -0
  51. package/components/CommunityLinks.vue +3 -3
  52. package/components/ConsumptionGauge.vue +24 -5
  53. package/components/CopyToClipboardText.vue +2 -1
  54. package/components/CruResource.vue +12 -7
  55. package/components/CruResourceFooter.vue +2 -2
  56. package/components/DashboardOptions.vue +21 -15
  57. package/components/DetailText.vue +5 -0
  58. package/components/DisableAuthProviderModal.vue +1 -0
  59. package/components/DotState.vue +84 -0
  60. package/components/ExplorerMembers.vue +1 -1
  61. package/components/ExplorerProjectsNamespaces.vue +56 -14
  62. package/components/FixedBanner.vue +19 -12
  63. package/components/GlobalRoleBindings.vue +5 -1
  64. package/components/GrafanaDashboard.vue +4 -4
  65. package/components/GrowlManager.vue +4 -1
  66. package/components/HardwareResourceGauge.vue +39 -3
  67. package/components/InfoBox.vue +3 -3
  68. package/components/InputOrDisplay.vue +28 -2
  69. package/components/LabelValue.vue +16 -1
  70. package/components/LandingPagePreference.vue +5 -3
  71. package/components/LocaleSelector.vue +39 -93
  72. package/components/ModalManager.vue +55 -0
  73. package/components/ModalWithCard.vue +2 -0
  74. package/components/MoveModal.vue +1 -0
  75. package/components/PromptChangePassword.vue +1 -1
  76. package/components/PromptModal.vue +15 -2
  77. package/components/PromptRemove.vue +28 -8
  78. package/components/PromptRestore.vue +1 -0
  79. package/components/ResourceCancelModal.vue +1 -0
  80. package/components/ResourceDetail/Masthead.vue +188 -43
  81. package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
  82. package/components/ResourceDetail/index.vue +49 -14
  83. package/components/ResourceList/Masthead.vue +80 -18
  84. package/components/ResourceTable.vue +60 -19
  85. package/components/SideNav.vue +32 -12
  86. package/components/SlideInPanelManager.vue +126 -0
  87. package/components/SortableTable/THead.vue +34 -5
  88. package/components/SortableTable/actions.js +1 -1
  89. package/components/SortableTable/index.vue +649 -142
  90. package/components/SortableTable/paging.js +36 -28
  91. package/components/SortableTable/selection.js +0 -11
  92. package/components/StatusBadge.vue +77 -0
  93. package/components/Tabbed/Tab.vue +3 -3
  94. package/components/Tabbed/index.vue +44 -26
  95. package/components/Wizard.vue +2 -2
  96. package/components/__tests__/AsyncButton.test.ts +2 -2
  97. package/components/__tests__/FixedBanner.test.ts +3 -3
  98. package/components/__tests__/ModalManager.spec.ts +176 -0
  99. package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
  100. package/components/auth/Principal.vue +10 -3
  101. package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
  102. package/components/form/ArrayList.vue +123 -85
  103. package/components/form/ArrayListGrouped.vue +10 -2
  104. package/components/form/Command.vue +6 -15
  105. package/components/form/EnvVars.vue +16 -8
  106. package/components/form/Footer.vue +8 -5
  107. package/components/form/HealthCheck.vue +3 -3
  108. package/components/form/HookOption.vue +11 -16
  109. package/components/form/KeyValue.vue +16 -7
  110. package/components/form/LabeledSelect.vue +59 -76
  111. package/components/form/LifecycleHooks.vue +3 -3
  112. package/components/form/MatchExpressions.vue +35 -12
  113. package/components/form/NameNsDescription.vue +147 -115
  114. package/components/form/Networking.vue +20 -12
  115. package/components/form/NodeAffinity.vue +31 -23
  116. package/components/form/NodeScheduling.vue +13 -3
  117. package/components/form/Password.vue +11 -5
  118. package/components/form/PodAffinity.vue +43 -44
  119. package/components/form/Probe.vue +68 -66
  120. package/components/form/ResourceQuota/Project.vue +5 -1
  121. package/components/form/ResourceSelector.vue +7 -9
  122. package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +6 -3
  123. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +12 -1
  124. package/components/form/SSHKnownHosts/index.vue +16 -2
  125. package/components/form/Security.vue +54 -56
  126. package/components/form/Select.vue +41 -7
  127. package/components/form/ShellInput.vue +5 -1
  128. package/components/form/Tolerations.vue +5 -1
  129. package/components/form/UnitInput.vue +2 -2
  130. package/components/form/ValueFromResource.vue +134 -121
  131. package/components/form/WorkloadPorts.vue +18 -18
  132. package/components/form/__tests__/ArrayList.test.ts +5 -2
  133. package/components/form/__tests__/MatchExpressions.test.ts +12 -12
  134. package/components/form/__tests__/NameNsDescription.test.ts +115 -14
  135. package/components/form/__tests__/Probe.test.ts +12 -8
  136. package/components/form/__tests__/SSHKnownHosts.test.ts +11 -0
  137. package/components/form/__tests__/Select.test.ts +37 -0
  138. package/components/form/__tests__/UnitInput.test.ts +4 -5
  139. package/components/formatter/BadgeStateFormatter.vue +8 -5
  140. package/components/formatter/InternalExternalIP.vue +2 -0
  141. package/components/formatter/SecretData.vue +20 -7
  142. package/components/nav/Favorite.vue +5 -1
  143. package/components/nav/Group.vue +60 -27
  144. package/components/nav/Header.vue +39 -13
  145. package/components/nav/Jump.vue +7 -0
  146. package/components/nav/NamespaceFilter.vue +14 -8
  147. package/components/nav/Pinned.vue +1 -1
  148. package/components/nav/TopLevelMenu.vue +5 -17
  149. package/components/nav/Type.vue +32 -35
  150. package/components/nav/__tests__/TopLevelMenu.test.ts +0 -40
  151. package/components/templates/blank.vue +4 -1
  152. package/components/templates/default.vue +8 -0
  153. package/components/templates/home.vue +10 -1
  154. package/components/templates/plain.vue +10 -1
  155. package/package.json +1 -1
  156. package/store/type-map.js +29 -2
  157. package/utils/error.js +30 -8
  158. package/utils/errorTranslate.json +916 -0
  159. package/components/formatter/ExtensionCache.vue +0 -74
  160. package/components/formatter/Port.vue +0 -24
  161. package/components/formatter/SecretType.vue +0 -41
@@ -2,7 +2,8 @@
2
2
  import { KUBERNETES, PROJECT } from '@shell/config/labels-annotations';
3
3
  import { FLEET, NAMESPACE, MANAGEMENT, HELM } from '@shell/config/types';
4
4
  import ButtonGroup from '@shell/components/ButtonGroup';
5
- import { BadgeState } from '@components/BadgeState';
5
+ // import { BadgeState } from '@components/BadgeState';
6
+ import DotState from '@shell/components/DotState.vue';
6
7
  import { Banner } from '@components/Banner';
7
8
  import { get } from '@shell/utils/object';
8
9
  import { NAME as FLEET_NAME } from '@shell/config/product/fleet';
@@ -13,6 +14,9 @@ import {
13
14
  import { ExtensionPoint, PanelLocation } from '@shell/core/types';
14
15
  import ExtensionPanel from '@shell/components/ExtensionPanel';
15
16
  import TabTitle from '@shell/components/TabTitle';
17
+ import ActionMenu from '@shell/components/ActionMenuShell.vue';
18
+ import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
19
+ import { useStore } from 'vuex';
16
20
 
17
21
  // i18n-uses resourceDetail.header.*
18
22
 
@@ -26,7 +30,13 @@ export default {
26
30
  name: 'MastheadResourceDetail',
27
31
 
28
32
  components: {
29
- BadgeState, Banner, ButtonGroup, ExtensionPanel, TabTitle
33
+ // BadgeState,
34
+ DotState,
35
+ Banner,
36
+ ButtonGroup,
37
+ ExtensionPanel,
38
+ TabTitle,
39
+ ActionMenu,
30
40
  },
31
41
  props: {
32
42
  value: {
@@ -92,11 +102,19 @@ export default {
92
102
  }
93
103
  },
94
104
 
105
+ setup() {
106
+ const store = useStore();
107
+ const { featureDropdownMenu } = useRuntimeFlag(store);
108
+
109
+ return { featureDropdownMenu };
110
+ },
111
+
95
112
  data() {
96
113
  return {
97
114
  DETAIL_VIEW: _DETAIL,
98
115
  extensionType: ExtensionPoint.PANEL,
99
116
  extensionLocation: PanelLocation.DETAILS_MASTHEAD,
117
+ Svg: require('~shell/assets/images/API.svg')
100
118
  };
101
119
  },
102
120
 
@@ -378,6 +396,33 @@ export default {
378
396
  return this.shouldHifenize ? ` - ${ displayName }` : displayName;
379
397
  },
380
398
 
399
+ demoDisplay() {
400
+ const product = this.$store.getters['productId'];
401
+
402
+ const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this.location.params.resource);
403
+
404
+ if (productId === undefined) {
405
+ return '';
406
+ }
407
+ const parts = productId.split('::');
408
+ const newString = 'root';
409
+
410
+ if (!parts?.includes(newString)) {
411
+ parts.unshift(newString); // 将字符串添加到数组第一位
412
+ }
413
+
414
+ const partsEn = parts.map((item) => {
415
+ return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
416
+ });
417
+
418
+ return partsEn;
419
+ },
420
+ menuIcon() {
421
+ const product = this.$store.getters['productId'];
422
+
423
+ return this.$store.getters['type-map/groupsForVirTypes'](product, this.location.params.resource);
424
+ },
425
+
381
426
  location() {
382
427
  const { parent } = this;
383
428
 
@@ -424,10 +469,81 @@ export default {
424
469
 
425
470
  <template>
426
471
  <div class="masthead">
472
+ <div class="title">
473
+ <!-- 创建api密钥不需要面包屑 -->
474
+ <div
475
+ v-if="!(parentRouteOverride === 'account' && resource=== 'token')"
476
+ class="excram-list"
477
+ >
478
+ <span
479
+ v-for="(item,index) in demoDisplay"
480
+ :key="index"
481
+ >
482
+ <span>{{ item }}</span>
483
+ <span>/</span>
484
+ </span>
485
+ <span class="excram-last-name">
486
+ {{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + parent.displayName }}
487
+ </span>
488
+ </div>
427
489
  <header>
428
490
  <div class="title">
429
491
  <div class="primaryheader">
430
- <h1>
492
+ <span class="primary-title">
493
+ <!-- <nuxt-link
494
+ v-if="location"
495
+ :to="location"
496
+ >
497
+ {{ parent.displayName }}:
498
+ </nuxt-link> -->
499
+ <span class="detailIcon-span">
500
+ <img
501
+ v-if="parentRouteOverride === 'account' && resource=== 'token'"
502
+ :src="Svg"
503
+ style="margin-top: 4px; margin-left: 5px;"
504
+ >
505
+ <i
506
+ v-else
507
+ :class="'icon-'+ menuIcon + ' detailIcon'"
508
+ />
509
+ </span>
510
+ <span class="detailIcon-span-title">{{ realMode=== 'create'? '创建': '' }}{{ parent.displayName }}{{ realMode=== 'create'? '': '名称:' }}</span>
511
+ <span v-if="realMode !== 'create'">
512
+ <span v-if="value.detailPageHeaderActionOverride && value.detailPageHeaderActionOverride(realMode)">{{ value.detailPageHeaderActionOverride(realMode) }}</span>
513
+ <t
514
+ v-else
515
+ :k="'resourceDetail.header.' + realMode"
516
+ :subtype="resourceSubtype"
517
+ :name="displayName"
518
+ :escapehtml="false"
519
+ />
520
+ </span>
521
+ <DotState
522
+ v-if="!isCreate && parent.showState"
523
+ class="masthead-state"
524
+ :value="value"
525
+ />
526
+ <span
527
+ v-if="!isCreate && value.injectionEnabled"
528
+ class="masthead-istio"
529
+ >
530
+ <i
531
+ v-clean-tooltip="t('projectNamespaces.isIstioInjectionEnabled')"
532
+ class="icon icon-sm icon-istio"
533
+ />
534
+ </span>
535
+ </span>
536
+ <span
537
+ v-if="location"
538
+ class="valid"
539
+ >|</span>
540
+ <router-link
541
+ v-if="location"
542
+ :to="location"
543
+ >
544
+ 返回
545
+ </router-link>
546
+ <!-- <h1>
431
547
  <TabTitle
432
548
  v-if="isCreate"
433
549
  :showChild="false"
@@ -483,9 +599,9 @@ export default {
483
599
  >
484
600
  <i class="icon icon-external-link" />
485
601
  </a>
486
- </h1>
602
+ </h1> -->
487
603
  </div>
488
- <div
604
+ <!-- <div
489
605
  v-if="!isCreate"
490
606
  class="subheader"
491
607
  >
@@ -531,7 +647,7 @@ export default {
531
647
  </span>
532
648
  </span>
533
649
  <span v-if="value.showPodRestarts">{{ t("resourceDetail.masthead.restartCount") }}:<span class="live-data"> {{ value.restartCount }}</span></span>
534
- </div>
650
+ </div> -->
535
651
  </div>
536
652
  <slot name="right">
537
653
  <div class="actions-container align-start">
@@ -561,17 +677,28 @@ export default {
561
677
  class="mr-10"
562
678
  />
563
679
 
564
- <button
565
- v-if="isView"
566
- ref="actions"
567
- data-testid="masthead-action-menu"
568
- aria-haspopup="true"
569
- type="button"
570
- class="btn role-multi-action actions"
571
- @click="showActions"
572
- >
573
- <i class="icon icon-actions" />
574
- </button>
680
+ <template v-if="featureDropdownMenu">
681
+ <ActionMenu
682
+ v-if="isView"
683
+ button-role="multiAction"
684
+ button-size="compact"
685
+ :resource="value"
686
+ data-testid="masthead-action-menu"
687
+ />
688
+ </template>
689
+ <template v-else>
690
+ <button
691
+ v-if="isView"
692
+ ref="actions"
693
+ data-testid="masthead-action-menu"
694
+ aria-haspopup="true"
695
+ type="button"
696
+ class="btn role-multi-action actions"
697
+ @click="showActions"
698
+ >
699
+ <i class="icon icon-actions" />
700
+ </button>
701
+ </template>
575
702
  </div>
576
703
  </div>
577
704
  </slot>
@@ -598,42 +725,30 @@ export default {
598
725
  />
599
726
 
600
727
  <slot />
728
+ </div>
601
729
  </div>
602
730
  </template>
603
731
 
604
732
  <style lang='scss' scoped>
605
733
  .masthead {
606
734
  padding-bottom: 10px;
607
- border-bottom: 1px solid var(--border);
735
+ /* border-bottom: 1px solid var(--border); */
608
736
  margin-bottom: 10px;
609
737
  }
610
738
 
611
739
  HEADER {
612
740
  margin: 0;
613
- grid-template-columns: minmax(0, 1fr) auto;
614
741
  }
615
742
 
616
743
  .primaryheader {
617
744
  display: flex;
618
745
  flex-direction: row;
619
746
  align-items: center;
747
+ font-size:14px;
748
+ height: 50px;
620
749
 
621
750
  h1 {
622
- margin: 0 0 0 -5px;
623
- overflow-x: hidden;
624
- display: flex;
625
- flex-direction: row;
626
- align-items: center;
627
-
628
- .masthead-resource-title {
629
- text-overflow: ellipsis;
630
- overflow: hidden;
631
- white-space: nowrap;
632
- }
633
-
634
- .masthead-resource-list-link {
635
- margin: 5px;
636
- }
751
+ margin: 0;
637
752
  }
638
753
  }
639
754
 
@@ -646,8 +761,7 @@ export default {
646
761
  }
647
762
 
648
763
  .live-data {
649
- color: var(--body-text);
650
- margin-left: 3px;
764
+ color: var(--body-text)
651
765
  }
652
766
  }
653
767
 
@@ -656,8 +770,12 @@ export default {
656
770
  }
657
771
 
658
772
  .masthead-state {
659
- margin-left: 8px;
660
773
  font-size: initial;
774
+ display: inline-block;
775
+ position: relative;
776
+ /* top: -2px; */
777
+ font-size: 12px;
778
+ margin-left: 5px;
661
779
  }
662
780
 
663
781
  .masthead-istio {
@@ -680,13 +798,40 @@ export default {
680
798
  }
681
799
  }
682
800
 
683
- div.actions-container > div.actions {
684
- display: flex;
685
- flex-direction: row;
686
- justify-content: flex-end;
687
- }
688
-
689
801
  .resource-external {
690
802
  font-size: 18px;
691
803
  }
804
+ .excram-list{
805
+ font-size: 14px;
806
+ margin-bottom: 20px;
807
+ }
808
+ .excram-last-name{
809
+ color: var(--link);
810
+ }
811
+ .valid{
812
+ color: #d7d7d7;
813
+ margin: 0px 10px;
814
+ }
815
+ .detailIcon-span{
816
+ width: 24px;
817
+ height: 24px;
818
+ display: inline-block;
819
+ position: relative;
820
+ background: var(--primary);
821
+ margin-right: 10px;
822
+ }
823
+ .detailIcon{
824
+ position: absolute;
825
+ color: #fff;
826
+ font-size: 38px;
827
+ left: 4px;
828
+ top: -2px;
829
+ }
830
+ .primary-title{
831
+ display: flex;
832
+ align-items: center;
833
+ }
834
+ .detailIcon-span-title{
835
+ font-weight: bold;
836
+ }
692
837
  </style>
@@ -1,6 +1,7 @@
1
1
  import { mount, RouterLinkStub } from '@vue/test-utils';
2
2
  import { _VIEW } from '@shell/config/query-params';
3
3
  import Masthead from '@shell/components/ResourceDetail/Masthead.vue';
4
+ import { createStore } from 'vuex';
4
5
 
5
6
  const mockedStore = () => {
6
7
  return {
@@ -17,12 +18,15 @@ const mockedStore = () => {
17
18
  };
18
19
 
19
20
  const requiredSetup = () => {
21
+ const store = createStore({ getters: { 'management/byId': () => jest.fn() } });
22
+
20
23
  return {
21
24
  stubs: {
22
25
  'router-link': RouterLinkStub,
23
26
  LiveDate: true
24
27
  },
25
- mocks: { $store: mockedStore() }
28
+ provide: { store },
29
+ mocks: { $store: mockedStore() }
26
30
  };
27
31
  };
28
32
 
@@ -384,18 +384,7 @@ export default {
384
384
  },
385
385
 
386
386
  created() {
387
- // eslint-disable-next-line prefer-const
388
- const id = this.$route.params.id;
389
- const resource = this.resourceOverride || this.$route.params.resource;
390
- const options = this.$store.getters[`type-map/optionsFor`](resource);
391
-
392
- const detailResource = options.resourceDetail || options.resource || resource;
393
- const editResource = options.resourceEdit || options.resource || resource;
394
-
395
- // FIXME: These aren't right... signature is (rawType, subType).. not (rawType, resourceId)
396
- // Remove id? How does subtype get in (cluster/node)
397
- this.detailComponent = this.$store.getters['type-map/importDetail'](detailResource, id);
398
- this.editComponent = this.$store.getters['type-map/importEdit'](editResource, id);
387
+ this.configureResource();
399
388
  },
400
389
 
401
390
  methods: {
@@ -414,6 +403,51 @@ export default {
414
403
  closeError(index) {
415
404
  this.errors = this.errors.filter((_, i) => i !== index);
416
405
  },
406
+ /**
407
+ * Initializes the resource components based on the provided user and
408
+ * resource override.
409
+ *
410
+ * Configures the detail and edit components for a resource based on the
411
+ * user's ID and the specified resource.
412
+ *
413
+ * @param {Object} user - The user object containing user-specific
414
+ * information.
415
+ * @param {string|null} resourceOverride - An optional resource override
416
+ * string. If not provided, the method will use the default resource from
417
+ * the route parameters or the instance's resourceOverride property.
418
+ */
419
+ configureResource(userId = '', resourceOverride = null) {
420
+ const id = userId || this.$route.params.id;
421
+ const resource = resourceOverride || this.resourceOverride || this.$route.params.resource;
422
+ const options = this.$store.getters[`type-map/optionsFor`](resource);
423
+
424
+ const detailResource = options.resourceDetail || options.resource || resource;
425
+ const editResource = options.resourceEdit || options.resource || resource;
426
+
427
+ // FIXME: These aren't right... signature is (rawType, subType).. not (rawType, resourceId)
428
+ // Remove id? How does subtype get in (cluster/node)
429
+ this.detailComponent = this.$store.getters['type-map/importDetail'](detailResource, id);
430
+ this.editComponent = this.$store.getters['type-map/importEdit'](editResource, id);
431
+ },
432
+ /**
433
+ * Sets the mode and initializes the resource components.
434
+ *
435
+ * This method sets the mode of the component and configures the resource
436
+ * components based on the provided user and resource.
437
+ *
438
+ * @param {Object} payload - An object containing the mode, user, and
439
+ * resource properties.
440
+ * @param {string} payload.mode - The mode to set.
441
+ * @param {Object} payload.user - The user object containing user-specific
442
+ * information.
443
+ * @param {string} payload.resource - The resource string to use for
444
+ * initialization.
445
+ */
446
+ setMode({ mode, userId, resource }) {
447
+ this.mode = mode;
448
+ this.value.id = userId;
449
+ this.configureResource(userId, resource);
450
+ }
417
451
  }
418
452
  };
419
453
  </script>
@@ -436,10 +470,10 @@ export default {
436
470
  :parent-route-override="parentRouteOverride"
437
471
  :store-override="storeOverride"
438
472
  >
439
- <DetailTop
473
+ <!-- <DetailTop
440
474
  v-if="isView && isDetail"
441
475
  :value="liveModel"
442
- />
476
+ /> -->
443
477
  </Masthead>
444
478
  <div
445
479
  v-if="hasErrors"
@@ -491,6 +525,7 @@ export default {
491
525
  :real-mode="realMode"
492
526
  :class="{'flex-content': flexContent}"
493
527
  @update:value="$emit('input', $event)"
528
+ @update:mode="setMode"
494
529
  @set-subtype="setSubtype"
495
530
  />
496
531
 
@@ -95,10 +95,12 @@ export default {
95
95
  query: { [AS]: _YAML },
96
96
  };
97
97
 
98
+ const tabList = ['集群配置'];
98
99
  return {
99
100
  formRoute,
100
101
  yamlRoute,
101
102
  hasEditComponent,
103
+ tabList,
102
104
  };
103
105
  },
104
106
 
@@ -125,6 +127,28 @@ export default {
125
127
 
126
128
  return this.$store.getters['type-map/labelFor'](this.schema, 99);
127
129
  },
130
+ _descriptionDisplay() {
131
+ const key = this.$route.path.split('/').pop();
132
+
133
+ return this.$store.getters['i18n/t'](`typeDescription."${ key.toLowerCase() }"`);
134
+ },
135
+ demoDisplay() {
136
+ const product = this.$store.getters['productId'];
137
+ const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this._createLocation.params.resource);
138
+ const parts = productId?.split('::');
139
+ const newString = 'root';
140
+
141
+ if (!parts.includes(newString)) {
142
+ parts.unshift(newString); // 将字符串添加到数组第一位
143
+ }
144
+
145
+ const partsEn = parts.map((item) => {
146
+ return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
147
+ });
148
+
149
+ return partsEn;
150
+ // return this.$store.getters['i18n/t'](`typeLabel."${ productId.toLowerCase() }"`)
151
+ },
128
152
 
129
153
  _isYamlCreatable() {
130
154
  if ( this.isYamlCreatable !== null) {
@@ -165,16 +189,30 @@ export default {
165
189
 
166
190
  <template>
167
191
  <header class="with-subheader">
168
- <slot name="typeDescription">
192
+ <!-- <slot name="typeDescription">
169
193
  <TypeDescription :resource="resource" />
170
- </slot>
194
+ </slot> -->
171
195
  <div class="title">
172
- <h1 class="m-0">
196
+ <div class="excram-list">
197
+ <span
198
+ v-for="(item,index) in demoDisplay"
199
+ :key="index"
200
+ >
201
+ <span>{{ item }}</span>
202
+ <span>/</span>
203
+ </span>
204
+ <span class="excram-last-name">{{ _typeDisplay }}</span>
205
+ </div>
206
+ <h1 class="m-0 descrip-name">
173
207
  <TabTitle>{{ _typeDisplay }}</TabTitle> <Favorite
174
208
  v-if="isExplorer"
175
209
  :resource="favoriteResource || resource"
176
210
  />
177
211
  </h1>
212
+ <!-- 描述 -->
213
+ <div class="masthod-title-description">
214
+ {{ _descriptionDisplay }}
215
+ </div>
178
216
  <ResourceLoadingIndicator
179
217
  v-if="showIncrementalLoadingIndicator"
180
218
  :resources="loadResources"
@@ -186,7 +224,15 @@ export default {
186
224
  <!--Slot content-->
187
225
  </slot>
188
226
  </div>
189
- <div class="actions-container">
227
+ <div
228
+ v-if="!(tabList.includes(_typeDisplay))"
229
+ style="width: 110%;height: 1px;background-color: #D7D7D7;margin-top: 10px;margin-bottom: 20px;margin-left: -20px;margin-right: -20px;"
230
+ />
231
+ <div
232
+ v-if="!(tabList.includes(_typeDisplay))"
233
+ class="actions-container"
234
+ style="width: 100%;min-height: 32px;text-align: left"
235
+ >
190
236
  <slot name="actions">
191
237
  <div class="actions">
192
238
  <slot name="extraActions" />
@@ -200,14 +246,14 @@ export default {
200
246
  >
201
247
  {{ _createButtonlabel }}
202
248
  </router-link>
203
- <router-link
249
+ <!-- <router-link
204
250
  v-else-if="_isYamlCreatable"
205
251
  :to="_yamlCreateLocation"
206
252
  class="btn role-primary"
207
253
  :data-testid="componentTestid+'-create-yaml'"
208
254
  >
209
255
  {{ t("resourceList.head.createFromYaml") }}
210
- </router-link>
256
+ </router-link> -->
211
257
  </slot>
212
258
  </div>
213
259
  </slot>
@@ -217,30 +263,46 @@ export default {
217
263
 
218
264
  <style lang="scss" scoped>
219
265
  .title {
220
- align-items: center;
221
- display: flex;
266
+ /* align-items: center;
267
+ display: flex; */
222
268
  h1 {
223
269
  margin: 0;
224
270
  }
225
271
  }
226
272
 
227
273
  header {
228
- margin-bottom: 20px;
274
+ /* margin-bottom: 20px; */
229
275
  }
230
276
 
231
277
  header.with-subheader {
232
- grid-template-areas:
278
+ /* grid-template-areas:
233
279
  'type-banner type-banner'
234
280
  'title actions'
235
281
  'sub-header sub-header'
236
- 'state-banner state-banner';
282
+ 'state-banner state-banner'; */
283
+ position: relative;
284
+ display: unset;
237
285
  }
238
-
239
- .sub-header {
240
- grid-area: sub-header;
241
-
242
- a {
243
- display: inline-block;
244
- }
286
+ .excram-list{
287
+ font-size: 14px;
288
+ line-height: 22px;
289
+ margin-bottom: 20px;
290
+ font-family: 'Microsoft YaHei';
291
+ }
292
+ .excram-last-name{
293
+ color: var(--primary);
294
+ }
295
+ .descrip-name{
296
+ font-size: 26px;
297
+ font-family: 'Microsoft YaHei';
298
+ }
299
+ .masthod-title-description{
300
+ font-family: 'Microsoft YaHei';
301
+ margin: 20px 0px;
302
+ }
303
+ .actions-container{
304
+ /* display: flex; */
305
+ /* margin-left: 0px; */
306
+ position: absolute;
245
307
  }
246
308
  </style>