dashboard-shell-shell 3.0.5-test.6 → 3.0.5-test.61
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/brand/csp/favicon.png +0 -0
- package/assets/brand/harvester/favicon.png +0 -0
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/icons/demo.css +539 -0
- package/assets/icons/demo.css:Zone.Identifier +0 -0
- package/assets/icons/demo_index.html +1131 -0
- package/assets/icons/demo_index.html:Zone.Identifier +0 -0
- package/assets/icons/iconfont.css +219 -0
- package/assets/icons/iconfont.css:Zone.Identifier +0 -0
- package/assets/icons/iconfont.js +1 -0
- package/assets/icons/iconfont.js:Zone.Identifier +0 -0
- package/assets/icons/iconfont.json +324 -0
- package/assets/icons/iconfont.json:Zone.Identifier +0 -0
- package/assets/icons/iconfont.ttf +0 -0
- package/assets/icons/iconfont.ttf:Zone.Identifier +0 -0
- package/assets/icons/iconfont.woff +0 -0
- package/assets/icons/iconfont.woff2 +0 -0
- package/assets/icons/iconfont.woff2:Zone.Identifier +0 -0
- package/assets/icons/iconfont.woff:Zone.Identifier +0 -0
- package/assets/iconsNew/demo.css +539 -0
- package/assets/iconsNew/demo.css:Zone.Identifier +0 -0
- package/assets/iconsNew/demo_index.html +303 -0
- package/assets/iconsNew/demo_index.html:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.css +43 -0
- package/assets/iconsNew/iconfont.css:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.js +1 -0
- package/assets/iconsNew/iconfont.js:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.json +44 -0
- package/assets/iconsNew/iconfont.json:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.ttf +0 -0
- package/assets/iconsNew/iconfont.ttf:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.woff +0 -0
- package/assets/iconsNew/iconfont.woff2 +0 -0
- package/assets/iconsNew/iconfont.woff2:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.woff:Zone.Identifier +0 -0
- package/assets/images/API.svg +3 -0
- package/assets/images/action.svg +6 -0
- package/assets/images/login/password.svg +20 -0
- package/assets/images/login/user.svg +6 -0
- package/assets/images/login-bg.png +0 -0
- package/assets/images/login-left.png +0 -0
- package/assets/images/login-logo.svg +44 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/logo.svg +47 -0
- package/assets/images/pl/dark/logo.png +0 -0
- package/assets/images/pl/half-logo.svg +2 -23
- package/assets/images/pl/harvester.png +0 -0
- package/assets/images/pl/logo.png +0 -0
- package/assets/images/promp-yellow.svg +5 -0
- package/assets/images/user.png +0 -0
- package/assets/styles/all.scss +83 -0
- package/assets/styles/app.scss +5 -0
- package/assets/styles/base/_basic.scss +2 -2
- package/assets/styles/base/_helpers.scss +1 -1
- package/assets/styles/base/_mixins.scss +1 -1
- package/assets/styles/base/_typography.scss +2 -1
- package/assets/styles/base/_variables.scss +14 -7
- package/assets/styles/fonts/_icons.scss +3 -2
- package/assets/styles/global/_button.scss +44 -26
- package/assets/styles/global/_columns.scss +3 -1
- package/assets/styles/global/_form.scss +46 -13
- package/assets/styles/global/_labeled-input.scss +54 -26
- package/assets/styles/global/_layout.scss +8 -3
- package/assets/styles/global/_select.scss +25 -17
- package/assets/styles/global/_table.scss +7 -1
- package/assets/styles/global/_tooltip.scss +60 -8
- package/assets/styles/themes/_dark.scss +3 -0
- package/assets/styles/themes/_light.scss +69 -46
- package/assets/styles/vendor/vue-select.scss +24 -10
- package/assets/translations/en-us.yaml +92 -4
- package/assets/translations/zh-hans.yaml +668 -206
- package/components/ActionDropdown.vue +2 -1
- package/components/ActionMenu.vue +2 -2
- package/components/ActionMenuShell.vue +2 -0
- package/components/AppModal.vue +46 -5
- package/components/BrandImage.vue +1 -0
- package/components/ButtonDropdown.vue +28 -4
- package/components/ButtonMultiAction.vue +1 -0
- package/components/ClusterIconMenu.vue +2 -2
- package/components/CodeMirror.vue +26 -10
- package/components/ConsumptionGauge.vue +24 -5
- package/components/ContainerResourceLimit.vue +2 -2
- package/components/CopyToClipboard.vue +15 -0
- package/components/CruResource.vue +12 -10
- package/components/CruResourceFooter.vue +2 -2
- package/components/DashboardOptions.vue +29 -17
- package/components/DotState.vue +84 -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/ExplorerProjectsNamespaces.vue +19 -5
- package/components/GlobalRoleBindings.vue +23 -4
- package/components/GrafanaDashboard.vue +4 -4
- package/components/GrowlManager.vue +3 -1
- package/components/HardwareResourceGauge.vue +39 -3
- package/components/IndentedPanel.vue +4 -10
- package/components/InfoBox.vue +3 -3
- package/components/InputOrDisplay.vue +28 -2
- package/components/LabelValue.vue +20 -1
- package/components/ModalWithCard.vue +12 -3
- package/components/PodSecurityAdmission.vue +2 -2
- package/components/PromptModal.vue +1 -1
- package/components/PromptRemove.vue +53 -12
- package/components/RelatedResources.vue +3 -0
- 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 +125 -27
- package/components/ResourceDetail/Masthead/index.vue +1 -1
- package/components/ResourceDetail/Masthead/latest.vue +1 -1
- package/components/ResourceDetail/Masthead/legacy.vue +183 -39
- package/components/ResourceDetail/legacy.vue +47 -29
- package/components/ResourceList/Masthead.vue +222 -54
- package/components/ResourceList/ResourceLoadingIndicator.vue +5 -2
- package/components/ResourceTable.vue +40 -2
- package/components/SideNav.vue +74 -20
- package/components/SingleClusterInfo.vue +2 -1
- package/components/SortableTable/THead.vue +79 -4
- package/components/SortableTable/index.vue +1053 -464
- package/components/SortableTable/paging.js +26 -16
- package/components/SortableTable/selection.js +2 -2
- package/components/Tabbed/Tab.vue +3 -3
- package/components/Tabbed/index.vue +53 -30
- package/components/YamlEditor.vue +0 -1
- package/components/auth/Principal.vue +51 -19
- package/components/auth/RoleDetailEdit.vue +69 -14
- package/components/auth/SelectPrincipal.vue +1 -0
- package/components/breadcrumb/index.vue +119 -0
- package/components/form/ArrayList.vue +177 -152
- package/components/form/ArrayListGrouped.vue +13 -3
- package/components/form/ArrayListSelect.vue +1 -1
- package/components/form/BannerSettings.vue +64 -59
- package/components/form/ChangePassword.vue +5 -5
- package/components/form/ClusterAppearance.vue +4 -3
- package/components/form/ColorInput.vue +32 -8
- package/components/form/Command.vue +4 -5
- package/components/form/Conditions.vue +15 -1
- package/components/form/Footer.vue +12 -8
- package/components/form/HealthCheck.vue +0 -2
- package/components/form/HookOption.vue +87 -58
- package/components/form/InputWithSelect.vue +8 -4
- package/components/form/KeyValue.vue +66 -8
- package/components/form/LabeledSelect.vue +216 -242
- package/components/form/Labels.vue +4 -4
- package/components/form/MatchExpressions.vue +28 -11
- package/components/form/Members/ClusterMembershipEditor.vue +1 -1
- package/components/form/Members/ClusterPermissionsEditor.vue +61 -43
- package/components/form/Members/MembershipEditor.vue +4 -4
- package/components/form/Members/ProjectMembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +62 -22
- package/components/form/Networking.vue +6 -9
- package/components/form/NodeAffinity.vue +29 -28
- package/components/form/Password.vue +16 -7
- package/components/form/PodAffinity.vue +24 -25
- package/components/form/Probe.vue +15 -11
- package/components/form/ProjectMemberEditor.vue +66 -48
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +26 -23
- package/components/form/ResourceQuota/Project.vue +4 -4
- package/components/form/ResourceQuota/ProjectRow.vue +38 -35
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/SecretSelector.vue +24 -23
- package/components/form/Security.vue +1 -3
- package/components/form/Select.vue +12 -3
- package/components/form/ServiceNameSelect.vue +2 -5
- package/components/form/ServicePorts.vue +149 -75
- package/components/form/SimpleSecretSelector.vue +29 -9
- package/components/form/Taints.vue +2 -1
- package/components/form/Tolerations.vue +13 -9
- package/components/form/UnitInput.vue +8 -3
- package/components/form/ValueFromResource.vue +110 -96
- package/components/form/WorkloadPorts.vue +143 -123
- package/components/formatter/BadgeStateFormatter.vue +8 -5
- package/components/formatter/LiveDate.vue +3 -3
- package/components/formatter/WorkloadHealthScale.vue +4 -3
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +139 -99
- package/components/nav/Header.vue +138 -164
- package/components/nav/HeaderPageActionMenu.vue +1 -0
- package/components/nav/NamespaceFilter.vue +34 -36
- package/components/nav/TopLevelMenu.vue +62 -25
- package/components/nav/Type.vue +73 -43
- package/composables/useClickOutside.ts +1 -1
- package/config/menuRouteMap.js +10 -0
- package/config/private-label.js +14 -11
- package/config/product/auth.js +17 -7
- package/config/product/explorer.js +32 -10
- package/config/product/manager.js +28 -17
- package/config/product/settings.js +19 -9
- package/config/product/uiplugins.js +13 -10
- package/config/router/navigation-guards/index.js +61 -3
- package/config/settings.ts +28 -0
- package/config/table-headers.js +3 -2
- package/detail/node.vue +28 -23
- package/dialog/AddCustomBadgeDialog.vue +17 -9
- package/dialog/ForceMachineRemoveDialog.vue +2 -2
- package/dialog/RollbackWorkloadDialog.vue +1 -1
- package/dialog/ScalePoolDownDialog.vue +2 -2
- 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/logging-flow/index.vue +1 -2
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +19 -19
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +23 -23
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +19 -19
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +14 -14
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +12 -12
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +23 -23
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +6 -6
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +10 -10
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +8 -8
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +17 -17
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +7 -7
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +12 -12
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +14 -14
- package/edit/logging.banzaicloud.io.output/providers/redis.vue +6 -6
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +23 -23
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +13 -13
- package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +54 -54
- package/edit/management.cattle.io.user.vue +17 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +19 -19
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +50 -26
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +36 -12
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/dingding.vue +32 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +6 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/message.vue +52 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/snmp.vue +45 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/work.vue +31 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +6 -6
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +5 -5
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +4 -4
- package/edit/namespace.vue +1 -2
- package/edit/networking.k8s.io.ingress/Certificate.vue +14 -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/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -1
- 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/token.vue +31 -12
- 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/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +8 -6
- package/list/management.cattle.io.setting.vue +22 -13
- package/list/management.cattle.io.user.vue +7 -3
- package/list/namespace.vue +3 -0
- package/list/provisioning.cattle.io.cluster.vue +6 -7
- package/mixins/brand.js +17 -0
- package/mixins/create-edit-view/impl.js +10 -0
- package/models/provisioning.cattle.io.cluster.js +19 -18
- package/models/workload.js +2 -2
- package/package.json +1 -1
- package/pages/account/index.vue +93 -58
- package/pages/account/pri.vue +229 -0
- package/pages/auth/login.vue +216 -51
- package/pages/auth/setup.vue +175 -33
- package/pages/c/_cluster/_product/namespaces.vue +5 -5
- package/pages/c/_cluster/auth/roles/index.vue +83 -8
- package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +2 -1
- package/pages/c/_cluster/explorer/tools/index.vue +6 -6
- package/pages/c/_cluster/monitoring/monitor/index.vue +2 -2
- package/pages/c/_cluster/settings/banners.vue +174 -102
- package/pages/c/_cluster/settings/brand.vue +350 -302
- package/pages/c/_cluster/settings/performance.vue +61 -38
- package/pages/home.vue +119 -37
- package/pages/prefs.vue +27 -25
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/actions.js +1 -1
- package/plugins/dashboard-store/resource-class.js +28 -27
- package/promptRemove/mixin/roleDeletionCheck.js +2 -2
- package/public/index.html +4 -4
- package/rancher-components/BadgeState/BadgeState.vue +38 -55
- package/rancher-components/Banner/Banner.vue +25 -9
- package/rancher-components/Card/Card.vue +7 -8
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +42 -3
- package/rancher-components/Form/Radio/RadioButton.vue +35 -11
- package/rancher-components/Form/Radio/RadioGroup.vue +22 -6
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +3 -3
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +1 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +41 -4
- package/rancher-components/RcDropdown/RcDropdown.vue +35 -7
- package/rancher-components/RcDropdown/RcDropdownItem.vue +2 -2
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +12 -6
- package/rancher-components/RcDropdown/types.ts +1 -0
- package/rancher-components/StringList/StringList.vue +1 -1
- package/scripts/build-pkg.sh +18 -23
- package/scripts/publish-shell.sh +1 -1
- package/static/favicon.ico +0 -0
- package/static/favicon.png +0 -0
- package/static/loading-indicator.html +3 -3
- package/store/i18n.js +6 -2
- package/store/modal.ts +3 -3
- package/store/prefs.js +11 -4
- package/store/type-map.js +30 -2
- package/types/shell/index.d.ts +86 -97
- package/utils/error.js +109 -8
- package/utils/errorTranslate.json +1740 -0
- package/utils/errorTranslateNew.json +39 -0
- package/utils/roleFiltering.js +33 -0
- package/utils/router.js +21 -0
- package/utils/select.js +26 -3
- package/utils/string.js +8 -5
- package/utils/title.ts +1 -1
- package/vue.config.js +1 -1
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,13 @@ 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
|
+
// 菜单选中动态映射逻辑
|
|
68
|
+
if (menuRouteMap[this.type.name] && menuRouteMap[this.type.name].includes(resource)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
64
72
|
// If the route explicitly declares the nav path that should be highlighted, then use that
|
|
65
73
|
if (routeMetaNav) {
|
|
66
74
|
const cluster = this.$route.params?.cluster;
|
|
@@ -112,6 +120,7 @@ export default {
|
|
|
112
120
|
</script>
|
|
113
121
|
|
|
114
122
|
<template>
|
|
123
|
+
<!-- 当 type 有 route 时,渲染一个 Vue Router 自定义链接 -->
|
|
115
124
|
<router-link
|
|
116
125
|
v-if="type.route"
|
|
117
126
|
:key="type.name"
|
|
@@ -119,60 +128,78 @@ export default {
|
|
|
119
128
|
custom
|
|
120
129
|
:to="type.route"
|
|
121
130
|
>
|
|
131
|
+
|
|
132
|
+
<!-- 导航项容器 -->
|
|
122
133
|
<li
|
|
123
134
|
class="child nav-type"
|
|
124
135
|
:class="{'root': isRoot, [`depth-${depth}`]: true, 'router-link-active': isActive, 'router-link-exact-active': isExactActive}"
|
|
125
136
|
@click="navigate"
|
|
126
137
|
@keypress.enter="navigate"
|
|
127
138
|
>
|
|
139
|
+
|
|
140
|
+
<!-- 如果是精确匹配激活状态,则显示 TabTitle 组件 -->
|
|
128
141
|
<TabTitle
|
|
129
142
|
v-if="isExactActive"
|
|
130
143
|
:show-child="false"
|
|
131
144
|
>
|
|
132
145
|
{{ type.labelKey ? t(type.labelKey) : (type.labelDisplay || type.label) }}
|
|
133
146
|
</TabTitle>
|
|
147
|
+
|
|
148
|
+
<!-- 链接主体 -->
|
|
134
149
|
<a
|
|
135
150
|
role="link"
|
|
136
151
|
:aria-label="type.labelKey ? t(type.labelKey) : (type.labelDisplay || type.label)"
|
|
137
|
-
:href="href"
|
|
152
|
+
:href="href.replace(/harvester/g, 'cloud')"
|
|
138
153
|
class="type-link"
|
|
139
154
|
:aria-current="isActive ? 'page' : undefined"
|
|
140
155
|
@click="selectType(); navigate($event);"
|
|
141
156
|
@mouseenter="setNear(true)"
|
|
142
157
|
@mouseleave="setNear(false)"
|
|
143
158
|
>
|
|
159
|
+
<!-- 文本标签:优先使用多语言 key -->
|
|
144
160
|
<span
|
|
145
161
|
v-if="type.labelKey"
|
|
146
162
|
class="label"
|
|
147
163
|
><t :k="type.labelKey" /></span>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
class="
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
|
|
165
|
+
<!-- 没有 labelKey 时,直接使用 HTML 文本 -->
|
|
166
|
+
<div v-else style="display: flex; align-items: center;" class="labelKey_menu">
|
|
167
|
+
<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>
|
|
168
|
+
<span
|
|
169
|
+
v-clean-html="type.labelDisplay || type.label"
|
|
170
|
+
class="label"
|
|
171
|
+
:class="{'no-icon': !type.icon}"
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<!-- 右侧附加信息(收藏按钮 / 命名空间图标 / 计数) -->
|
|
176
|
+
<!-- <span
|
|
155
177
|
v-if="showFavorite || namespaceIcon || showCount"
|
|
156
178
|
class="count"
|
|
157
179
|
>
|
|
180
|
+
|
|
158
181
|
<Favorite
|
|
159
182
|
v-if="showFavorite"
|
|
160
183
|
:resource="type.name"
|
|
161
184
|
/>
|
|
185
|
+
|
|
162
186
|
<i
|
|
163
187
|
v-if="namespaceIcon"
|
|
164
188
|
class="icon icon-namespace"
|
|
165
189
|
:class="{'ns-and-icon': showCount}"
|
|
166
190
|
data-testid="type-namespaced"
|
|
167
191
|
/>
|
|
192
|
+
|
|
168
193
|
<span
|
|
169
194
|
v-if="showCount"
|
|
170
195
|
data-testid="type-count"
|
|
171
196
|
>{{ count }}</span>
|
|
172
|
-
</span>
|
|
197
|
+
</span> -->
|
|
173
198
|
</a>
|
|
174
199
|
</li>
|
|
175
200
|
</router-link>
|
|
201
|
+
|
|
202
|
+
<!-- 当 type 没有 route 但有外部 link 时 -->
|
|
176
203
|
<li
|
|
177
204
|
v-else-if="type.link"
|
|
178
205
|
class="child nav-type nav-link"
|
|
@@ -180,7 +207,7 @@ export default {
|
|
|
180
207
|
>
|
|
181
208
|
<a
|
|
182
209
|
role="link"
|
|
183
|
-
:href="type.link"
|
|
210
|
+
:href="type.link.replace(/harvester/g, 'cloud')"
|
|
184
211
|
:target="type.target"
|
|
185
212
|
rel="noopener noreferrer nofollow"
|
|
186
213
|
:aria-label="type.label"
|
|
@@ -188,6 +215,8 @@ export default {
|
|
|
188
215
|
<span class="label">{{ type.label }} <i class="icon icon-external-link" /></span>
|
|
189
216
|
</a>
|
|
190
217
|
</li>
|
|
218
|
+
|
|
219
|
+
<!-- 兜底情况:既没有 route,也没有 link -->
|
|
191
220
|
<li v-else>
|
|
192
221
|
{{ type }}?
|
|
193
222
|
</li>
|
|
@@ -214,6 +243,7 @@ export default {
|
|
|
214
243
|
.label {
|
|
215
244
|
align-items: center;
|
|
216
245
|
grid-area: label;
|
|
246
|
+
display: flex;
|
|
217
247
|
overflow: hidden;
|
|
218
248
|
text-overflow: ellipsis;
|
|
219
249
|
|
|
@@ -221,13 +251,13 @@ export default {
|
|
|
221
251
|
padding-left: 3px;
|
|
222
252
|
}
|
|
223
253
|
|
|
224
|
-
|
|
254
|
+
::v-deep .highlight {
|
|
225
255
|
background: var(--diff-ins-bg);
|
|
226
256
|
color: var(--body-text);
|
|
227
257
|
padding: 2px;
|
|
228
258
|
}
|
|
229
259
|
|
|
230
|
-
|
|
260
|
+
::v-deep .icon {
|
|
231
261
|
position: relative;
|
|
232
262
|
color: var(--muted);
|
|
233
263
|
}
|
|
@@ -236,24 +266,28 @@ export default {
|
|
|
236
266
|
A {
|
|
237
267
|
display: grid;
|
|
238
268
|
grid-template-areas: "label count";
|
|
239
|
-
grid-template-columns: auto
|
|
269
|
+
grid-template-columns: auto 20px;
|
|
240
270
|
grid-column-gap: 5px;
|
|
241
271
|
font-size: 14px;
|
|
242
272
|
line-height: 24px;
|
|
243
|
-
padding: 7.5px 7px 7.5px 10px;
|
|
273
|
+
/* padding: 7.5px 7px 7.5px 10px; */
|
|
274
|
+
padding: 0px 16px 0px 30px;
|
|
275
|
+
height: 50px;
|
|
244
276
|
margin: 0 0 0 -3px;
|
|
245
277
|
overflow: hidden;
|
|
246
278
|
text-overflow: ellipsis;
|
|
247
279
|
white-space: nowrap;
|
|
248
280
|
color: var(--body-text);
|
|
249
|
-
height: 33px;
|
|
250
281
|
|
|
251
282
|
&:hover {
|
|
252
|
-
background: var(--nav-
|
|
283
|
+
background: var(--nav-active) !important;
|
|
284
|
+
color: var(--nav-hover-color);
|
|
285
|
+
/* background: var(--nav-hover); */
|
|
253
286
|
text-decoration: none;
|
|
254
287
|
|
|
255
|
-
|
|
256
|
-
color: var(--body-text);
|
|
288
|
+
::v-deep .icon {
|
|
289
|
+
/* color: var(--body-text); */
|
|
290
|
+
color: var(--nav-hover-color);
|
|
257
291
|
}
|
|
258
292
|
}
|
|
259
293
|
}
|
|
@@ -262,46 +296,42 @@ export default {
|
|
|
262
296
|
grid-area: favorite;
|
|
263
297
|
font-size: 12px;
|
|
264
298
|
position: relative;
|
|
265
|
-
vertical-align: middle;
|
|
266
|
-
margin-right: 4px;
|
|
267
299
|
}
|
|
268
300
|
|
|
269
301
|
.count {
|
|
302
|
+
grid-area: count;
|
|
270
303
|
font-size: 12px;
|
|
304
|
+
text-align: right;
|
|
271
305
|
justify-items: center;
|
|
272
|
-
|
|
273
|
-
display: flex;
|
|
274
|
-
align-items: center;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
&.nav-type.nav-link {
|
|
278
|
-
a .label {
|
|
279
|
-
display: flex;
|
|
280
|
-
}
|
|
306
|
+
line-height: 50px;
|
|
281
307
|
}
|
|
282
308
|
|
|
283
309
|
&.nav-type:not(.depth-0) {
|
|
284
310
|
A {
|
|
285
|
-
|
|
311
|
+
font-size: 13px;
|
|
312
|
+
padding: 5.5px 7px 5.5px 40px;
|
|
286
313
|
}
|
|
287
314
|
|
|
288
|
-
|
|
315
|
+
::v-deep .label I {
|
|
289
316
|
padding-right: 2px;
|
|
290
317
|
}
|
|
291
318
|
}
|
|
319
|
+
}
|
|
292
320
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
321
|
+
.labelKey_menu{
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
}
|
|
325
|
+
.labelKey_menu:hover{
|
|
326
|
+
i{
|
|
327
|
+
color: var(--nav-hover-color) !important;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
.router-link-active{
|
|
331
|
+
.labelKey_menu{
|
|
332
|
+
i{
|
|
333
|
+
color: var(--nav-hover-color) !important;
|
|
304
334
|
}
|
|
305
335
|
}
|
|
306
|
-
|
|
336
|
+
}
|
|
307
337
|
</style>
|
|
@@ -76,6 +76,6 @@ export const useClickOutside = <T extends OnClickOutsideOptions>(
|
|
|
76
76
|
|
|
77
77
|
onBeforeUnmount(() => {
|
|
78
78
|
window.removeEventListener('click', listener as any);
|
|
79
|
-
window.removeEventListener('
|
|
79
|
+
window.removeEventListener('pointerdown', setShouldListen);
|
|
80
80
|
});
|
|
81
81
|
};
|
package/config/private-label.js
CHANGED
|
@@ -58,17 +58,20 @@ export function matches(pl) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export function getVendor() {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
return '云翼云管平台';
|
|
62
|
+
}
|
|
63
|
+
// export function getVendor() {
|
|
64
|
+
// if ( vendor === SETTING.PL_RANCHER_VALUE ) {
|
|
65
|
+
// // Custom vendor override based on brand
|
|
66
|
+
// if (brand && CUSTOM_VENDOR[brand]) {
|
|
67
|
+
// return CUSTOM_VENDOR[brand];
|
|
68
|
+
// }
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
// return STANDARD_VENDOR;
|
|
71
|
+
// }
|
|
69
72
|
|
|
70
|
-
|
|
71
|
-
}
|
|
73
|
+
// return vendor;
|
|
74
|
+
// }
|
|
72
75
|
|
|
73
76
|
export function getProduct() {
|
|
74
77
|
return product;
|
|
@@ -80,13 +83,13 @@ export function setTitle() {
|
|
|
80
83
|
if (v === 'Harvester') {
|
|
81
84
|
const ico = require(`~shell/assets/images/pl/harvester.png`);
|
|
82
85
|
|
|
83
|
-
document.title = '
|
|
86
|
+
document.title = '云翼云管平台';
|
|
84
87
|
const link = document.createElement('link');
|
|
85
88
|
|
|
86
89
|
link.hid = 'icon';
|
|
87
90
|
link.rel = 'icon';
|
|
88
91
|
link.type = 'image/x-icon';
|
|
89
|
-
link.
|
|
92
|
+
link.href = ico;
|
|
90
93
|
const head = document.getElementsByTagName('head')[0];
|
|
91
94
|
|
|
92
95
|
head.appendChild(link);
|
package/config/product/auth.js
CHANGED
|
@@ -191,13 +191,23 @@ export function init(store) {
|
|
|
191
191
|
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/genericoidc`, 'auth/oidc');
|
|
192
192
|
componentForType(`${ MANAGEMENT.AUTH_CONFIG }/cognito`, 'auth/oidc');
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS')
|
|
195
|
+
|
|
196
|
+
if (topLevelPermissions && topLevelPermissions === 'superadmin') {
|
|
197
|
+
basicType([
|
|
198
|
+
'config',
|
|
199
|
+
USERS_VIRTUAL_TYPE,
|
|
200
|
+
NORMAN.SPOOFED.GROUP_PRINCIPAL,
|
|
201
|
+
ROLES_VIRTUAL_TYPE,
|
|
202
|
+
MANAGEMENT.OIDC_CLIENT
|
|
203
|
+
]);
|
|
204
|
+
} else {
|
|
205
|
+
basicType([
|
|
206
|
+
USERS_VIRTUAL_TYPE,
|
|
207
|
+
ROLES_VIRTUAL_TYPE
|
|
208
|
+
]);
|
|
209
|
+
}
|
|
210
|
+
|
|
201
211
|
|
|
202
212
|
headers(NORMAN.SPOOFED.GROUP_PRINCIPAL, [
|
|
203
213
|
GROUP_NAME,
|
|
@@ -67,16 +67,37 @@ export function init(store) {
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
+
const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS')
|
|
71
|
+
|
|
70
72
|
basicType(['cluster-dashboard', 'cluster-tools']);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
|
|
74
|
+
if (topLevelPermissions && topLevelPermissions === 'superadmin') {
|
|
75
|
+
basicType([
|
|
76
|
+
'cluster-dashboard',
|
|
77
|
+
'projects-namespaces',
|
|
78
|
+
'namespaces',
|
|
79
|
+
'namespace',
|
|
80
|
+
NODE,
|
|
81
|
+
VIRTUAL_TYPES.CLUSTER_MEMBERS,
|
|
82
|
+
EVENT,
|
|
83
|
+
'c-cluster-explorer-tools',
|
|
84
|
+
'management.cattle.io.project',
|
|
85
|
+
'management.cattle.io.clusterroletemplatebinding'
|
|
86
|
+
], 'cluster');
|
|
87
|
+
} else {
|
|
88
|
+
basicType([
|
|
89
|
+
'cluster-dashboard',
|
|
90
|
+
'projects-namespaces',
|
|
91
|
+
'namespaces',
|
|
92
|
+
'namespace',
|
|
93
|
+
NODE,
|
|
94
|
+
VIRTUAL_TYPES.CLUSTER_MEMBERS,
|
|
95
|
+
EVENT,
|
|
96
|
+
'management.cattle.io.project',
|
|
97
|
+
'management.cattle.io.clusterroletemplatebinding'
|
|
98
|
+
], 'cluster');
|
|
99
|
+
}
|
|
100
|
+
|
|
80
101
|
basicType([
|
|
81
102
|
LIMIT_RANGE,
|
|
82
103
|
NETWORK_POLICY,
|
|
@@ -95,6 +116,7 @@ export function init(store) {
|
|
|
95
116
|
STORAGE_CLASS,
|
|
96
117
|
SECRET,
|
|
97
118
|
VIRTUAL_TYPES.PROJECT_SECRETS,
|
|
119
|
+
VIRTUAL_TYPES.NAMESPACES,
|
|
98
120
|
CONFIG_MAP
|
|
99
121
|
], 'storage');
|
|
100
122
|
basicType([
|
|
@@ -633,7 +655,7 @@ export function init(store) {
|
|
|
633
655
|
virtualType({
|
|
634
656
|
label: store.getters['i18n/t'](`typeLabel.${ VIRTUAL_TYPES.PROJECT_SECRETS }`, { count: 2 }),
|
|
635
657
|
group: 'storage',
|
|
636
|
-
icon: '
|
|
658
|
+
icon: 'default',
|
|
637
659
|
namespaced: false,
|
|
638
660
|
ifRancherCluster: true,
|
|
639
661
|
name: VIRTUAL_TYPES.PROJECT_SECRETS,
|
|
@@ -13,6 +13,7 @@ import { DSL } from '@shell/store/type-map';
|
|
|
13
13
|
import { BLANK_CLUSTER } from '@shell/store/store-types.js';
|
|
14
14
|
|
|
15
15
|
export const NAME = 'manager';
|
|
16
|
+
const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS')
|
|
16
17
|
|
|
17
18
|
export function init(store) {
|
|
18
19
|
const {
|
|
@@ -60,11 +61,17 @@ export function init(store) {
|
|
|
60
61
|
route: { name: 'c-cluster-manager-cloudCredential' },
|
|
61
62
|
});
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
if (topLevelPermissions && topLevelPermissions === 'superadmin') {
|
|
65
|
+
basicType([
|
|
66
|
+
CAPI.RANCHER_CLUSTER,
|
|
67
|
+
'cloud-credentials',
|
|
68
|
+
'drivers',
|
|
69
|
+
]);
|
|
70
|
+
} else {
|
|
71
|
+
basicType([
|
|
72
|
+
CAPI.RANCHER_CLUSTER,
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
68
75
|
|
|
69
76
|
configureType(SNAPSHOT, { depaginate: true });
|
|
70
77
|
|
|
@@ -111,10 +118,12 @@ export function init(store) {
|
|
|
111
118
|
exact: true
|
|
112
119
|
});
|
|
113
120
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
if (topLevelPermissions && topLevelPermissions === 'superadmin') {
|
|
122
|
+
basicType([
|
|
123
|
+
'rke-kontainer-drivers',
|
|
124
|
+
'rke-node-drivers',
|
|
125
|
+
], 'drivers');
|
|
126
|
+
}
|
|
118
127
|
|
|
119
128
|
weightType(CAPI.MACHINE_DEPLOYMENT, 4, true);
|
|
120
129
|
weightType(CAPI.MACHINE_SET, 3, true);
|
|
@@ -123,14 +132,16 @@ export function init(store) {
|
|
|
123
132
|
weightType(MANAGEMENT.PSA, 5, true);
|
|
124
133
|
weightType(VIRTUAL_TYPES.JWT_AUTHENTICATION, 0, true);
|
|
125
134
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
if (topLevelPermissions && topLevelPermissions === 'superadmin') {
|
|
136
|
+
basicType([
|
|
137
|
+
CAPI.MACHINE_DEPLOYMENT,
|
|
138
|
+
CAPI.MACHINE_SET,
|
|
139
|
+
CAPI.MACHINE,
|
|
140
|
+
CATALOG.CLUSTER_REPO,
|
|
141
|
+
MANAGEMENT.PSA,
|
|
142
|
+
VIRTUAL_TYPES.JWT_AUTHENTICATION
|
|
143
|
+
], 'advanced');
|
|
144
|
+
}
|
|
134
145
|
|
|
135
146
|
weightGroup('advanced', -1, true);
|
|
136
147
|
|
|
@@ -112,15 +112,25 @@ export function init(store) {
|
|
|
112
112
|
route: { name: 'c-cluster-settings-fleet' }
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS')
|
|
116
|
+
|
|
117
|
+
if (topLevelPermissions && topLevelPermissions === 'superadmin') {
|
|
118
|
+
basicType([
|
|
119
|
+
'settings',
|
|
120
|
+
'features',
|
|
121
|
+
'brand',
|
|
122
|
+
'banners',
|
|
123
|
+
'performance',
|
|
124
|
+
'links',
|
|
125
|
+
'fleet-settings'
|
|
126
|
+
]);
|
|
127
|
+
} else {
|
|
128
|
+
basicType([
|
|
129
|
+
'settings',
|
|
130
|
+
'brand',
|
|
131
|
+
]);
|
|
132
|
+
}
|
|
133
|
+
|
|
124
134
|
|
|
125
135
|
configureType(MANAGEMENT.SETTING, {
|
|
126
136
|
isCreatable: false,
|
|
@@ -5,14 +5,17 @@ export const NAME = 'uiplugins';
|
|
|
5
5
|
export function init(store) {
|
|
6
6
|
const { product } = DSL(store, NAME);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
if (sessionStorage.getItem('TOPLEVELPERMISSIONS') && sessionStorage.getItem('TOPLEVELPERMISSIONS') === 'superadmin') {
|
|
9
|
+
// Add a product for UI Plugins - will appear in the top-level menu
|
|
10
|
+
product({
|
|
11
|
+
ifHave: IF_HAVE.ADMIN, // Only admins can see the UI Plugin Custom Resource by default
|
|
12
|
+
inStore: 'management',
|
|
13
|
+
icon: 'extension',
|
|
14
|
+
removable: false,
|
|
15
|
+
showClusterSwitcher: false,
|
|
16
|
+
category: 'configuration',
|
|
17
|
+
weight: 50,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
18
21
|
}
|
|
@@ -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
|
+
|
package/config/settings.ts
CHANGED
|
@@ -112,6 +112,34 @@ export const SETTING = {
|
|
|
112
112
|
CLUSTER_AGENT_DEFAULT_POD_DISTRIBUTION_BUDGET: 'cluster-agent-default-pod-disruption-budget'
|
|
113
113
|
} as const;
|
|
114
114
|
|
|
115
|
+
export const ALLOWED_SETTINGS_NEW: GlobalSetting = {
|
|
116
|
+
[SETTING.CA_CERTS]: { kind: 'multiline', readOnly: true },
|
|
117
|
+
[SETTING.PASSWORD_MIN_LENGTH]: {
|
|
118
|
+
kind: 'integer',
|
|
119
|
+
ruleSet: [
|
|
120
|
+
{
|
|
121
|
+
name: 'betweenValues',
|
|
122
|
+
key: 'Password',
|
|
123
|
+
factoryArg: [2, 256]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'isInteger',
|
|
127
|
+
key: 'Password',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'isPositive',
|
|
131
|
+
key: 'Password',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'isOctal',
|
|
135
|
+
key: 'Password',
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
[SETTING.AUTH_USER_SESSION_TTL_MINUTES]: {},
|
|
140
|
+
[SETTING.AUTH_TOKEN_MAX_TTL_MINUTES]: {},
|
|
141
|
+
}
|
|
142
|
+
|
|
115
143
|
// These are the settings that are allowed to be edited via the UI
|
|
116
144
|
export const ALLOWED_SETTINGS: GlobalSetting = {
|
|
117
145
|
[SETTING.CA_CERTS]: { kind: 'multiline', readOnly: true },
|