@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.6
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/data/aws-regions.json +1 -0
- package/assets/images/icons/document.svg +3 -0
- package/assets/images/key.svg +17 -0
- package/assets/images/vendor/cognito.svg +1 -0
- package/assets/styles/app.scss +1 -0
- package/assets/styles/base/_basic.scss +10 -0
- package/assets/styles/base/_spacing.scss +29 -0
- package/assets/styles/global/_form.scss +1 -1
- package/assets/styles/global/_labeled-input.scss +1 -1
- package/assets/styles/global/_layout.scss +1 -1
- package/assets/styles/themes/_dark.scss +28 -0
- package/assets/styles/themes/_light.scss +68 -0
- package/assets/styles/vendor/vue-select.scss +1 -1
- package/assets/translations/en-us.yaml +721 -83
- package/assets/translations/zh-hans.yaml +11 -9
- package/cloud-credential/gcp.vue +9 -1
- package/components/AppModal.vue +2 -0
- package/components/Certificates.vue +5 -0
- package/components/CodeMirror.vue +1 -1
- package/components/ConfigMapSettings/Settings.vue +377 -0
- package/components/ConfigMapSettings/index.vue +354 -0
- package/components/CruResource.vue +1 -2
- package/components/DetailText.vue +61 -11
- package/components/Drawer/Chrome.vue +116 -0
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +61 -0
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +48 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +54 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/YamlTab.test.ts +80 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +82 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/helpers.test.ts +42 -0
- package/components/Drawer/ResourceDetailDrawer/composables.ts +50 -0
- package/components/Drawer/ResourceDetailDrawer/helpers.ts +10 -0
- package/components/Drawer/ResourceDetailDrawer/index.vue +110 -0
- package/components/FilterPanel.vue +156 -0
- package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
- package/components/GrowlManager.vue +16 -15
- package/components/IconOrSvg.vue +19 -35
- package/components/KeyValueView.vue +1 -1
- package/components/LocaleSelector.vue +9 -1
- package/components/ProgressBarMulti.vue +1 -0
- package/components/PromptModal.vue +6 -1
- package/components/PromptRemove.vue +5 -1
- package/components/RelatedResources.vue +4 -12
- package/components/Resource/Detail/Additional.vue +46 -0
- package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
- package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
- package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
- package/components/Resource/Detail/Card/Scaler.vue +89 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
- package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
- package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
- package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
- package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
- package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
- package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
- package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
- package/components/Resource/Detail/Card/index.vue +56 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
- package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Annotations/index.vue +31 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +223 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +64 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +298 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +133 -0
- package/components/Resource/Detail/Metadata/KeyValue.vue +138 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
- package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +31 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +75 -0
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
- package/components/Resource/Detail/Metadata/composables.ts +78 -0
- package/components/Resource/Detail/Metadata/index.vue +73 -0
- package/components/Resource/Detail/Page.vue +37 -0
- package/components/Resource/Detail/PercentageBar.vue +40 -0
- package/components/Resource/Detail/ResourceRow.vue +138 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/composables.test.ts +29 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/index.test.ts +48 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/composables.ts +31 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/index.vue +50 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/__tests__/composables.test.ts +66 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/composables.ts +21 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/index.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Basic.vue +45 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/BasicAuth.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Certificate.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Registry.vue +22 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/ServiceAccountToken.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Ssh.vue +32 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Basic.test.ts +40 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/BasicAuth.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Certificate.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Registry.test.ts +27 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/ServiceAccountToken.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Ssh.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/auth-types.test.ts +186 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/composables.test.ts +102 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/auth-types.ts +109 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/composeables.ts +52 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/index.vue +71 -0
- package/components/Resource/Detail/SpacedRow.vue +14 -0
- package/components/Resource/Detail/StatusBar.vue +59 -0
- package/components/Resource/Detail/StatusRow.vue +61 -0
- package/components/Resource/Detail/TitleBar/Title.vue +14 -0
- package/components/Resource/Detail/TitleBar/Top.vue +14 -0
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +63 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
- package/components/Resource/Detail/TitleBar/composables.ts +44 -0
- package/components/Resource/Detail/TitleBar/index.vue +196 -0
- package/components/Resource/Detail/Top/index.vue +34 -0
- package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
- package/components/Resource/Detail/composables.ts +45 -0
- package/components/ResourceDetail/Masthead/__tests__/index.test.ts +70 -0
- package/components/ResourceDetail/{__tests__/Masthead.test.ts → Masthead/__tests__/legacy.test.ts} +3 -3
- package/components/ResourceDetail/Masthead/index.vue +65 -0
- package/components/ResourceDetail/Masthead/latest.vue +44 -0
- package/components/ResourceDetail/__tests__/index.test.ts +135 -0
- package/components/ResourceDetail/index.vue +73 -557
- package/components/ResourceDetail/legacy.vue +562 -0
- package/components/ResourceList/Masthead.vue +6 -0
- package/components/ResourceTable.vue +41 -7
- package/components/ResourceYaml.vue +14 -1
- package/components/SlideInPanelManager.vue +117 -10
- package/components/SortableTable/index.vue +13 -2
- package/components/SortableTable/selection.js +21 -8
- package/components/StateDot/index.vue +28 -0
- package/components/StatusBadge.vue +6 -4
- package/components/SubtleLink.vue +25 -0
- package/components/Tabbed/index.vue +11 -15
- package/components/Wizard.vue +16 -3
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/ConfigMapSettings.test.ts +376 -0
- package/components/__tests__/FilterPanel.test.ts +81 -0
- package/components/__tests__/GrowlManager.test.ts +0 -25
- package/components/auth/AuthBanner.vue +2 -3
- package/components/auth/RoleDetailEdit.vue +45 -3
- package/components/auth/login/ldap.vue +1 -1
- package/components/auth/login/oidc.vue +6 -1
- package/components/fleet/FleetApplications.vue +174 -0
- package/components/fleet/FleetClusterTargets/TargetsList.vue +66 -0
- package/components/fleet/FleetClusterTargets/index.vue +455 -0
- package/components/fleet/FleetClusters.vue +25 -6
- package/components/fleet/FleetGitRepoPaths.vue +476 -0
- package/components/fleet/FleetHelmOps.vue +123 -0
- package/components/fleet/FleetIntro.vue +58 -28
- package/components/fleet/FleetNoWorkspaces.vue +5 -1
- package/components/fleet/FleetOCIStorageSecret.vue +171 -0
- package/components/fleet/FleetRepos.vue +37 -80
- package/components/fleet/FleetResources.vue +53 -26
- package/components/fleet/FleetSummary.vue +26 -51
- package/components/fleet/FleetValuesFrom.vue +295 -0
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +1224 -0
- package/components/fleet/__tests__/FleetGitRepoPaths.test.ts +265 -0
- package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +213 -0
- package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +300 -0
- package/components/fleet/dashboard/Empty.vue +73 -0
- package/components/fleet/dashboard/ResourceCard.vue +184 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +195 -0
- package/components/fleet/dashboard/ResourceDetails.vue +194 -0
- package/components/fleet/dashboard/ResourcePanel.vue +383 -0
- package/components/form/ArrayList.vue +19 -2
- package/components/form/ChangePassword.vue +3 -1
- package/components/form/Footer.vue +10 -4
- package/components/form/KeyValue.vue +81 -43
- package/components/form/LabeledSelect.vue +56 -16
- package/components/form/Labels.vue +90 -17
- package/components/form/MatchExpressions.vue +46 -5
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/ResourceSelector.vue +1 -0
- package/components/form/ResourceTabs/index.vue +5 -0
- package/components/form/SecretSelector.vue +9 -2
- package/components/form/Select.vue +57 -19
- package/components/form/SimpleSecretSelector.vue +17 -4
- package/components/form/Taints.vue +21 -2
- package/components/form/UnitInput.vue +8 -0
- package/components/form/ValueFromResource.vue +31 -19
- package/components/form/__tests__/LabeledSelect.test.ts +8 -4
- package/components/form/__tests__/Labels.test.ts +360 -0
- package/components/form/__tests__/MatchExpressions.test.ts +16 -13
- package/components/form/__tests__/Select.test.ts +5 -2
- package/components/formatter/FleetApplicationClustersReady.vue +77 -0
- package/components/formatter/FleetApplicationSource.vue +71 -0
- package/components/formatter/FleetSummaryGraph.vue +7 -0
- package/components/formatter/WorkloadHealthScale.vue +1 -1
- package/components/google/AccountAccess.vue +211 -0
- package/components/google/types/gcp.d.ts +136 -0
- package/components/google/types/index.d.ts +101 -0
- package/components/google/util/__mocks__/gcp.ts +465 -0
- package/components/google/util/formatter.ts +82 -0
- package/components/google/util/gcp.ts +134 -0
- package/components/google/util/index.d.ts +11 -0
- package/components/nav/Favorite.vue +1 -1
- package/components/nav/Group.vue +70 -47
- package/components/nav/Header.vue +13 -8
- package/components/nav/NamespaceFilter.vue +13 -1
- package/components/nav/NotificationCenter/Notification.vue +510 -0
- package/components/nav/NotificationCenter/NotificationHeader.vue +112 -0
- package/components/nav/NotificationCenter/index.vue +148 -0
- package/components/nav/TopLevelMenu.helper.ts +55 -34
- package/components/nav/TopLevelMenu.vue +11 -0
- package/components/nav/Type.vue +4 -1
- package/composables/drawer.ts +26 -0
- package/composables/resources.test.ts +63 -0
- package/composables/resources.ts +38 -0
- package/composables/useI18n.ts +12 -11
- package/composables/useIsNewDetailPageEnabled.ts +17 -0
- package/config/labels-annotations.js +20 -11
- package/config/product/auth.js +17 -1
- package/config/product/{cis.js → compliance.js} +23 -26
- package/config/product/explorer.js +5 -1
- package/config/product/fleet.js +77 -17
- package/config/product/settings.js +22 -11
- package/config/query-params.js +6 -1
- package/config/roles.ts +2 -1
- package/config/router/navigation-guards/authentication.js +51 -2
- package/config/router/routes.js +45 -31
- package/config/secret.ts +15 -0
- package/config/settings.ts +24 -5
- package/config/store.js +2 -0
- package/config/system-namespaces.js +1 -1
- package/config/table-headers.js +53 -23
- package/config/types.js +17 -6
- package/core/plugin-helpers.ts +3 -2
- package/core/plugin.ts +32 -7
- package/core/types.ts +18 -1
- package/detail/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +22 -18
- package/detail/fleet.cattle.io.cluster.vue +28 -15
- package/detail/fleet.cattle.io.gitrepo.vue +10 -1
- package/detail/fleet.cattle.io.helmop.vue +157 -0
- package/detail/management.cattle.io.fleetworkspace.vue +18 -27
- package/detail/management.cattle.io.oidcclient.vue +369 -0
- package/detail/node.vue +2 -2
- package/detail/pod.vue +2 -2
- package/detail/service.vue +10 -1
- package/detail/workload/index.vue +8 -2
- package/dialog/ExtensionCatalogUninstallDialog.vue +7 -4
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/HelmOpForceUpdateDialog.vue +132 -0
- package/dialog/ImportDialog.vue +8 -8
- package/dialog/OidcClientSecretDialog.vue +117 -0
- package/dialog/RedeployWorkloadDialog.vue +164 -0
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +3 -3
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +60 -68
- package/edit/auth/oidc.vue +159 -93
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -1
- package/edit/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +30 -31
- package/edit/{cis.cattle.io.clusterscanbenchmark.vue → compliance.cattle.io.clusterscanbenchmark.vue} +4 -4
- package/edit/{cis.cattle.io.clusterscanprofile.vue → compliance.cattle.io.clusterscanprofile.vue} +5 -5
- package/edit/configmap.vue +4 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
- package/edit/fleet.cattle.io.gitrepo.vue +70 -255
- package/edit/fleet.cattle.io.helmop.vue +772 -0
- package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +1 -0
- package/edit/logging-flow/index.vue +1 -0
- package/edit/logging.banzaicloud.io.output/index.vue +1 -0
- package/edit/management.cattle.io.fleetworkspace.vue +44 -10
- package/edit/management.cattle.io.oidcclient.vue +162 -0
- package/edit/management.cattle.io.project.vue +4 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +5 -0
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/auth.vue +30 -30
- package/edit/monitoring.coreos.com.receiver/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -1
- package/edit/monitoring.coreos.com.route.vue +1 -0
- package/edit/namespace.vue +1 -0
- package/edit/networking.istio.io.destinationrule/index.vue +4 -1
- package/edit/networking.k8s.io.ingress/index.vue +4 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +7 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +6 -2
- package/edit/node.vue +1 -0
- package/edit/persistentvolume/index.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/rke2.vue +418 -382
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +27 -27
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +5 -0
- package/edit/resources.cattle.io.restore.vue +1 -1
- package/edit/secret/index.vue +1 -0
- package/edit/service.vue +4 -1
- package/edit/serviceaccount.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +4 -1
- package/edit/workload/index.vue +5 -0
- package/list/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +2 -2
- package/list/fleet.cattle.io.gitrepo.vue +1 -1
- package/list/fleet.cattle.io.helmop.vue +108 -0
- package/list/management.cattle.io.oidcclient.vue +108 -0
- package/list/namespace.vue +5 -2
- package/list/node.vue +2 -0
- package/machine-config/amazonec2.vue +3 -24
- package/machine-config/components/GCEImage.vue +374 -0
- package/machine-config/google.vue +617 -0
- package/mixins/__tests__/brand.spec.ts +170 -0
- package/mixins/auth-config.js +8 -1
- package/mixins/brand.js +16 -17
- package/mixins/create-edit-view/index.js +5 -0
- package/mixins/preset.js +100 -0
- package/mixins/resource-fetch-api-pagination.js +18 -0
- package/mixins/resource-fetch.js +1 -1
- package/mixins/resource-table-watch.js +45 -0
- package/mixins/vue-select-overrides.js +1 -0
- package/models/__tests__/chart.test.ts +273 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
- package/models/chart.js +144 -2
- package/models/{cis.cattle.io.clusterscan.js → compliance.cattle.io.clusterscan.js} +8 -8
- package/models/{cis.cattle.io.clusterscanbenchmark.js → compliance.cattle.io.clusterscanbenchmark.js} +1 -1
- package/models/{cis.cattle.io.clusterscanprofile.js → compliance.cattle.io.clusterscanprofile.js} +5 -5
- package/models/{cis.cattle.io.clusterscanreport.js → compliance.cattle.io.clusterscanreport.js} +1 -1
- package/models/fleet-application.js +314 -0
- package/models/fleet.cattle.io.bundle.js +9 -8
- package/models/fleet.cattle.io.cluster.js +11 -0
- package/models/fleet.cattle.io.gitrepo.js +41 -365
- package/models/fleet.cattle.io.helmop.js +198 -0
- package/models/management.cattle.io.authconfig.js +1 -0
- package/models/management.cattle.io.fleetworkspace.js +14 -1
- package/models/management.cattle.io.oidcclient.js +18 -0
- package/models/management.cattle.io.registration.js +3 -0
- package/models/provisioning.cattle.io.cluster.js +5 -5
- package/models/service.js +4 -0
- package/models/workload.js +19 -18
- package/package.json +2 -1
- package/pages/about.vue +4 -58
- package/pages/auth/login.vue +1 -1
- package/pages/auth/verify.vue +13 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +36 -0
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
- package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
- package/pages/c/_cluster/apps/charts/index.vue +487 -465
- package/pages/c/_cluster/auth/user.retention/index.vue +87 -78
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +3 -3
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +0 -1
- package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
- package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
- package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
- package/pages/c/_cluster/fleet/application/create.vue +341 -0
- package/pages/c/_cluster/fleet/application/index.vue +139 -0
- package/pages/c/_cluster/fleet/graph/config.js +277 -0
- package/pages/c/_cluster/fleet/index.vue +809 -329
- package/pages/c/_cluster/fleet/settings/index.vue +229 -0
- package/pages/c/_cluster/longhorn/index.vue +5 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +16 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -2
- package/pages/explorer/resource/detail/configmap.vue +42 -0
- package/pages/explorer/resource/detail/secret.vue +50 -0
- package/pages/home.vue +9 -55
- package/pages/support/index.vue +4 -6
- package/plugins/dashboard-store/actions.js +50 -14
- package/plugins/dashboard-store/getters.js +38 -21
- package/plugins/dashboard-store/mutations.js +51 -7
- package/plugins/dashboard-store/resource-class.js +30 -4
- package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
- package/plugins/steve/actions.js +3 -0
- package/plugins/steve/steve-pagination-utils.ts +17 -8
- package/plugins/steve/subscribe.js +235 -43
- package/rancher-components/BadgeState/BadgeState.vue +3 -1
- package/rancher-components/Banner/Banner.vue +13 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +11 -6
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +430 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
- package/rancher-components/RcItemCard/index.ts +2 -0
- package/store/auth.js +3 -0
- package/store/catalog.js +85 -25
- package/store/growl.js +97 -8
- package/store/index.js +39 -14
- package/store/notifications.ts +426 -0
- package/store/prefs.js +0 -1
- package/store/slideInPanel.ts +6 -0
- package/store/type-map.js +19 -15
- package/store/uiplugins.ts +15 -1
- package/types/fleet.d.ts +59 -0
- package/types/notifications/index.ts +74 -0
- package/types/resources/settings.d.ts +19 -1
- package/types/shell/index.d.ts +388 -307
- package/types/store/dashboard-store.types.ts +33 -3
- package/types/store/pagination.types.ts +6 -1
- package/types/store/subscribe.types.ts +50 -0
- package/utils/__tests__/fleet.test.ts +148 -0
- package/utils/__tests__/object.test.ts +54 -1
- package/utils/__tests__/string.test.ts +273 -1
- package/utils/__tests__/time.test.ts +31 -0
- package/utils/auth.js +41 -5
- package/utils/crypto/encryption.ts +103 -0
- package/utils/cspAdaptor.ts +51 -0
- package/utils/fleet-types.ts +0 -0
- package/utils/fleet.ts +190 -2
- package/utils/object.js +36 -0
- package/utils/pagination-utils.ts +27 -2
- package/utils/pagination-wrapper.ts +132 -50
- package/utils/release-notes.ts +48 -0
- package/utils/selector-typed.ts +7 -2
- package/utils/settings.ts +4 -1
- package/utils/string.js +24 -0
- package/utils/style.ts +39 -0
- package/utils/{time.js → time.ts} +25 -6
- package/utils/uiplugins.ts +22 -0
- package/utils/validators/formRules/__tests__/index.test.ts +36 -3
- package/utils/validators/formRules/index.ts +13 -3
- package/utils/window.js +11 -7
- package/components/__tests__/ApplicationCard.test.ts +0 -27
- package/components/cards/ApplicationCard.vue +0 -145
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
- package/config/product/legacy.js +0 -62
- package/config/secret.js +0 -14
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
- package/pages/c/_cluster/legacy/pages/_page.vue +0 -29
- package/pages/c/_cluster/legacy/project/_page.vue +0 -57
- package/pages/c/_cluster/legacy/project/index.vue +0 -32
- package/pages/c/_cluster/legacy/project/pipelines.vue +0 -96
- /package/components/ResourceDetail/{Masthead.vue → Masthead/legacy.vue} +0 -0
- /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import * as d3 from 'd3';
|
|
3
3
|
import { STATES } from '@shell/plugins/dashboard-store/resource-class';
|
|
4
4
|
import { BadgeState } from '@components/BadgeState';
|
|
5
|
-
import { getChartIcon } from './chartIcons.js';
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
7
|
name: 'ForceDirectedTreeChart',
|
|
@@ -17,8 +16,24 @@ export default {
|
|
|
17
16
|
required: true
|
|
18
17
|
}
|
|
19
18
|
},
|
|
19
|
+
|
|
20
|
+
async fetch() {
|
|
21
|
+
this.canViewChart = await this.fdcConfig.checkSchemaPermissions(this.$store);
|
|
22
|
+
|
|
23
|
+
if (this.canViewChart) {
|
|
24
|
+
// set watcher for the chart data
|
|
25
|
+
this.dataWatcher = this.$watch(this.fdcConfig.watcherProp, (newValue) => {
|
|
26
|
+
this.watcherFunction(newValue);
|
|
27
|
+
}, {
|
|
28
|
+
deep: true,
|
|
29
|
+
immediate: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
20
34
|
data() {
|
|
21
35
|
return {
|
|
36
|
+
canViewChart: null,
|
|
22
37
|
dataWatcher: undefined,
|
|
23
38
|
parsedInfo: undefined,
|
|
24
39
|
root: undefined,
|
|
@@ -37,7 +52,7 @@ export default {
|
|
|
37
52
|
},
|
|
38
53
|
methods: {
|
|
39
54
|
watcherFunction(newValue) {
|
|
40
|
-
if (newValue
|
|
55
|
+
if (newValue?.length) {
|
|
41
56
|
if (!this.isChartFirstRendered) {
|
|
42
57
|
this.parsedInfo = this.fdcConfig.parseData(this.data);
|
|
43
58
|
|
|
@@ -158,16 +173,11 @@ export default {
|
|
|
158
173
|
.attr('r', this.setNodeRadius);
|
|
159
174
|
|
|
160
175
|
nodeEnter.append('circle')
|
|
161
|
-
.attr('r', (d) =>
|
|
162
|
-
return this.setNodeRadius(d) - 5;
|
|
163
|
-
})
|
|
176
|
+
.attr('r', (d) => this.setNodeRadius(d) - 5)
|
|
164
177
|
.attr('class', 'node-hover-layer');
|
|
165
178
|
|
|
166
|
-
nodeEnter.append('svg')
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return getChartIcon(icon);
|
|
170
|
-
})
|
|
179
|
+
nodeEnter.append('svg')
|
|
180
|
+
.html((d) => this.fdcConfig.fetchNodeIcon(d))
|
|
171
181
|
.attr('x', this.nodeImagePosition)
|
|
172
182
|
.attr('y', this.nodeImagePosition)
|
|
173
183
|
.attr('height', this.nodeImageSize)
|
|
@@ -177,9 +187,7 @@ export default {
|
|
|
177
187
|
|
|
178
188
|
this.simulation.nodes(this.allNodesData);
|
|
179
189
|
this.simulation.force('link', d3.forceLink()
|
|
180
|
-
.id((d) =>
|
|
181
|
-
return d.id;
|
|
182
|
-
})
|
|
190
|
+
.id((d) => d.id)
|
|
183
191
|
.distance(100)
|
|
184
192
|
.links(this.allLinks)
|
|
185
193
|
);
|
|
@@ -188,10 +196,10 @@ export default {
|
|
|
188
196
|
const lowerCaseStatus = d.data?.state ? d.data.state.toLowerCase() : 'unkown_status';
|
|
189
197
|
const defaultClassArray = ['node'];
|
|
190
198
|
|
|
191
|
-
if (
|
|
192
|
-
defaultClassArray.push(`node-${ STATES[lowerCaseStatus].color }`);
|
|
193
|
-
} else {
|
|
199
|
+
if (d?.data?.muteStatus) {
|
|
194
200
|
defaultClassArray.push(`node-default-fill`);
|
|
201
|
+
} else if (STATES[lowerCaseStatus] && STATES[lowerCaseStatus].color) {
|
|
202
|
+
defaultClassArray.push(`node-${ STATES[lowerCaseStatus].color }`);
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
// node active (clicked)
|
|
@@ -334,14 +342,6 @@ export default {
|
|
|
334
342
|
this.svg = d3.select('#tree').append('svg')
|
|
335
343
|
.attr('viewBox', `0 0 ${ this.fdcConfig.chartWidth } ${ this.fdcConfig.chartHeight }`)
|
|
336
344
|
.attr('preserveAspectRatio', 'none');
|
|
337
|
-
|
|
338
|
-
// set watcher for the chart data
|
|
339
|
-
this.dataWatcher = this.$watch(this.fdcConfig.watcherProp, function(newValue) {
|
|
340
|
-
this.watcherFunction(newValue);
|
|
341
|
-
}, {
|
|
342
|
-
deep: true,
|
|
343
|
-
immediate: true
|
|
344
|
-
});
|
|
345
345
|
},
|
|
346
346
|
unmounted() {
|
|
347
347
|
this.dataWatcher();
|
|
@@ -353,20 +353,26 @@ export default {
|
|
|
353
353
|
<div>
|
|
354
354
|
<div
|
|
355
355
|
class="chart-container"
|
|
356
|
-
data-testid="
|
|
356
|
+
data-testid="resource-graph"
|
|
357
357
|
>
|
|
358
358
|
<!-- loading status container -->
|
|
359
359
|
<div
|
|
360
360
|
v-if="!isChartFirstRenderAnimationFinished"
|
|
361
361
|
class="loading-container"
|
|
362
362
|
>
|
|
363
|
-
<p v-
|
|
364
|
-
{{ t('
|
|
363
|
+
<p v-if="canViewChart === false">
|
|
364
|
+
{{ t('graph.noPermissions') }}
|
|
365
|
+
</p>
|
|
366
|
+
<p v-else-if="!isChartFirstRendered">
|
|
367
|
+
{{ t('graph.loading') }}
|
|
365
368
|
</p>
|
|
366
|
-
<p v-
|
|
367
|
-
{{ t('
|
|
369
|
+
<p v-else-if="!isChartFirstRenderAnimationFinished">
|
|
370
|
+
{{ t('graph.rendering') }}
|
|
368
371
|
</p>
|
|
369
|
-
<i
|
|
372
|
+
<i
|
|
373
|
+
v-if="canViewChart !== false"
|
|
374
|
+
class="mt-10 icon-spinner icon-spin"
|
|
375
|
+
/>
|
|
370
376
|
</div>
|
|
371
377
|
<!-- main div for svg container -->
|
|
372
378
|
<div id="tree" />
|
|
@@ -416,6 +422,9 @@ export default {
|
|
|
416
422
|
>
|
|
417
423
|
<p>{{ item.value }}</p>
|
|
418
424
|
</td>
|
|
425
|
+
<td v-else-if="item.type === 'resource-type'">
|
|
426
|
+
{{ t(`typeLabel."${ item.valueKey }"`, { count: 1 }) }}
|
|
427
|
+
</td>
|
|
419
428
|
<!-- default template -->
|
|
420
429
|
<td v-else>
|
|
421
430
|
{{ item.value }}
|
|
@@ -478,32 +487,29 @@ export default {
|
|
|
478
487
|
}
|
|
479
488
|
}
|
|
480
489
|
|
|
481
|
-
&.repo.active > circle {
|
|
482
|
-
transform: scale(1.2);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
490
|
&.bundle.active > circle {
|
|
486
491
|
transform: scale(1.35);
|
|
487
492
|
}
|
|
488
493
|
|
|
489
|
-
&.
|
|
494
|
+
&.bundledeployment.active > circle {
|
|
490
495
|
transform: scale(1.6);
|
|
491
496
|
}
|
|
492
497
|
|
|
493
|
-
&.node-default-fill > circle
|
|
494
|
-
|
|
498
|
+
&.node-default-fill > circle {
|
|
499
|
+
transform: scale(1.2);
|
|
495
500
|
fill: var(--muted);
|
|
496
501
|
}
|
|
497
|
-
|
|
502
|
+
|
|
503
|
+
&.node-success > circle {
|
|
498
504
|
fill: var(--success);
|
|
499
505
|
}
|
|
500
|
-
|
|
506
|
+
&.node-info > circle {
|
|
501
507
|
fill: var(--info);
|
|
502
508
|
}
|
|
503
|
-
|
|
509
|
+
&.node-warning > circle {
|
|
504
510
|
fill: var(--warning);
|
|
505
511
|
}
|
|
506
|
-
|
|
512
|
+
&.node-error > circle {
|
|
507
513
|
fill: var(--error);
|
|
508
514
|
}
|
|
509
515
|
|
|
@@ -25,10 +25,18 @@ export default {
|
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
methods: {
|
|
28
|
-
|
|
28
|
+
remove(growl) {
|
|
29
29
|
this.$store.dispatch('growl/remove', growl.id);
|
|
30
30
|
},
|
|
31
31
|
|
|
32
|
+
close(growl) {
|
|
33
|
+
this.$store.dispatch('growl/close', growl.id);
|
|
34
|
+
|
|
35
|
+
// If a user closes a growl, we won't get the mouse leave event, so we won't start the auto removal
|
|
36
|
+
// again, leaving to stuck growls that should timeout
|
|
37
|
+
this.startAutoRemove();
|
|
38
|
+
},
|
|
39
|
+
|
|
32
40
|
closeAll() {
|
|
33
41
|
this.$store.dispatch('growl/clear');
|
|
34
42
|
},
|
|
@@ -36,13 +44,18 @@ export default {
|
|
|
36
44
|
closeExpired() {
|
|
37
45
|
const now = new Date().getTime();
|
|
38
46
|
|
|
47
|
+
// Check that we should still be running the auto-close interval timer
|
|
48
|
+
if (!this.shouldRun) {
|
|
49
|
+
this.stopAutoRemove();
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
for ( const growl of this.stack ) {
|
|
40
53
|
if ( !growl.timeout ) {
|
|
41
54
|
continue;
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
if ( growl.started + growl.timeout < now ) {
|
|
45
|
-
this.
|
|
58
|
+
this.remove(growl);
|
|
46
59
|
}
|
|
47
60
|
}
|
|
48
61
|
},
|
|
@@ -124,18 +137,6 @@ export default {
|
|
|
124
137
|
</div>
|
|
125
138
|
</div>
|
|
126
139
|
</div>
|
|
127
|
-
<div
|
|
128
|
-
v-if="stack.length > 1"
|
|
129
|
-
class="text-right mr-10 mt-10"
|
|
130
|
-
>
|
|
131
|
-
<button
|
|
132
|
-
type="button"
|
|
133
|
-
class="btn btn-sm role-primary"
|
|
134
|
-
@click="closeAll()"
|
|
135
|
-
>
|
|
136
|
-
{{ t('growl.clearAll') }}
|
|
137
|
-
</button>
|
|
138
|
-
</div>
|
|
139
140
|
</div>
|
|
140
141
|
</template>
|
|
141
142
|
|
|
@@ -143,7 +144,7 @@ export default {
|
|
|
143
144
|
.growl-container {
|
|
144
145
|
z-index: 1000;
|
|
145
146
|
position: absolute;
|
|
146
|
-
top:
|
|
147
|
+
top: var(--header-height);
|
|
147
148
|
right: 0;
|
|
148
149
|
width: 100%;
|
|
149
150
|
|
package/components/IconOrSvg.vue
CHANGED
|
@@ -44,6 +44,10 @@ export default {
|
|
|
44
44
|
type: String,
|
|
45
45
|
default: () => undefined,
|
|
46
46
|
},
|
|
47
|
+
imgAlt: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: () => undefined,
|
|
50
|
+
},
|
|
47
51
|
color: {
|
|
48
52
|
type: String,
|
|
49
53
|
default: () => 'primary',
|
|
@@ -61,41 +65,16 @@ export default {
|
|
|
61
65
|
},
|
|
62
66
|
|
|
63
67
|
methods: {
|
|
68
|
+
getComputedStyleFor(cssVar) {
|
|
69
|
+
return normalizeHex(mapStandardColors((window.getComputedStyle(document.body).getPropertyValue(cssVar)).trim()));
|
|
70
|
+
},
|
|
71
|
+
|
|
64
72
|
setColor() {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
for (let i = 0; i < Object.keys(document.styleSheets).length; i++) {
|
|
71
|
-
let found = false;
|
|
72
|
-
const stylesheet = document.styleSheets[i];
|
|
73
|
-
|
|
74
|
-
if (stylesheet && stylesheet.cssRules) {
|
|
75
|
-
for (let x = 0; x < Object.keys(stylesheet.cssRules).length; x++) {
|
|
76
|
-
const cssRules = stylesheet.cssRules[x];
|
|
77
|
-
|
|
78
|
-
if (cssRules.selectorText && ((currTheme === 'light' && (cssRules.selectorText.includes('body') || cssRules.selectorText.includes('BODY')) &&
|
|
79
|
-
cssRules.selectorText.includes('.theme-light') && cssRules.style.cssText.includes('--link:')) ||
|
|
80
|
-
(currTheme === 'dark' && cssRules.selectorText.includes('.theme-dark')))) {
|
|
81
|
-
// grab the colors to be used on the icon from the css rules
|
|
82
|
-
uiColor = mapStandardColors(cssRules.style.getPropertyValue(colors[this.color].color).trim());
|
|
83
|
-
hoverColor = mapStandardColors(cssRules.style.getPropertyValue(colors[this.color].hover).trim());
|
|
84
|
-
|
|
85
|
-
// normalize hex colors (#xxx to #xxxxxx)
|
|
86
|
-
uiColor = normalizeHex(uiColor);
|
|
87
|
-
hoverColor = normalizeHex(hoverColor);
|
|
88
|
-
|
|
89
|
-
found = true;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (found) {
|
|
95
|
-
break;
|
|
96
|
-
} else {
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
73
|
+
const uiColor = this.getComputedStyleFor(colors[this.color].color);
|
|
74
|
+
const hoverColor = this.getComputedStyleFor(colors[this.color].hover);
|
|
75
|
+
|
|
76
|
+
if (!uiColor || !hoverColor) {
|
|
77
|
+
return;
|
|
99
78
|
}
|
|
100
79
|
|
|
101
80
|
const uiColorRGB = colorToRgb(uiColor);
|
|
@@ -142,7 +121,11 @@ export default {
|
|
|
142
121
|
}
|
|
143
122
|
a.option:hover > img.${ className } {
|
|
144
123
|
${ hoverFilter };
|
|
145
|
-
}
|
|
124
|
+
}
|
|
125
|
+
a.option.active-menu-link > img.${ className } {
|
|
126
|
+
${ hoverFilter };
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
146
129
|
|
|
147
130
|
const styleSheet = document.createElement('style');
|
|
148
131
|
|
|
@@ -164,6 +147,7 @@ export default {
|
|
|
164
147
|
:src="src"
|
|
165
148
|
class="svg-icon"
|
|
166
149
|
:class="className"
|
|
150
|
+
:alt="imgAlt"
|
|
167
151
|
>
|
|
168
152
|
<i
|
|
169
153
|
v-else-if="icon"
|
|
@@ -71,7 +71,12 @@ export default {
|
|
|
71
71
|
<template>
|
|
72
72
|
<div>
|
|
73
73
|
<div v-if="mode === 'login'">
|
|
74
|
-
<rc-dropdown
|
|
74
|
+
<rc-dropdown
|
|
75
|
+
v-if="showLocale"
|
|
76
|
+
:aria-label="$attrs['aria-label'] || undefined"
|
|
77
|
+
:aria-labelledby="$attrs['aria-labelledby'] || undefined"
|
|
78
|
+
:aria-describedby="$attrs['aria-describedby'] || undefined"
|
|
79
|
+
>
|
|
75
80
|
<rc-dropdown-trigger
|
|
76
81
|
data-testid="locale-selector"
|
|
77
82
|
link
|
|
@@ -105,6 +110,9 @@ export default {
|
|
|
105
110
|
</div>
|
|
106
111
|
<div v-else>
|
|
107
112
|
<Select
|
|
113
|
+
:aria-label="$attrs['aria-label'] || undefined"
|
|
114
|
+
:aria-labelledby="$attrs['aria-labelledby'] || undefined"
|
|
115
|
+
:aria-describedby="$attrs['aria-describedby'] || undefined"
|
|
108
116
|
:value="selectedOption"
|
|
109
117
|
:options="localesOptions"
|
|
110
118
|
:is-lang-select="true"
|
|
@@ -92,7 +92,12 @@ export default {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
this.errors = [];
|
|
95
|
-
|
|
95
|
+
|
|
96
|
+
// Guard against events that can be implicitly passed by components
|
|
97
|
+
const modalData = data instanceof Event ? undefined : data;
|
|
98
|
+
|
|
99
|
+
this.$store.commit('action-menu/togglePromptModal', modalData);
|
|
100
|
+
|
|
96
101
|
if (this.backgroundClosing) {
|
|
97
102
|
this.backgroundClosing();
|
|
98
103
|
}
|
|
@@ -43,6 +43,7 @@ export default {
|
|
|
43
43
|
chartsToRemoveIsApp: false,
|
|
44
44
|
chartsDeleteCrd: false,
|
|
45
45
|
showModal: false,
|
|
46
|
+
cachedDoneLocation: null
|
|
46
47
|
};
|
|
47
48
|
},
|
|
48
49
|
computed: {
|
|
@@ -220,6 +221,7 @@ export default {
|
|
|
220
221
|
this.error = '';
|
|
221
222
|
this.chartsDeleteCrd = false;
|
|
222
223
|
this.chartsToRemoveIsApp = false;
|
|
224
|
+
this.cachedDoneLocation = null;
|
|
223
225
|
this.$store.commit('action-menu/togglePromptRemove');
|
|
224
226
|
},
|
|
225
227
|
|
|
@@ -227,6 +229,8 @@ export default {
|
|
|
227
229
|
if (this.doneLocation) {
|
|
228
230
|
// doneLocation will recompute to undefined when delete request completes
|
|
229
231
|
this.cachedDoneLocation = { ...this.doneLocation };
|
|
232
|
+
} else {
|
|
233
|
+
this.cachedDoneLocation = null;
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
if (this.hasCustomRemove && this.$refs?.customPrompt?.remove) {
|
|
@@ -294,7 +298,7 @@ export default {
|
|
|
294
298
|
}
|
|
295
299
|
},
|
|
296
300
|
done() {
|
|
297
|
-
if (
|
|
301
|
+
if (!isEmpty(this.cachedDoneLocation) && this.currentRouter) {
|
|
298
302
|
this.currentRouter.push(this.cachedDoneLocation);
|
|
299
303
|
}
|
|
300
304
|
this.close();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import ResourceTable from '@shell/components/ResourceTable';
|
|
3
|
-
import { colorForState, stateDisplay } from '@shell/plugins/dashboard-store/resource-class';
|
|
3
|
+
import { STATES_ENUM, colorForState, stateDisplay } from '@shell/plugins/dashboard-store/resource-class';
|
|
4
4
|
import { NAME, NAMESPACE, STATE, TYPE } from '@shell/config/table-headers';
|
|
5
5
|
import { sortableNumericSuffix } from '@shell/utils/sort';
|
|
6
6
|
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
|
@@ -70,9 +70,9 @@ export default {
|
|
|
70
70
|
const out = [];
|
|
71
71
|
|
|
72
72
|
for ( const r of this.filteredRelationships) {
|
|
73
|
-
const state = r.state || 'active';
|
|
74
|
-
const stateColor = colorForState(state, r.error, r.transitioning);
|
|
75
73
|
const type = r[`${ this.direction }Type`];
|
|
74
|
+
const state = r.state || this.$store.getters[`${ inStore }/byId`](type, r[`${ this.direction }Id`])?.state || STATES_ENUM.MISSING;
|
|
75
|
+
const stateColor = colorForState(state, r.error, r.transitioning);
|
|
76
76
|
const schema = this.$store.getters[`${ inStore }/schemaFor`](type);
|
|
77
77
|
|
|
78
78
|
let name = r[`${ this.direction }Id`];
|
|
@@ -104,7 +104,6 @@ export default {
|
|
|
104
104
|
|
|
105
105
|
out.push({
|
|
106
106
|
type,
|
|
107
|
-
real: this.$store.getters[`${ inStore }/byId`](type, r[`${ this.direction }Id`]),
|
|
108
107
|
id: r[`${ this.direction }Id`],
|
|
109
108
|
state,
|
|
110
109
|
metadata: { namespace, name },
|
|
@@ -174,14 +173,7 @@ export default {
|
|
|
174
173
|
:groupable="false"
|
|
175
174
|
>
|
|
176
175
|
<template #cell:state="{row}">
|
|
177
|
-
<BadgeState
|
|
178
|
-
v-if="row.real"
|
|
179
|
-
:value="row.real"
|
|
180
|
-
/>
|
|
181
|
-
<BadgeState
|
|
182
|
-
v-else
|
|
183
|
-
:value="row"
|
|
184
|
-
/>
|
|
176
|
+
<BadgeState :value="row" />
|
|
185
177
|
</template>
|
|
186
178
|
</ResourceTable>
|
|
187
179
|
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
export interface Props {
|
|
5
|
+
items: string[];
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
|
|
11
|
+
const { items } = defineProps<Props>();
|
|
12
|
+
|
|
13
|
+
const first = computed(() => items[0]);
|
|
14
|
+
const tooltipValue = computed(() => {
|
|
15
|
+
let rows = '';
|
|
16
|
+
|
|
17
|
+
items.forEach((item) => {
|
|
18
|
+
rows += `• ${ item }<br>`;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return rows;
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="additional">
|
|
27
|
+
<div class="initial">
|
|
28
|
+
{{ first }}
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
v-if="items.length > 1"
|
|
32
|
+
v-clean-tooltip.bottom="tooltipValue"
|
|
33
|
+
class="more text-muted"
|
|
34
|
+
>
|
|
35
|
+
{{ t('generic.plusMore', {n: items.length-1}) }}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<style lang="scss" scoped>
|
|
41
|
+
.more {
|
|
42
|
+
margin-top: 4px;
|
|
43
|
+
cursor: help;
|
|
44
|
+
font-size: 0.8em;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
2
|
+
import { toValue } from 'vue';
|
|
3
|
+
import { useStore } from 'vuex';
|
|
4
|
+
|
|
5
|
+
export type ScaleFn = () => Promise<void>;
|
|
6
|
+
export const useScaling = (workloadName: string, scaleUpFn: ScaleFn, scaleDownFn: ScaleFn) => {
|
|
7
|
+
const store = useStore();
|
|
8
|
+
const i18n = useI18n(store);
|
|
9
|
+
|
|
10
|
+
const scale = (scaleFn: () => Promise<void>, workloadName: string, direction: 'up' | 'down') => {
|
|
11
|
+
return async() => {
|
|
12
|
+
try {
|
|
13
|
+
await scaleFn();
|
|
14
|
+
} catch (err) {
|
|
15
|
+
store.dispatch('growl/fromError', {
|
|
16
|
+
title: i18n.t('workload.list.errorCannotScale', { workloadName, direction }),
|
|
17
|
+
err
|
|
18
|
+
},
|
|
19
|
+
{ root: true });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const workloadNameValue = toValue(workloadName);
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
scaleUp: scale(() => scaleUpFn(), workloadNameValue, 'up'),
|
|
28
|
+
scaleDown: scale(() => scaleDownFn(), workloadNameValue, 'down')
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Card from '@shell/components/Resource/Detail/Card/index.vue';
|
|
3
|
+
import Scaler from '@shell/components/Resource/Detail/Card/Scaler.vue';
|
|
4
|
+
import VerticalGap from '@shell/components/Resource/Detail/Card/VerticalGap.vue';
|
|
5
|
+
import StatusBar from '@shell/components/Resource/Detail/StatusBar.vue';
|
|
6
|
+
import StatusRow from '@shell/components/Resource/Detail/StatusRow.vue';
|
|
7
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
8
|
+
import { StateColor } from '@shell/utils/style';
|
|
9
|
+
import { computed } from 'vue';
|
|
10
|
+
import { useStore } from 'vuex';
|
|
11
|
+
|
|
12
|
+
export interface Props {
|
|
13
|
+
pods?: any[];
|
|
14
|
+
showScaling?: boolean;
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
const store = useStore();
|
|
20
|
+
const i18n = useI18n(store);
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(defineProps<Props>(), { pods: undefined, showScaling: false });
|
|
23
|
+
const emit = defineEmits(['decrease', 'increase']);
|
|
24
|
+
|
|
25
|
+
const segmentAccumulator = computed(() => {
|
|
26
|
+
interface Value {
|
|
27
|
+
count: number;
|
|
28
|
+
}
|
|
29
|
+
const accumulator: {[key in StateColor]?: Value} = {};
|
|
30
|
+
|
|
31
|
+
props.pods?.forEach((pod: any) => {
|
|
32
|
+
const color: StateColor = pod.stateSimpleColor;
|
|
33
|
+
|
|
34
|
+
accumulator[color] = accumulator[color] || { count: 0 };
|
|
35
|
+
accumulator[color].count++;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return accumulator;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const rowAccumulator = computed(() => {
|
|
42
|
+
interface Value {
|
|
43
|
+
count: number;
|
|
44
|
+
color: StateColor;
|
|
45
|
+
}
|
|
46
|
+
const accumulator: {[key in string]: Value} = {};
|
|
47
|
+
|
|
48
|
+
props.pods?.forEach((pod: any) => {
|
|
49
|
+
accumulator[pod.stateDisplay] = accumulator[pod.stateDisplay] || { count: 0 };
|
|
50
|
+
accumulator[pod.stateDisplay].count++;
|
|
51
|
+
accumulator[pod.stateDisplay].color = pod.stateSimpleColor.replace('text-', '') as StateColor;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return accumulator;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const percent = (count: number, total: number) => {
|
|
58
|
+
return count / total * 100;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const count = computed(() => props.pods?.length || 0);
|
|
62
|
+
|
|
63
|
+
const segmentColors = computed(() => Object.keys(segmentAccumulator.value) as StateColor[]);
|
|
64
|
+
const segments = computed(() => segmentColors.value.map((color: StateColor) => ({
|
|
65
|
+
color,
|
|
66
|
+
percent: percent(segmentAccumulator.value[color]?.count || 0, count.value)
|
|
67
|
+
})));
|
|
68
|
+
|
|
69
|
+
const rowStates = computed(() => {
|
|
70
|
+
return Object.keys(rowAccumulator.value);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const rows = computed(() => {
|
|
74
|
+
return rowStates.value.map((state) => ({
|
|
75
|
+
color: rowAccumulator.value[state].color,
|
|
76
|
+
label: state,
|
|
77
|
+
count: rowAccumulator.value[state].count,
|
|
78
|
+
percent: percent(rowAccumulator.value[state].count, count.value)
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<Card :title="i18n.t('component.resource.detail.card.podsCard.title')">
|
|
86
|
+
<template
|
|
87
|
+
v-if="props.showScaling"
|
|
88
|
+
#heading-action
|
|
89
|
+
>
|
|
90
|
+
<Scaler
|
|
91
|
+
:ariaResourceName="i18n.t('component.resource.detail.card.podsCard.ariaResourceName')"
|
|
92
|
+
:value="count"
|
|
93
|
+
:min="0"
|
|
94
|
+
@increase="(newValue) => emit('increase', newValue)"
|
|
95
|
+
@decrease="(newValue) => emit('decrease', newValue)"
|
|
96
|
+
/>
|
|
97
|
+
</template>
|
|
98
|
+
<StatusBar :segments="segments" />
|
|
99
|
+
<VerticalGap />
|
|
100
|
+
<div class="pod-distribution">
|
|
101
|
+
<StatusRow
|
|
102
|
+
v-for="(row, i) in rows"
|
|
103
|
+
:key="i"
|
|
104
|
+
:color="row.color"
|
|
105
|
+
:label="row.label"
|
|
106
|
+
:count="row.count"
|
|
107
|
+
:percent="row.percent"
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</Card>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<style lang="scss" scoped>
|
|
114
|
+
.pod-distribution {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
}
|
|
118
|
+
</style>
|