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.
- package/assets/icons/iconfont.css +4 -1
- package/assets/images/pl/dark/logo.png +0 -0
- package/assets/styles/all.scss +21 -1
- package/assets/styles/base/_variables.scss +5 -5
- package/assets/styles/fonts/_icons.scss +3 -2
- package/assets/styles/global/_button.scss +8 -8
- package/assets/styles/global/_select.scss +1 -1
- package/assets/styles/global/_tooltip.scss +9 -5
- package/assets/styles/themes/_light.scss +3 -1
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/zh-hans.yaml +150 -13
- package/components/ActionDropdown.vue +1 -1
- package/components/ButtonDropdown.vue +3 -1
- package/components/CodeMirror.vue +6 -4
- package/components/ContainerResourceLimit.vue +2 -2
- package/components/CopyToClipboard.vue +15 -0
- package/components/Drawer/Chrome.vue +2 -2
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +30 -27
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
- package/components/Drawer/ResourceDetailDrawer/index.vue +5 -4
- package/components/ExplorerMembers.vue +28 -4
- package/components/GlobalRoleBindings.vue +48 -112
- package/components/PodSecurityAdmission.vue +2 -2
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
- package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
- package/components/Resource/Detail/Metadata/index.vue +3 -1
- package/components/Resource/Detail/TitleBar/Title.vue +4 -3
- package/components/Resource/Detail/TitleBar/Top.vue +2 -0
- package/components/Resource/Detail/TitleBar/composables.ts +16 -1
- package/components/Resource/Detail/TitleBar/index.vue +123 -25
- package/components/ResourceDetail/Masthead/index.vue +1 -1
- package/components/ResourceDetail/Masthead/latest.vue +1 -1
- package/components/ResourceDetail/Masthead/legacy.vue +239 -167
- package/components/ResourceDetail/legacy.vue +44 -28
- package/components/ResourceList/Masthead.vue +14 -15
- package/components/SideNav.vue +21 -21
- package/components/SortableTable/THead.vue +21 -1
- package/components/SortableTable/index.vue +21 -6
- package/components/Tabbed/index.vue +6 -1
- package/components/auth/Principal.vue +42 -13
- package/components/auth/RoleDetailEdit.vue +11 -7
- package/components/breadcrumb/index.vue +119 -0
- package/components/form/ArrayList.vue +164 -147
- package/components/form/ArrayListGrouped.vue +3 -1
- package/components/form/ChangePassword.vue +1 -1
- package/components/form/Command.vue +4 -5
- package/components/form/Conditions.vue +15 -1
- package/components/form/Footer.vue +1 -0
- package/components/form/HealthCheck.vue +0 -2
- package/components/form/HookOption.vue +87 -58
- package/components/form/InputWithSelect.vue +8 -7
- package/components/form/KeyValue.vue +20 -2
- package/components/form/LabeledSelect.vue +6 -3
- package/components/form/Labels.vue +2 -2
- package/components/form/MatchExpressions.vue +3 -4
- package/components/form/Members/ClusterMembershipEditor.vue +1 -1
- package/components/form/Members/ClusterPermissionsEditor.vue +5 -5
- package/components/form/Members/MembershipEditor.vue +2 -2
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/Networking.vue +6 -9
- package/components/form/NodeAffinity.vue +29 -28
- package/components/form/PodAffinity.vue +23 -23
- package/components/form/Probe.vue +15 -11
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
- package/components/form/ResourceQuota/Project.vue +4 -4
- package/components/form/ResourceQuota/ProjectRow.vue +36 -30
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/Security.vue +1 -3
- package/components/form/Select.vue +6 -1
- package/components/form/ServiceNameSelect.vue +2 -5
- package/components/form/ServicePorts.vue +149 -75
- package/components/form/Taints.vue +2 -1
- package/components/form/Tolerations.vue +12 -9
- package/components/form/ValueFromResource.vue +110 -96
- package/components/form/WorkloadPorts.vue +143 -123
- package/components/formatter/WorkloadHealthScale.vue +4 -3
- package/components/nav/Group.vue +6 -0
- package/components/nav/Header.vue +7 -4
- package/components/nav/NamespaceFilter.vue +15 -21
- package/components/nav/TopLevelMenu.vue +99 -125
- package/components/nav/Type.vue +15 -3
- package/config/menuRouteMap.js +10 -0
- package/config/product/explorer.js +5 -1
- package/config/router/navigation-guards/index.js +61 -3
- package/detail/node.vue +28 -23
- package/dialog/AddCustomBadgeDialog.vue +17 -9
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
- package/edit/configmap.vue +4 -0
- package/edit/networking.k8s.io.ingress/Certificate.vue +7 -5
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
- package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
- package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/persistentvolume/index.vue +3 -1
- package/edit/persistentvolumeclaim.vue +2 -0
- package/edit/secret/index.vue +2 -2
- package/edit/service.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +10 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
- package/edit/workload/Job.vue +31 -34
- package/edit/workload/Upgrading.vue +5 -5
- package/edit/workload/index.vue +22 -18
- package/edit/workload/storage/Mount.vue +1 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
- package/edit/workload/storage/azureDisk.vue +14 -10
- package/edit/workload/storage/azureFile.vue +9 -7
- package/edit/workload/storage/csi/index.vue +6 -9
- package/edit/workload/storage/emptyDir.vue +7 -5
- package/edit/workload/storage/gcePersistentDisk.vue +9 -7
- package/edit/workload/storage/hostPath.vue +7 -5
- package/edit/workload/storage/nfs.vue +8 -6
- package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
- package/edit/workload/storage/secret.vue +9 -6
- package/edit/workload/storage/vsphereVolume.vue +11 -7
- package/initialize/app-extended.js +7 -1
- package/models/provisioning.cattle.io.cluster.js +19 -18
- package/package.json +1 -1
- package/pages/account/index.vue +95 -115
- package/pages/auth/setup.vue +35 -16
- package/pages/c/_cluster/auth/roles/index.vue +38 -5
- package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
- package/pages/c/_cluster/explorer/tools/index.vue +6 -6
- package/pages/home.vue +3 -4
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/resource-class.js +28 -27
- package/rancher-components/BadgeState/BadgeState.vue +33 -52
- package/rancher-components/Banner/Banner.vue +4 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
- package/scripts/publish-shell.sh +1 -1
- package/store/i18n.js +4 -0
- package/store/type-map.js +1 -1
- package/types/shell/index.d.ts +4 -30
- package/utils/error.js +3 -1
- package/utils/errorTranslate.json +351 -2
- package/vue.config.js +1 -1
package/components/nav/Group.vue
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import Type from '@shell/components/nav/Type';
|
|
3
|
+
import { menuRouteMap } from '@shell/config/menuRouteMap';
|
|
4
|
+
|
|
3
5
|
export default {
|
|
4
6
|
name: 'Group',
|
|
5
7
|
|
|
@@ -178,6 +180,7 @@ export default {
|
|
|
178
180
|
|
|
179
181
|
let parentPath = '';
|
|
180
182
|
const cluster = this.$route.params?.cluster;
|
|
183
|
+
const resource = this.$route?.params?.resource || ''
|
|
181
184
|
|
|
182
185
|
// Where we use nested route configuration, consider the parent route when trying to identify the nav location
|
|
183
186
|
if (this.$route.matched.length > 1) {
|
|
@@ -201,6 +204,9 @@ export default {
|
|
|
201
204
|
return true;
|
|
202
205
|
} else if (parentPath && itemFullPath === parentPath) {
|
|
203
206
|
return true;
|
|
207
|
+
// === 新增映射逻辑 ===
|
|
208
|
+
} else if (menuRouteMap[item.name] && menuRouteMap[item.name].includes(resource)) {
|
|
209
|
+
return true;
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
}
|
|
@@ -670,7 +670,8 @@ export default {
|
|
|
670
670
|
</template>
|
|
671
671
|
|
|
672
672
|
<!-- 资源搜索按钮 -->
|
|
673
|
-
|
|
673
|
+
<!-- 2025/9/30 隐藏 -->
|
|
674
|
+
<!-- <button
|
|
674
675
|
v-if="showSearch"
|
|
675
676
|
id="header-btn-search"
|
|
676
677
|
v-clean-tooltip="t('nav.resourceSearch.toolTip', {key: searchShortcut})"
|
|
@@ -685,7 +686,7 @@ export default {
|
|
|
685
686
|
@click="openSearch()"
|
|
686
687
|
>
|
|
687
688
|
<i class="icon icon-search icon-lg" />
|
|
688
|
-
</button>
|
|
689
|
+
</button> -->
|
|
689
690
|
|
|
690
691
|
<!-- 搜索弹窗 -->
|
|
691
692
|
<app-modal
|
|
@@ -706,9 +707,10 @@ export default {
|
|
|
706
707
|
v-if="extensionHeaderActions.length"
|
|
707
708
|
class="header-buttons"
|
|
708
709
|
>
|
|
710
|
+
<template v-for="action, i in extensionHeaderActions" :key="`${action.label}${i}`">
|
|
711
|
+
<!-- kubectl-explain.action | 2025/9/30隐藏 -->
|
|
709
712
|
<button
|
|
710
|
-
v-
|
|
711
|
-
:key="`${action.label}${i}`"
|
|
713
|
+
v-if="action.labelKey !== 'kubectl-explain.action'"
|
|
712
714
|
v-clean-tooltip="handleExtensionTooltip(action)"
|
|
713
715
|
v-shortkey="action.shortcutKey"
|
|
714
716
|
:disabled="action.enabled ? !action.enabled(ctx) : false"
|
|
@@ -728,6 +730,7 @@ export default {
|
|
|
728
730
|
color="header"
|
|
729
731
|
/>
|
|
730
732
|
</button>
|
|
733
|
+
</template>
|
|
731
734
|
</div>
|
|
732
735
|
|
|
733
736
|
<!-- ===== 用户菜单(右上角头像 + 下拉) ===== -->
|
|
@@ -748,7 +748,7 @@ export default {
|
|
|
748
748
|
data-testid="namespaces-values-label"
|
|
749
749
|
class="ns-values"
|
|
750
750
|
>
|
|
751
|
-
{{ value[0].label }}
|
|
751
|
+
{{ value[0].label.replace('harvester', 'cloud') }}
|
|
752
752
|
</div>
|
|
753
753
|
|
|
754
754
|
<!-- All the selected namespaces -->
|
|
@@ -774,20 +774,18 @@ export default {
|
|
|
774
774
|
:data-testid="`namespaces-value-${j}`"
|
|
775
775
|
class="ns-value"
|
|
776
776
|
>
|
|
777
|
-
<div>{{ ns.label }}</div>
|
|
777
|
+
<div>{{ ns.label.replace('harvester', 'cloud') }}</div>
|
|
778
778
|
<!-- block user from removing the last selection if ns forced filtering is on -->
|
|
779
|
-
<
|
|
779
|
+
<i
|
|
780
780
|
v-if="!namespaceFilterMode || value.length > 1"
|
|
781
781
|
small
|
|
782
782
|
ghost
|
|
783
|
-
class="ns-chip-button"
|
|
783
|
+
class="ns-chip-button icon icon-close"
|
|
784
784
|
:data-testid="`namespaces-values-close-${j}`"
|
|
785
785
|
@click="removeOption(ns, $event)"
|
|
786
786
|
@keydown.enter.space.stop="removeOption(ns, $event)"
|
|
787
787
|
@mousedown="handleValueMouseDown(ns, $event)"
|
|
788
|
-
|
|
789
|
-
<i class="icon icon-close" />
|
|
790
|
-
</RcButton>
|
|
788
|
+
/>
|
|
791
789
|
</div>
|
|
792
790
|
</div>
|
|
793
791
|
|
|
@@ -836,19 +834,15 @@ export default {
|
|
|
836
834
|
@click="focusFilter"
|
|
837
835
|
@keydown="inputKeyHandler($event)"
|
|
838
836
|
>
|
|
839
|
-
<
|
|
837
|
+
<i
|
|
840
838
|
v-if="hasFilter"
|
|
841
839
|
small
|
|
842
840
|
ghost
|
|
843
|
-
class="ns-filter-clear"
|
|
841
|
+
class="ns-filter-clear icon icon-close"
|
|
844
842
|
:aria-label="t('namespaceFilter.button.clearFilter')"
|
|
845
843
|
@click="clearFilter"
|
|
846
844
|
@keydown.enter.stop="clearFilter"
|
|
847
|
-
|
|
848
|
-
<i
|
|
849
|
-
class="icon icon-close"
|
|
850
|
-
/>
|
|
851
|
-
</RcButton>
|
|
845
|
+
/>
|
|
852
846
|
</div>
|
|
853
847
|
<div
|
|
854
848
|
v-if="namespaceFilterMode"
|
|
@@ -859,7 +853,7 @@ export default {
|
|
|
859
853
|
class="icon icon-info"
|
|
860
854
|
/>
|
|
861
855
|
</div>
|
|
862
|
-
<
|
|
856
|
+
<div
|
|
863
857
|
v-else
|
|
864
858
|
small
|
|
865
859
|
ghost
|
|
@@ -871,8 +865,9 @@ export default {
|
|
|
871
865
|
>
|
|
872
866
|
<i
|
|
873
867
|
class="icon icon-close"
|
|
868
|
+
@click="clear()"
|
|
874
869
|
/>
|
|
875
|
-
</
|
|
870
|
+
</div>
|
|
876
871
|
</div>
|
|
877
872
|
<div class="ns-divider mt-0" />
|
|
878
873
|
<div
|
|
@@ -889,12 +884,12 @@ export default {
|
|
|
889
884
|
v-for="(opt, i) in cachedFiltered"
|
|
890
885
|
:key="opt.id"
|
|
891
886
|
>
|
|
892
|
-
<
|
|
887
|
+
<div
|
|
893
888
|
v-if="opt.kind === NAMESPACE_FILTER_KINDS.DIVIDER"
|
|
894
889
|
role="separator"
|
|
895
890
|
aria-orientation="horizontal"
|
|
896
891
|
class="ns-divider"
|
|
897
|
-
|
|
892
|
+
/>
|
|
898
893
|
<div
|
|
899
894
|
v-else
|
|
900
895
|
:id="opt.elementId"
|
|
@@ -919,7 +914,7 @@ export default {
|
|
|
919
914
|
v-if="opt.kind === NAMESPACE_FILTER_KINDS.NAMESPACE"
|
|
920
915
|
class="icon icon-folder"
|
|
921
916
|
/>
|
|
922
|
-
<div>{{ opt.label }}</div>
|
|
917
|
+
<div>{{ opt.label.replace('harvester', 'cloud') }}</div>
|
|
923
918
|
<i
|
|
924
919
|
v-if="opt.selected"
|
|
925
920
|
class="icon icon-checkmark"
|
|
@@ -949,7 +944,6 @@ export default {
|
|
|
949
944
|
.ns-filter {
|
|
950
945
|
width: 280px;
|
|
951
946
|
display: inline-block;
|
|
952
|
-
border-radius: var(--border-radius);
|
|
953
947
|
|
|
954
948
|
.ns-glass {
|
|
955
949
|
top: 0;
|
|
@@ -968,9 +962,9 @@ export default {
|
|
|
968
962
|
}
|
|
969
963
|
|
|
970
964
|
.ns-clear {
|
|
971
|
-
padding: 0 5px;
|
|
972
965
|
&:hover {
|
|
973
966
|
color: var(--primary);
|
|
967
|
+
cursor: pointer;
|
|
974
968
|
}
|
|
975
969
|
}
|
|
976
970
|
|
|
@@ -52,10 +52,7 @@ export default {
|
|
|
52
52
|
helper.update(args);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS') || ''
|
|
56
|
-
|
|
57
55
|
return {
|
|
58
|
-
topLevelPermissions,
|
|
59
56
|
shown: false,
|
|
60
57
|
displayVersion,
|
|
61
58
|
fullVersion,
|
|
@@ -523,7 +520,7 @@ export default {
|
|
|
523
520
|
</div>
|
|
524
521
|
|
|
525
522
|
<!-- 品牌Logo -->
|
|
526
|
-
<div
|
|
523
|
+
<div class="side-menu-logo">
|
|
527
524
|
<BrandImage
|
|
528
525
|
data-testid="side-menu__brand-img"
|
|
529
526
|
:alt="t('nav.alt.mainMenuRancherLogo')"
|
|
@@ -534,7 +531,7 @@ export default {
|
|
|
534
531
|
|
|
535
532
|
<!-- ====================== 菜单内容区 ====================== -->
|
|
536
533
|
<div class="body">
|
|
537
|
-
<div
|
|
534
|
+
<div>
|
|
538
535
|
|
|
539
536
|
<!-- 首页按钮 -->
|
|
540
537
|
<div @click="hide()">
|
|
@@ -650,7 +647,7 @@ export default {
|
|
|
650
647
|
</template>
|
|
651
648
|
|
|
652
649
|
<!-- ====================== 集群列表 ====================== -->
|
|
653
|
-
<template v-if="
|
|
650
|
+
<template v-if="!!allClustersCount">
|
|
654
651
|
<div
|
|
655
652
|
ref="clusterList"
|
|
656
653
|
class="clusters"
|
|
@@ -833,7 +830,7 @@ export default {
|
|
|
833
830
|
</div>
|
|
834
831
|
</div>
|
|
835
832
|
|
|
836
|
-
<!--
|
|
833
|
+
<!-- See all clusters -->
|
|
837
834
|
<router-link
|
|
838
835
|
v-if="allClustersCount > maxClustersToShow"
|
|
839
836
|
class="clusters-all"
|
|
@@ -853,129 +850,106 @@ export default {
|
|
|
853
850
|
</template>
|
|
854
851
|
|
|
855
852
|
<!-- ====================== 多集群应用区 ====================== -->
|
|
856
|
-
<div
|
|
853
|
+
<div class="category">
|
|
857
854
|
<!-- 多集群应用 -->
|
|
858
855
|
<template v-if="multiClusterApps.length">
|
|
859
|
-
<
|
|
860
|
-
|
|
861
|
-
|
|
856
|
+
<div
|
|
857
|
+
class="category-title"
|
|
858
|
+
>
|
|
859
|
+
<hr role="none">
|
|
860
|
+
<span>
|
|
861
|
+
{{ t('nav.categories.multiCluster') }}
|
|
862
|
+
</span>
|
|
863
|
+
</div>
|
|
864
|
+
<div
|
|
865
|
+
v-for="(a, i) in appBar.multiClusterApps"
|
|
866
|
+
:key="i"
|
|
867
|
+
@click="hide()"
|
|
868
|
+
>
|
|
869
|
+
<router-link
|
|
870
|
+
v-if="a.value !== 'fleet'"
|
|
871
|
+
class="option"
|
|
872
|
+
:class="{'active-menu-link': a.isMenuActive }"
|
|
873
|
+
:to="a.to"
|
|
874
|
+
role="link"
|
|
875
|
+
:aria-label="`${t('nav.ariaLabel.multiClusterApps')} ${ a.label }`"
|
|
862
876
|
>
|
|
863
|
-
<
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
<
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
>
|
|
873
|
-
<router-link
|
|
874
|
-
class="option"
|
|
875
|
-
:class="{'active-menu-link': a.isMenuActive }"
|
|
876
|
-
:to="a.to"
|
|
877
|
-
role="link"
|
|
878
|
-
:aria-label="`${t('nav.ariaLabel.multiClusterApps')} ${ a.label }`"
|
|
879
|
-
>
|
|
880
|
-
<IconOrSvg
|
|
881
|
-
v-clean-tooltip="getTooltipConfig(a.label)"
|
|
882
|
-
class="app-icon"
|
|
883
|
-
:icon="a.icon"
|
|
884
|
-
:src="a.svg"
|
|
885
|
-
/>
|
|
886
|
-
<span class="option-link">{{ a.label }}</span>
|
|
887
|
-
</router-link>
|
|
888
|
-
</div>
|
|
889
|
-
</template>
|
|
890
|
-
</template>
|
|
891
|
-
<template v-else>
|
|
892
|
-
<template v-for="(a, i) in appBar.multiClusterApps" :key="i">
|
|
893
|
-
<div
|
|
894
|
-
v-if="a.value === 'harvesterManager'"
|
|
895
|
-
@click="hide()"
|
|
896
|
-
>
|
|
897
|
-
<router-link
|
|
898
|
-
class="option"
|
|
899
|
-
:class="{'active-menu-link': a.isMenuActive }"
|
|
900
|
-
:to="a.to"
|
|
901
|
-
role="link"
|
|
902
|
-
:aria-label="`${t('nav.ariaLabel.multiClusterApps')} ${ a.label }`"
|
|
903
|
-
>
|
|
904
|
-
<IconOrSvg
|
|
905
|
-
v-clean-tooltip="getTooltipConfig(a.label)"
|
|
906
|
-
class="app-icon"
|
|
907
|
-
:icon="a.icon"
|
|
908
|
-
:src="a.svg"
|
|
909
|
-
/>
|
|
910
|
-
<span class="option-link">{{ a.label }}</span>
|
|
911
|
-
</router-link>
|
|
912
|
-
</div>
|
|
913
|
-
</template>
|
|
914
|
-
</template>
|
|
877
|
+
<IconOrSvg
|
|
878
|
+
v-clean-tooltip="getTooltipConfig(a.label)"
|
|
879
|
+
class="app-icon"
|
|
880
|
+
:icon="a.icon"
|
|
881
|
+
:src="a.svg"
|
|
882
|
+
/>
|
|
883
|
+
<span class="option-link">{{ a.label }}</span>
|
|
884
|
+
</router-link>
|
|
885
|
+
</div>
|
|
915
886
|
</template>
|
|
916
887
|
|
|
917
|
-
<!--
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
:src="a.svg"
|
|
969
|
-
/>
|
|
970
|
-
<div>{{ a.label }}</div>
|
|
971
|
-
</router-link>
|
|
972
|
-
</div>
|
|
973
|
-
</template>
|
|
974
|
-
</template>
|
|
975
|
-
<div style="height: 40px;"></div>
|
|
976
|
-
</template>
|
|
977
|
-
</div>
|
|
888
|
+
<!-- Configuration apps menu -->
|
|
889
|
+
<template v-if="configurationApps.length">
|
|
890
|
+
<div
|
|
891
|
+
class="category-title"
|
|
892
|
+
>
|
|
893
|
+
<hr role="none">
|
|
894
|
+
<span>
|
|
895
|
+
{{ t('nav.categories.configuration') }}
|
|
896
|
+
</span>
|
|
897
|
+
</div>
|
|
898
|
+
<div
|
|
899
|
+
v-for="(a, i) in appBar.configurationApps"
|
|
900
|
+
:key="i"
|
|
901
|
+
@click="hide()"
|
|
902
|
+
>
|
|
903
|
+
<router-link
|
|
904
|
+
class="option"
|
|
905
|
+
:class="{'active-menu-link': a.isMenuActive }"
|
|
906
|
+
:to="a.to"
|
|
907
|
+
role="link"
|
|
908
|
+
:aria-label="`${t('nav.ariaLabel.configurationApps')} ${ a.label }`"
|
|
909
|
+
>
|
|
910
|
+
<IconOrSvg
|
|
911
|
+
v-clean-tooltip="getTooltipConfig(a.label)"
|
|
912
|
+
class="app-icon"
|
|
913
|
+
:icon="a.icon"
|
|
914
|
+
:src="a.svg"
|
|
915
|
+
/>
|
|
916
|
+
<div>{{ a.label }}</div>
|
|
917
|
+
</router-link>
|
|
918
|
+
</div>
|
|
919
|
+
</template>
|
|
920
|
+
</div>
|
|
921
|
+
</div>
|
|
922
|
+
|
|
923
|
+
<!-- Footer -->
|
|
924
|
+
<div
|
|
925
|
+
class="footer"
|
|
926
|
+
>
|
|
927
|
+
<!-- <div
|
|
928
|
+
v-if="canEditSettings"
|
|
929
|
+
class="support"
|
|
930
|
+
@click="hide()"
|
|
931
|
+
>
|
|
932
|
+
<router-link
|
|
933
|
+
:to="{name: 'support'}"
|
|
934
|
+
role="link"
|
|
935
|
+
:aria-label="t('nav.ariaLabel.support')"
|
|
936
|
+
>
|
|
937
|
+
{{ t('nav.support', {hasSupport}) }}
|
|
938
|
+
</router-link>
|
|
978
939
|
</div>
|
|
940
|
+
<div
|
|
941
|
+
class="version"
|
|
942
|
+
:class="{'version-small': largeAboutText}"
|
|
943
|
+
@click="hide()"
|
|
944
|
+
>
|
|
945
|
+
<router-link
|
|
946
|
+
:to="{ name: 'about' }"
|
|
947
|
+
role="link"
|
|
948
|
+
:aria-label="t('nav.ariaLabel.about')"
|
|
949
|
+
>
|
|
950
|
+
{{ aboutText }}
|
|
951
|
+
</router-link>
|
|
952
|
+
</div> -->
|
|
979
953
|
</div>
|
|
980
954
|
</div>
|
|
981
955
|
</transition>
|
|
@@ -1644,7 +1618,7 @@ export default {
|
|
|
1644
1618
|
}
|
|
1645
1619
|
|
|
1646
1620
|
:deep() .v-popper__arrow-container {
|
|
1647
|
-
display: none;
|
|
1621
|
+
display: none !important;
|
|
1648
1622
|
}
|
|
1649
1623
|
|
|
1650
1624
|
:deep() .v-popper:focus {
|
package/components/nav/Type.vue
CHANGED
|
@@ -3,6 +3,7 @@ import Favorite from '@shell/components/nav/Favorite';
|
|
|
3
3
|
import { TYPE_MODES } from '@shell/store/type-map';
|
|
4
4
|
|
|
5
5
|
import TabTitle from '@shell/components/TabTitle';
|
|
6
|
+
import { menuRouteMap } from '@shell/config/menuRouteMap';
|
|
6
7
|
|
|
7
8
|
const showFavoritesFor = [TYPE_MODES.FAVORITE, TYPE_MODES.USED];
|
|
8
9
|
|
|
@@ -61,6 +62,17 @@ export default {
|
|
|
61
62
|
const pageFullPath = this.$route.fullPath?.toLowerCase().split('#')[0]; // Ignore the shebang when comparing routes
|
|
62
63
|
const routeMetaNav = this.$route.meta?.nav;
|
|
63
64
|
|
|
65
|
+
const resource = this.$route?.params?.resource || ''
|
|
66
|
+
|
|
67
|
+
console.log(this.type, ' this.type----------------------------');
|
|
68
|
+
console.log(this.$route.params, ' this.$route?.params----------------------------');
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// 菜单选中动态映射逻辑
|
|
72
|
+
if (menuRouteMap[this.type.name] && menuRouteMap[this.type.name].includes(resource)) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
64
76
|
// If the route explicitly declares the nav path that should be highlighted, then use that
|
|
65
77
|
if (routeMetaNav) {
|
|
66
78
|
const cluster = this.$route.params?.cluster;
|
|
@@ -141,7 +153,7 @@ export default {
|
|
|
141
153
|
<a
|
|
142
154
|
role="link"
|
|
143
155
|
:aria-label="type.labelKey ? t(type.labelKey) : (type.labelDisplay || type.label)"
|
|
144
|
-
:href="href"
|
|
156
|
+
:href="href.replace(/harvester/g, 'cloud')"
|
|
145
157
|
class="type-link"
|
|
146
158
|
:aria-current="isActive ? 'page' : undefined"
|
|
147
159
|
@click="selectType(); navigate($event);"
|
|
@@ -158,7 +170,7 @@ export default {
|
|
|
158
170
|
<div v-else style="display: flex; align-items: center;" class="labelKey_menu">
|
|
159
171
|
<i v-if="!type.labelDisplay || (type.labelDisplay && type.labelDisplay.indexOf('</i>') === -1)" class="icon icon-fw icon-globe" style="color: var(--muted);width: 32px;text-align: left;"></i>
|
|
160
172
|
<span
|
|
161
|
-
v-clean-html="type.labelDisplay
|
|
173
|
+
v-clean-html="type.labelDisplay || type.label"
|
|
162
174
|
class="label"
|
|
163
175
|
:class="{'no-icon': !type.icon}"
|
|
164
176
|
/>
|
|
@@ -199,7 +211,7 @@ export default {
|
|
|
199
211
|
>
|
|
200
212
|
<a
|
|
201
213
|
role="link"
|
|
202
|
-
:href="type.link"
|
|
214
|
+
:href="type.link.replace(/harvester/g, 'cloud')"
|
|
203
215
|
:target="type.target"
|
|
204
216
|
rel="noopener noreferrer nofollow"
|
|
205
217
|
:aria-label="type.label"
|
|
@@ -72,10 +72,13 @@ export function init(store) {
|
|
|
72
72
|
'cluster-dashboard',
|
|
73
73
|
'projects-namespaces',
|
|
74
74
|
'namespaces',
|
|
75
|
+
'namespace',
|
|
75
76
|
NODE,
|
|
76
77
|
VIRTUAL_TYPES.CLUSTER_MEMBERS,
|
|
77
78
|
EVENT,
|
|
78
|
-
'c-cluster-explorer-tools'
|
|
79
|
+
'c-cluster-explorer-tools',
|
|
80
|
+
'management.cattle.io.project',
|
|
81
|
+
'management.cattle.io.clusterroletemplatebinding'
|
|
79
82
|
], 'cluster');
|
|
80
83
|
basicType([
|
|
81
84
|
LIMIT_RANGE,
|
|
@@ -95,6 +98,7 @@ export function init(store) {
|
|
|
95
98
|
STORAGE_CLASS,
|
|
96
99
|
SECRET,
|
|
97
100
|
VIRTUAL_TYPES.PROJECT_SECRETS,
|
|
101
|
+
VIRTUAL_TYPES.NAMESPACES,
|
|
98
102
|
CONFIG_MAP
|
|
99
103
|
], 'storage');
|
|
100
104
|
basicType([
|
|
@@ -11,13 +11,71 @@ import { install as installPageTitle } from '@shell/config/router/navigation-gua
|
|
|
11
11
|
import { install as installServerUpgradeGrowl } from '@shell/config/router/navigation-guards/server-upgrade-growl';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Install
|
|
14
|
+
* Install router navigation guards
|
|
15
|
+
* 1. 保留原有导航守卫顺序
|
|
16
|
+
* 2. 不在 beforeEach 改 params,只在 push/replace & afterEach 改 URL
|
|
15
17
|
*/
|
|
16
18
|
export function installNavigationGuards(router, context) {
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
+
// 最早执行:保证进入逻辑时 params 始终是 harvester
|
|
20
|
+
router.beforeEach((to, from, next) => {
|
|
21
|
+
let changed = false;
|
|
22
|
+
const params = { ...to.params };
|
|
23
|
+
|
|
24
|
+
if (params?.product?.includes('cloud')) {
|
|
25
|
+
params.product = params.product.replace(/cloud/g, 'harvester');
|
|
26
|
+
changed = true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (params?.cluster?.includes('cloud')) {
|
|
30
|
+
params.cluster = params.cluster.replace(/cloud/g, 'harvester');
|
|
31
|
+
changed = true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (params?.resource?.includes('cloud')) {
|
|
35
|
+
params.resource = params.resource.replace(/cloud/g, 'harvester');
|
|
36
|
+
changed = true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (changed) {
|
|
40
|
+
// 触发路由重定向
|
|
41
|
+
return next({ ...to, params });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
next();
|
|
45
|
+
});
|
|
46
|
+
|
|
19
47
|
|
|
20
48
|
const navigationGuardInstallers = [installLoadInitialSettings, installAttemptFirstLogin, installAuthentication, installProducts, installClusters, installRuntimeExtensionRoute, installI18N, installHandleInstallRedirect, installPageTitle, installRecordLastRoute, installServerUpgradeGrowl];
|
|
21
49
|
|
|
22
50
|
navigationGuardInstallers.forEach((installer) => installer(router, context));
|
|
51
|
+
|
|
52
|
+
// 🔹 最后执行:只改地址栏,不改内部
|
|
53
|
+
router.afterEach((to) => {
|
|
54
|
+
const base = router.options.history?.base || '';
|
|
55
|
+
const pathParts = to.path.split('/');
|
|
56
|
+
|
|
57
|
+
const newPathParts = pathParts.map((part) => {
|
|
58
|
+
// 只替换 cluster/product/resource 对应的 segment
|
|
59
|
+
for (const key of ['cluster', 'product', 'resource']) {
|
|
60
|
+
if (to.params[key] && to.params[key] === part) {
|
|
61
|
+
return part.replace(/harvester/g, 'cloud');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return part;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
let cloudPath = newPathParts.join('/');
|
|
68
|
+
if (!cloudPath.startsWith(base)) {
|
|
69
|
+
cloudPath = base + cloudPath;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const currentLocation = window.location.pathname + window.location.search + window.location.hash;
|
|
73
|
+
|
|
74
|
+
if (cloudPath !== currentLocation) {
|
|
75
|
+
console.info('[URL Replace] Updating address bar:', currentLocation, '→', cloudPath);
|
|
76
|
+
window.history.replaceState({}, '', cloudPath);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
23
80
|
}
|
|
81
|
+
|