@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
|
@@ -34,6 +34,8 @@ import { waitFor } from '@shell/utils/async';
|
|
|
34
34
|
import { WORKER_MODES } from './worker';
|
|
35
35
|
import acceptOrRejectSocketMessage from './accept-or-reject-socket-message';
|
|
36
36
|
import { BLANK_CLUSTER, STORE } from '@shell/store/store-types.js';
|
|
37
|
+
import { _MERGE } from '@shell/plugins/dashboard-store/actions';
|
|
38
|
+
import { STEVE_WATCH_EVENT, STEVE_WATCH_MODE } from '@shell/types/store/subscribe.types';
|
|
37
39
|
import paginationUtils from '@shell/utils/pagination-utils';
|
|
38
40
|
|
|
39
41
|
// minimum length of time a disconnect notification is shown
|
|
@@ -185,10 +187,14 @@ export async function createWorker(store, ctx) {
|
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
export function equivalentWatch(a, b) {
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
+
const aResourceType = a.resourceType || a.type;
|
|
191
|
+
const bResourceType = b.resourceType || b.type;
|
|
190
192
|
|
|
191
|
-
if (
|
|
193
|
+
if ( aResourceType !== bResourceType ) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (a.mode !== b.mode && (a.mode || b.mode)) {
|
|
192
198
|
return false;
|
|
193
199
|
}
|
|
194
200
|
|
|
@@ -256,6 +262,13 @@ function growlsDisabled(rootGetters) {
|
|
|
256
262
|
return getPerformanceSetting(rootGetters)?.disableWebsocketNotification;
|
|
257
263
|
}
|
|
258
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Supported events are listed
|
|
267
|
+
*
|
|
268
|
+
* of type { [key: STEVE_WATCH_EVENT]: STEVE_WATCH_EVENT_LISTENER[]}
|
|
269
|
+
*/
|
|
270
|
+
const listeners = { [STEVE_WATCH_EVENT.CHANGES]: [] };
|
|
271
|
+
|
|
259
272
|
/**
|
|
260
273
|
* Actions that cover all cases (see file description)
|
|
261
274
|
*/
|
|
@@ -354,14 +367,80 @@ const sharedActions = {
|
|
|
354
367
|
return Promise.all(cleanupTasks);
|
|
355
368
|
},
|
|
356
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Create a trigger for a specific type of watch event
|
|
372
|
+
*
|
|
373
|
+
* For example if a watch on mgmt clusters exists and a page wants to know when any changes occur
|
|
374
|
+
* @param {} ctx
|
|
375
|
+
* @param {STEVE_WATCH_EVENT_PARAMS} event
|
|
376
|
+
*/
|
|
377
|
+
watchEvent(ctx, {
|
|
378
|
+
event = STEVE_WATCH_EVENT.CHANGES,
|
|
379
|
+
id,
|
|
380
|
+
callback,
|
|
381
|
+
/**
|
|
382
|
+
* of type @STEVE_WATCH_PARAMS
|
|
383
|
+
*/
|
|
384
|
+
params
|
|
385
|
+
}) {
|
|
386
|
+
if (!listeners[event]) {
|
|
387
|
+
console.error(`Unknown event type "${ event }", only ${ Object.keys(listeners).join(',') } are supported`); // eslint-disable-line no-console
|
|
388
|
+
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// STEVE_WATCH_EVENT_LISTENER | undefined
|
|
393
|
+
let listener = listeners[event].find((l) => equivalentWatch(l.params, params));
|
|
394
|
+
|
|
395
|
+
if (!listener) {
|
|
396
|
+
listener = {
|
|
397
|
+
params,
|
|
398
|
+
callbacks: { }
|
|
399
|
+
};
|
|
400
|
+
listeners[event].push(listener);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (!listener.callbacks[id]) {
|
|
404
|
+
listener.callbacks[id] = callback;
|
|
405
|
+
ctx.dispatch('watch', params);
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* @param {} ctx
|
|
411
|
+
* @param {STEVE_UNWATCH_EVENT_PARAMS} event
|
|
412
|
+
*/
|
|
413
|
+
unwatchEvent(ctx, {
|
|
414
|
+
event = STEVE_WATCH_EVENT.CHANGES,
|
|
415
|
+
id,
|
|
416
|
+
/**
|
|
417
|
+
* of type @STEVE_WATCH_PARAMS
|
|
418
|
+
*/
|
|
419
|
+
params
|
|
420
|
+
}) {
|
|
421
|
+
if (!listeners[event]) {
|
|
422
|
+
console.info(`Attempted to unwatch for an event "${ event }" but it had no watchers`); // eslint-disable-line no-console
|
|
423
|
+
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const existing = listeners[event].find((l) => equivalentWatch(l.params, params));
|
|
428
|
+
|
|
429
|
+
if (existing) {
|
|
430
|
+
delete existing.callbacks[id];
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @param {STEVE_WATCH_PARAMS} params
|
|
436
|
+
*/
|
|
357
437
|
watch({
|
|
358
438
|
state, dispatch, getters, rootGetters
|
|
359
439
|
}, params) {
|
|
360
440
|
state.debugSocket && console.info(`Watch Request [${ getters.storeName }]`, JSON.stringify(params)); // eslint-disable-line no-console
|
|
361
|
-
|
|
362
441
|
let {
|
|
363
442
|
// eslint-disable-next-line prefer-const
|
|
364
|
-
type, selector, id, revision, namespace, stop, force
|
|
443
|
+
type, selector, id, revision, namespace, stop, force, mode
|
|
365
444
|
} = params;
|
|
366
445
|
|
|
367
446
|
namespace = acceptOrRejectSocketMessage.subscribeNamespace(namespace);
|
|
@@ -393,29 +472,43 @@ const sharedActions = {
|
|
|
393
472
|
return;
|
|
394
473
|
}
|
|
395
474
|
|
|
396
|
-
|
|
397
|
-
type, id, selector, namespace
|
|
398
|
-
}
|
|
475
|
+
const messageMeta = {
|
|
476
|
+
type, id, selector, namespace, mode
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
if (!stop && getters.watchStarted(messageMeta)) {
|
|
399
480
|
// eslint-disable-next-line no-console
|
|
400
481
|
state.debugSocket && console.debug(`Already Watching [${ getters.storeName }]`, {
|
|
401
|
-
type, id, selector, namespace
|
|
482
|
+
type, id, selector, namespace, mode
|
|
402
483
|
});
|
|
403
484
|
|
|
404
485
|
return;
|
|
405
486
|
}
|
|
406
487
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
488
|
+
if (!stop) {
|
|
489
|
+
dispatch('unwatchIncompatible', messageMeta);
|
|
490
|
+
}
|
|
491
|
+
|
|
411
492
|
// Watch errors mean we make a http request to get latest revision (which is still missing) and try to re-watch with it...
|
|
412
493
|
// etc
|
|
413
|
-
if (typeof revision === 'undefined'
|
|
494
|
+
if (typeof revision === 'undefined') {
|
|
414
495
|
revision = getters.nextResourceVersion(type, id);
|
|
415
496
|
}
|
|
416
497
|
|
|
417
498
|
const msg = { resourceType: type };
|
|
418
499
|
|
|
500
|
+
if (mode) {
|
|
501
|
+
msg.mode = mode;
|
|
502
|
+
|
|
503
|
+
if (mode === STEVE_WATCH_MODE.RESOURCE_CHANGES) {
|
|
504
|
+
const debounceMs = paginationUtils.resourceChangesDebounceMs({ rootGetters });
|
|
505
|
+
|
|
506
|
+
if (debounceMs) {
|
|
507
|
+
msg.debounceMs = debounceMs;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
419
512
|
if ( revision ) {
|
|
420
513
|
msg.resourceVersion = `${ revision }`;
|
|
421
514
|
}
|
|
@@ -451,8 +544,11 @@ const sharedActions = {
|
|
|
451
544
|
return dispatch('send', msg);
|
|
452
545
|
},
|
|
453
546
|
|
|
547
|
+
/**
|
|
548
|
+
* @param {STEVE_WATCH_PARAMS} params
|
|
549
|
+
*/
|
|
454
550
|
unwatch(ctx, {
|
|
455
|
-
type, id, namespace, selector, all
|
|
551
|
+
type, id, namespace, selector, all, mode
|
|
456
552
|
}) {
|
|
457
553
|
const { commit, getters, dispatch } = ctx;
|
|
458
554
|
|
|
@@ -464,6 +560,7 @@ const sharedActions = {
|
|
|
464
560
|
id,
|
|
465
561
|
namespace,
|
|
466
562
|
selector,
|
|
563
|
+
mode,
|
|
467
564
|
stop: true, // Stops the watch on a type
|
|
468
565
|
};
|
|
469
566
|
|
|
@@ -483,7 +580,7 @@ const sharedActions = {
|
|
|
483
580
|
dispatch('watch', obj); // Ask the backend to stop watching the type
|
|
484
581
|
} else if (all) {
|
|
485
582
|
getters['watchesOfType'](type).forEach((obj) => {
|
|
486
|
-
unwatch(obj);
|
|
583
|
+
unwatch({ ...obj, stop: true });
|
|
487
584
|
});
|
|
488
585
|
} else if (getters['watchStarted'](obj)) {
|
|
489
586
|
unwatch(obj);
|
|
@@ -491,6 +588,24 @@ const sharedActions = {
|
|
|
491
588
|
}
|
|
492
589
|
},
|
|
493
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Unwatch watches that are incompatible with the new type
|
|
593
|
+
*/
|
|
594
|
+
unwatchIncompatible({ state, dispatch, getters }, messageMeta) {
|
|
595
|
+
const watchesOfType = getters.watchesOfType(messageMeta.type);
|
|
596
|
+
let unwatch = [];
|
|
597
|
+
|
|
598
|
+
if (messageMeta.mode === STEVE_WATCH_EVENT.CHANGES) {
|
|
599
|
+
// resource.changes should not be running when other types are, so unwatch
|
|
600
|
+
unwatch = watchesOfType.filter((entry) => entry.mode !== STEVE_WATCH_EVENT.CHANGES);
|
|
601
|
+
} else {
|
|
602
|
+
// all other modes of watches should not be running when resource.changes is, so unwatch
|
|
603
|
+
unwatch = watchesOfType.filter((entry) => entry.mode === STEVE_WATCH_EVENT.CHANGES);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
unwatch.forEach((entry) => dispatch('unwatch', entry));
|
|
607
|
+
},
|
|
608
|
+
|
|
494
609
|
'ws.ping'({ getters, dispatch }, msg) {
|
|
495
610
|
if ( getters.storeName === 'management' ) {
|
|
496
611
|
const version = msg?.data?.version || null;
|
|
@@ -587,16 +702,30 @@ const defaultActions = {
|
|
|
587
702
|
return Promise.all(promises);
|
|
588
703
|
},
|
|
589
704
|
|
|
590
|
-
|
|
705
|
+
/**
|
|
706
|
+
* Socket has been closed, restart afresh (make http request, ensure we re-watch)
|
|
707
|
+
*/
|
|
708
|
+
async resyncWatch({ getters, dispatch }, params) {
|
|
709
|
+
console.info(`Resync [${ getters.storeName }]`, params); // eslint-disable-line no-console
|
|
710
|
+
|
|
711
|
+
await dispatch('fetchResources', {
|
|
712
|
+
...params,
|
|
713
|
+
opt: { force: true, forceWatch: true }
|
|
714
|
+
});
|
|
715
|
+
},
|
|
716
|
+
|
|
717
|
+
async fetchResources({
|
|
591
718
|
state, getters, dispatch, commit
|
|
592
|
-
}, params) {
|
|
719
|
+
}, { opt, ...params }) {
|
|
593
720
|
const {
|
|
594
|
-
resourceType, namespace, id, selector
|
|
721
|
+
resourceType, namespace, id, selector, mode
|
|
595
722
|
} = params;
|
|
596
723
|
|
|
597
|
-
|
|
724
|
+
if (!resourceType) {
|
|
725
|
+
console.error(`A socket message has prompted a request to fetch a resource but no resource type was supplied`); // eslint-disable-line no-console
|
|
598
726
|
|
|
599
|
-
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
600
729
|
|
|
601
730
|
if ( id ) {
|
|
602
731
|
await dispatch('find', {
|
|
@@ -613,7 +742,7 @@ const defaultActions = {
|
|
|
613
742
|
|
|
614
743
|
return;
|
|
615
744
|
}
|
|
616
|
-
let have
|
|
745
|
+
let have = []; let want = [];
|
|
617
746
|
|
|
618
747
|
if ( selector ) {
|
|
619
748
|
have = getters['matching'](resourceType, selector).slice();
|
|
@@ -623,17 +752,50 @@ const defaultActions = {
|
|
|
623
752
|
opt,
|
|
624
753
|
});
|
|
625
754
|
} else {
|
|
626
|
-
|
|
755
|
+
if (mode === STEVE_WATCH_MODE.RESOURCE_CHANGES) {
|
|
756
|
+
// Other findX use options (id/ns/selector) from the messages received over socket.
|
|
757
|
+
// However paginated requests have more complex params so grab them from store from the store.
|
|
758
|
+
// of type @StorePagination
|
|
759
|
+
const storePagination = getters['havePage'](resourceType);
|
|
760
|
+
|
|
761
|
+
if (!!storePagination) {
|
|
762
|
+
have = []; // findPage removes stale entries, so we don't need to rely on below process to remove them
|
|
763
|
+
|
|
764
|
+
// This could have been kicked off given a resource.changes message
|
|
765
|
+
// If the messages come in quicker than findPage completes (resource.changes debounce time >= http request time),
|
|
766
|
+
// and the request is the same, only the first request will be processed. all others until it finishes will be ignored
|
|
767
|
+
// (see deferred process - `waiting.push(later);` - in request action).
|
|
768
|
+
// If this becomes an issue we need to debounce and work around the deferred issue within request
|
|
769
|
+
want = await dispatch('findPage', {
|
|
770
|
+
type: resourceType,
|
|
771
|
+
opt: {
|
|
772
|
+
...opt,
|
|
773
|
+
namespaced: namespace,
|
|
774
|
+
// This brings in page, page size, filter, etc
|
|
775
|
+
...storePagination.request
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
}
|
|
627
779
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}
|
|
780
|
+
// Should any listeners be notified of this request for them to kick off their own event handling?
|
|
781
|
+
const listener = listeners[STEVE_WATCH_MODE.RESOURCE_CHANGES].find((sl) => equivalentWatch(sl.params, params));
|
|
631
782
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
783
|
+
if (listener) {
|
|
784
|
+
Object.values(listener.callbacks).forEach((cb) => cb());
|
|
785
|
+
}
|
|
786
|
+
} else {
|
|
787
|
+
have = getters['all'](resourceType).slice();
|
|
788
|
+
|
|
789
|
+
if ( namespace ) {
|
|
790
|
+
have = have.filter((x) => x.metadata?.namespace === namespace);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
want = await dispatch('findAll', {
|
|
794
|
+
type: resourceType,
|
|
795
|
+
watchNamespace: namespace,
|
|
796
|
+
opt
|
|
797
|
+
});
|
|
798
|
+
}
|
|
637
799
|
}
|
|
638
800
|
|
|
639
801
|
const wantMap = {};
|
|
@@ -792,7 +954,8 @@ const defaultActions = {
|
|
|
792
954
|
type: msg.resourceType,
|
|
793
955
|
namespace: msg.namespace,
|
|
794
956
|
id: msg.id,
|
|
795
|
-
selector: msg.selector
|
|
957
|
+
selector: msg.selector,
|
|
958
|
+
mode: msg.mode,
|
|
796
959
|
};
|
|
797
960
|
|
|
798
961
|
state.started.filter((entry) => {
|
|
@@ -846,7 +1009,8 @@ const defaultActions = {
|
|
|
846
1009
|
type,
|
|
847
1010
|
id: msg.id,
|
|
848
1011
|
namespace: msg.namespace,
|
|
849
|
-
selector: msg.selector
|
|
1012
|
+
selector: msg.selector,
|
|
1013
|
+
mode: msg.mode
|
|
850
1014
|
};
|
|
851
1015
|
|
|
852
1016
|
state.debugSocket && console.info(`Resource Stop [${ getters.storeName }]`, type, msg); // eslint-disable-line no-console
|
|
@@ -922,6 +1086,13 @@ const defaultActions = {
|
|
|
922
1086
|
}
|
|
923
1087
|
},
|
|
924
1088
|
|
|
1089
|
+
'ws.resource.changes'({ dispatch }, msg) {
|
|
1090
|
+
dispatch('fetchResources', {
|
|
1091
|
+
...msg,
|
|
1092
|
+
opt: { force: true, load: _MERGE }
|
|
1093
|
+
} );
|
|
1094
|
+
},
|
|
1095
|
+
|
|
925
1096
|
'ws.resource.remove'(ctx, msg) {
|
|
926
1097
|
const data = msg.data;
|
|
927
1098
|
const type = data.type;
|
|
@@ -1040,9 +1211,24 @@ const defaultGetters = {
|
|
|
1040
1211
|
},
|
|
1041
1212
|
|
|
1042
1213
|
watchStarted: (state) => (obj) => {
|
|
1043
|
-
|
|
1214
|
+
const existing = state.started.find((entry) => equivalentWatch(obj, entry));
|
|
1215
|
+
|
|
1216
|
+
return !!existing;
|
|
1044
1217
|
},
|
|
1045
1218
|
|
|
1219
|
+
/**
|
|
1220
|
+
* Try to determine the latest revision to use in a watch request.
|
|
1221
|
+
*
|
|
1222
|
+
* It does some dodgy revision comparisons (revisions are not guaranteed to be numerical or equate higher to newer)
|
|
1223
|
+
*
|
|
1224
|
+
* If we have an id - and that resource has a revision - use it
|
|
1225
|
+
* If we have a list - and the store has a revision - and it's a string - use it straight away
|
|
1226
|
+
* If we have a list - and the store has a revision - and it's a number - compare it to the revisions in the list and use overall highest
|
|
1227
|
+
*
|
|
1228
|
+
* Note - This used to use parseInt which does stuff like `abc-123` --> NaN, `123-abc` --> 123
|
|
1229
|
+
*
|
|
1230
|
+
* Returns string, non-zero number or null
|
|
1231
|
+
*/
|
|
1046
1232
|
nextResourceVersion: (state, getters) => (type, id) => {
|
|
1047
1233
|
type = normalizeType(type);
|
|
1048
1234
|
let revision = 0;
|
|
@@ -1050,32 +1236,38 @@ const defaultGetters = {
|
|
|
1050
1236
|
if ( id ) {
|
|
1051
1237
|
const existing = getters['byId'](type, id);
|
|
1052
1238
|
|
|
1053
|
-
revision =
|
|
1239
|
+
revision = existing?.metadata?.resourceVersion;
|
|
1054
1240
|
}
|
|
1055
1241
|
|
|
1056
1242
|
if ( !revision ) {
|
|
1057
1243
|
const cache = state.types[type];
|
|
1058
1244
|
|
|
1245
|
+
// No Cache, nothing to compare to, return early
|
|
1059
1246
|
if ( !cache ) {
|
|
1060
1247
|
return null;
|
|
1061
1248
|
}
|
|
1062
1249
|
|
|
1063
|
-
revision = cache.revision;
|
|
1250
|
+
revision = Number(cache.revision);
|
|
1251
|
+
|
|
1252
|
+
// Cached LIST revision isn't a number, cannot compare to, return early
|
|
1253
|
+
if (Number.isNaN(revision)) {
|
|
1254
|
+
return cache.revision || null;
|
|
1255
|
+
}
|
|
1064
1256
|
|
|
1065
|
-
for ( const obj of cache.list ) {
|
|
1257
|
+
for ( const obj of cache.list || [] ) {
|
|
1066
1258
|
if ( obj && obj.metadata ) {
|
|
1067
|
-
const neu =
|
|
1259
|
+
const neu = Number(obj.metadata.resourceVersion);
|
|
1260
|
+
|
|
1261
|
+
if (Number.isNaN(neu)) {
|
|
1262
|
+
continue;
|
|
1263
|
+
}
|
|
1068
1264
|
|
|
1069
1265
|
revision = Math.max(revision, neu);
|
|
1070
1266
|
}
|
|
1071
1267
|
}
|
|
1072
1268
|
}
|
|
1073
1269
|
|
|
1074
|
-
|
|
1075
|
-
return revision;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
return null;
|
|
1270
|
+
return revision || null;
|
|
1079
1271
|
},
|
|
1080
1272
|
};
|
|
1081
1273
|
|
|
@@ -3,6 +3,19 @@ import { defineComponent } from 'vue';
|
|
|
3
3
|
import { nlToBr, generateRandomAlphaString } from '@shell/utils/string';
|
|
4
4
|
import { stringify } from '@shell/utils/error';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* These should eventually be used when making this component use the composable api but I need the props elsewhere so I'm defining them here.
|
|
8
|
+
*/
|
|
9
|
+
export interface Props {
|
|
10
|
+
color?: string;
|
|
11
|
+
label?: string | Error | Object;
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
closable?: boolean;
|
|
15
|
+
stacked?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
export default defineComponent({
|
|
7
20
|
props: {
|
|
8
21
|
/**
|
|
@@ -13,7 +13,7 @@ export default defineComponent({
|
|
|
13
13
|
* The checkbox value.
|
|
14
14
|
*/
|
|
15
15
|
value: {
|
|
16
|
-
type: [Boolean, Array, String] as PropType<boolean | boolean[] | string>,
|
|
16
|
+
type: [Boolean, Array, String] as PropType<boolean | boolean[] | string | string[]>,
|
|
17
17
|
default: false
|
|
18
18
|
},
|
|
19
19
|
|
|
@@ -245,7 +245,7 @@ export default defineComponent({
|
|
|
245
245
|
/**
|
|
246
246
|
* Determines if there are multiple values for the checkbox.
|
|
247
247
|
*/
|
|
248
|
-
isMulti(value: boolean | boolean[] | string): value is boolean[] {
|
|
248
|
+
isMulti(value: boolean | boolean[] | string | string[]): value is boolean[] {
|
|
249
249
|
return Array.isArray(value);
|
|
250
250
|
},
|
|
251
251
|
|
|
@@ -305,12 +305,15 @@ export default defineComponent({
|
|
|
305
305
|
:class="{ 'checkbox-primary': primary }"
|
|
306
306
|
>
|
|
307
307
|
<slot name="label">
|
|
308
|
-
<
|
|
308
|
+
<span
|
|
309
309
|
v-if="labelKey"
|
|
310
310
|
:id="idForLabel"
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
>
|
|
312
|
+
<t
|
|
313
|
+
:k="labelKey"
|
|
314
|
+
:raw="true"
|
|
315
|
+
/>
|
|
316
|
+
</span>
|
|
314
317
|
<span
|
|
315
318
|
v-else-if="label"
|
|
316
319
|
:id="idForLabel"
|
|
@@ -322,6 +325,7 @@ export default defineComponent({
|
|
|
322
325
|
class="checkbox-info icon icon-info icon-lg"
|
|
323
326
|
:data-testid="componentTestid + '-info-icon'"
|
|
324
327
|
:tabindex="isDisabled ? -1 : 0"
|
|
328
|
+
role="tooltip"
|
|
325
329
|
/>
|
|
326
330
|
<i
|
|
327
331
|
v-else-if="tooltip"
|
|
@@ -330,6 +334,7 @@ export default defineComponent({
|
|
|
330
334
|
class="checkbox-info icon icon-info icon-lg"
|
|
331
335
|
:data-testid="componentTestid + '-info-icon'"
|
|
332
336
|
:tabindex="isDisabled ? -1 : 0"
|
|
337
|
+
role="tooltip"
|
|
333
338
|
/>
|
|
334
339
|
</slot>
|
|
335
340
|
</span>
|
|
@@ -407,7 +407,7 @@ export default defineComponent({
|
|
|
407
407
|
:id="inputId"
|
|
408
408
|
ref="value"
|
|
409
409
|
v-stripped-aria-label="!hasLabel && ariaLabel ? ariaLabel : undefined"
|
|
410
|
-
role="textbox"
|
|
410
|
+
:role="type === 'number' ? undefined : 'textbox'"
|
|
411
411
|
:class="{ 'no-label': !hasLabel }"
|
|
412
412
|
v-bind="$attrs"
|
|
413
413
|
:maxlength="_maxlength"
|