dashboard-shell-shell 1.0.111
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/dark/rancher-logo.svg +148 -0
- package/assets/brand/csp/favicon.png +0 -0
- package/assets/brand/csp/metadata.json +3 -0
- package/assets/brand/csp/rancher-logo.svg +130 -0
- package/assets/brand/federal/dark/rancher-logo.svg +104 -0
- package/assets/brand/federal/metadata.json +3 -0
- package/assets/brand/federal/rancher-logo.svg +1 -0
- package/assets/brand/harvester/favicon.png +0 -0
- package/assets/brand/harvester/metadata.json +3 -0
- package/assets/brand/rgs/dark/rancher-logo.svg +1 -0
- package/assets/brand/rgs/metadata.json +3 -0
- package/assets/brand/rgs/rancher-logo.svg +1 -0
- package/assets/brand/suse/dark/rancher-logo.svg +1 -0
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/brand/suse/metadata.json +3 -0
- package/assets/brand/suse/rancher-logo.svg +1 -0
- package/assets/data/aws-regions.json +39 -0
- package/assets/data/ec2-instance-groups.json +85 -0
- package/assets/fonts/lato/lato-v17-latin-700.woff +0 -0
- package/assets/fonts/lato/lato-v17-latin-700.woff2 +0 -0
- package/assets/fonts/lato/lato-v17-latin-regular.woff +0 -0
- package/assets/fonts/lato/lato-v17-latin-regular.woff2 +0 -0
- package/assets/fonts/poppins/poppins-v15-latin-300.woff +0 -0
- package/assets/fonts/poppins/poppins-v15-latin-300.woff2 +0 -0
- package/assets/fonts/poppins/poppins-v15-latin-500.woff +0 -0
- package/assets/fonts/poppins/poppins-v15-latin-500.woff2 +0 -0
- package/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff +0 -0
- package/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff2 +0 -0
- package/assets/images/featured/img1.jpg +0 -0
- package/assets/images/featured.jpg +0 -0
- package/assets/images/field-valid.svg +16 -0
- package/assets/images/generic-catalog.svg +15 -0
- package/assets/images/generic-driver.svg +17 -0
- package/assets/images/generic-plugin.svg +1 -0
- package/assets/images/pl/README.md +13 -0
- package/assets/images/pl/banner.svg +241 -0
- package/assets/images/pl/dark/banner.svg +242 -0
- package/assets/images/pl/dark/login-landscape.svg +291 -0
- package/assets/images/pl/dark/rancher-logo.svg +51 -0
- package/assets/images/pl/decoration-cloud-big-white.svg +1 -0
- package/assets/images/pl/decoration-ground.svg +1 -0
- package/assets/images/pl/error-desert-landscape.svg +217 -0
- package/assets/images/pl/half-logo.svg +23 -0
- package/assets/images/pl/harvester.png +0 -0
- package/assets/images/pl/harvester.svg +1 -0
- package/assets/images/pl/login-landscape.svg +496 -0
- package/assets/images/pl/rancher-logo.svg +51 -0
- package/assets/images/pl/setup-step-one.svg +612 -0
- package/assets/images/pl/sunglasses.svg +20 -0
- package/assets/images/providers/aliyun-black.svg +14 -0
- package/assets/images/providers/aliyun.svg +17 -0
- package/assets/images/providers/aliyunecs-black.svg +13 -0
- package/assets/images/providers/aliyunecs.svg +21 -0
- package/assets/images/providers/amazonec2-black.svg +8 -0
- package/assets/images/providers/amazonec2.svg +19 -0
- package/assets/images/providers/amazoneks-black.svg +10 -0
- package/assets/images/providers/amazoneks.svg +14 -0
- package/assets/images/providers/aws.svg +38 -0
- package/assets/images/providers/azure-black.svg +29 -0
- package/assets/images/providers/azure.svg +32 -0
- package/assets/images/providers/azuread-black.svg +22 -0
- package/assets/images/providers/azuread.svg +25 -0
- package/assets/images/providers/azureaks-black.svg +28 -0
- package/assets/images/providers/azureaks.svg +31 -0
- package/assets/images/providers/baidu-black.svg +19 -0
- package/assets/images/providers/baidu.svg +25 -0
- package/assets/images/providers/cloudca-black.svg +45 -0
- package/assets/images/providers/cloudca.svg +49 -0
- package/assets/images/providers/cloudscale-black.svg +24 -0
- package/assets/images/providers/cloudscale.svg +28 -0
- package/assets/images/providers/custom.svg +85 -0
- package/assets/images/providers/digitalocean-black.svg +21 -0
- package/assets/images/providers/digitalocean.svg +24 -0
- package/assets/images/providers/equinix-black.svg +13 -0
- package/assets/images/providers/equinix.svg +13 -0
- package/assets/images/providers/exoscale.svg +1 -0
- package/assets/images/providers/gcp.svg +6 -0
- package/assets/images/providers/gke-black.svg +10 -0
- package/assets/images/providers/gke.svg +28 -0
- package/assets/images/providers/google.svg +29 -0
- package/assets/images/providers/googlegke-black.svg +10 -0
- package/assets/images/providers/googlegke.svg +28 -0
- package/assets/images/providers/harvester.svg +1 -0
- package/assets/images/providers/huaweicce-black.svg +109 -0
- package/assets/images/providers/huaweicce.svg +184 -0
- package/assets/images/providers/import.svg +99 -0
- package/assets/images/providers/k3s-black.svg +10 -0
- package/assets/images/providers/k3s.svg +15 -0
- package/assets/images/providers/kubernetes-black.svg +37 -0
- package/assets/images/providers/kubernetes.svg +99 -0
- package/assets/images/providers/linode.svg +54 -0
- package/assets/images/providers/linodelke-black.svg +40 -0
- package/assets/images/providers/linodelke.svg +54 -0
- package/assets/images/providers/local-cluster.svg +20 -0
- package/assets/images/providers/minikube-black.svg +25 -0
- package/assets/images/providers/minikube.svg +36 -0
- package/assets/images/providers/nutanix.svg +12 -0
- package/assets/images/providers/oci-black.svg +41 -0
- package/assets/images/providers/oci.svg +44 -0
- package/assets/images/providers/openstack-black.svg +16 -0
- package/assets/images/providers/openstack.svg +20 -0
- package/assets/images/providers/oracle.svg +66 -0
- package/assets/images/providers/oracleoke-black.svg +51 -0
- package/assets/images/providers/oracleoke.svg +55 -0
- package/assets/images/providers/otc-black.svg +15 -0
- package/assets/images/providers/otc.svg +33 -0
- package/assets/images/providers/otccce.svg +33 -0
- package/assets/images/providers/outscale.svg +19 -0
- package/assets/images/providers/ovhcloudmks.svg +122 -0
- package/assets/images/providers/ovhcloudpubliccloud.svg +122 -0
- package/assets/images/providers/packet-black.svg +15 -0
- package/assets/images/providers/packet.svg +16 -0
- package/assets/images/providers/pinganyunecs-black.svg +26 -0
- package/assets/images/providers/pinganyunecs.svg +26 -0
- package/assets/images/providers/pnap-black.svg +43 -0
- package/assets/images/providers/pnap.svg +48 -0
- package/assets/images/providers/rackspace-black.svg +14 -0
- package/assets/images/providers/rackspace.svg +18 -0
- package/assets/images/providers/rke.svg +26 -0
- package/assets/images/providers/rke2.svg +26 -0
- package/assets/images/providers/softlayer.svg +27 -0
- package/assets/images/providers/tencenttke-black.svg +22 -0
- package/assets/images/providers/tencenttke.svg +39 -0
- package/assets/images/providers/vmwarevsphere-black.svg +60 -0
- package/assets/images/providers/vmwarevsphere.svg +51 -0
- package/assets/images/vendor/activedirectory.svg +20 -0
- package/assets/images/vendor/adfs.svg +19 -0
- package/assets/images/vendor/azuread.svg +18 -0
- package/assets/images/vendor/custom.svg +42 -0
- package/assets/images/vendor/email.svg +22 -0
- package/assets/images/vendor/freeipa.svg +26 -0
- package/assets/images/vendor/github.svg +13 -0
- package/assets/images/vendor/googleoauth.svg +9 -0
- package/assets/images/vendor/grafana.svg +48 -0
- package/assets/images/vendor/jaeger.svg +1 -0
- package/assets/images/vendor/keycloak.svg +30 -0
- package/assets/images/vendor/kiali.svg +23 -0
- package/assets/images/vendor/linux.svg +23 -0
- package/assets/images/vendor/longhorn.svg +25 -0
- package/assets/images/vendor/neuvector.svg +1 -0
- package/assets/images/vendor/okta.svg +31 -0
- package/assets/images/vendor/openid.svg +18 -0
- package/assets/images/vendor/openldap.svg +34 -0
- package/assets/images/vendor/pagerduty.svg +26 -0
- package/assets/images/vendor/ping.svg +58 -0
- package/assets/images/vendor/prometheus.svg +14 -0
- package/assets/images/vendor/shibboleth.svg +481 -0
- package/assets/images/vendor/slack.svg +38 -0
- package/assets/images/vendor/webhook.svg +23 -0
- package/assets/images/vendor/windows.svg +13 -0
- package/assets/images/wechat-qr-code.jpg +0 -0
- package/assets/styles/app.scss +34 -0
- package/assets/styles/base/_basic.scss +146 -0
- package/assets/styles/base/_color.scss +11 -0
- package/assets/styles/base/_functions.scss +134 -0
- package/assets/styles/base/_helpers.scss +267 -0
- package/assets/styles/base/_mixins.scss +163 -0
- package/assets/styles/base/_typography.scss +69 -0
- package/assets/styles/base/_variables.scss +70 -0
- package/assets/styles/fonts/_dots.scss +18 -0
- package/assets/styles/fonts/_fontstack.scss +49 -0
- package/assets/styles/fonts/_icons.scss +101 -0
- package/assets/styles/fonts/_zerowidthspace.scss +8 -0
- package/assets/styles/global/_button.scss +222 -0
- package/assets/styles/global/_cards.scss +94 -0
- package/assets/styles/global/_columns.scss +126 -0
- package/assets/styles/global/_form.scss +146 -0
- package/assets/styles/global/_gauges.scss +55 -0
- package/assets/styles/global/_labeled-input.scss +140 -0
- package/assets/styles/global/_layout.scss +165 -0
- package/assets/styles/global/_resource.scss +89 -0
- package/assets/styles/global/_select.scss +193 -0
- package/assets/styles/global/_table.scss +106 -0
- package/assets/styles/global/_tooltip.scss +165 -0
- package/assets/styles/themes/_csp.scss +25 -0
- package/assets/styles/themes/_dark.scss +232 -0
- package/assets/styles/themes/_light.scss +556 -0
- package/assets/styles/themes/_suse.scss +26 -0
- package/assets/styles/vendor/_code-mirror.scss +3 -0
- package/assets/styles/vendor/normalize.scss +349 -0
- package/assets/styles/vendor/vue-select.scss +391 -0
- package/assets/translations/en-us.yaml +8103 -0
- package/assets/translations/zh-hans.yaml +7678 -0
- package/babel.config.js +35 -0
- package/chart/__tests__/S3.test.ts +64 -0
- package/chart/example.vue +18 -0
- package/chart/gatekeeper.vue +69 -0
- package/chart/istio.vue +284 -0
- package/chart/logging/index.vue +84 -0
- package/chart/monitoring/ClusterSelector.vue +215 -0
- package/chart/monitoring/StorageClassSelector.vue +49 -0
- package/chart/monitoring/alerting/index.vue +188 -0
- package/chart/monitoring/grafana/index.vue +378 -0
- package/chart/monitoring/index.vue +364 -0
- package/chart/monitoring/prometheus/index.vue +373 -0
- package/chart/rancher-backup/S3.vue +190 -0
- package/chart/rancher-backup/index.vue +260 -0
- package/cloud-credential/__tests__/azure.test.ts +43 -0
- package/cloud-credential/__tests__/harvester.test.ts +18 -0
- package/cloud-credential/aws.vue +109 -0
- package/cloud-credential/azure.vue +132 -0
- package/cloud-credential/digitalocean.vue +55 -0
- package/cloud-credential/gcp.vue +82 -0
- package/cloud-credential/generic.vue +100 -0
- package/cloud-credential/harvester.vue +125 -0
- package/cloud-credential/linode.vue +58 -0
- package/cloud-credential/pnap.vue +92 -0
- package/cloud-credential/s3.vue +143 -0
- package/cloud-credential/vmwarevsphere.vue +109 -0
- package/components/ActionDropdown.vue +248 -0
- package/components/ActionMenu.vue +366 -0
- package/components/ActionMenuShell.vue +105 -0
- package/components/AdvancedSection.vue +40 -0
- package/components/Alert.vue +55 -0
- package/components/AlertTable.vue +123 -0
- package/components/AppModal.vue +231 -0
- package/components/AssignTo.vue +185 -0
- package/components/AsyncButton.vue +315 -0
- package/components/AwsComplianceBanner.vue +47 -0
- package/components/BackLink.vue +44 -0
- package/components/BannerGraphic.vue +94 -0
- package/components/BrandImage.vue +135 -0
- package/components/ButtonDropdown.vue +318 -0
- package/components/ButtonGroup.vue +120 -0
- package/components/ButtonMultiAction.vue +51 -0
- package/components/Carousel.vue +397 -0
- package/components/Certificates.vue +161 -0
- package/components/ChartHeading.vue +25 -0
- package/components/ChartReadme.vue +100 -0
- package/components/ClusterBadge.vue +48 -0
- package/components/ClusterIconMenu.vue +189 -0
- package/components/ClusterProviderIcon.vue +131 -0
- package/components/CodeMirror.vue +488 -0
- package/components/Collapse.vue +87 -0
- package/components/CollapsibleCard.vue +121 -0
- package/components/CommunityLinks.vue +216 -0
- package/components/CompoundStatusBadge.vue +53 -0
- package/components/ConsumptionGauge.vue +148 -0
- package/components/ContainerResourceLimit.vue +254 -0
- package/components/CopyCode.vue +74 -0
- package/components/CopyToClipboard.vue +44 -0
- package/components/CopyToClipboardText.vue +82 -0
- package/components/CountBox.vue +114 -0
- package/components/CountGauge.vue +180 -0
- package/components/CreateDriver.vue +81 -0
- package/components/CruResource.vue +931 -0
- package/components/CruResourceFooter.vue +127 -0
- package/components/DashboardMetrics.vue +125 -0
- package/components/DashboardOptions.vue +147 -0
- package/components/DetailText.vue +215 -0
- package/components/DetailTop.vue +374 -0
- package/components/Dialog.vue +136 -0
- package/components/DisableAuthProviderModal.vue +114 -0
- package/components/DraggableZone.vue +181 -0
- package/components/EmberPage.vue +622 -0
- package/components/EmberPageView.vue +39 -0
- package/components/EtcdInfoBanner.vue +76 -0
- package/components/ExplorerMembers.vue +453 -0
- package/components/ExplorerProjectsNamespaces.vue +612 -0
- package/components/ExtensionPanel.vue +42 -0
- package/components/FileDiff.vue +184 -0
- package/components/FixedBanner.vue +277 -0
- package/components/Flag.vue +83 -0
- package/components/Glance.vue +79 -0
- package/components/GlobalRoleBindings.vue +425 -0
- package/components/GradientBox.vue +82 -0
- package/components/GrafanaDashboard.vue +321 -0
- package/components/GroupPanel.vue +57 -0
- package/components/GrowlManager.vue +212 -0
- package/components/HardwareResourceGauge.vue +170 -0
- package/components/HarvesterServiceAddOnConfig.vue +207 -0
- package/components/IconMessage.vue +101 -0
- package/components/IconOrSvg.vue +184 -0
- package/components/Import.vue +260 -0
- package/components/Inactivity.vue +236 -0
- package/components/IndentedPanel.vue +26 -0
- package/components/InfoBox.vue +84 -0
- package/components/InputOrDisplay.vue +65 -0
- package/components/KeyValueView.vue +283 -0
- package/components/LabelValue.vue +42 -0
- package/components/LandingPagePreference.vue +152 -0
- package/components/LazyImage.vue +70 -0
- package/components/Loading.vue +85 -0
- package/components/LocaleSelector.vue +175 -0
- package/components/LogItem.vue +69 -0
- package/components/Markdown.vue +138 -0
- package/components/MessageLink.vue +79 -0
- package/components/ModalWithCard.vue +137 -0
- package/components/MoveModal.vue +166 -0
- package/components/PaginatedResourceTable.vue +133 -0
- package/components/PercentageBar.vue +127 -0
- package/components/PodSecurityAdmission.vue +306 -0
- package/components/ProgressBarMulti.vue +173 -0
- package/components/PromptChangePassword.vue +123 -0
- package/components/PromptModal.vue +109 -0
- package/components/PromptRemove.vue +471 -0
- package/components/PromptRestore.vue +327 -0
- package/components/Questions/Array.vue +38 -0
- package/components/Questions/Boolean.vue +37 -0
- package/components/Questions/CloudCredential.vue +54 -0
- package/components/Questions/Enum.vue +53 -0
- package/components/Questions/Float.vue +41 -0
- package/components/Questions/Int.vue +41 -0
- package/components/Questions/Question.js +145 -0
- package/components/Questions/QuestionMap.vue +45 -0
- package/components/Questions/Radio.vue +35 -0
- package/components/Questions/Reference.vue +167 -0
- package/components/Questions/String.vue +51 -0
- package/components/Questions/Yaml.vue +48 -0
- package/components/Questions/__tests__/Boolean.test.ts +125 -0
- package/components/Questions/__tests__/Float.test.ts +125 -0
- package/components/Questions/__tests__/Int.test.ts +125 -0
- package/components/Questions/__tests__/String.test.ts +125 -0
- package/components/Questions/__tests__/Yaml.test.ts +125 -0
- package/components/Questions/__tests__/utils/questions-defaults.ts +20 -0
- package/components/Questions/index.vue +522 -0
- package/components/Random.vue +100 -0
- package/components/RelatedResources.vue +187 -0
- package/components/ResourceCancelModal.vue +127 -0
- package/components/ResourceDetail/Masthead.vue +692 -0
- package/components/ResourceDetail/__tests__/Masthead.test.ts +61 -0
- package/components/ResourceDetail/index.vue +534 -0
- package/components/ResourceList/Masthead.vue +246 -0
- package/components/ResourceList/ResourceLoadingIndicator.vue +137 -0
- package/components/ResourceList/index.vue +306 -0
- package/components/ResourceList/resource-list.config.js +7 -0
- package/components/ResourceSummary.vue +173 -0
- package/components/ResourceTable.vue +661 -0
- package/components/ResourceYaml.vue +403 -0
- package/components/RoleBindings.vue +470 -0
- package/components/SelectIconGrid.vue +414 -0
- package/components/Setting.vue +115 -0
- package/components/SideNav.vue +568 -0
- package/components/SimpleBox.vue +121 -0
- package/components/SingleClusterInfo.vue +199 -0
- package/components/SortableTable/THead.vue +526 -0
- package/components/SortableTable/actions.js +153 -0
- package/components/SortableTable/advanced-filtering.js +272 -0
- package/components/SortableTable/debug.js +117 -0
- package/components/SortableTable/filtering.js +290 -0
- package/components/SortableTable/grouping.js +48 -0
- package/components/SortableTable/index.vue +2089 -0
- package/components/SortableTable/paging.js +147 -0
- package/components/SortableTable/selection.js +640 -0
- package/components/SortableTable/sortable-config.ts +4 -0
- package/components/SortableTable/sorting.js +129 -0
- package/components/StatusTable.vue +61 -0
- package/components/TabTitle.vue +78 -0
- package/components/Tabbed/Tab.vue +129 -0
- package/components/Tabbed/index.vue +569 -0
- package/components/TableDataUserIcon.vue +47 -0
- package/components/TableSparkLine.vue +108 -0
- package/components/Tag.vue +19 -0
- package/components/Tip.vue +43 -0
- package/components/TypeDescription.vue +65 -0
- package/components/Wizard.vue +704 -0
- package/components/YamlEditor.vue +296 -0
- package/components/__tests__/AppModal.test.ts +106 -0
- package/components/__tests__/ApplicationCard.test.ts +27 -0
- package/components/__tests__/AsyncButton.test.ts +148 -0
- package/components/__tests__/BackLink.test.ts +33 -0
- package/components/__tests__/ButtonGroup.test.ts +121 -0
- package/components/__tests__/ButtonMultiAction.test.ts +31 -0
- package/components/__tests__/Carousel.test.ts +72 -0
- package/components/__tests__/Certificates.test.ts +31 -0
- package/components/__tests__/ClusterBadge.test.ts +32 -0
- package/components/__tests__/CodeMirror.test.ts +93 -0
- package/components/__tests__/Collapse.test.ts +44 -0
- package/components/__tests__/CollapsibleCard.test.ts +64 -0
- package/components/__tests__/ConsumptionGauge.test.ts +88 -0
- package/components/__tests__/ContainerResourceLimit.test.ts +35 -0
- package/components/__tests__/CopyCode.test.ts +16 -0
- package/components/__tests__/CruResource.test.ts +155 -0
- package/components/__tests__/EtcdInfoBanner.test.ts +39 -0
- package/components/__tests__/FixedBanner.test.ts +114 -0
- package/components/__tests__/GrowlManager.test.ts +146 -0
- package/components/__tests__/NamespaceFilter.test.ts +247 -0
- package/components/__tests__/PercentageBar.test.ts +32 -0
- package/components/__tests__/PodSecurityAdmission.test.ts +440 -0
- package/components/__tests__/ProjectRow.test.ts +59 -0
- package/components/__tests__/PromptRestore.test.ts +139 -0
- package/components/__tests__/SimpleBox.spec.ts +28 -0
- package/components/__tests__/TabTitle.test.ts +136 -0
- package/components/auth/AllowedPrincipals.vue +122 -0
- package/components/auth/AuthBanner.vue +104 -0
- package/components/auth/AzureWarning.vue +77 -0
- package/components/auth/Principal.vue +212 -0
- package/components/auth/RoleDetailEdit.vue +808 -0
- package/components/auth/SelectPrincipal.vue +260 -0
- package/components/auth/__tests__/Principal.test.ts +40 -0
- package/components/auth/__tests__/RoleDetailEdit.test.ts +83 -0
- package/components/auth/login/github.vue +23 -0
- package/components/auth/login/ldap.vue +106 -0
- package/components/auth/login/oauth.vue +26 -0
- package/components/auth/login/oidc.vue +32 -0
- package/components/auth/login/saml.vue +39 -0
- package/components/cards/ApplicationCard.vue +145 -0
- package/components/fleet/FleetBundleResources.vue +86 -0
- package/components/fleet/FleetBundles.vue +136 -0
- package/components/fleet/FleetClusters.vue +208 -0
- package/components/fleet/FleetIntro.vue +65 -0
- package/components/fleet/FleetNoWorkspaces.vue +62 -0
- package/components/fleet/FleetRepos.vue +184 -0
- package/components/fleet/FleetResources.vue +83 -0
- package/components/fleet/FleetStatus.vue +301 -0
- package/components/fleet/FleetSummary.vue +210 -0
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +17 -0
- package/components/fleet/ForceDirectedTreeChart/index.vue +565 -0
- package/components/fleet/ResourcesSummary.vue +93 -0
- package/components/fleet/__tests__/FleetSummary.test.ts +362 -0
- package/components/form/ArrayList.vue +418 -0
- package/components/form/ArrayListGrouped.vue +141 -0
- package/components/form/ArrayListSelect.vue +103 -0
- package/components/form/BannerSettings.vue +220 -0
- package/components/form/ChangePassword.vue +461 -0
- package/components/form/ClusterAppearance.vue +132 -0
- package/components/form/ColorInput.vue +200 -0
- package/components/form/Command.vue +213 -0
- package/components/form/Conditions.vue +93 -0
- package/components/form/EnvVars.vue +154 -0
- package/components/form/Error.vue +66 -0
- package/components/form/FileImageSelector.vue +140 -0
- package/components/form/FileSelector.vue +169 -0
- package/components/form/Footer.vue +116 -0
- package/components/form/GitPicker.vue +590 -0
- package/components/form/HealthCheck.vue +86 -0
- package/components/form/HookOption.vue +258 -0
- package/components/form/InputWithSelect.vue +329 -0
- package/components/form/KeyValue.vue +962 -0
- package/components/form/LabeledSelect.vue +723 -0
- package/components/form/Labels.vue +151 -0
- package/components/form/LifecycleHooks.vue +87 -0
- package/components/form/MatchExpressions.vue +446 -0
- package/components/form/Members/ClusterMembershipEditor.vue +61 -0
- package/components/form/Members/ClusterPermissionsEditor.vue +314 -0
- package/components/form/Members/MembershipEditor.vue +230 -0
- package/components/form/Members/ProjectMembershipEditor.vue +63 -0
- package/components/form/Members/__tests__/MembershipEditor.test.ts +62 -0
- package/components/form/NameNsDescription.vue +554 -0
- package/components/form/Networking.vue +273 -0
- package/components/form/NodeAffinity.vue +250 -0
- package/components/form/NodeScheduling.vue +202 -0
- package/components/form/NotificationSettings.vue +71 -0
- package/components/form/Password.vue +185 -0
- package/components/form/PlusMinus.vue +109 -0
- package/components/form/PodAffinity.vue +497 -0
- package/components/form/Ports.vue +310 -0
- package/components/form/Probe.vue +374 -0
- package/components/form/ProjectMemberEditor.vue +342 -0
- package/components/form/ResourceLabeledSelect.vue +154 -0
- package/components/form/ResourceQuota/Namespace.vue +117 -0
- package/components/form/ResourceQuota/NamespaceRow.vue +220 -0
- package/components/form/ResourceQuota/Project.vue +103 -0
- package/components/form/ResourceQuota/ProjectRow.vue +115 -0
- package/components/form/ResourceQuota/shared.js +147 -0
- package/components/form/ResourceSelector.vue +146 -0
- package/components/form/ResourceTabs/index.vue +292 -0
- package/components/form/RuleSelector.vue +184 -0
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +193 -0
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +104 -0
- package/components/form/SSHKnownHosts/index.vue +101 -0
- package/components/form/SchedulingCustomization.vue +85 -0
- package/components/form/SecretSelector.vue +269 -0
- package/components/form/Security.vue +247 -0
- package/components/form/Select.vue +370 -0
- package/components/form/SelectOrCreateAuthSecret.vue +693 -0
- package/components/form/ServiceNameSelect.vue +168 -0
- package/components/form/ServicePorts.vue +340 -0
- package/components/form/ShellInput.vue +91 -0
- package/components/form/SimpleSecretSelector.vue +258 -0
- package/components/form/Taints.vue +98 -0
- package/components/form/Tolerations.vue +315 -0
- package/components/form/UnitInput.vue +257 -0
- package/components/form/ValueFromResource.vue +394 -0
- package/components/form/WorkloadPorts.vue +514 -0
- package/components/form/__tests__/ArrayList.test.ts +124 -0
- package/components/form/__tests__/ArrayListGrouped.test.ts +41 -0
- package/components/form/__tests__/BannerSettings.test.ts +54 -0
- package/components/form/__tests__/ColorInput.test.ts +27 -0
- package/components/form/__tests__/Command.test.ts +64 -0
- package/components/form/__tests__/Error.test.ts +56 -0
- package/components/form/__tests__/FileImageSelector.test.ts +42 -0
- package/components/form/__tests__/FileSelector.test.ts +76 -0
- package/components/form/__tests__/HookOption.test.ts +28 -0
- package/components/form/__tests__/InputWithSelect.test.ts +42 -0
- package/components/form/__tests__/KeyValue.test.ts +179 -0
- package/components/form/__tests__/LabeledSelect.test.ts +217 -0
- package/components/form/__tests__/MatchExpressions.test.ts +78 -0
- package/components/form/__tests__/NameNsDescription.test.ts +72 -0
- package/components/form/__tests__/NodeAffinity.test.ts +39 -0
- package/components/form/__tests__/NodeScheduling.test.ts +44 -0
- package/components/form/__tests__/PodAffinity.test.ts +47 -0
- package/components/form/__tests__/Probe.test.ts +74 -0
- package/components/form/__tests__/SSHKnownHosts.test.ts +59 -0
- package/components/form/__tests__/Security.test.ts +55 -0
- package/components/form/__tests__/Select.test.ts +30 -0
- package/components/form/__tests__/SelectOrCreateAuthSecret.test.ts +34 -0
- package/components/form/__tests__/ServiceNameSelect.test.ts +42 -0
- package/components/form/__tests__/Taints.test.ts +71 -0
- package/components/form/__tests__/UnitInput.test.ts +256 -0
- package/components/form/labeled-select-utils/labeled-select-pagination.ts +151 -0
- package/components/form/labeled-select-utils/labeled-select.utils.ts +122 -0
- package/components/formatter/AppSummaryGraph.vue +154 -0
- package/components/formatter/BadgeStateFormatter.vue +63 -0
- package/components/formatter/Capitalize.vue +28 -0
- package/components/formatter/Checked.vue +31 -0
- package/components/formatter/CloudCredExpired.vue +69 -0
- package/components/formatter/CloudCredPublicData.vue +30 -0
- package/components/formatter/ClusterLink.vue +117 -0
- package/components/formatter/ClusterProvider.vue +38 -0
- package/components/formatter/CopyToClipboard.vue +18 -0
- package/components/formatter/Date.vue +74 -0
- package/components/formatter/DelayedValue.vue +46 -0
- package/components/formatter/Endpoints.vue +106 -0
- package/components/formatter/ExtensionCache.vue +74 -0
- package/components/formatter/ExternalLink.vue +11 -0
- package/components/formatter/FleetClusterSummaryGraph.vue +27 -0
- package/components/formatter/FleetSummaryGraph.vue +122 -0
- package/components/formatter/IconIsDefault.vue +34 -0
- package/components/formatter/IconText.vue +49 -0
- package/components/formatter/ImageName.vue +23 -0
- package/components/formatter/ImagePercentageBar.vue +86 -0
- package/components/formatter/IngressFullPath.vue +22 -0
- package/components/formatter/IngressTarget.vue +96 -0
- package/components/formatter/InternalExternalIP.vue +62 -0
- package/components/formatter/InvolvedObjectLink.vue +54 -0
- package/components/formatter/KeyValue.vue +78 -0
- package/components/formatter/Link.vue +189 -0
- package/components/formatter/LinkDetail.vue +58 -0
- package/components/formatter/LinkDetailImage.vue +31 -0
- package/components/formatter/LinkName.vue +66 -0
- package/components/formatter/List.vue +22 -0
- package/components/formatter/ListLink.vue +37 -0
- package/components/formatter/ListLinkDetail.vue +30 -0
- package/components/formatter/LiveDate.vue +167 -0
- package/components/formatter/LiveDuration.vue +78 -0
- package/components/formatter/LiveExpiryBadgeState.vue +79 -0
- package/components/formatter/LiveExpiryDate.vue +87 -0
- package/components/formatter/LivePodRestarts.vue +50 -0
- package/components/formatter/MachineSummaryGraph.vue +108 -0
- package/components/formatter/Number.vue +34 -0
- package/components/formatter/Percentage.vue +25 -0
- package/components/formatter/PercentageBar.vue +41 -0
- package/components/formatter/PodImages.vue +72 -0
- package/components/formatter/PodsUsage.vue +29 -0
- package/components/formatter/Port.vue +24 -0
- package/components/formatter/Principal.vue +22 -0
- package/components/formatter/PrincipalGroupBindings.vue +59 -0
- package/components/formatter/QualityText.vue +21 -0
- package/components/formatter/RKETemplateName.vue +37 -0
- package/components/formatter/ReceiverIcons.vue +132 -0
- package/components/formatter/RunBookLink.vue +20 -0
- package/components/formatter/Scale.vue +143 -0
- package/components/formatter/ScanResult.vue +33 -0
- package/components/formatter/SecretData.vue +55 -0
- package/components/formatter/SecretType.vue +41 -0
- package/components/formatter/ServiceTargets.vue +121 -0
- package/components/formatter/ServiceType.vue +54 -0
- package/components/formatter/Shortened.vue +55 -0
- package/components/formatter/Si.vue +46 -0
- package/components/formatter/Translate.vue +32 -0
- package/components/formatter/VerticalScroll.vue +17 -0
- package/components/formatter/VirtualServiceGateways.vue +111 -0
- package/components/formatter/WorkloadDetailEndpoints.vue +107 -0
- package/components/formatter/WorkloadHealthScale.vue +339 -0
- package/components/formatter/__tests__/Checked.test.ts +19 -0
- package/components/formatter/__tests__/ClusterLink.test.ts +101 -0
- package/components/formatter/__tests__/Date.test.ts +60 -0
- package/components/formatter/__tests__/LinkDetail.test.ts +72 -0
- package/components/formatter/__tests__/LiveDate.test.ts +90 -0
- package/components/formatter/__tests__/PodsUsage.test.ts +55 -0
- package/components/formatter/__tests__/Si.test.ts +35 -0
- package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +81 -0
- package/components/graph/AspectPreserver.vue +79 -0
- package/components/graph/Bar.vue +81 -0
- package/components/graph/Circle.vue +164 -0
- package/components/graph/HalfCircle.vue +46 -0
- package/components/graph/LinePlot.vue +189 -0
- package/components/graph/ProgressArc.vue +94 -0
- package/components/nav/Favorite.vue +56 -0
- package/components/nav/GlobalLoading.vue +25 -0
- package/components/nav/Group.vue +462 -0
- package/components/nav/Header.vue +1156 -0
- package/components/nav/HeaderPageActionMenu.vue +22 -0
- package/components/nav/Jump.vue +128 -0
- package/components/nav/NamespaceFilter.vue +1155 -0
- package/components/nav/Pinned.vue +52 -0
- package/components/nav/TopLevelMenu.helper.ts +562 -0
- package/components/nav/TopLevelMenu.vue +1602 -0
- package/components/nav/Type.vue +292 -0
- package/components/nav/WindowManager/ChartReadme.vue +48 -0
- package/components/nav/WindowManager/ContainerLogs.vue +877 -0
- package/components/nav/WindowManager/ContainerShell.vue +585 -0
- package/components/nav/WindowManager/KubectlShell.vue +42 -0
- package/components/nav/WindowManager/MachineSsh.vue +21 -0
- package/components/nav/WindowManager/Window.vue +105 -0
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +197 -0
- package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +571 -0
- package/components/nav/WindowManager/index.vue +587 -0
- package/components/nav/WorkspaceSwitcher.vue +190 -0
- package/components/nav/__tests__/TopLevelMenu.test.ts +598 -0
- package/components/nav/__tests__/Type.test.ts +491 -0
- package/components/templates/blank.vue +20 -0
- package/components/templates/default.vue +263 -0
- package/components/templates/home.vue +126 -0
- package/components/templates/plain.vue +134 -0
- package/components/templates/standalone.vue +9 -0
- package/components/templates/unauthenticated.vue +26 -0
- package/components/user.retention/user-retention-header.vue +34 -0
- package/composables/focusTrap.ts +68 -0
- package/composables/useClickOutside.ts +81 -0
- package/composables/useCompactInput.test.ts +36 -0
- package/composables/useCompactInput.ts +20 -0
- package/composables/useI18n.ts +26 -0
- package/composables/useLabeledFormElement.test.ts +135 -0
- package/composables/useLabeledFormElement.ts +153 -0
- package/composables/useUserRetentionValidation.test.ts +178 -0
- package/composables/useUserRetentionValidation.ts +201 -0
- package/config/__test__/home-links.test.ts +57 -0
- package/config/cookies.js +4 -0
- package/config/elemental-types.js +9 -0
- package/config/features.js +6 -0
- package/config/harvester-manager-types.js +3 -0
- package/config/home-links.js +209 -0
- package/config/labels-annotations.js +192 -0
- package/config/local-storage.js +6 -0
- package/config/page-actions.js +4 -0
- package/config/pagination-table-headers.js +80 -0
- package/config/persistentVolume.ts +108 -0
- package/config/pod-security-admission.ts +82 -0
- package/config/private-label.js +94 -0
- package/config/product/apps.js +148 -0
- package/config/product/auth.js +218 -0
- package/config/product/backup.js +61 -0
- package/config/product/cis.js +158 -0
- package/config/product/explorer.js +632 -0
- package/config/product/fleet.js +100 -0
- package/config/product/gatekeeper.js +119 -0
- package/config/product/istio.js +89 -0
- package/config/product/legacy.js +62 -0
- package/config/product/logging.js +377 -0
- package/config/product/longhorn.js +49 -0
- package/config/product/manager.js +217 -0
- package/config/product/monitoring.js +287 -0
- package/config/product/navlinks.js +32 -0
- package/config/product/neuvector.js +30 -0
- package/config/product/settings.js +161 -0
- package/config/product/uiplugins.js +18 -0
- package/config/query-params.js +79 -0
- package/config/roles.ts +409 -0
- package/config/router/index.js +26 -0
- package/config/router/navigation-guards/attempt-first-login.js +73 -0
- package/config/router/navigation-guards/authentication.js +64 -0
- package/config/router/navigation-guards/clusters.js +132 -0
- package/config/router/navigation-guards/i18n.js +13 -0
- package/config/router/navigation-guards/index.js +23 -0
- package/config/router/navigation-guards/install-redirect.js +95 -0
- package/config/router/navigation-guards/load-initial-settings.js +15 -0
- package/config/router/navigation-guards/page-title.js +12 -0
- package/config/router/navigation-guards/products.js +15 -0
- package/config/router/navigation-guards/record-last-route.js +24 -0
- package/config/router/navigation-guards/runtime-extension-route.js +31 -0
- package/config/router/navigation-guards/server-upgrade-growl.js +19 -0
- package/config/router/routes.js +488 -0
- package/config/schema.js +32 -0
- package/config/secret.js +14 -0
- package/config/settings.ts +258 -0
- package/config/store.js +184 -0
- package/config/system-namespaces.js +18 -0
- package/config/table-headers.js +1115 -0
- package/config/types.js +353 -0
- package/config/uiplugins.js +272 -0
- package/config/version.js +33 -0
- package/config/workload.ts +1 -0
- package/core/plugin-helpers.ts +220 -0
- package/core/plugin-routes.ts +144 -0
- package/core/plugin.ts +367 -0
- package/core/plugins-loader.js +31 -0
- package/core/plugins.js +471 -0
- package/core/types-provisioning.ts +361 -0
- package/core/types.ts +661 -0
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +135 -0
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +119 -0
- package/detail/__tests__/service.test.ts +62 -0
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +254 -0
- package/detail/catalog.cattle.io.app.vue +181 -0
- package/detail/catalog.cattle.io.clusterrepo.vue +35 -0
- package/detail/cis.cattle.io.clusterscan.vue +372 -0
- package/detail/configmap.vue +81 -0
- package/detail/constraints.gatekeeper.sh.constraint.vue +66 -0
- package/detail/fleet.cattle.io.bundle.vue +63 -0
- package/detail/fleet.cattle.io.cluster.vue +99 -0
- package/detail/fleet.cattle.io.clustergroup.vue +76 -0
- package/detail/fleet.cattle.io.gitrepo.vue +148 -0
- package/detail/harvesterhci.io.management.cluster.vue +104 -0
- package/detail/helm.cattle.io.projecthelmchart.vue +249 -0
- package/detail/management.cattle.io.fleetworkspace.vue +100 -0
- package/detail/management.cattle.io.globalrole.vue +8 -0
- package/detail/management.cattle.io.roletemplate.vue +11 -0
- package/detail/management.cattle.io.user.vue +312 -0
- package/detail/namespace.vue +269 -0
- package/detail/networking.k8s.io.ingress.vue +74 -0
- package/detail/node.vue +330 -0
- package/detail/pod.vue +255 -0
- package/detail/provisioning.cattle.io.cluster.vue +1134 -0
- package/detail/rbac.authorization.k8s.io.clusterrole.vue +8 -0
- package/detail/rbac.authorization.k8s.io.role.vue +8 -0
- package/detail/secret.vue +313 -0
- package/detail/service.vue +202 -0
- package/detail/workload/index.vue +541 -0
- package/dialog/AddClusterMemberDialog.vue +86 -0
- package/dialog/AddCustomBadgeDialog.vue +465 -0
- package/dialog/AddProjectMemberDialog.vue +181 -0
- package/dialog/AddonConfigConfirmationDialog.vue +101 -0
- package/dialog/DeactivateDriverDialog.vue +138 -0
- package/dialog/DiagnosticTimingsDialog.vue +141 -0
- package/dialog/DrainNode.vue +247 -0
- package/dialog/ForceMachineRemoveDialog.vue +131 -0
- package/dialog/GenericPrompt.vue +135 -0
- package/dialog/GitRepoForceUpdateDialog.vue +132 -0
- package/dialog/RollbackWorkloadDialog.vue +308 -0
- package/dialog/RotateCertificatesDialog.vue +205 -0
- package/dialog/RotateEncryptionKeyDialog.vue +191 -0
- package/dialog/SaveAsRKETemplateDialog.vue +139 -0
- package/dialog/ScaleMachineDownDialog.vue +156 -0
- package/dialog/ScalePoolDownDialog.vue +121 -0
- package/dialog/SloDialog.vue +97 -0
- package/directives/clean-html.js +15 -0
- package/directives/clean-tooltip.js +32 -0
- package/directives/focus.js +47 -0
- package/directives/int-number.js +21 -0
- package/directives/positive-int-number.js +19 -0
- package/directives/strip-html-aria-label.js +19 -0
- package/directives/trim-whitespace.js +19 -0
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +87 -0
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +246 -0
- package/edit/__tests__/kontainerDriver.test.ts +110 -0
- package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +71 -0
- package/edit/__tests__/management.cattle.io.setting.test.ts +109 -0
- package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +57 -0
- package/edit/__tests__/namespace.test.ts +49 -0
- package/edit/__tests__/nodeDriver.test.ts +89 -0
- package/edit/__tests__/service.test.ts +100 -0
- package/edit/__tests__/ui.cattle.io.navlink.test.ts +114 -0
- package/edit/auth/AuthProviderWarningBanners.vue +34 -0
- package/edit/auth/__tests__/AuthProviderWarningBanners.test.ts +19 -0
- package/edit/auth/__tests__/azuread.test.ts +238 -0
- package/edit/auth/__tests__/oidc.test.ts +151 -0
- package/edit/auth/azuread.vue +537 -0
- package/edit/auth/github.vue +269 -0
- package/edit/auth/googleoauth.vue +256 -0
- package/edit/auth/ldap/__tests__/config.test.ts +58 -0
- package/edit/auth/ldap/config.vue +403 -0
- package/edit/auth/ldap/index.vue +156 -0
- package/edit/auth/oidc.vue +412 -0
- package/edit/auth/saml.vue +432 -0
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +58 -0
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +130 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +343 -0
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +79 -0
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +60 -0
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +220 -0
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +198 -0
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +71 -0
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +58 -0
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +65 -0
- package/edit/catalog.cattle.io.clusterrepo.vue +336 -0
- package/edit/cis.cattle.io.clusterscan.vue +377 -0
- package/edit/cis.cattle.io.clusterscanbenchmark.vue +153 -0
- package/edit/cis.cattle.io.clusterscanprofile.vue +150 -0
- package/edit/cloudcredential.vue +319 -0
- package/edit/configmap.vue +163 -0
- package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +72 -0
- package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +78 -0
- package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +52 -0
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +368 -0
- package/edit/fleet.cattle.io.cluster.vue +105 -0
- package/edit/fleet.cattle.io.clustergroup.vue +187 -0
- package/edit/fleet.cattle.io.gitrepo.vue +910 -0
- package/edit/group.principal.vue +65 -0
- package/edit/helm.cattle.io.projecthelmchart.vue +163 -0
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +94 -0
- package/edit/kontainerDriver.vue +67 -0
- package/edit/logging-flow/Match.vue +142 -0
- package/edit/logging-flow/index.vue +549 -0
- package/edit/logging.banzaicloud.io.clusterflow.vue +7 -0
- package/edit/logging.banzaicloud.io.clusteroutput.vue +12 -0
- package/edit/logging.banzaicloud.io.flow.vue +7 -0
- package/edit/logging.banzaicloud.io.output/__tests__/logging.banzaicloud.io.output.test.ts +279 -0
- package/edit/logging.banzaicloud.io.output/index.vue +386 -0
- package/edit/logging.banzaicloud.io.output/providers/__tests__/loki.test.ts +13 -0
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +77 -0
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +94 -0
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +112 -0
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +95 -0
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +234 -0
- package/edit/logging.banzaicloud.io.output/providers/file.vue +47 -0
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +152 -0
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +102 -0
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +167 -0
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +166 -0
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +76 -0
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +72 -0
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +107 -0
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +172 -0
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +71 -0
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +225 -0
- package/edit/logging.banzaicloud.io.output/providers/redis.vue +142 -0
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +122 -0
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +180 -0
- package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +59 -0
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +234 -0
- package/edit/logging.banzaicloud.io.output/providers/utils.js +27 -0
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +71 -0
- package/edit/management.cattle.io.fleetworkspace.vue +245 -0
- package/edit/management.cattle.io.globalrole.vue +8 -0
- package/edit/management.cattle.io.node.vue +72 -0
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +111 -0
- package/edit/management.cattle.io.project.vue +255 -0
- package/edit/management.cattle.io.projectroletemplatebinding.vue +96 -0
- package/edit/management.cattle.io.roletemplate.vue +11 -0
- package/edit/management.cattle.io.setting.vue +264 -0
- package/edit/management.cattle.io.user.vue +264 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +324 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +287 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +423 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +152 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +272 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +175 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +282 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +203 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +140 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +230 -0
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +534 -0
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +229 -0
- package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +112 -0
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +223 -0
- package/edit/monitoring.coreos.com.receiver/auth.vue +142 -0
- package/edit/monitoring.coreos.com.receiver/index.vue +357 -0
- package/edit/monitoring.coreos.com.receiver/tls.vue +72 -0
- package/edit/monitoring.coreos.com.receiver/types/__tests__/email.test.ts +57 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +130 -0
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +237 -0
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +97 -0
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +88 -0
- package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +65 -0
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +28 -0
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +93 -0
- package/edit/monitoring.coreos.com.route.vue +237 -0
- package/edit/namespace.vue +282 -0
- package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +194 -0
- package/edit/networking.istio.io.destinationrule/index.vue +237 -0
- package/edit/networking.k8s.io.ingress/Certificate.vue +134 -0
- package/edit/networking.k8s.io.ingress/Certificates.vue +111 -0
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +145 -0
- package/edit/networking.k8s.io.ingress/IngressClass.vue +65 -0
- package/edit/networking.k8s.io.ingress/Rule.vue +188 -0
- package/edit/networking.k8s.io.ingress/RulePath.vue +224 -0
- package/edit/networking.k8s.io.ingress/Rules.vue +155 -0
- package/edit/networking.k8s.io.ingress/index.vue +300 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +108 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +50 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +401 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +93 -0
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.test.ts +180 -0
- package/edit/networking.k8s.io.networkpolicy/__tests__/utils/mock.json +158 -0
- package/edit/networking.k8s.io.networkpolicy/__tests__/utils/selectors.test.ts +45 -0
- package/edit/networking.k8s.io.networkpolicy/index.vue +299 -0
- package/edit/node.vue +82 -0
- package/edit/nodeDriver.vue +72 -0
- package/edit/persistentvolume/__tests__/persistentvolume.test.ts +93 -0
- package/edit/persistentvolume/index.vue +380 -0
- package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +90 -0
- package/edit/persistentvolume/plugins/azureDisk.vue +136 -0
- package/edit/persistentvolume/plugins/azureFile.vue +78 -0
- package/edit/persistentvolume/plugins/cephfs.vue +109 -0
- package/edit/persistentvolume/plugins/cinder.vue +89 -0
- package/edit/persistentvolume/plugins/csi.vue +209 -0
- package/edit/persistentvolume/plugins/fc.vue +101 -0
- package/edit/persistentvolume/plugins/flexVolume.vue +102 -0
- package/edit/persistentvolume/plugins/flocker.vue +45 -0
- package/edit/persistentvolume/plugins/gcePersistentDisk.vue +90 -0
- package/edit/persistentvolume/plugins/glusterfs.vue +70 -0
- package/edit/persistentvolume/plugins/hostPath.vue +82 -0
- package/edit/persistentvolume/plugins/iscsi.vue +170 -0
- package/edit/persistentvolume/plugins/local.vue +37 -0
- package/edit/persistentvolume/plugins/longhorn.vue +99 -0
- package/edit/persistentvolume/plugins/nfs.vue +70 -0
- package/edit/persistentvolume/plugins/photonPersistentDisk.vue +58 -0
- package/edit/persistentvolume/plugins/portworxVolume.vue +71 -0
- package/edit/persistentvolume/plugins/quobyte.vue +88 -0
- package/edit/persistentvolume/plugins/rbd.vue +127 -0
- package/edit/persistentvolume/plugins/scaleIO.vue +146 -0
- package/edit/persistentvolume/plugins/storageos.vue +98 -0
- package/edit/persistentvolume/plugins/vsphereVolume.vue +63 -0
- package/edit/persistentvolumeclaim.vue +395 -0
- package/edit/pod.vue +27 -0
- package/edit/policy.poddisruptionbudget.vue +152 -0
- package/edit/provisioning.cattle.io.cluster/AgentEnv.vue +40 -0
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +303 -0
- package/edit/provisioning.cattle.io.cluster/Labels.vue +46 -0
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +324 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +306 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +564 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.test.ts +129 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +182 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +54 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +72 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +546 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +391 -0
- package/edit/provisioning.cattle.io.cluster/index.vue +733 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +2547 -0
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +49 -0
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +112 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +221 -0
- package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +335 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +700 -0
- package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +219 -0
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +374 -0
- package/edit/provisioning.cattle.io.cluster/tabs/MemberRoles.vue +40 -0
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +153 -0
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +138 -0
- package/edit/provisioning.cattle.io.cluster/tabs/networking/ACE.vue +73 -0
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +214 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +211 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryMirrors.vue +138 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +66 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +149 -0
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +155 -0
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +76 -0
- package/edit/rbac.authorization.k8s.io.clusterrole.vue +8 -0
- package/edit/rbac.authorization.k8s.io.role.vue +8 -0
- package/edit/resources.cattle.io.backup.vue +454 -0
- package/edit/resources.cattle.io.restore.vue +326 -0
- package/edit/secret/__tests__/ssh.test.ts +79 -0
- package/edit/secret/basic.vue +64 -0
- package/edit/secret/generic.vue +64 -0
- package/edit/secret/index.vue +407 -0
- package/edit/secret/registry.vue +145 -0
- package/edit/secret/ssh.vue +106 -0
- package/edit/secret/tls.vue +94 -0
- package/edit/service.vue +549 -0
- package/edit/serviceaccount.vue +193 -0
- package/edit/storage.k8s.io.storageclass/index.vue +307 -0
- package/edit/storage.k8s.io.storageclass/provisioners/custom.vue +25 -0
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +114 -0
- package/edit/storage.k8s.io.storageclass/provisioners/driver.longhorn.io.vue +40 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +180 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +75 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +47 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +69 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +117 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +99 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/no-provisioner.vue +21 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +83 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +91 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +117 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +116 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +65 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +97 -0
- package/edit/token.vue +316 -0
- package/edit/ui.cattle.io.navlink.vue +461 -0
- package/edit/workload/Job.vue +339 -0
- package/edit/workload/Upgrading.vue +372 -0
- package/edit/workload/VolumeClaimTemplate.vue +136 -0
- package/edit/workload/__tests__/Job.test.ts +72 -0
- package/edit/workload/__tests__/Upgrading.test.ts +61 -0
- package/edit/workload/__tests__/index.test.ts +103 -0
- package/edit/workload/index.vue +676 -0
- package/edit/workload/mixins/workload.js +1067 -0
- package/edit/workload/storage/ContainerMountPaths.vue +171 -0
- package/edit/workload/storage/Mount.vue +157 -0
- package/edit/workload/storage/__tests__/Mount.test.ts +102 -0
- package/edit/workload/storage/__tests__/Storage.test.ts +106 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +73 -0
- package/edit/workload/storage/azureDisk.vue +104 -0
- package/edit/workload/storage/azureFile.vue +74 -0
- package/edit/workload/storage/csi/driver.longhorn.io.vue +48 -0
- package/edit/workload/storage/csi/index.vue +122 -0
- package/edit/workload/storage/emptyDir.vue +88 -0
- package/edit/workload/storage/ephemeralVolume/index.vue +108 -0
- package/edit/workload/storage/gcePersistentDisk.vue +73 -0
- package/edit/workload/storage/hostPath.vue +115 -0
- package/edit/workload/storage/index.vue +339 -0
- package/edit/workload/storage/nfs.vue +78 -0
- package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +38 -0
- package/edit/workload/storage/persistentVolumeClaim/index.vue +154 -0
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +256 -0
- package/edit/workload/storage/secret.vue +186 -0
- package/edit/workload/storage/vsphereVolume.vue +73 -0
- package/initialize/App.vue +70 -0
- package/initialize/app-extended.js +112 -0
- package/initialize/entry-helpers.js +147 -0
- package/initialize/entry.js +33 -0
- package/initialize/install-components.js +11 -0
- package/initialize/install-directives.js +61 -0
- package/initialize/install-plugins.js +128 -0
- package/list/__tests__/workload.test.ts +55 -0
- package/list/catalog.cattle.io.app.vue +76 -0
- package/list/catalog.cattle.io.clusterrepo.vue +83 -0
- package/list/cis.cattle.io.clusterscan.vue +76 -0
- package/list/fleet.cattle.io.bundle.vue +127 -0
- package/list/fleet.cattle.io.cluster.vue +95 -0
- package/list/fleet.cattle.io.clustergroup.vue +88 -0
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +94 -0
- package/list/fleet.cattle.io.gitrepo.vue +108 -0
- package/list/group.principal.vue +153 -0
- package/list/harvesterhci.io.management.cluster.vue +244 -0
- package/list/helm.cattle.io.projecthelmchart.vue +157 -0
- package/list/logging.banzaicloud.io.clusterflow.vue +44 -0
- package/list/logging.banzaicloud.io.flow.vue +45 -0
- package/list/management.cattle.io.cluster.vue +54 -0
- package/list/management.cattle.io.feature.vue +367 -0
- package/list/management.cattle.io.fleetworkspace.vue +44 -0
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +51 -0
- package/list/management.cattle.io.setting.vue +117 -0
- package/list/management.cattle.io.user.vue +178 -0
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +83 -0
- package/list/namespace.vue +79 -0
- package/list/networking.k8s.io.ingress.vue +39 -0
- package/list/node.vue +418 -0
- package/list/persistentvolume.vue +89 -0
- package/list/persistentvolumeclaim.vue +32 -0
- package/list/provisioning.cattle.io.cluster.vue +318 -0
- package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +47 -0
- package/list/service.vue +48 -0
- package/list/ui.cattle.io.navlink.vue +72 -0
- package/list/workload.vue +187 -0
- package/machine-config/__tests__/vmwarevsphere.test.ts +257 -0
- package/machine-config/amazonec2.vue +702 -0
- package/machine-config/azure.vue +901 -0
- package/machine-config/digitalocean.vue +231 -0
- package/machine-config/generic.vue +103 -0
- package/machine-config/linode.vue +189 -0
- package/machine-config/pnap.vue +288 -0
- package/machine-config/vmwarevsphere-config.ts +17 -0
- package/machine-config/vmwarevsphere.vue +1252 -0
- package/mixins/__tests__/auth-config.test.ts +74 -0
- package/mixins/__tests__/chart.test.ts +104 -0
- package/mixins/__tests__/create-edit-view.test.ts +56 -0
- package/mixins/auth-config.js +332 -0
- package/mixins/back-link.js +15 -0
- package/mixins/brand.js +211 -0
- package/mixins/browser-tab-visibility.js +31 -0
- package/mixins/chart.js +557 -0
- package/mixins/child-hook.js +82 -0
- package/mixins/closeable.js +47 -0
- package/mixins/compact-input.ts +25 -0
- package/mixins/create-edit-view/impl.js +201 -0
- package/mixins/create-edit-view/index.js +48 -0
- package/mixins/fetch.client.js +90 -0
- package/mixins/form-validation.js +197 -0
- package/mixins/labeled-form-element.ts +225 -0
- package/mixins/login.js +31 -0
- package/mixins/metric-poller.js +19 -0
- package/mixins/page-actions.js +36 -0
- package/mixins/resource-fetch-api-pagination.js +339 -0
- package/mixins/resource-fetch-namespaced.js +90 -0
- package/mixins/resource-fetch.js +290 -0
- package/mixins/resource-manager.js +109 -0
- package/mixins/vue-select-overrides.js +102 -0
- package/models/__tests__/apps.deployment.test.ts +93 -0
- package/models/__tests__/batch.cronjob.test.ts +88 -0
- package/models/__tests__/catalog.cattle.io.app.test.ts +148 -0
- package/models/__tests__/cluster.test.ts +44 -0
- package/models/__tests__/fleet.cattle.io.cluster.test.ts +36 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +157 -0
- package/models/__tests__/management.cattle.io.cluster.test.ts +23 -0
- package/models/__tests__/management.cattle.io.node.ts +181 -0
- package/models/__tests__/management.cattle.io.nodepool.ts +83 -0
- package/models/__tests__/namespace.test.ts +165 -0
- package/models/__tests__/node.test.ts +74 -0
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +155 -0
- package/models/__tests__/schema.tests.ts +24 -0
- package/models/__tests__/secret.test.ts +80 -0
- package/models/__tests__/steve-schema.test.ts +73 -0
- package/models/__tests__/storage.k8s.io.storageclass.test.ts +22 -0
- package/models/__tests__/workload.test.ts +91 -0
- package/models/app.js +25 -0
- package/models/apps.controllerrevision.js +7 -0
- package/models/apps.daemonset.js +22 -0
- package/models/apps.deployment.js +71 -0
- package/models/apps.replicaset.js +11 -0
- package/models/apps.statefulset.js +49 -0
- package/models/autoscaling.horizontalpodautoscaler.js +44 -0
- package/models/batch.cronjob.js +85 -0
- package/models/batch.job.js +19 -0
- package/models/catalog.cattle.io.app.js +488 -0
- package/models/catalog.cattle.io.clusterrepo.js +223 -0
- package/models/catalog.cattle.io.operation.js +43 -0
- package/models/catalog.cattle.io.repo.js +4 -0
- package/models/catalog.cattle.io.uiplugin.js +37 -0
- package/models/chart.js +50 -0
- package/models/chartinstallaction.js +17 -0
- package/models/chartupgradeaction.js +12 -0
- package/models/cis.cattle.io.clusterscan.js +179 -0
- package/models/cis.cattle.io.clusterscanbenchmark.js +18 -0
- package/models/cis.cattle.io.clusterscanprofile.js +31 -0
- package/models/cis.cattle.io.clusterscanreport.js +62 -0
- package/models/cloudcredential.js +336 -0
- package/models/cluster/node.js +487 -0
- package/models/cluster/schema.js +6 -0
- package/models/cluster.js +44 -0
- package/models/cluster.x-k8s.io.machine.js +272 -0
- package/models/cluster.x-k8s.io.machinedeployment.js +228 -0
- package/models/cluster.x-k8s.io.machineset.js +23 -0
- package/models/clusterroletemplatebinding.js +31 -0
- package/models/configmap.js +20 -0
- package/models/constraints.gatekeeper.sh.constraint.js +121 -0
- package/models/driver.js +63 -0
- package/models/etcdbackup.js +45 -0
- package/models/event.js +34 -0
- package/models/fleet.cattle.io.bundle.js +168 -0
- package/models/fleet.cattle.io.cluster.js +221 -0
- package/models/fleet.cattle.io.clustergroup.js +62 -0
- package/models/fleet.cattle.io.clusterregistrationtoken.js +14 -0
- package/models/fleet.cattle.io.gitrepo.js +548 -0
- package/models/group.principal.js +71 -0
- package/models/helm.cattle.io.projecthelmchart.js +38 -0
- package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +88 -0
- package/models/kontainerdriver.js +85 -0
- package/models/logging.banzaicloud.io.clusterflow.js +36 -0
- package/models/logging.banzaicloud.io.clusteroutput.js +4 -0
- package/models/logging.banzaicloud.io.flow.js +114 -0
- package/models/logging.banzaicloud.io.output.js +173 -0
- package/models/management/schema.js +6 -0
- package/models/management.cattle.io.authconfig.js +70 -0
- package/models/management.cattle.io.cluster.js +501 -0
- package/models/management.cattle.io.clusterroletemplatebinding.js +143 -0
- package/models/management.cattle.io.feature.js +56 -0
- package/models/management.cattle.io.fleetworkspace.js +90 -0
- package/models/management.cattle.io.gitreporestriction.js +5 -0
- package/models/management.cattle.io.globalrole.js +172 -0
- package/models/management.cattle.io.globalrolebinding.js +59 -0
- package/models/management.cattle.io.kontainerdriver.js +90 -0
- package/models/management.cattle.io.node.js +179 -0
- package/models/management.cattle.io.nodepool.js +185 -0
- package/models/management.cattle.io.nodetemplate.js +139 -0
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
- package/models/management.cattle.io.project.js +182 -0
- package/models/management.cattle.io.projectroletemplatebinding.js +150 -0
- package/models/management.cattle.io.roletemplate.js +216 -0
- package/models/management.cattle.io.setting.js +71 -0
- package/models/management.cattle.io.user.js +302 -0
- package/models/metrics.k8s.io.nodemetrics.js +41 -0
- package/models/monitoring.coreos.com.alertmanagerconfig.js +126 -0
- package/models/monitoring.coreos.com.podmonitor.js +23 -0
- package/models/monitoring.coreos.com.prometheusrule.js +38 -0
- package/models/monitoring.coreos.com.receiver.js +197 -0
- package/models/monitoring.coreos.com.route.js +162 -0
- package/models/monitoring.coreos.com.servicemonitor.js +23 -0
- package/models/namespace.js +262 -0
- package/models/networking.istio.io.destinationrule.js +19 -0
- package/models/networking.k8s.io.ingress.js +209 -0
- package/models/nodedriver.js +93 -0
- package/models/persistentvolume.js +43 -0
- package/models/persistentvolumeclaim.js +63 -0
- package/models/pod.js +279 -0
- package/models/principal.js +42 -0
- package/models/projectroletemplatebinding.js +35 -0
- package/models/provisioning.cattle.io.cluster.js +1091 -0
- package/models/rbac.authorization.k8s.io.clusterrole.js +17 -0
- package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
- package/models/rbac.authorization.k8s.io.role.js +52 -0
- package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
- package/models/replicationcontroller.js +4 -0
- package/models/resources.cattle.io.backup.js +29 -0
- package/models/resources.cattle.io.restore.js +33 -0
- package/models/rke-machine-config.cattle.io.harvesterconfig.js +19 -0
- package/models/rke-machine.cattle.io.amazonec2machinetemplate.js +15 -0
- package/models/rke-machine.cattle.io.azuremachinetemplate.js +15 -0
- package/models/rke-machine.cattle.io.digitaloceanmachinetemplate.js +15 -0
- package/models/rke-machine.cattle.io.linodemachinetemplate.js +15 -0
- package/models/rke-machine.cattle.io.machinetemplate.js +22 -0
- package/models/rke-machine.cattle.io.pnapmachinetemplate.js +15 -0
- package/models/rke-machine.cattle.io.vmwarevspheremachinetemplate.js +14 -0
- package/models/rke.cattle.io.etcdsnapshot.js +76 -0
- package/models/schema.js +38 -0
- package/models/secret.js +473 -0
- package/models/service.js +193 -0
- package/models/steve-schema.ts +254 -0
- package/models/storage.k8s.io.storageclass.js +164 -0
- package/models/templates.gatekeeper.sh.constrainttemplate.js +23 -0
- package/models/token.js +19 -0
- package/models/ui.cattle.io.navlink.js +38 -0
- package/models/workload.js +688 -0
- package/models/workload.service.js +341 -0
- package/package.json +173 -0
- package/pages/404.vue +15 -0
- package/pages/__tests__/prefs.test.ts +96 -0
- package/pages/about.vue +303 -0
- package/pages/account/create-key.vue +16 -0
- package/pages/account/index.vue +252 -0
- package/pages/auth/login.vue +591 -0
- package/pages/auth/logout.vue +44 -0
- package/pages/auth/setup.vue +521 -0
- package/pages/auth/verify.vue +198 -0
- package/pages/c/_cluster/_product/_resource/_id.vue +12 -0
- package/pages/c/_cluster/_product/_resource/_namespace/_id.vue +12 -0
- package/pages/c/_cluster/_product/_resource/create.vue +12 -0
- package/pages/c/_cluster/_product/_resource/index.vue +12 -0
- package/pages/c/_cluster/_product/index.vue +15 -0
- package/pages/c/_cluster/_product/members/index.vue +8 -0
- package/pages/c/_cluster/_product/namespaces.vue +77 -0
- package/pages/c/_cluster/_product/projectsnamespaces.vue +6 -0
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +18 -0
- package/pages/c/_cluster/apps/charts/chart.vue +452 -0
- package/pages/c/_cluster/apps/charts/index.vue +718 -0
- package/pages/c/_cluster/apps/charts/install.helpers.js +15 -0
- package/pages/c/_cluster/apps/charts/install.vue +2050 -0
- package/pages/c/_cluster/auth/config/_id.vue +35 -0
- package/pages/c/_cluster/auth/config/index.vue +116 -0
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +138 -0
- package/pages/c/_cluster/auth/roles/_resource/_id.vue +12 -0
- package/pages/c/_cluster/auth/roles/_resource/create.vue +12 -0
- package/pages/c/_cluster/auth/roles/index.vue +215 -0
- package/pages/c/_cluster/auth/user.retention/index.vue +323 -0
- package/pages/c/_cluster/ecm/index.vue +14 -0
- package/pages/c/_cluster/explorer/ConfigBadge.vue +64 -0
- package/pages/c/_cluster/explorer/EventsTable.vue +121 -0
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +264 -0
- package/pages/c/_cluster/explorer/explorer-utils.js +17 -0
- package/pages/c/_cluster/explorer/index.vue +1002 -0
- package/pages/c/_cluster/explorer/tools/__tests__/index.test.ts +71 -0
- package/pages/c/_cluster/explorer/tools/index.vue +397 -0
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +29 -0
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +249 -0
- package/pages/c/_cluster/fleet/index.vue +506 -0
- package/pages/c/_cluster/gatekeeper/constraints/index.vue +90 -0
- package/pages/c/_cluster/gatekeeper/index.vue +78 -0
- package/pages/c/_cluster/istio/index.vue +149 -0
- package/pages/c/_cluster/legacy/pages/_page.vue +29 -0
- package/pages/c/_cluster/legacy/project/_page.vue +57 -0
- package/pages/c/_cluster/legacy/project/index.vue +32 -0
- package/pages/c/_cluster/legacy/project/pipelines.vue +96 -0
- package/pages/c/_cluster/logging/index.vue +94 -0
- package/pages/c/_cluster/longhorn/__tests__/longhorn.index.test.ts +92 -0
- package/pages/c/_cluster/longhorn/index.vue +107 -0
- package/pages/c/_cluster/manager/cloudCredential/_id.vue +15 -0
- package/pages/c/_cluster/manager/cloudCredential/create.vue +15 -0
- package/pages/c/_cluster/manager/cloudCredential/index.vue +158 -0
- package/pages/c/_cluster/manager/drivers/kontainerDriver/_id.vue +12 -0
- package/pages/c/_cluster/manager/drivers/kontainerDriver/create.vue +15 -0
- package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +91 -0
- package/pages/c/_cluster/manager/drivers/nodeDriver/_id.vue +12 -0
- package/pages/c/_cluster/manager/drivers/nodeDriver/create.vue +15 -0
- package/pages/c/_cluster/manager/drivers/nodeDriver/index.vue +60 -0
- package/pages/c/_cluster/manager/jwt.authentication/index.vue +244 -0
- package/pages/c/_cluster/manager/pages/_page.vue +22 -0
- package/pages/c/_cluster/mcapps/pages/_page.vue +22 -0
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/index.vue +12 -0
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +320 -0
- package/pages/c/_cluster/monitoring/alertmanagerconfig/index.vue +24 -0
- package/pages/c/_cluster/monitoring/index.vue +202 -0
- package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +19 -0
- package/pages/c/_cluster/monitoring/monitor/create.vue +27 -0
- package/pages/c/_cluster/monitoring/monitor/index.vue +99 -0
- package/pages/c/_cluster/monitoring/route-receiver/_id.vue +27 -0
- package/pages/c/_cluster/monitoring/route-receiver/create.vue +19 -0
- package/pages/c/_cluster/monitoring/route-receiver/index.vue +133 -0
- package/pages/c/_cluster/navlinks/_group.vue +42 -0
- package/pages/c/_cluster/neuvector/index.vue +75 -0
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +128 -0
- package/pages/c/_cluster/settings/banners.vue +361 -0
- package/pages/c/_cluster/settings/brand.vue +648 -0
- package/pages/c/_cluster/settings/index.vue +20 -0
- package/pages/c/_cluster/settings/links.vue +167 -0
- package/pages/c/_cluster/settings/performance.vue +515 -0
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +175 -0
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +551 -0
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +193 -0
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +134 -0
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +261 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +366 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +503 -0
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +83 -0
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +152 -0
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +76 -0
- package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +77 -0
- package/pages/c/_cluster/uiplugins/index.vue +1288 -0
- package/pages/clusters/index.vue +21 -0
- package/pages/diagnostic.vue +532 -0
- package/pages/fail-whale.vue +197 -0
- package/pages/home.vue +848 -0
- package/pages/index.vue +54 -0
- package/pages/prefs.vue +367 -0
- package/pages/support/index.vue +263 -0
- package/pkg/auto-import.js +118 -0
- package/pkg/babel.config.js +8 -0
- package/pkg/dynamic-importer.lib.js +82 -0
- package/pkg/dynamic-plugin-loader.js +28 -0
- package/pkg/import.js +10 -0
- package/pkg/model-loader-require.lib.js +3 -0
- package/pkg/tsconfig.json +65 -0
- package/pkg/vue.config.js +146 -0
- package/plugins/axios.js +31 -0
- package/plugins/clean-html.js +103 -0
- package/plugins/codemirror-loader.js +5 -0
- package/plugins/codemirror.js +359 -0
- package/plugins/dashboard-store/__tests__/actions.test.ts +250 -0
- package/plugins/dashboard-store/__tests__/getters.test.ts +100 -0
- package/plugins/dashboard-store/__tests__/mutations.test.ts +391 -0
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +49 -0
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +7 -0
- package/plugins/dashboard-store/actions.js +784 -0
- package/plugins/dashboard-store/classify.js +18 -0
- package/plugins/dashboard-store/getters.js +457 -0
- package/plugins/dashboard-store/index.js +53 -0
- package/plugins/dashboard-store/model-loader-require.js +12 -0
- package/plugins/dashboard-store/model-loader.js +76 -0
- package/plugins/dashboard-store/mutations.js +548 -0
- package/plugins/dashboard-store/normalize.js +48 -0
- package/plugins/dashboard-store/resource-class.js +1902 -0
- package/plugins/ember-cookie.js +13 -0
- package/plugins/extend-router.js +80 -0
- package/plugins/floating-vue.js +1 -0
- package/plugins/formatters.js +15 -0
- package/plugins/global-formatters.js +20 -0
- package/plugins/i18n.js +136 -0
- package/plugins/js-yaml.js +4 -0
- package/plugins/nuxt-client-init.js +3 -0
- package/plugins/plugin.js +93 -0
- package/plugins/replaceall.js +19 -0
- package/plugins/shortkey.js +282 -0
- package/plugins/steve/__tests__/getters.test.ts +214 -0
- package/plugins/steve/__tests__/header-warnings.test.ts +238 -0
- package/plugins/steve/__tests__/mutations.test.ts +50 -0
- package/plugins/steve/__tests__/resource-utils.test.ts +159 -0
- package/plugins/steve/__tests__/steve-class.test.ts +59 -0
- package/plugins/steve/__tests__/subscribe.spec.ts +109 -0
- package/plugins/steve/__tests__/utils/mutation.test.helpers.ts +105 -0
- package/plugins/steve/__tests__/utils/steve-mocks.ts +31 -0
- package/plugins/steve/accept-or-reject-socket-message.ts +103 -0
- package/plugins/steve/actions.js +386 -0
- package/plugins/steve/caches/resourceCache.js +60 -0
- package/plugins/steve/getters.js +342 -0
- package/plugins/steve/header-warnings.ts +91 -0
- package/plugins/steve/hybrid-class.js +102 -0
- package/plugins/steve/index.js +76 -0
- package/plugins/steve/mutations.js +210 -0
- package/plugins/steve/norman-class.js +198 -0
- package/plugins/steve/performanceTesting.js +128 -0
- package/plugins/steve/projectAndNamespaceFiltering.utils.ts +80 -0
- package/plugins/steve/resource-utils.ts +38 -0
- package/plugins/steve/resourceWatcher.js +251 -0
- package/plugins/steve/schema.d.ts +22 -0
- package/plugins/steve/schema.utils.js +25 -0
- package/plugins/steve/steve-class.js +61 -0
- package/plugins/steve/steve-description-class.js +36 -0
- package/plugins/steve/steve-pagination-utils.ts +513 -0
- package/plugins/steve/subscribe.js +1092 -0
- package/plugins/steve/worker/index.js +24 -0
- package/plugins/steve/worker/web-worker.advanced.js +320 -0
- package/plugins/steve/worker/web-worker.basic.js +116 -0
- package/plugins/steve-create-worker.js +14 -0
- package/plugins/version.js +11 -0
- package/promptRemove/management.cattle.io.fleetworkspace.vue +98 -0
- package/promptRemove/management.cattle.io.globalrole.vue +49 -0
- package/promptRemove/management.cattle.io.project.vue +131 -0
- package/promptRemove/management.cattle.io.roletemplate.vue +51 -0
- package/promptRemove/mixin/roleDeletionCheck.js +105 -0
- package/promptRemove/pod.vue +132 -0
- package/public/index.html +74 -0
- package/rancher-components/Accordion/Accordion.test.ts +45 -0
- package/rancher-components/Accordion/Accordion.vue +86 -0
- package/rancher-components/Accordion/index.ts +1 -0
- package/rancher-components/BadgeState/BadgeState.test.ts +12 -0
- package/rancher-components/BadgeState/BadgeState.vue +118 -0
- package/rancher-components/BadgeState/index.ts +1 -0
- package/rancher-components/Banner/Banner.test.ts +59 -0
- package/rancher-components/Banner/Banner.vue +257 -0
- package/rancher-components/Banner/index.ts +1 -0
- package/rancher-components/Card/Card.test.ts +37 -0
- package/rancher-components/Card/Card.vue +187 -0
- package/rancher-components/Card/index.ts +1 -0
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +68 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +488 -0
- package/rancher-components/Form/Checkbox/index.ts +1 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +57 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +471 -0
- package/rancher-components/Form/LabeledInput/index.ts +1 -0
- package/rancher-components/Form/Radio/RadioButton.test.ts +33 -0
- package/rancher-components/Form/Radio/RadioButton.vue +304 -0
- package/rancher-components/Form/Radio/RadioGroup.test.ts +27 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +298 -0
- package/rancher-components/Form/Radio/index.ts +2 -0
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +199 -0
- package/rancher-components/Form/TextArea/index.ts +1 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +94 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +192 -0
- package/rancher-components/Form/ToggleSwitch/index.ts +1 -0
- package/rancher-components/Form/index.ts +5 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +140 -0
- package/rancher-components/LabeledTooltip/index.ts +1 -0
- package/rancher-components/RcButton/RcButton.test.ts +97 -0
- package/rancher-components/RcButton/RcButton.vue +95 -0
- package/rancher-components/RcButton/index.ts +2 -0
- package/rancher-components/RcButton/types.ts +17 -0
- package/rancher-components/RcDropdown/RcDropdown.vue +124 -0
- package/rancher-components/RcDropdown/RcDropdownItem.vue +121 -0
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +66 -0
- package/rancher-components/RcDropdown/RcDropdownSeparator.vue +6 -0
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +42 -0
- package/rancher-components/RcDropdown/index.ts +5 -0
- package/rancher-components/RcDropdown/types.ts +49 -0
- package/rancher-components/RcDropdown/useDropdownCollection.ts +46 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +113 -0
- package/rancher-components/StringList/StringList.test.ts +754 -0
- package/rancher-components/StringList/StringList.vue +645 -0
- package/rancher-components/StringList/index.ts +1 -0
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +69 -0
- package/scripts/build-pkg.sh +102 -0
- package/scripts/clean +6 -0
- package/scripts/drone-build-pkg.sh +31 -0
- package/scripts/extension/bundle +86 -0
- package/scripts/extension/helm/charts/ui-plugin-server/.helmignore +23 -0
- package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +18 -0
- package/scripts/extension/helm/charts/ui-plugin-server/templates/_helpers.tpl +63 -0
- package/scripts/extension/helm/charts/ui-plugin-server/templates/cr.yaml +14 -0
- package/scripts/extension/helm/charts/ui-plugin-server/values.yaml +8 -0
- package/scripts/extension/helm/package/Dockerfile +27 -0
- package/scripts/extension/helm/package/nginx.conf +17 -0
- package/scripts/extension/helm/scripts/package +31 -0
- package/scripts/extension/helm/scripts/patch +128 -0
- package/scripts/extension/helm/scripts/version +31 -0
- package/scripts/extension/helmpatch +67 -0
- package/scripts/extension/parse-tag-name +39 -0
- package/scripts/extension/publish +476 -0
- package/scripts/pkgfile.js +23 -0
- package/scripts/publish-pkg.sh +18 -0
- package/scripts/publish-shell.sh +115 -0
- package/scripts/record-deps.js +37 -0
- package/scripts/serve-pkgs +71 -0
- package/scripts/sync-shell-deps +37 -0
- package/scripts/test-plugins-build.sh +248 -0
- package/scripts/typegen.sh +102 -0
- package/scripts/vue-migrate.js +686 -0
- package/server/har-file.js +183 -0
- package/server/server-middleware.js +11 -0
- package/server/server.crt +22 -0
- package/server/server.csr +16 -0
- package/server/server.key +27 -0
- package/server/v3.ext +8 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.png +0 -0
- package/static/loading-indicator.html +39 -0
- package/store/__tests__/auth.test.ts +120 -0
- package/store/__tests__/catalog.test.ts +207 -0
- package/store/__tests__/index.test.ts +110 -0
- package/store/__tests__/type-map.test.ts +1122 -0
- package/store/action-menu.js +240 -0
- package/store/auth.js +409 -0
- package/store/aws.js +256 -0
- package/store/catalog.js +666 -0
- package/store/cru-resource.ts +26 -0
- package/store/customisation.js +35 -0
- package/store/digitalocean.js +198 -0
- package/store/features.js +73 -0
- package/store/github.js +109 -0
- package/store/gitlab.js +159 -0
- package/store/growl.js +98 -0
- package/store/i18n.js +356 -0
- package/store/index.js +1290 -0
- package/store/linode.js +142 -0
- package/store/plugins.js +210 -0
- package/store/pnap.js +128 -0
- package/store/prefs.js +531 -0
- package/store/resource-fetch.js +44 -0
- package/store/store-types.js +7 -0
- package/store/type-map.js +2057 -0
- package/store/type-map.utils.ts +243 -0
- package/store/uiplugins.ts +67 -0
- package/store/wm.js +95 -0
- package/tsconfig.json +48 -0
- package/tsconfig.paths.json +21 -0
- package/types/api.d.ts +1 -0
- package/types/components/labeledSelect.ts +50 -0
- package/types/components/paginatedResourceTable.ts +25 -0
- package/types/components/resourceLabeledSelect.ts +48 -0
- package/types/fleet.d.ts +1 -0
- package/types/form.ts +1 -0
- package/types/generic.ts +2 -0
- package/types/rancher/index.d.ts +9 -0
- package/types/resources/fleet.d.ts +57 -0
- package/types/resources/pod-security-admission.ts +36 -0
- package/types/resources/settings.d.ts +93 -0
- package/types/resources/userPreferences.d.ts +13 -0
- package/types/shell/index.d.ts +4704 -0
- package/types/store/dashboard-store.types.ts +46 -0
- package/types/store/pagination.types.ts +470 -0
- package/types/store/type-map.ts +30 -0
- package/types/store/vuex.d.ts +17 -0
- package/types/t.ts +1 -0
- package/types/vue-shim.d +20 -0
- package/types/vue-shim.d.ts +20 -0
- package/utils/__mocks__/socket.js +21 -0
- package/utils/__tests__/array.test.ts +514 -0
- package/utils/__tests__/cluster.test.ts +57 -0
- package/utils/__tests__/create-yaml.test.ts +490 -0
- package/utils/__tests__/formatter.test.ts +77 -0
- package/utils/__tests__/grafana.test.ts +44 -0
- package/utils/__tests__/kontainer.test.ts +180 -0
- package/utils/__tests__/object.test.ts +409 -0
- package/utils/__tests__/pod-security-admission.test.ts +61 -0
- package/utils/__tests__/selector.test.ts +444 -0
- package/utils/__tests__/sort.test.ts +61 -0
- package/utils/__tests__/string.test.ts +91 -0
- package/utils/__tests__/version.test.ts +18 -0
- package/utils/alertmanagerconfig.js +181 -0
- package/utils/array.ts +256 -0
- package/utils/async.ts +38 -0
- package/utils/auth.js +334 -0
- package/utils/aws.js +0 -0
- package/utils/axios.js +171 -0
- package/utils/azure.js +24 -0
- package/utils/banners.js +103 -0
- package/utils/clipboard.js +5 -0
- package/utils/cluster.js +298 -0
- package/utils/color.js +147 -0
- package/utils/computed.js +45 -0
- package/utils/config.js +4 -0
- package/utils/cookie-universal.js +10 -0
- package/utils/create-yaml.js +518 -0
- package/utils/crypto/LICENSE.txt +15 -0
- package/utils/crypto/browserHashUtils.js +51 -0
- package/utils/crypto/browserMd5.js +183 -0
- package/utils/crypto/browserSha1.js +149 -0
- package/utils/crypto/browserSha256.js +237 -0
- package/utils/crypto/index.js +181 -0
- package/utils/custom-validators.js +32 -0
- package/utils/dom.js +15 -0
- package/utils/download.js +35 -0
- package/utils/duration.js +43 -0
- package/utils/dynamic-importer.js +134 -0
- package/utils/ember-page.js +30 -0
- package/utils/error.js +131 -0
- package/utils/favicon.js +49 -0
- package/utils/fleet.ts +191 -0
- package/utils/formatter.js +13 -0
- package/utils/gatekeeper/util.js +35 -0
- package/utils/gc/gc-interval.ts +40 -0
- package/utils/gc/gc-root-store.js +76 -0
- package/utils/gc/gc-route-changed.ts +44 -0
- package/utils/gc/gc-types.ts +21 -0
- package/utils/gc/gc.ts +282 -0
- package/utils/git.ts +92 -0
- package/utils/grafana.js +114 -0
- package/utils/ingress.ts +64 -0
- package/utils/kontainer.ts +190 -0
- package/utils/kube.js +9 -0
- package/utils/monitoring.js +63 -0
- package/utils/namespace-filter.js +43 -0
- package/utils/object.js +501 -0
- package/utils/pagination-utils.ts +176 -0
- package/utils/pagination-wrapper.ts +70 -0
- package/utils/parse-externalid.js +139 -0
- package/utils/platform.js +64 -0
- package/utils/pod-security-admission.ts +39 -0
- package/utils/poller-sequential.js +53 -0
- package/utils/poller.js +39 -0
- package/utils/position.js +172 -0
- package/utils/promise.js +115 -0
- package/utils/queue.js +70 -0
- package/utils/router.js +119 -0
- package/utils/select.js +65 -0
- package/utils/selector.js +229 -0
- package/utils/settings.ts +108 -0
- package/utils/socket.js +409 -0
- package/utils/sort.js +225 -0
- package/utils/stream.js +49 -0
- package/utils/string.js +362 -0
- package/utils/svg-filter.js +301 -0
- package/utils/time.js +121 -0
- package/utils/title.ts +3 -0
- package/utils/type-helpers.ts +9 -0
- package/utils/uiplugins.ts +319 -0
- package/utils/unit-tests/ChildRenderingRouterLinkStub.ts +36 -0
- package/utils/units.js +184 -0
- package/utils/url.ts +171 -0
- package/utils/v-sphere.ts +285 -0
- package/utils/validators/__tests__/cidr.test.ts +33 -0
- package/utils/validators/cidr.js +14 -0
- package/utils/validators/cluster-name.js +12 -0
- package/utils/validators/container-images.js +24 -0
- package/utils/validators/cron-schedule.js +14 -0
- package/utils/validators/flow-output.js +15 -0
- package/utils/validators/formRules/__tests__/index.test.ts +1218 -0
- package/utils/validators/formRules/index.ts +535 -0
- package/utils/validators/index.js +244 -0
- package/utils/validators/kubernetes-name.js +39 -0
- package/utils/validators/logging-outputs.js +11 -0
- package/utils/validators/monitoring-route.js +13 -0
- package/utils/validators/pod-affinity.js +128 -0
- package/utils/validators/prometheusrule.js +76 -0
- package/utils/validators/role-template.js +27 -0
- package/utils/validators/service.js +136 -0
- package/utils/validators/setting.js +9 -0
- package/utils/version.js +128 -0
- package/utils/versions.ts +39 -0
- package/utils/width.js +39 -0
- package/utils/window.js +46 -0
- package/vue-config-helper.js +135 -0
- package/vue.config.js +577 -0
|
@@ -0,0 +1,2057 @@
|
|
|
1
|
+
// This file has 2 sections that control getting and using specializations of particular types
|
|
2
|
+
// over the generic info that is specified or generated from schemas.
|
|
3
|
+
//
|
|
4
|
+
// 1) Getting info about types
|
|
5
|
+
//
|
|
6
|
+
// labelFor(schema, count) Get the display label for a schema. Count is (in English) 1 or not-1 for pluralizing
|
|
7
|
+
// groupLabelFor(schema) Get the label for the API group of this schema's type
|
|
8
|
+
// isIgnored(schema) Returns true if this type should be hidden from the tree
|
|
9
|
+
// groupForBasicType(schema) Returns the group a type should be shown in basic view, or false-y if it shouldn't be shown.
|
|
10
|
+
// typeWeightFor(type, forBasic) Get the weight value for a particular type label
|
|
11
|
+
// groupWeightFor(group, forBasic) Get the weight value for a particular group
|
|
12
|
+
// headersFor(schema) Returns the column definitions for a type to give to SortableTable
|
|
13
|
+
// activeProducts() Returns the list of products that are installed and should be shown
|
|
14
|
+
//
|
|
15
|
+
// 2) Detecting and using custom list/detail/edit/header components
|
|
16
|
+
//
|
|
17
|
+
// hasCustomList(type) Does type have a custom list implementation?
|
|
18
|
+
// hasCustomDetail(type[,subType]) Does type have a custom detail implementation?
|
|
19
|
+
// hasCustomEdit(type[,subType]) Does type have a custom edit implementation?
|
|
20
|
+
// importList(type) Returns a promise that resolves to the list component for type
|
|
21
|
+
// importDetail(type[,subType]) Returns a promise that resolves to the detail component for type
|
|
22
|
+
// importEdit(type[,subType]) Returns a promise that resolves to the edit component for type
|
|
23
|
+
// optionsFor(schemaOrType) Return the configured options for a type (from configureType)
|
|
24
|
+
//
|
|
25
|
+
// 3) Changing specialization info about a type
|
|
26
|
+
// For all:
|
|
27
|
+
// let { thingYouWant } = DSL(instanceOfTheStore, 'product');
|
|
28
|
+
//
|
|
29
|
+
// product( Add a product into the nav
|
|
30
|
+
// removable, -- Is the product removable (true) or built-in (false).
|
|
31
|
+
// weight, -- Sort order and divider sections in the product menu. 3=global (fleet, ecm), 2=always on (apps, explorer) 1=other
|
|
32
|
+
// showClusterSwitcher, -- Show the cluster switcher in the header (default true)
|
|
33
|
+
// showNamespaceFilter, -- Show the namespace filter in the header (default false)
|
|
34
|
+
// showWorkspaceSwitcher, -- Show the workspace switcher in the header (conflicts with namespace) (default false)
|
|
35
|
+
// ifHave, -- Show this product only if the given capability is available
|
|
36
|
+
// ifHaveGroup, -- Show this product only if the given group exists in the store [inStore]
|
|
37
|
+
// ifHaveType, -- Show this product only if the given type exists in the store [inStore], This can also be specified as an object { type: TYPE, store: 'management' } if the type isn't in the current [inStore]
|
|
38
|
+
// ifHaveVerb, -- In combination with ifHaveTYpe, show it only if the type also has this collectionMethod
|
|
39
|
+
// inStore, -- Which store to look at for if* above and the left-nav, defaults to "cluster"
|
|
40
|
+
// rootProduct, -- Optional root (parent) product - if set, used to optimize navigation when product changes stays within root product
|
|
41
|
+
// inExplorer, -- Determines if the product is to be scoped to the explorer
|
|
42
|
+
// public, -- If true, show to all users. If false, only show when the Developer Tools pref is on (default true)
|
|
43
|
+
// category, -- Group to show the product in for the nav hamburger menu
|
|
44
|
+
// typeStoreMap, -- An object mapping types to the store that should be used to retrieve information about the type
|
|
45
|
+
// hideSystemResources -- Hide resources in namespaces where namespace.isSystem === true, or a namespace managed by fleet (per its annotation) and hide those namespaces from ns/project list and nsfilter (default false)
|
|
46
|
+
// hideNamespaceLocation -- Hide the namespace link in the ResourceDetail masthead of namespaced resources and hide the ExplorerProjectsNamespaces namespace link (default false)
|
|
47
|
+
// })
|
|
48
|
+
//
|
|
49
|
+
// externalLink(stringOrFn) The product has an external page (function gets context object
|
|
50
|
+
//
|
|
51
|
+
// virtualType(obj) Add an item to the tree that goes to a route instead of an actual type.
|
|
52
|
+
// -- obj can contain anything in the objects getTree returns.
|
|
53
|
+
// -- obj must have a `name` that is unique among all virtual types.
|
|
54
|
+
// -- `cluster` is automatically added to route.params if it exists.
|
|
55
|
+
//
|
|
56
|
+
// spoofedType(obj) Create a fake type that can be treated like a normal type
|
|
57
|
+
//
|
|
58
|
+
// basicType( Mark type(s) as always shown in the top of the nav
|
|
59
|
+
// type(s), -- Type name or array of type names
|
|
60
|
+
// group -- Group to show the type(s) under; false-y for top-level.
|
|
61
|
+
// )
|
|
62
|
+
// basicType( Mark all types in group as always shown in the top of the nav
|
|
63
|
+
// group, -- Group to show
|
|
64
|
+
// asLabel -- Label to display the group as; false-y for top-level.
|
|
65
|
+
// )
|
|
66
|
+
// ignoreType(type) Never show type
|
|
67
|
+
// weightType( Set the weight (sorting) order of one or more types
|
|
68
|
+
// typeOrArrayOfTypes,
|
|
69
|
+
// weight, -- Higher numbers are shown first/higher up on the nav tree
|
|
70
|
+
// forBasic -- Apply to basic type instead of regular type tree
|
|
71
|
+
// )
|
|
72
|
+
// mapType( Remap a type id to a display name
|
|
73
|
+
// matchRegexOrString, -- Type to match, or regex that matches types
|
|
74
|
+
// replacementStringOrFn, -- String to replace the type with, or
|
|
75
|
+
// -- sync function: (type, capturedString, schemaObj => { return 'new-type'; }
|
|
76
|
+
// mapWeight, -- Priority for apply this mapping (higher numbers applied first)
|
|
77
|
+
// continueOnMatch -- If true, continue applying to hit other rules that might match the new type.
|
|
78
|
+
// )
|
|
79
|
+
// moveType( Change the group a type is in
|
|
80
|
+
// matchRegexOrString, -- Type to match, or regex that matches types
|
|
81
|
+
// newGroup, -- Group to move the type into
|
|
82
|
+
// mapWeight, -- Priority for apply this mapping (higher numbers applied first)
|
|
83
|
+
// )
|
|
84
|
+
// componentForType( Map matching types to a single component name
|
|
85
|
+
// ( (this is helpful if multiple types should be rendered by a single component)
|
|
86
|
+
// matchRegexOrString, -- Type to match, or regex that matches types
|
|
87
|
+
// replacementString -- String to replace the type with
|
|
88
|
+
// )
|
|
89
|
+
// configureType( Display options for a particular type
|
|
90
|
+
// type, -- Type to apply to
|
|
91
|
+
// options -- Object of options. Defaults/Supported: {
|
|
92
|
+
// isCreatable: true, -- If false, disable create even if schema says it's allowed
|
|
93
|
+
// isEditable: true, -- Ditto, for edit
|
|
94
|
+
// isRemovable: true, -- Ditto, for remove/delete
|
|
95
|
+
// showState: true, -- If false, hide state in columns and masthead
|
|
96
|
+
// showAge: true, -- If false, hide age in columns and masthead
|
|
97
|
+
// showConfigView: true -- If false, hide masthead config button in view mode
|
|
98
|
+
// showListMasthead: true, -- If false, hide masthead in list view
|
|
99
|
+
// canYaml: true,
|
|
100
|
+
// resource: undefined -- Use this resource in ResourceDetails instead
|
|
101
|
+
// resourceDetail: undefined -- Use this resource specifically for ResourceDetail's detail component
|
|
102
|
+
// resourceEdit: undefined -- Use this resource specifically for ResourceDetail's edit component
|
|
103
|
+
// depaginate: undefined -- Use this to depaginate requests for this type
|
|
104
|
+
// resourceEditMasthead: true -- Show the Masthead in the edit resource component
|
|
105
|
+
// customRoute: undefined,
|
|
106
|
+
// hasGraph: undefined -- If true, render ForceDirectedTreeChart graph (ATTENTION: option graphConfig is needed also!!!)
|
|
107
|
+
// graphConfig: undefined -- Use this to pass along the graph configuration
|
|
108
|
+
// notFilterNamespace: undefined -- Define namespaces that do not need to be filtered
|
|
109
|
+
// localOnly: False -- Hide this type from the nav/search bar on downstream clusters
|
|
110
|
+
// }
|
|
111
|
+
// )
|
|
112
|
+
// ignoreGroup(group): Never show group or any types in it
|
|
113
|
+
// weightGroup( Set the weight (sorting) of one or more groups
|
|
114
|
+
// groupOrArrayOfGroups, -- see weightType...
|
|
115
|
+
// weight
|
|
116
|
+
// )
|
|
117
|
+
// setGroupDefaultType( Set the default child type to show when the group is expanded
|
|
118
|
+
// groupOrArrayOfGroups, -- see setGroupDefaultType...
|
|
119
|
+
// defaultType
|
|
120
|
+
// )
|
|
121
|
+
// mapGroup( Remap a group name to a display name
|
|
122
|
+
// matchRegexOrString, -- see mapType...
|
|
123
|
+
// replacementString,
|
|
124
|
+
// mapWeight,
|
|
125
|
+
// continueOnMatch
|
|
126
|
+
// )
|
|
127
|
+
import { AGE, NAME, NAMESPACE as NAMESPACE_COL, STATE } from '@shell/config/table-headers';
|
|
128
|
+
import {
|
|
129
|
+
CATALOG,
|
|
130
|
+
COUNT,
|
|
131
|
+
SCHEMA,
|
|
132
|
+
MANAGEMENT,
|
|
133
|
+
NAMESPACE
|
|
134
|
+
} from '@shell/config/types';
|
|
135
|
+
import { VIEW_IN_API, EXPANDED_GROUPS, FAVORITE_TYPES } from '@shell/store/prefs';
|
|
136
|
+
import {
|
|
137
|
+
addObject, findBy, isArray, removeObject, filterBy
|
|
138
|
+
} from '@shell/utils/array';
|
|
139
|
+
import { clone, get } from '@shell/utils/object';
|
|
140
|
+
import {
|
|
141
|
+
ensureRegex, escapeHtml, escapeRegex, ucFirst, pluralize
|
|
142
|
+
} from '@shell/utils/string';
|
|
143
|
+
import {
|
|
144
|
+
importChart, importList, importDetail, importEdit, listProducts, loadProduct, importCustomPromptRemove, resolveList, resolveEdit, resolveWindowComponent, importWindowComponent, importLogin, resolveChart, resolveDetail, importDialog, importMachineConfig, resolveMachineConfigComponent, resolveCloudCredentialComponent, importCloudCredential
|
|
145
|
+
} from '@shell/utils/dynamic-importer';
|
|
146
|
+
|
|
147
|
+
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
|
148
|
+
import isObject from 'lodash/isObject';
|
|
149
|
+
import { normalizeType } from '@shell/plugins/dashboard-store/normalize';
|
|
150
|
+
import { sortBy } from '@shell/utils/sort';
|
|
151
|
+
|
|
152
|
+
import { haveV2Monitoring } from '@shell/utils/monitoring';
|
|
153
|
+
import { NEU_VECTOR_NAMESPACE } from '@shell/config/product/neuvector';
|
|
154
|
+
import { createHeaders, rowValueGetter } from '@shell/store/type-map.utils';
|
|
155
|
+
import { defineAsyncComponent } from 'vue';
|
|
156
|
+
|
|
157
|
+
export const NAMESPACED = 'namespaced';
|
|
158
|
+
export const CLUSTER_LEVEL = 'cluster';
|
|
159
|
+
export const BOTH = 'both';
|
|
160
|
+
|
|
161
|
+
export const TYPE_MODES = {
|
|
162
|
+
/**
|
|
163
|
+
* allTypes usage: All resource types
|
|
164
|
+
*
|
|
165
|
+
* getTree usage: Remove ignored schemas, resources not applicable to ns, etc
|
|
166
|
+
*/
|
|
167
|
+
ALL: 'all',
|
|
168
|
+
/**
|
|
169
|
+
* Represents resource types that should be shown at the top of the side nav.
|
|
170
|
+
*
|
|
171
|
+
* For example all fixed resource types above `More Resources` in the cluster explorer
|
|
172
|
+
*
|
|
173
|
+
* These will always be shown in the side nav
|
|
174
|
+
*
|
|
175
|
+
* allTypes usage: Resources that are in a group
|
|
176
|
+
*
|
|
177
|
+
* getTree usage: Remove ignored schemas, resources not applicable to ns, etc
|
|
178
|
+
*/
|
|
179
|
+
BASIC: 'basic',
|
|
180
|
+
/**
|
|
181
|
+
* Represents any type of resource type that has been favourited
|
|
182
|
+
*
|
|
183
|
+
* These will always be shown in the side nav.
|
|
184
|
+
*
|
|
185
|
+
* allTypes usage: Resource types that have been favorited
|
|
186
|
+
*
|
|
187
|
+
* getTree usage: Remove ignored schemas, resources not applicable to ns, etc
|
|
188
|
+
*/
|
|
189
|
+
FAVORITE: 'favorite',
|
|
190
|
+
/**
|
|
191
|
+
* Represents no virtual or spoofed types that have a count.
|
|
192
|
+
*
|
|
193
|
+
* For example the `More Resource` in the cluster explorer
|
|
194
|
+
*
|
|
195
|
+
* These will be shown in the side nav if there are resources in the ns filter OR the resource is not namespaces
|
|
196
|
+
*
|
|
197
|
+
* allTypes usage: All resource types that are not virtual or spoofed
|
|
198
|
+
*
|
|
199
|
+
* getTree usage: Remove types with no counts. Remove ignored schemas, resources not applicable to ns, etc
|
|
200
|
+
*/
|
|
201
|
+
USED: 'used',
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export const ROOT = 'root';
|
|
205
|
+
|
|
206
|
+
export const SPOOFED_PREFIX = '__[[spoofed]]__';
|
|
207
|
+
export const SPOOFED_API_PREFIX = '__[[spoofedapi]]__';
|
|
208
|
+
|
|
209
|
+
const instanceMethods = {};
|
|
210
|
+
const graphConfigMap = {};
|
|
211
|
+
|
|
212
|
+
export const IF_HAVE = {
|
|
213
|
+
V2_MONITORING: 'v2-monitoring',
|
|
214
|
+
PROJECT: 'project',
|
|
215
|
+
NO_PROJECT: 'no-project',
|
|
216
|
+
NOT_V1_ISTIO: 'not-v1-istio',
|
|
217
|
+
MULTI_CLUSTER: 'multi-cluster',
|
|
218
|
+
NEUVECTOR_NAMESPACE: 'neuvector-namespace',
|
|
219
|
+
ADMIN: 'admin-user',
|
|
220
|
+
MCM_DISABLED: 'mcm-disabled',
|
|
221
|
+
NOT_STANDALONE_HARVESTER: 'not-standalone-harvester',
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export function DSL(store, product, module = 'type-map') {
|
|
225
|
+
// store.commit(`${ module }/product`, { name: product });
|
|
226
|
+
|
|
227
|
+
return {
|
|
228
|
+
product(inOpt) {
|
|
229
|
+
const opt = {
|
|
230
|
+
name: product,
|
|
231
|
+
weight: 1,
|
|
232
|
+
inStore: 'cluster',
|
|
233
|
+
inExplorer: false,
|
|
234
|
+
removable: true,
|
|
235
|
+
showClusterSwitcher: true,
|
|
236
|
+
showNamespaceFilter: false,
|
|
237
|
+
public: true,
|
|
238
|
+
filterMode: 'namespaces',
|
|
239
|
+
...inOpt
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// Convert strings to regex's - we do this once here for efficiency
|
|
243
|
+
for ( const k of ['ifHaveGroup', 'ifHaveType'] ) {
|
|
244
|
+
if ( opt[k] ) {
|
|
245
|
+
if (Array.isArray(opt[k])) {
|
|
246
|
+
opt[k] = opt[k].map((r) => regexToString(ensureRegex(r)));
|
|
247
|
+
} else {
|
|
248
|
+
opt[k] = regexToString(ensureRegex(opt[k]));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
store.commit(`${ module }/product`, opt);
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
basicType(types, group) {
|
|
257
|
+
// Support passing in a map of types and using just the values
|
|
258
|
+
if ( !isArray(types) && types && isObject(types) ) {
|
|
259
|
+
types = Object.values(types);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
store.commit(`${ module }/basicType`, {
|
|
263
|
+
product, types, group
|
|
264
|
+
});
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
// Type- and Group-dependent
|
|
268
|
+
groupBy(type, field) {
|
|
269
|
+
store.commit(`${ module }/groupBy`, { type, field });
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
headers(type, headers, paginationHeaders = []) {
|
|
273
|
+
headers.forEach((header) => {
|
|
274
|
+
// If on the client, then use the value getter if there is one
|
|
275
|
+
if (header.getValue) {
|
|
276
|
+
// we need to store the .value prop for the advanced filtering
|
|
277
|
+
header.valueProp = header.value;
|
|
278
|
+
header.value = header.getValue;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
delete header.getValue;
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
store.commit(`${ module }/headers`, { type, headers });
|
|
285
|
+
store.commit(`${ module }/paginationHeaders`, { type, paginationHeaders });
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
hideBulkActions(type, field) {
|
|
289
|
+
store.commit(`${ module }/hideBulkActions`, { type, field });
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
configureType(match, options) {
|
|
293
|
+
if (options.graphConfig) {
|
|
294
|
+
graphConfigMap[match] = options.graphConfig;
|
|
295
|
+
delete options.graphConfig;
|
|
296
|
+
}
|
|
297
|
+
store.commit(`${ module }/configureType`, { ...options, match });
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
componentForType(match, replace) {
|
|
301
|
+
store.commit(`${ module }/componentForType`, { match, replace });
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
ignoreType(regexOrString) {
|
|
305
|
+
store.commit(`${ module }/ignoreType`, regexOrString);
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
ignoreGroup(regexOrString, cb) {
|
|
309
|
+
store.commit(`${ module }/ignoreGroup`, { regexOrString, cb });
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
weightGroup(input, weight, forBasic) {
|
|
313
|
+
if ( isArray(input) ) {
|
|
314
|
+
store.commit(`${ module }/weightGroup`, {
|
|
315
|
+
groups: input, weight, forBasic
|
|
316
|
+
});
|
|
317
|
+
} else {
|
|
318
|
+
store.commit(`${ module }/weightGroup`, {
|
|
319
|
+
group: input, weight, forBasic
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
setGroupDefaultType(input, defaultType) {
|
|
325
|
+
if ( isArray(input) ) {
|
|
326
|
+
store.commit(`${ module }/setGroupDefaultType`, { groups: input, defaultType });
|
|
327
|
+
} else {
|
|
328
|
+
store.commit(`${ module }/setGroupDefaultType`, { group: input, defaultType });
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
|
|
332
|
+
weightType(input, weight, forBasic) {
|
|
333
|
+
if ( isArray(input) ) {
|
|
334
|
+
store.commit(`${ module }/weightType`, {
|
|
335
|
+
types: input, weight, forBasic
|
|
336
|
+
});
|
|
337
|
+
} else {
|
|
338
|
+
store.commit(`${ module }/weightType`, {
|
|
339
|
+
type: input, weight, forBasic
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
|
|
344
|
+
mapGroup(match, replace, weight = 5, continueOnMatch = false) {
|
|
345
|
+
store.commit(`${ module }/mapGroup`, {
|
|
346
|
+
match, replace, weight, continueOnMatch
|
|
347
|
+
});
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
mapType(match, replace, weight = 5, continueOnMatch = false) {
|
|
351
|
+
store.commit(`${ module }/mapType`, {
|
|
352
|
+
match, replace, weight, continueOnMatch
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
moveType(match, group, weight = 5, continueOnMatch = false) {
|
|
357
|
+
store.commit(`${ module }/moveType`, {
|
|
358
|
+
match, group, weight,
|
|
359
|
+
});
|
|
360
|
+
},
|
|
361
|
+
|
|
362
|
+
virtualType(obj) {
|
|
363
|
+
store.commit(`${ module }/virtualType`, { product, obj });
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
spoofedType(obj) {
|
|
367
|
+
store.commit(`${ module }/spoofedType`, { product, obj });
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
let called = false;
|
|
373
|
+
|
|
374
|
+
export async function applyProducts(store, $plugin) {
|
|
375
|
+
if (called) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
called = true;
|
|
380
|
+
for ( const product of listProducts() ) {
|
|
381
|
+
const impl = await loadProduct(product);
|
|
382
|
+
|
|
383
|
+
if ( impl?.init ) {
|
|
384
|
+
impl.init(store);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
// Load the products from all plugins
|
|
388
|
+
$plugin.loadProducts();
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export function productsLoaded() {
|
|
392
|
+
return called;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export const state = function() {
|
|
396
|
+
return {
|
|
397
|
+
products: [],
|
|
398
|
+
virtualTypes: {},
|
|
399
|
+
spoofedTypes: {},
|
|
400
|
+
basicTypes: {},
|
|
401
|
+
groupIgnore: [],
|
|
402
|
+
groupWeights: {},
|
|
403
|
+
groupDefaultTypes: {},
|
|
404
|
+
basicGroupWeights: { [ROOT]: 1000 },
|
|
405
|
+
groupMappings: [],
|
|
406
|
+
typeIgnore: [],
|
|
407
|
+
basicTypeWeights: {},
|
|
408
|
+
typeWeights: {},
|
|
409
|
+
typeMappings: [],
|
|
410
|
+
typeMoveMappings: [],
|
|
411
|
+
typeToComponentMappings: [],
|
|
412
|
+
typeOptions: [],
|
|
413
|
+
groupBy: {},
|
|
414
|
+
headers: {},
|
|
415
|
+
paginationHeaders: {},
|
|
416
|
+
hideBulkActions: {},
|
|
417
|
+
schemaGeneration: 1,
|
|
418
|
+
cache: {
|
|
419
|
+
typeMove: {},
|
|
420
|
+
groupLabel: {},
|
|
421
|
+
ignore: {},
|
|
422
|
+
list: {},
|
|
423
|
+
chart: {},
|
|
424
|
+
detail: {},
|
|
425
|
+
edit: {},
|
|
426
|
+
componentFor: {},
|
|
427
|
+
promptRemove: {},
|
|
428
|
+
windowComponents: {},
|
|
429
|
+
'machine-config': {},
|
|
430
|
+
'cloud-credential': {}
|
|
431
|
+
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
export const getters = {
|
|
437
|
+
// ----------------------------------------------------------------------------
|
|
438
|
+
// 1 ) Getting info
|
|
439
|
+
// ----------------------------------------------------------------------------
|
|
440
|
+
// Turns a type name into a display label (e.g. management.cattle.io.cluster -> Cluster)
|
|
441
|
+
labelFor(state, getters, rootState, rootGetters) {
|
|
442
|
+
return (schema, count = 1, language = null) => {
|
|
443
|
+
return _applyMapping(schema, state.typeMappings, 'id', false, () => {
|
|
444
|
+
// i18n-uses typeLabel.*
|
|
445
|
+
const key = `typeLabel."${ schema.id.toLowerCase() }"`;
|
|
446
|
+
|
|
447
|
+
if ( rootGetters['i18n/exists'](key, language) ) {
|
|
448
|
+
return rootGetters['i18n/t'](key, { count }, language).trim();
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const out = schema?.attributes?.kind || schema.id || '?';
|
|
452
|
+
|
|
453
|
+
// Add spaces, but breaks typing names into jump menu naturally
|
|
454
|
+
// out = ucFirst(out.replace(/([a-z])([A-Z])/g,'$1 $2'));
|
|
455
|
+
|
|
456
|
+
if ( count === 1 ) {
|
|
457
|
+
return out;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// This works for most things... if you don't like it, put in a typeLabel translation for above.
|
|
461
|
+
return pluralize(out);
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
},
|
|
465
|
+
|
|
466
|
+
// Turns a group name into a display label (e.g. management.cattle.io.v3.cluster -> Cluster)
|
|
467
|
+
groupLabelFor(state) {
|
|
468
|
+
return (schemaOrName) => {
|
|
469
|
+
let group = schemaOrName;
|
|
470
|
+
|
|
471
|
+
if ( typeof schemaOrName === 'object' ) {
|
|
472
|
+
let moved = false;
|
|
473
|
+
|
|
474
|
+
for ( const rule of state.typeMoveMappings ) {
|
|
475
|
+
const re = stringToRegex(rule.match);
|
|
476
|
+
|
|
477
|
+
if ( schemaOrName.id.match(re) ) {
|
|
478
|
+
moved = true;
|
|
479
|
+
group = rule.replace;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if ( !moved ) {
|
|
484
|
+
group = group.attributes.group;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if ( typeof group !== 'string' ) {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const out = _applyMapping(group, state.groupMappings, null, state.cache.groupLabel, (group) => {
|
|
493
|
+
const match = group.match(/^(.*)\.k8s\.io$/);
|
|
494
|
+
|
|
495
|
+
if ( match ) {
|
|
496
|
+
return match[1].split(/\./).map((x) => ucFirst(x)).join('.');
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return group;
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
return out;
|
|
503
|
+
};
|
|
504
|
+
},
|
|
505
|
+
|
|
506
|
+
groupForBasicType(state) {
|
|
507
|
+
return (product, schemaId) => {
|
|
508
|
+
return state.basicTypes?.[product]?.[schemaId];
|
|
509
|
+
};
|
|
510
|
+
},
|
|
511
|
+
|
|
512
|
+
optionsFor(state, getters, rootState, rootGetters) {
|
|
513
|
+
const def = {
|
|
514
|
+
isCreatable: true,
|
|
515
|
+
isEditable: true,
|
|
516
|
+
isRemovable: true,
|
|
517
|
+
showState: true,
|
|
518
|
+
showAge: true,
|
|
519
|
+
canYaml: true,
|
|
520
|
+
namespaced: null,
|
|
521
|
+
listGroups: [],
|
|
522
|
+
listGroupsWillOverride: false,
|
|
523
|
+
listMandatorySort: null,
|
|
524
|
+
depaginate: false,
|
|
525
|
+
customRoute: undefined,
|
|
526
|
+
resourceEditMasthead: true,
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
return (schemaOrType, pagination) => {
|
|
530
|
+
// Note - This can run a LOT so needs to be performant
|
|
531
|
+
|
|
532
|
+
if (!schemaOrType) {
|
|
533
|
+
return {};
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
const type = (typeof schemaOrType === 'object' ? schemaOrType.id : schemaOrType);
|
|
537
|
+
const found = state.typeOptions.find((entry) => {
|
|
538
|
+
const re = stringToRegex(entry.match);
|
|
539
|
+
|
|
540
|
+
return re.test(type);
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
const opts = Object.assign({}, def, found || {});
|
|
544
|
+
|
|
545
|
+
// As this runs a lot, avoid anything we don't strictly need (like going out to another store)
|
|
546
|
+
if (!pagination) {
|
|
547
|
+
return opts;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const storeOptionsFor = schemaOrType?.$ctx?.getters?.['optionsFor'];
|
|
551
|
+
const storeOpts = storeOptionsFor ? storeOptionsFor({ getters, state }, {
|
|
552
|
+
schema: schemaOrType, pagination, opts
|
|
553
|
+
}) : {};
|
|
554
|
+
|
|
555
|
+
return {
|
|
556
|
+
...opts,
|
|
557
|
+
...storeOpts,
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
},
|
|
561
|
+
|
|
562
|
+
isFavorite(state, getters, rootState, rootGetters) {
|
|
563
|
+
return (schemaId) => {
|
|
564
|
+
return rootGetters['prefs/get'](FAVORITE_TYPES).includes(schemaId) || false;
|
|
565
|
+
};
|
|
566
|
+
},
|
|
567
|
+
|
|
568
|
+
typeWeightFor(state) {
|
|
569
|
+
return (type, forBasic) => {
|
|
570
|
+
type = type?.toLowerCase();
|
|
571
|
+
|
|
572
|
+
if ( forBasic ) {
|
|
573
|
+
return state.basicTypeWeights[type] || 0;
|
|
574
|
+
} else {
|
|
575
|
+
return state.typeWeights[type] || 0;
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
},
|
|
579
|
+
|
|
580
|
+
groupWeightFor(state) {
|
|
581
|
+
return (group, forBasic) => {
|
|
582
|
+
group = group.toLowerCase();
|
|
583
|
+
|
|
584
|
+
if ( forBasic ) {
|
|
585
|
+
return state.basicGroupWeights[group] || 0;
|
|
586
|
+
} else {
|
|
587
|
+
return state.groupWeights[group] || 0;
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
groupDefaultTypeFor(state) {
|
|
593
|
+
return (group) => {
|
|
594
|
+
group = group.toLowerCase();
|
|
595
|
+
|
|
596
|
+
return state.groupDefaultTypes[group];
|
|
597
|
+
};
|
|
598
|
+
},
|
|
599
|
+
|
|
600
|
+
getTree(state, getters, rootState, rootGetters) {
|
|
601
|
+
// Name the function so it's easily identifiable when performance tracing
|
|
602
|
+
return function getTree(productId, mode, allTypes, clusterId, namespaceMode, currentType, search) {
|
|
603
|
+
// getTree has four modes:
|
|
604
|
+
// - `basic` matches data types that should always be shown (even if there are 0 of them).
|
|
605
|
+
// - `used` matches the data types where there are more than 0 of them in the current set of namespaces.
|
|
606
|
+
// - `all` matches all types.
|
|
607
|
+
// - `favorite` matches starred types.
|
|
608
|
+
// namespaceMode: 'namespaced', 'cluster', or 'both'
|
|
609
|
+
// namespaces: null means all, otherwise it will be an array of specific namespaces to include
|
|
610
|
+
const isBasic = mode === TYPE_MODES.BASIC;
|
|
611
|
+
|
|
612
|
+
let searchRegex;
|
|
613
|
+
|
|
614
|
+
if ( search ) {
|
|
615
|
+
searchRegex = new RegExp(`^(.*)(${ escapeRegex(search) })(.*)$`, 'i');
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const root = { children: [] };
|
|
619
|
+
|
|
620
|
+
// Add types from shortest to longest so that parents
|
|
621
|
+
// get added before children
|
|
622
|
+
const keys = Object.keys(allTypes).sort((a, b) => a.length - b.length);
|
|
623
|
+
|
|
624
|
+
// Set these for later
|
|
625
|
+
const currentLocal = rootGetters['i18n/current']();
|
|
626
|
+
const defaultLocal = rootGetters['i18n/default']();
|
|
627
|
+
|
|
628
|
+
for ( const type of keys ) {
|
|
629
|
+
const typeObj = allTypes[type];
|
|
630
|
+
|
|
631
|
+
if ( typeObj.schema && getters.isIgnored(typeObj.schema) ) {
|
|
632
|
+
// Skip ignored groups & types
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
const namespaced = typeObj.namespaced;
|
|
637
|
+
|
|
638
|
+
if ( (namespaceMode === NAMESPACED && !namespaced ) || (namespaceMode === CLUSTER_LEVEL && namespaced) ) {
|
|
639
|
+
// Skip types that are not the right namespace mode
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
const inStore = rootGetters.currentStore(typeObj.name);
|
|
644
|
+
const count = rootGetters[`${ inStore }/count`](typeObj);
|
|
645
|
+
const groupForBasicType = getters.groupForBasicType(productId, typeObj.name);
|
|
646
|
+
|
|
647
|
+
if ( typeObj.id === currentType ) {
|
|
648
|
+
// If this is the type currently being shown, always show it
|
|
649
|
+
} else if ( isBasic && !groupForBasicType ) {
|
|
650
|
+
// If we want the basic tree only return basic types;
|
|
651
|
+
continue;
|
|
652
|
+
} else if ( mode === TYPE_MODES.USED && count <= 0 ) {
|
|
653
|
+
// If there's none of this type, ignore this entry when viewing only in-use types
|
|
654
|
+
// Note: count is sometimes null, in js `null <= 0` is `true`.
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
const label = typeObj.labelKey ? rootGetters['i18n/t'](typeObj.labelKey) || typeObj.label : typeObj.label;
|
|
659
|
+
|
|
660
|
+
const labelDisplay = highlightLabel(label, count, typeObj.schema);
|
|
661
|
+
|
|
662
|
+
if ( !labelDisplay ) {
|
|
663
|
+
// Search happens in highlight and returns null if not found
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
let group;
|
|
668
|
+
|
|
669
|
+
if ( isBasic ) {
|
|
670
|
+
group = _ensureGroup(root, groupForBasicType, true);
|
|
671
|
+
} else if ( mode === TYPE_MODES.FAVORITE ) {
|
|
672
|
+
group = _ensureGroup(root, 'starred');
|
|
673
|
+
group.weight = 1000;
|
|
674
|
+
} else if ( mode === TYPE_MODES.USED ) {
|
|
675
|
+
group = _ensureGroup(root, `inUse::${ getters.groupLabelFor(typeObj.schema) }`);
|
|
676
|
+
} else {
|
|
677
|
+
group = _ensureGroup(root, typeObj.schema || typeObj.group || ROOT);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
let route = typeObj.route;
|
|
681
|
+
|
|
682
|
+
// Make the default route if one isn't set
|
|
683
|
+
if (!route ) {
|
|
684
|
+
route = {
|
|
685
|
+
name: 'c-cluster-product-resource',
|
|
686
|
+
params: {
|
|
687
|
+
product: productId,
|
|
688
|
+
cluster: clusterId,
|
|
689
|
+
resource: typeObj.name,
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
typeObj.route = route;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// Cluster ID and Product should always be set
|
|
697
|
+
if ( route && typeof route === 'object' ) {
|
|
698
|
+
route.params = route.params || {};
|
|
699
|
+
route.params.cluster = clusterId;
|
|
700
|
+
route.params.product = productId;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
group.children.push({
|
|
704
|
+
label,
|
|
705
|
+
labelDisplay,
|
|
706
|
+
mode: typeObj.mode,
|
|
707
|
+
exact: typeObj.exact || false,
|
|
708
|
+
'exact-path': typeObj['exact-path'] || false,
|
|
709
|
+
namespaced,
|
|
710
|
+
route,
|
|
711
|
+
name: typeObj.name,
|
|
712
|
+
weight: typeObj.weight || getters.typeWeightFor(typeObj.schema?.id || label, isBasic),
|
|
713
|
+
overview: !!typeObj.overview,
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// Recursively sort the groups
|
|
718
|
+
_sortGroup(root, mode);
|
|
719
|
+
|
|
720
|
+
return root.children;
|
|
721
|
+
|
|
722
|
+
// ----------------------
|
|
723
|
+
|
|
724
|
+
function _ensureGroup(tree, schemaOrName, forBasic = false) {
|
|
725
|
+
let name = getters.groupLabelFor(schemaOrName);
|
|
726
|
+
const isRoot = ( name === ROOT || name.startsWith(`${ ROOT }::`) );
|
|
727
|
+
|
|
728
|
+
if ( name && name.includes('::') ) {
|
|
729
|
+
let parent;
|
|
730
|
+
|
|
731
|
+
[parent, name] = name.split('::', 2);
|
|
732
|
+
tree = _ensureGroup(tree, parent);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
// Translate if an entry exists
|
|
736
|
+
let label = name;
|
|
737
|
+
// i18n-uses nav.group.*
|
|
738
|
+
const key = `nav.group."${ name }"`;
|
|
739
|
+
|
|
740
|
+
if ( rootGetters['i18n/exists'](key) ) {
|
|
741
|
+
label = rootGetters['i18n/t'](key);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
let group = findBy(tree.children, 'name', name);
|
|
745
|
+
|
|
746
|
+
if ( !group ) {
|
|
747
|
+
group = {
|
|
748
|
+
name,
|
|
749
|
+
label,
|
|
750
|
+
weight: getters.groupWeightFor(name, forBasic),
|
|
751
|
+
defaultType: getters.groupDefaultTypeFor(name),
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
tree.children.push(group);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if ( isRoot ) {
|
|
758
|
+
group.isRoot = true;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
if ( !group.children ) {
|
|
762
|
+
group.children = [];
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
return group;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
function highlightLabel(original, count, schema) {
|
|
769
|
+
let label = escapeHtml(original);
|
|
770
|
+
|
|
771
|
+
if ( searchRegex ) {
|
|
772
|
+
let match = label.match(searchRegex);
|
|
773
|
+
|
|
774
|
+
if (!match) {
|
|
775
|
+
if ( currentLocal !== defaultLocal && schema ) {
|
|
776
|
+
const defaultLabel = getters.labelFor(schema, count, defaultLocal);
|
|
777
|
+
|
|
778
|
+
if (defaultLabel && defaultLabel !== label ) {
|
|
779
|
+
label += ` (${ defaultLabel })`;
|
|
780
|
+
match = label.match(searchRegex);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
if ( match ) {
|
|
786
|
+
label = `${ escapeHtml(match[1]) }<span class="highlight">${ escapeHtml(match[2]) }</span>${ escapeHtml(match[3]) }`;
|
|
787
|
+
} else {
|
|
788
|
+
return null;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return label;
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
},
|
|
796
|
+
|
|
797
|
+
isSpoofed(state, getters, rootState, rootGetters) {
|
|
798
|
+
return (type, product) => {
|
|
799
|
+
product = product || rootGetters['productId'];
|
|
800
|
+
const productSpoofedTypes = state.spoofedTypes[product] || [];
|
|
801
|
+
|
|
802
|
+
return productSpoofedTypes.some((st) => st.type === type);
|
|
803
|
+
};
|
|
804
|
+
},
|
|
805
|
+
|
|
806
|
+
isVirtual(state, getters, rootState, rootGetters) {
|
|
807
|
+
return (name, product) => {
|
|
808
|
+
product = product || rootGetters['productId'];
|
|
809
|
+
const productVirtualTypes = state.virtualTypes[product] || [];
|
|
810
|
+
|
|
811
|
+
return productVirtualTypes.some((st) => st.name === name);
|
|
812
|
+
};
|
|
813
|
+
},
|
|
814
|
+
|
|
815
|
+
getSpoofedInstances(state, getters, rootState, rootGetters) {
|
|
816
|
+
return async(type, product) => {
|
|
817
|
+
product = product || rootGetters['productId'];
|
|
818
|
+
const getInstances = instanceMethods[product]?.[type] || (() => []);
|
|
819
|
+
const instances = await getInstances();
|
|
820
|
+
|
|
821
|
+
instances.forEach((instance) => {
|
|
822
|
+
const type = instance.type;
|
|
823
|
+
const id = instance.id;
|
|
824
|
+
const link = `/${ SPOOFED_PREFIX }/${ type }/${ id }`;
|
|
825
|
+
const apiLink = `/${ SPOOFED_API_PREFIX }/${ type }/${ id }`;
|
|
826
|
+
|
|
827
|
+
instance.links = {
|
|
828
|
+
remove: instance.links?.remove || link,
|
|
829
|
+
self: instance.links?.self || link,
|
|
830
|
+
update: instance.links?.update || link,
|
|
831
|
+
view: instance.links?.view || apiLink,
|
|
832
|
+
};
|
|
833
|
+
instance.isSpoofed = true;
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
return instances;
|
|
837
|
+
};
|
|
838
|
+
},
|
|
839
|
+
|
|
840
|
+
getSpoofedInstance(state, getters, rootState, rootGetters) {
|
|
841
|
+
return async(type, product, id) => {
|
|
842
|
+
const productInstances = await getters.getSpoofedInstances(type, product);
|
|
843
|
+
|
|
844
|
+
return productInstances.find( (instance) => instance.id === id);
|
|
845
|
+
};
|
|
846
|
+
},
|
|
847
|
+
|
|
848
|
+
allSpoofedTypes(state, getters, rootState, rootGetters) {
|
|
849
|
+
return Object.values(state.spoofedTypes).flat();
|
|
850
|
+
},
|
|
851
|
+
|
|
852
|
+
spoofedSchemas(state, getters, rootState, rootGetters) {
|
|
853
|
+
return (product) => {
|
|
854
|
+
const types = state.spoofedTypes[product] || [];
|
|
855
|
+
|
|
856
|
+
return types.flatMap((type) => {
|
|
857
|
+
const schemas = type.schemas || [];
|
|
858
|
+
|
|
859
|
+
return schemas.map((schema) => ({
|
|
860
|
+
...schema,
|
|
861
|
+
isSpoofed: true
|
|
862
|
+
}));
|
|
863
|
+
});
|
|
864
|
+
};
|
|
865
|
+
},
|
|
866
|
+
|
|
867
|
+
allSpoofedSchemas(state, getters, rootState, rootGetters) {
|
|
868
|
+
return getters.allSpoofedTypes.flatMap((type) => {
|
|
869
|
+
const schemas = type.schemas || [];
|
|
870
|
+
|
|
871
|
+
return schemas.map((schema) => ({
|
|
872
|
+
...schema,
|
|
873
|
+
isSpoofed: true
|
|
874
|
+
}));
|
|
875
|
+
});
|
|
876
|
+
},
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Given many things, create a list of menu items per schema given the mode
|
|
880
|
+
*/
|
|
881
|
+
allTypes(state, getters, rootState, rootGetters) {
|
|
882
|
+
// Name the function so it's easily identifiable when performance tracing
|
|
883
|
+
return function allTypes(product, modes = [TYPE_MODES.ALL]) {
|
|
884
|
+
const module = state.products.find((p) => p.name === product)?.inStore;
|
|
885
|
+
const schemas = rootGetters[`${ module }/all`](SCHEMA);
|
|
886
|
+
const isLocal = !rootGetters.currentCluster?.isLocal;
|
|
887
|
+
const isRancher = rootGetters.isRancher;
|
|
888
|
+
const counts = rootGetters[`${ module }/all`](COUNT)?.[0]?.counts || {};
|
|
889
|
+
|
|
890
|
+
const out = {};
|
|
891
|
+
|
|
892
|
+
// For performance reasons this must be super quick to iterate over.
|
|
893
|
+
// For each schema...
|
|
894
|
+
// 1) Determine if it's applicable given the mode
|
|
895
|
+
// 2) For each applicable mode create a `Type` entry
|
|
896
|
+
for ( const schema of schemas ) {
|
|
897
|
+
let schemaModes = { };
|
|
898
|
+
|
|
899
|
+
modes.forEach((m) => {
|
|
900
|
+
schemaModes[m] = true;
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
const attrs = schema.attributes || {};
|
|
904
|
+
const typeOptions = getters['optionsFor'](schema);
|
|
905
|
+
|
|
906
|
+
schemaModes[TYPE_MODES.BASIC] = schemaModes[TYPE_MODES.BASIC] && getters.groupForBasicType(product, schema.id);
|
|
907
|
+
|
|
908
|
+
if (Object.values(schemaModes).every((s) => !s)) {
|
|
909
|
+
continue;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
schemaModes[TYPE_MODES.FAVORITE] = schemaModes[TYPE_MODES.FAVORITE] && getters.isFavorite(schema.id);
|
|
913
|
+
|
|
914
|
+
if (Object.values(schemaModes).every((s) => !s)) {
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
const onlyBasic = schemaModes[TYPE_MODES.BASIC] && modes.length === 1;
|
|
919
|
+
|
|
920
|
+
// This clause is only valid for non-basic modes. So if we have only basic... skip it
|
|
921
|
+
if (!onlyBasic) {
|
|
922
|
+
const invalidType = !attrs.kind ||
|
|
923
|
+
(typeof typeOptions.ifRancherCluster !== 'undefined' && typeOptions.ifRancherCluster !== isRancher) ||
|
|
924
|
+
(typeOptions.localOnly && isLocal);
|
|
925
|
+
|
|
926
|
+
if (invalidType) {
|
|
927
|
+
// Remove anything not basic
|
|
928
|
+
schemaModes = { [TYPE_MODES.BASIC]: schemaModes[TYPE_MODES.BASIC] };
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// This is an expensive request to make, so only do it if we really need to
|
|
933
|
+
let label;
|
|
934
|
+
|
|
935
|
+
Object.entries(schemaModes).forEach(([mode, enabled]) => {
|
|
936
|
+
if (!enabled) {
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
if (!out[mode]) {
|
|
941
|
+
out[mode] = {};
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
if (!label) {
|
|
945
|
+
label = getters.labelFor(schema, counts[schema.id]);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
out[mode][schema.id] = {
|
|
949
|
+
label,
|
|
950
|
+
mode,
|
|
951
|
+
weight: getters.typeWeightFor(schema?.id || label, mode === TYPE_MODES.BASIC),
|
|
952
|
+
schema,
|
|
953
|
+
name: schema.id,
|
|
954
|
+
namespaced: typeOptions.namespaced === null ? attrs.namespaced : typeOptions.namespaced,
|
|
955
|
+
route: typeOptions.customRoute
|
|
956
|
+
};
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
const nonUsedModes = modes.filter((m) => m !== TYPE_MODES.USED);
|
|
961
|
+
const isDev = rootGetters['prefs/get'](VIEW_IN_API);
|
|
962
|
+
|
|
963
|
+
// Add virtual and spoofed types
|
|
964
|
+
if ( nonUsedModes.length ) {
|
|
965
|
+
const virtualTypes = state.virtualTypes[product] || [];
|
|
966
|
+
const spoofedTypes = state.spoofedTypes[product] || [];
|
|
967
|
+
const allTypes = [...virtualTypes, ...spoofedTypes];
|
|
968
|
+
|
|
969
|
+
for ( const type of allTypes ) {
|
|
970
|
+
const item = clone(type);
|
|
971
|
+
const id = item.name;
|
|
972
|
+
const virtSpoofedModes = [...nonUsedModes];
|
|
973
|
+
|
|
974
|
+
// Is there a virtual/spoofed type override for schema type?
|
|
975
|
+
// Currently used by harvester, this should be investigated and removed if possible
|
|
976
|
+
virtSpoofedModes.forEach((mode) => {
|
|
977
|
+
if (out[mode]?.[id]) {
|
|
978
|
+
delete out[mode][id];
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
|
|
982
|
+
if ( item['public'] === false && !isDev ) {
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
if (item.ifHave && !ifHave(rootGetters, item.ifHave)) {
|
|
987
|
+
continue;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
if ( item.ifHaveType ) {
|
|
991
|
+
const ifHaveTypeArray = Array.isArray(item.ifHaveType) ? item.ifHaveType : [item.ifHaveType];
|
|
992
|
+
let satisfiesIfHave = true;
|
|
993
|
+
|
|
994
|
+
// Support an array of required types that the user must have access to
|
|
995
|
+
for (let i = 0; i < ifHaveTypeArray.length; i++) {
|
|
996
|
+
const ifHaveType = ifHaveTypeArray[i];
|
|
997
|
+
const targetedSchemas = typeof ifHaveType === 'string' ? schemas : rootGetters[`${ ifHaveType.store }/all`](SCHEMA);
|
|
998
|
+
const type = typeof ifHaveType === 'string' ? ifHaveType : ifHaveType?.type;
|
|
999
|
+
|
|
1000
|
+
const haveIds = filterBy(targetedSchemas, 'id', normalizeType(type)).map((s) => s.id);
|
|
1001
|
+
|
|
1002
|
+
if (!haveIds.length) {
|
|
1003
|
+
satisfiesIfHave = false;
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (item.ifHaveVerb && !ifHaveVerb(rootGetters, module, item.ifHaveVerb, haveIds)) {
|
|
1008
|
+
satisfiesIfHave = false;
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if (!satisfiesIfHave) {
|
|
1014
|
+
continue;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
if ( item.ifHaveSubTypes ) {
|
|
1019
|
+
const hasSome = (item.ifHaveSubTypes || []).some((type) => {
|
|
1020
|
+
return !!findBy(schemas, 'id', normalizeType(type));
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
if (!hasSome) {
|
|
1024
|
+
continue;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
if ( typeof item.ifRancherCluster !== 'undefined' && item.ifRancherCluster !== rootGetters.isRancher ) {
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
if (item.ifFeature) {
|
|
1033
|
+
if (item.ifFeature[0] === '!') {
|
|
1034
|
+
const feature = item.ifFeature.replace('!', '');
|
|
1035
|
+
|
|
1036
|
+
if (rootGetters['features/get'](feature)) {
|
|
1037
|
+
continue;
|
|
1038
|
+
}
|
|
1039
|
+
} else {
|
|
1040
|
+
if (!rootGetters['features/get'](item.ifFeature)) {
|
|
1041
|
+
continue;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
if (virtSpoofedModes.includes(TYPE_MODES.BASIC) && !getters.groupForBasicType(product, id) ) {
|
|
1047
|
+
virtSpoofedModes.splice(virtSpoofedModes.indexOf(TYPE_MODES.BASIC), 1);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
if (virtSpoofedModes.includes(TYPE_MODES.FAVORITE) && !getters.isFavorite(id) ) { // mode === TYPE_MODES.FAVORITE &&
|
|
1051
|
+
virtSpoofedModes.splice(virtSpoofedModes.indexOf(TYPE_MODES.FAVORITE), 1);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
// Ensure labelKey is taken into account... with a mock count
|
|
1055
|
+
// This is harmless if the translation doesn't require count
|
|
1056
|
+
if (item.labelKey && rootGetters['i18n/exists'](item.labelKey)) {
|
|
1057
|
+
item.label = rootGetters['i18n/t'](item.labelKey, { count: 2 }).trim();
|
|
1058
|
+
delete item.labelKey; // Label should really take precedence over labelKey, but it doesn't, so remove it
|
|
1059
|
+
} else {
|
|
1060
|
+
item.label = item.label || item.name;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
virtSpoofedModes.forEach((mode) => {
|
|
1064
|
+
const isBasic = mode === TYPE_MODES.BASIC;
|
|
1065
|
+
const weight = type.weight || getters.typeWeightFor(item.label, isBasic);
|
|
1066
|
+
|
|
1067
|
+
item.mode = mode;
|
|
1068
|
+
item.weight = weight;
|
|
1069
|
+
if (!out[mode]) {
|
|
1070
|
+
out[mode] = {};
|
|
1071
|
+
}
|
|
1072
|
+
out[mode][id] = item;
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
return out;
|
|
1078
|
+
};
|
|
1079
|
+
},
|
|
1080
|
+
|
|
1081
|
+
groupByFor(state) {
|
|
1082
|
+
return (schema) => {
|
|
1083
|
+
return state.groupBy[schema?.id];
|
|
1084
|
+
};
|
|
1085
|
+
},
|
|
1086
|
+
|
|
1087
|
+
hideBulkActionsFor(state) {
|
|
1088
|
+
return (schema) => {
|
|
1089
|
+
return state.hideBulkActions[schema.id];
|
|
1090
|
+
};
|
|
1091
|
+
},
|
|
1092
|
+
|
|
1093
|
+
headersFor(state, getters, rootState, rootGetters) {
|
|
1094
|
+
return (schema, pagination) => {
|
|
1095
|
+
if (pagination) {
|
|
1096
|
+
const storeHeadersFor = schema?.$ctx?.getters?.['headersFor'];
|
|
1097
|
+
|
|
1098
|
+
if (storeHeadersFor) {
|
|
1099
|
+
const res = storeHeadersFor({ getters, state }, { schema, pagination });
|
|
1100
|
+
|
|
1101
|
+
if (res) {
|
|
1102
|
+
return res;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
return createHeaders({ rootGetters }, {
|
|
1108
|
+
headers: state.headers,
|
|
1109
|
+
typeOptions: getters['optionsFor'](schema, false),
|
|
1110
|
+
schema,
|
|
1111
|
+
columns: {
|
|
1112
|
+
state: STATE,
|
|
1113
|
+
name: NAME,
|
|
1114
|
+
namespace: NAMESPACE_COL,
|
|
1115
|
+
age: AGE,
|
|
1116
|
+
},
|
|
1117
|
+
pagination
|
|
1118
|
+
});
|
|
1119
|
+
};
|
|
1120
|
+
},
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Simple getter to fetch pre-configured headers used in pagination
|
|
1124
|
+
*/
|
|
1125
|
+
configuredPaginationHeaders(state) {
|
|
1126
|
+
return (schemaOrType) => state.paginationHeaders?.[schemaOrType.id || schemaOrType];
|
|
1127
|
+
},
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Simple getter to fetch pre-configured headers (not used in paginated lists)
|
|
1131
|
+
*/
|
|
1132
|
+
configuredHeaders(state) {
|
|
1133
|
+
return (schemaOrType) => state.headers?.[schemaOrType.id || schemaOrType];
|
|
1134
|
+
},
|
|
1135
|
+
|
|
1136
|
+
// ------------------------------------
|
|
1137
|
+
// Custom list/detail/edit/header component detection
|
|
1138
|
+
//
|
|
1139
|
+
// Note: you can't refactor these into one function that does `@/${kind}/${type}`,
|
|
1140
|
+
// because babel needs some hardcoded idea where to look for the dependency.
|
|
1141
|
+
//
|
|
1142
|
+
// Note 2: Yes these are editing state in a getter for caching... it's ok, probably.
|
|
1143
|
+
// ------------------------------------
|
|
1144
|
+
hasCustomList(state, getters, rootState) {
|
|
1145
|
+
return (rawType) => {
|
|
1146
|
+
const key = getters.componentFor(rawType);
|
|
1147
|
+
|
|
1148
|
+
return hasCustom(state, rootState, 'list', key, (key) => resolveList(key));
|
|
1149
|
+
};
|
|
1150
|
+
},
|
|
1151
|
+
|
|
1152
|
+
hasCustomChart(state, getters, rootState) {
|
|
1153
|
+
return (rawType) => {
|
|
1154
|
+
const key = getters.componentFor(rawType);
|
|
1155
|
+
|
|
1156
|
+
return hasCustom(state, rootState, 'chart', key, (key) => resolveChart(key));
|
|
1157
|
+
};
|
|
1158
|
+
},
|
|
1159
|
+
|
|
1160
|
+
hasCustomDetail(state, getters, rootState) {
|
|
1161
|
+
return (rawType, subType) => {
|
|
1162
|
+
const key = getters.componentFor(rawType, subType);
|
|
1163
|
+
|
|
1164
|
+
return hasCustom(state, rootState, 'detail', key, (key) => resolveDetail(key));
|
|
1165
|
+
};
|
|
1166
|
+
},
|
|
1167
|
+
|
|
1168
|
+
hasGraph(state, getters) {
|
|
1169
|
+
return (resource) => {
|
|
1170
|
+
const typeOptions = getters['optionsFor'](resource);
|
|
1171
|
+
|
|
1172
|
+
if (typeOptions && typeOptions.hasGraph) {
|
|
1173
|
+
return graphConfigMap[resource];
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
return null;
|
|
1177
|
+
};
|
|
1178
|
+
},
|
|
1179
|
+
|
|
1180
|
+
hasCustomEdit(state, getters, rootState) {
|
|
1181
|
+
return (rawType, subType) => {
|
|
1182
|
+
const key = getters.componentFor(rawType, subType);
|
|
1183
|
+
|
|
1184
|
+
return hasCustom(state, rootState, 'edit', key, (key) => resolveEdit(key));
|
|
1185
|
+
};
|
|
1186
|
+
},
|
|
1187
|
+
|
|
1188
|
+
hasComponent(state, getters, rootState) {
|
|
1189
|
+
return (path) => {
|
|
1190
|
+
return hasCustom(state, rootState, 'edit', path, (path) => resolveEdit(path));
|
|
1191
|
+
};
|
|
1192
|
+
},
|
|
1193
|
+
|
|
1194
|
+
hasCustomPromptRemove(state, getters, rootState) {
|
|
1195
|
+
return (rawType, subType) => {
|
|
1196
|
+
const key = getters.componentFor(rawType, subType);
|
|
1197
|
+
|
|
1198
|
+
return hasCustom(state, rootState, 'promptRemove', key, () => require.resolve(`@shell/promptRemove/${ key }`));
|
|
1199
|
+
};
|
|
1200
|
+
},
|
|
1201
|
+
|
|
1202
|
+
hasCustomWindowComponent(state, getters, rootState) {
|
|
1203
|
+
return (rawType, subType) => {
|
|
1204
|
+
const key = getters.componentFor(rawType, subType);
|
|
1205
|
+
|
|
1206
|
+
return hasCustom(state, rootState, 'windowComponents', key, (key) => resolveWindowComponent(key));
|
|
1207
|
+
};
|
|
1208
|
+
},
|
|
1209
|
+
|
|
1210
|
+
hasCustomMachineConfigComponent(state, getters, rootState) {
|
|
1211
|
+
return (rawType, subType) => {
|
|
1212
|
+
const key = getters.componentFor(rawType, subType);
|
|
1213
|
+
|
|
1214
|
+
return hasCustom(state, rootState, 'machine-config', key, (key) => resolveMachineConfigComponent(key));
|
|
1215
|
+
};
|
|
1216
|
+
},
|
|
1217
|
+
|
|
1218
|
+
hasCustomCloudCredentialComponent(state, getters, rootState) {
|
|
1219
|
+
return (rawType, subType) => {
|
|
1220
|
+
const key = getters.componentFor(rawType, subType);
|
|
1221
|
+
|
|
1222
|
+
return hasCustom(state, rootState, 'cloud-credential', key, (key) => resolveCloudCredentialComponent(key));
|
|
1223
|
+
};
|
|
1224
|
+
},
|
|
1225
|
+
|
|
1226
|
+
importComponent(state, getters) {
|
|
1227
|
+
return (path) => {
|
|
1228
|
+
return importEdit(path);
|
|
1229
|
+
};
|
|
1230
|
+
},
|
|
1231
|
+
|
|
1232
|
+
importDialog(state, getters, rootState) {
|
|
1233
|
+
return (rawType, subType) => {
|
|
1234
|
+
return loadExtension(rootState, 'dialog', getters.componentFor(rawType, subType), importDialog);
|
|
1235
|
+
};
|
|
1236
|
+
},
|
|
1237
|
+
|
|
1238
|
+
importList(state, getters, rootState) {
|
|
1239
|
+
return (rawType) => {
|
|
1240
|
+
return loadExtension(rootState, 'list', getters.componentFor(rawType), importList);
|
|
1241
|
+
};
|
|
1242
|
+
},
|
|
1243
|
+
|
|
1244
|
+
importChart(state, getters, rootState) {
|
|
1245
|
+
return (rawType) => {
|
|
1246
|
+
return loadExtension(rootState, 'chart', getters.componentFor(rawType), importChart);
|
|
1247
|
+
};
|
|
1248
|
+
},
|
|
1249
|
+
|
|
1250
|
+
importDetail(state, getters, rootState) {
|
|
1251
|
+
return (rawType, subType) => {
|
|
1252
|
+
return loadExtension(rootState, 'detail', getters.componentFor(rawType, subType), importDetail);
|
|
1253
|
+
};
|
|
1254
|
+
},
|
|
1255
|
+
|
|
1256
|
+
importEdit(state, getters, rootState) {
|
|
1257
|
+
return (rawType, subType) => {
|
|
1258
|
+
return loadExtension(rootState, 'edit', getters.componentFor(rawType, subType), importEdit);
|
|
1259
|
+
};
|
|
1260
|
+
},
|
|
1261
|
+
|
|
1262
|
+
importCustomPromptRemove(state, getters, rootState) {
|
|
1263
|
+
return (rawType, subType) => {
|
|
1264
|
+
return loadExtension(rootState, 'promptRemove', getters.componentFor(rawType, subType), importCustomPromptRemove);
|
|
1265
|
+
};
|
|
1266
|
+
},
|
|
1267
|
+
|
|
1268
|
+
importWindowComponent(state, getters, rootState) {
|
|
1269
|
+
return (rawType, subType) => {
|
|
1270
|
+
return loadExtension(rootState, 'windowComponents', getters.componentFor(rawType, subType), importWindowComponent);
|
|
1271
|
+
};
|
|
1272
|
+
},
|
|
1273
|
+
|
|
1274
|
+
importLogin(state, getters, rootState) {
|
|
1275
|
+
return (authType) => {
|
|
1276
|
+
return loadExtension(rootState, 'login', authType, importLogin);
|
|
1277
|
+
};
|
|
1278
|
+
},
|
|
1279
|
+
|
|
1280
|
+
importMachineConfig(state, getters, rootState) {
|
|
1281
|
+
return (rawType, subType) => {
|
|
1282
|
+
return loadExtension(rootState, 'machine-config', getters.componentFor(rawType, subType), importMachineConfig);
|
|
1283
|
+
};
|
|
1284
|
+
},
|
|
1285
|
+
|
|
1286
|
+
importCloudCredential(state, getters, rootState) {
|
|
1287
|
+
return (rawType, subType) => {
|
|
1288
|
+
return loadExtension(rootState, 'cloud-credential', getters.componentFor(rawType, subType), importCloudCredential);
|
|
1289
|
+
};
|
|
1290
|
+
},
|
|
1291
|
+
|
|
1292
|
+
componentFor(state, getters) {
|
|
1293
|
+
return (type, subType) => {
|
|
1294
|
+
let key = type;
|
|
1295
|
+
|
|
1296
|
+
if ( subType ) {
|
|
1297
|
+
key = `${ type }/${ subType }`;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
if ( state.cache.componentFor[key] !== undefined ) {
|
|
1301
|
+
return state.cache.componentFor[key];
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
let out = type;
|
|
1305
|
+
|
|
1306
|
+
const mapping = state.typeToComponentMappings.find((mapping) => {
|
|
1307
|
+
const re = stringToRegex(mapping.match);
|
|
1308
|
+
|
|
1309
|
+
return re.test(key);
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
if ( mapping ) {
|
|
1313
|
+
out = mapping.replace;
|
|
1314
|
+
} else if ( subType ) {
|
|
1315
|
+
// Try again without the subType
|
|
1316
|
+
out = getters.componentFor(type);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
state.cache.componentFor[key] = out;
|
|
1320
|
+
|
|
1321
|
+
return out;
|
|
1322
|
+
};
|
|
1323
|
+
},
|
|
1324
|
+
|
|
1325
|
+
isIgnored(state, getters, rootState, rootGetters) {
|
|
1326
|
+
return (schema) => {
|
|
1327
|
+
let out = false;
|
|
1328
|
+
|
|
1329
|
+
for ( const rule of state.groupIgnore ) {
|
|
1330
|
+
const group = schema?.attributes?.group;
|
|
1331
|
+
|
|
1332
|
+
if (group && group.match(stringToRegex(rule.type) && isObject(rule) && rule.type)) {
|
|
1333
|
+
out = rule.cb(rootGetters);
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
if ( group && typeof rule === 'string' && group.match(stringToRegex(rule)) ) {
|
|
1338
|
+
out = true;
|
|
1339
|
+
break;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
if ( !out ) {
|
|
1344
|
+
for ( const rule of state.typeIgnore ) {
|
|
1345
|
+
if ( schema.id.match(stringToRegex(rule)) ) {
|
|
1346
|
+
out = true;
|
|
1347
|
+
break;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
state.cache.ignore[schema.id] = out;
|
|
1353
|
+
|
|
1354
|
+
return out;
|
|
1355
|
+
};
|
|
1356
|
+
},
|
|
1357
|
+
|
|
1358
|
+
activeProducts(state, getters, rootState, rootGetters) {
|
|
1359
|
+
const knownTypes = {};
|
|
1360
|
+
const knownGroups = {};
|
|
1361
|
+
const isDev = rootGetters['prefs/get'](VIEW_IN_API);
|
|
1362
|
+
|
|
1363
|
+
if ( state.schemaGeneration < 0 ) {
|
|
1364
|
+
// This does nothing, but makes activeProducts depend on schemaGeneration
|
|
1365
|
+
// so that it can be used to update the product list on schema change.
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
return state.products.filter((p) => {
|
|
1370
|
+
const module = p.inStore;
|
|
1371
|
+
|
|
1372
|
+
if ( p['public'] === false && !isDev ) {
|
|
1373
|
+
return false;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
if ( p.ifGetter && !rootGetters[p.ifGetter] ) {
|
|
1377
|
+
return false;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
if ( !knownTypes[module] ) {
|
|
1381
|
+
const schemas = rootGetters[`${ module }/all`](SCHEMA);
|
|
1382
|
+
|
|
1383
|
+
knownTypes[module] = [];
|
|
1384
|
+
knownGroups[module] = [];
|
|
1385
|
+
|
|
1386
|
+
for ( const s of schemas ) {
|
|
1387
|
+
knownTypes[module].push(s._id);
|
|
1388
|
+
|
|
1389
|
+
if ( s._group ) {
|
|
1390
|
+
addObject(knownGroups[module], s._group);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
if ( p.ifFeature) {
|
|
1396
|
+
const features = Array.isArray(p.ifFeature) ? p.ifFeature : [p.ifFeature];
|
|
1397
|
+
|
|
1398
|
+
for (const f of features) {
|
|
1399
|
+
if (!rootGetters['features/get'](f)) {
|
|
1400
|
+
return false;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
if ( p.ifHave && !ifHave(rootGetters, p.ifHave)) {
|
|
1406
|
+
return false;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
if ( p.ifHaveType ) {
|
|
1410
|
+
const haveIds = knownTypes[module].filter((t) => t.match(stringToRegex(p.ifHaveType)) );
|
|
1411
|
+
|
|
1412
|
+
if ( !haveIds.length ) {
|
|
1413
|
+
return false;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
if ( p.ifHaveVerb && !ifHaveVerb(rootGetters, module, p.ifHaveVerb, haveIds)) {
|
|
1417
|
+
return false;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
if ( p.ifHaveGroup && !knownGroups[module].find((t) => t.match(stringToRegex(p.ifHaveGroup)) ) ) {
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
return true;
|
|
1426
|
+
});
|
|
1427
|
+
},
|
|
1428
|
+
|
|
1429
|
+
isProductActive(state, getters) {
|
|
1430
|
+
return (name) => {
|
|
1431
|
+
if ( findBy(getters['activeProducts'], 'name', name) ) {
|
|
1432
|
+
return true;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
return false;
|
|
1436
|
+
};
|
|
1437
|
+
},
|
|
1438
|
+
|
|
1439
|
+
rowValueGetter(state) {
|
|
1440
|
+
return (schema, colName) => {
|
|
1441
|
+
const col = _findColumnByName(schema, colName);
|
|
1442
|
+
|
|
1443
|
+
return rowValueGetter(col);
|
|
1444
|
+
};
|
|
1445
|
+
},
|
|
1446
|
+
|
|
1447
|
+
isProductRegistered(state) {
|
|
1448
|
+
return (productName) => {
|
|
1449
|
+
const prod = state.products.find((p) => p.name === productName);
|
|
1450
|
+
|
|
1451
|
+
return !!prod;
|
|
1452
|
+
};
|
|
1453
|
+
},
|
|
1454
|
+
|
|
1455
|
+
productByName(state) {
|
|
1456
|
+
return (productName) => state.products.find((p) => p.name === productName);
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1460
|
+
export const mutations = {
|
|
1461
|
+
schemaChanged(state) {
|
|
1462
|
+
state.schemaGeneration = state.schemaGeneration + 1;
|
|
1463
|
+
},
|
|
1464
|
+
|
|
1465
|
+
// Remove the specified product
|
|
1466
|
+
remove(state, { product, plugin }) {
|
|
1467
|
+
const existing = state.products.findIndex((p) => p.name === product);
|
|
1468
|
+
|
|
1469
|
+
// Remove the product
|
|
1470
|
+
if (existing !== -1) {
|
|
1471
|
+
state.products.splice(existing, 1);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
// Go through the basic types and remove the headers
|
|
1475
|
+
if (state.virtualTypes[product]) {
|
|
1476
|
+
delete state.virtualTypes[product];
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
if (state.basicTypes[product]) {
|
|
1480
|
+
// Remove table header configuration
|
|
1481
|
+
Object.keys(state.basicTypes[product]).forEach((type) => {
|
|
1482
|
+
delete state.headers[type];
|
|
1483
|
+
delete state.basicTypeWeights[type];
|
|
1484
|
+
delete state.cache.ignore[type];
|
|
1485
|
+
// These track whether the type has a custom component
|
|
1486
|
+
delete state.cache.detail[type];
|
|
1487
|
+
delete state.cache.edit[type];
|
|
1488
|
+
delete state.cache.list[type];
|
|
1489
|
+
|
|
1490
|
+
// Delete all of the entries from the componentFor cache where the valye is the type
|
|
1491
|
+
// Can do this more efficiently
|
|
1492
|
+
Object.keys(state.cache.componentFor).forEach((k) => {
|
|
1493
|
+
const v = state.cache.componentFor[k];
|
|
1494
|
+
|
|
1495
|
+
if (v === type) {
|
|
1496
|
+
delete state.cache.componentFor[k];
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
});
|
|
1500
|
+
|
|
1501
|
+
delete state.basicTypes[product];
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
if (plugin) {
|
|
1505
|
+
// kind is list, edit, detail etc
|
|
1506
|
+
Object.keys(plugin.types).forEach((kind) => {
|
|
1507
|
+
if (state.cache[kind]) {
|
|
1508
|
+
Object.keys(plugin.types[kind]).forEach((type) => {
|
|
1509
|
+
delete state.cache[kind][type];
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
|
|
1516
|
+
product(state, obj) {
|
|
1517
|
+
let existing = state.products.find((p) => p.name === obj.name);
|
|
1518
|
+
|
|
1519
|
+
if ( existing ) {
|
|
1520
|
+
Object.assign(existing, obj);
|
|
1521
|
+
} else {
|
|
1522
|
+
addObject(state.products, obj);
|
|
1523
|
+
existing = state.products.find((p) => p.name === obj.name);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
// Make sure deprecated `inExplorer` is synchronized with `rootProduct` (and vice-versa)
|
|
1527
|
+
if (existing?.inExplorer) {
|
|
1528
|
+
existing.rootProduct = EXPLORER;
|
|
1529
|
+
} else if (existing?.rootProduct === EXPLORER) {
|
|
1530
|
+
existing.inExplorer = true;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
// We make an assumption that if the store for a product is 'cluster' it will be displayed within cluster explorer
|
|
1534
|
+
// Detect that here and set rootProduct and inExporer in this case
|
|
1535
|
+
if (!existing?.rootProduct && existing?.inStore === 'cluster') {
|
|
1536
|
+
existing.rootProduct = EXPLORER;
|
|
1537
|
+
existing.inExplorer = (existing.rootProduct === EXPLORER);
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
|
|
1541
|
+
virtualType(state, { product, obj }) {
|
|
1542
|
+
if ( !state.virtualTypes[product] ) {
|
|
1543
|
+
state.virtualTypes[product] = [];
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
const copy = clone(obj);
|
|
1547
|
+
|
|
1548
|
+
copy.virtual = true;
|
|
1549
|
+
|
|
1550
|
+
const existing = findBy(state.virtualTypes[product], 'name', copy.name);
|
|
1551
|
+
|
|
1552
|
+
if ( existing ) {
|
|
1553
|
+
Object.assign(existing, copy);
|
|
1554
|
+
} else {
|
|
1555
|
+
addObject(state.virtualTypes[product], copy);
|
|
1556
|
+
}
|
|
1557
|
+
},
|
|
1558
|
+
|
|
1559
|
+
spoofedType(state, { product, obj }) {
|
|
1560
|
+
if ( !state.spoofedTypes[product] ) {
|
|
1561
|
+
state.spoofedTypes[product] = [];
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
const copy = clone(obj);
|
|
1565
|
+
|
|
1566
|
+
instanceMethods[product] = instanceMethods[product] || {};
|
|
1567
|
+
instanceMethods[product][copy.type] = copy.getInstances;
|
|
1568
|
+
delete copy.getInstances;
|
|
1569
|
+
|
|
1570
|
+
copy.name = copy.type;
|
|
1571
|
+
copy.isSpoofed = true;
|
|
1572
|
+
copy.virtual = true;
|
|
1573
|
+
copy.schemas.forEach((schema) => {
|
|
1574
|
+
schema.links = {
|
|
1575
|
+
collection: `/${ SPOOFED_PREFIX }/${ schema.id }`,
|
|
1576
|
+
...(schema.links || {})
|
|
1577
|
+
};
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1580
|
+
const existing = findBy(state.spoofedTypes[product], 'type', copy.type);
|
|
1581
|
+
|
|
1582
|
+
if ( existing ) {
|
|
1583
|
+
Object.assign(existing, copy);
|
|
1584
|
+
} else {
|
|
1585
|
+
addObject(state.spoofedTypes[product], copy);
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
|
|
1589
|
+
basicType(state, { product, group, types }) {
|
|
1590
|
+
if ( !product ) {
|
|
1591
|
+
product = EXPLORER;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
if ( !group ) {
|
|
1595
|
+
group = ROOT;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
if ( !isArray(types) ) {
|
|
1599
|
+
types = [types];
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
if ( !state.basicTypes[product] ) {
|
|
1603
|
+
state.basicTypes[product] = {};
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
for ( const t of types ) {
|
|
1607
|
+
state.basicTypes[product][t] = group;
|
|
1608
|
+
}
|
|
1609
|
+
},
|
|
1610
|
+
|
|
1611
|
+
ignoreGroup(state, { regexOrString: match, cb }) {
|
|
1612
|
+
match = ensureRegex(match);
|
|
1613
|
+
// State shouldn't contain actual RegExp objects, because they don't serialize
|
|
1614
|
+
cb ? state.groupIgnore.push({
|
|
1615
|
+
type: regexToString(match),
|
|
1616
|
+
cb
|
|
1617
|
+
}) : state.groupIgnore.push(regexToString(match));
|
|
1618
|
+
},
|
|
1619
|
+
|
|
1620
|
+
ignoreType(state, match) {
|
|
1621
|
+
match = ensureRegex(match);
|
|
1622
|
+
state.typeIgnore.push(regexToString(match));
|
|
1623
|
+
},
|
|
1624
|
+
|
|
1625
|
+
groupBy(state, { type, field }) {
|
|
1626
|
+
state.groupBy[type] = field;
|
|
1627
|
+
},
|
|
1628
|
+
|
|
1629
|
+
headers(state, { type, headers }) {
|
|
1630
|
+
state.headers[type] = headers;
|
|
1631
|
+
},
|
|
1632
|
+
|
|
1633
|
+
paginationHeaders(state, { type, paginationHeaders }) {
|
|
1634
|
+
state.paginationHeaders[type] = paginationHeaders;
|
|
1635
|
+
},
|
|
1636
|
+
|
|
1637
|
+
hideBulkActions(state, { type, field }) {
|
|
1638
|
+
state.hideBulkActions[type] = field;
|
|
1639
|
+
},
|
|
1640
|
+
|
|
1641
|
+
// weightGroup({group: 'core', weight: 99}); -- higher groups are shown first
|
|
1642
|
+
// These operate on group names *after* mapping but *before* translation
|
|
1643
|
+
weightGroup(state, {
|
|
1644
|
+
group, groups, weight, forBasic
|
|
1645
|
+
}) {
|
|
1646
|
+
if ( !groups ) {
|
|
1647
|
+
groups = [];
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
if ( group ) {
|
|
1651
|
+
groups.push(group);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
const map = forBasic ? state.basicGroupWeights : state.groupWeights;
|
|
1655
|
+
|
|
1656
|
+
for ( const g of groups ) {
|
|
1657
|
+
map[g.toLowerCase()] = weight;
|
|
1658
|
+
}
|
|
1659
|
+
},
|
|
1660
|
+
|
|
1661
|
+
// setGroupDefaultType({group: 'core', defaultType: 'name'});
|
|
1662
|
+
// By default when a group is clicked, the first item is selected - this allows
|
|
1663
|
+
// this behaviour to be changed and a named child type can be chosen
|
|
1664
|
+
// These operate on group names *after* mapping but *before* translation
|
|
1665
|
+
setGroupDefaultType(state, { group, groups, defaultType }) {
|
|
1666
|
+
if ( !groups ) {
|
|
1667
|
+
groups = [];
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
if ( group ) {
|
|
1671
|
+
groups.push(group);
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
for ( const g of groups ) {
|
|
1675
|
+
state.groupDefaultTypes[g.toLowerCase()] = defaultType;
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1678
|
+
|
|
1679
|
+
// weightType('Cluster' 99); -- higher groups are shown first
|
|
1680
|
+
// These operate on *schema* type names, before mapping
|
|
1681
|
+
weightType(state, {
|
|
1682
|
+
type, types, weight, forBasic
|
|
1683
|
+
}) {
|
|
1684
|
+
if ( !types ) {
|
|
1685
|
+
types = [];
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
if ( type ) {
|
|
1689
|
+
types.push(type);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
const map = forBasic ? state.basicTypeWeights : state.typeWeights;
|
|
1693
|
+
|
|
1694
|
+
for ( const t of types ) {
|
|
1695
|
+
map[t.toLowerCase()] = weight;
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
|
|
1699
|
+
// mapGroup('ugly.thing', 'Nice Thing', 1);
|
|
1700
|
+
// mapGroup(/ugly.thing.(stuff)', '$1', 2);
|
|
1701
|
+
// mapGroup(/ugly.thing.(stuff)', function(groupStr, ruleObj, regexMatch, typeObj) { return ucFirst(group.id) } , 2);
|
|
1702
|
+
mapGroup(state, {
|
|
1703
|
+
match, replace, weight = 5, continueOnMatch = false
|
|
1704
|
+
}) {
|
|
1705
|
+
_addMapping(state.groupMappings, match, replace, weight, continueOnMatch);
|
|
1706
|
+
},
|
|
1707
|
+
|
|
1708
|
+
mapType(state, {
|
|
1709
|
+
match, replace, weight = 5, continueOnMatch = false
|
|
1710
|
+
}) {
|
|
1711
|
+
_addMapping(state.typeMappings, match, replace, weight, continueOnMatch);
|
|
1712
|
+
},
|
|
1713
|
+
|
|
1714
|
+
// moveType('apps.deployment', 'Core');
|
|
1715
|
+
moveType(state, { match, group, weight = 5 }) {
|
|
1716
|
+
_addMapping(state.typeMoveMappings, match, group, weight);
|
|
1717
|
+
},
|
|
1718
|
+
|
|
1719
|
+
componentForType(state, { match, replace }) {
|
|
1720
|
+
match = ensureRegex(match);
|
|
1721
|
+
match = regexToString(match);
|
|
1722
|
+
state.typeToComponentMappings.push({ match, replace });
|
|
1723
|
+
},
|
|
1724
|
+
|
|
1725
|
+
configureType(state, options) {
|
|
1726
|
+
const match = regexToString(ensureRegex(options.match));
|
|
1727
|
+
|
|
1728
|
+
const idx = state.typeOptions.findIndex((obj) => obj.match === match);
|
|
1729
|
+
let obj = { ...options, match };
|
|
1730
|
+
|
|
1731
|
+
if ( idx >= 0 ) {
|
|
1732
|
+
obj = Object.assign(state.typeOptions[idx], obj);
|
|
1733
|
+
state.typeOptions.splice(idx, 1, obj);
|
|
1734
|
+
} else {
|
|
1735
|
+
const obj = Object.assign({}, options, { match });
|
|
1736
|
+
|
|
1737
|
+
state.typeOptions.push(obj);
|
|
1738
|
+
}
|
|
1739
|
+
},
|
|
1740
|
+
|
|
1741
|
+
};
|
|
1742
|
+
|
|
1743
|
+
export const actions = {
|
|
1744
|
+
removeProduct({ commit }, metadata) {
|
|
1745
|
+
commit('remove', metadata);
|
|
1746
|
+
},
|
|
1747
|
+
|
|
1748
|
+
addFavorite({ dispatch, rootGetters }, type) {
|
|
1749
|
+
const types = rootGetters['prefs/get'](FAVORITE_TYPES) || [];
|
|
1750
|
+
|
|
1751
|
+
addObject(types, type);
|
|
1752
|
+
|
|
1753
|
+
dispatch('prefs/set', { key: FAVORITE_TYPES, value: types }, { root: true });
|
|
1754
|
+
},
|
|
1755
|
+
|
|
1756
|
+
removeFavorite({ dispatch, rootGetters }, type) {
|
|
1757
|
+
const types = rootGetters['prefs/get'](FAVORITE_TYPES) || [];
|
|
1758
|
+
|
|
1759
|
+
removeObject(types, type);
|
|
1760
|
+
|
|
1761
|
+
dispatch('prefs/set', { key: FAVORITE_TYPES, value: types }, { root: true });
|
|
1762
|
+
},
|
|
1763
|
+
|
|
1764
|
+
toggleGroup({ dispatch, rootGetters }, { group, expanded }) {
|
|
1765
|
+
const groups = rootGetters['prefs/get'](EXPANDED_GROUPS);
|
|
1766
|
+
|
|
1767
|
+
if ( expanded ) {
|
|
1768
|
+
addObject(groups, group);
|
|
1769
|
+
} else {
|
|
1770
|
+
removeObject(groups, group);
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
dispatch('prefs/set', { key: EXPANDED_GROUPS, value: groups }, { root: true });
|
|
1774
|
+
},
|
|
1775
|
+
|
|
1776
|
+
configureType({ commit }, options) {
|
|
1777
|
+
commit('configureType', options);
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
|
|
1781
|
+
function _sortGroup(tree, mode) {
|
|
1782
|
+
const by = ['weight:desc', 'namespaced', 'label'];
|
|
1783
|
+
|
|
1784
|
+
tree.children = sortBy(tree.children, by);
|
|
1785
|
+
|
|
1786
|
+
for (const entry of tree.children ) {
|
|
1787
|
+
if ( entry.children ) {
|
|
1788
|
+
_sortGroup(entry, mode);
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
function _applyMapping(objOrValue, mappings, keyField, cache, defaultFn) {
|
|
1794
|
+
let key = objOrValue;
|
|
1795
|
+
let found = false;
|
|
1796
|
+
|
|
1797
|
+
if ( keyField ) {
|
|
1798
|
+
if ( typeof objOrValue !== 'object' ) {
|
|
1799
|
+
return objOrValue;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
key = get(objOrValue, keyField);
|
|
1803
|
+
|
|
1804
|
+
if ( typeof key !== 'string' ) {
|
|
1805
|
+
return null;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
if ( key && cache && cache[key] ) {
|
|
1810
|
+
return cache[key];
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
let out = `${ key }`;
|
|
1814
|
+
|
|
1815
|
+
for ( const rule of mappings ) {
|
|
1816
|
+
const re = stringToRegex(rule.match);
|
|
1817
|
+
const captured = out.match(re);
|
|
1818
|
+
|
|
1819
|
+
if ( captured && rule.replace ) {
|
|
1820
|
+
out = out.replace(re, rule.replace);
|
|
1821
|
+
|
|
1822
|
+
found = true;
|
|
1823
|
+
if ( !rule.continueOnMatch ) {
|
|
1824
|
+
break;
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
if ( !found && defaultFn ) {
|
|
1830
|
+
out = defaultFn(out, objOrValue);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
if ( cache ) {
|
|
1834
|
+
cache[key] = out;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
return out;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
function _addMapping(mappings, match, replace, weight, continueOnMatch) {
|
|
1841
|
+
match = regexToString(ensureRegex(match));
|
|
1842
|
+
|
|
1843
|
+
mappings.push({
|
|
1844
|
+
match,
|
|
1845
|
+
replace,
|
|
1846
|
+
weight,
|
|
1847
|
+
continueOnMatch,
|
|
1848
|
+
insertIndex: mappings.length,
|
|
1849
|
+
});
|
|
1850
|
+
|
|
1851
|
+
// Re-sort the list by weight (highest first) and insert time (oldest first)
|
|
1852
|
+
mappings.sort((a, b) => {
|
|
1853
|
+
const pri = b.weight - a.weight;
|
|
1854
|
+
|
|
1855
|
+
if ( pri ) {
|
|
1856
|
+
return pri;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
return a.insertIndex - b.insertIndex;
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
// Regexes can't be represented in state because they don't serialize to JSON..
|
|
1864
|
+
const regexCache = {};
|
|
1865
|
+
|
|
1866
|
+
function regexToString(regex) {
|
|
1867
|
+
return regex.source;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
function stringToRegex(str) {
|
|
1871
|
+
let out = regexCache[str];
|
|
1872
|
+
|
|
1873
|
+
if ( !out ) {
|
|
1874
|
+
out = new RegExp(str);
|
|
1875
|
+
regexCache[str] = out;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
return out;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
function ifHave(getters, option) {
|
|
1882
|
+
switch (option) {
|
|
1883
|
+
case IF_HAVE.V2_MONITORING: {
|
|
1884
|
+
return haveV2Monitoring(getters);
|
|
1885
|
+
}
|
|
1886
|
+
case IF_HAVE.PROJECT: {
|
|
1887
|
+
return !!project(getters);
|
|
1888
|
+
}
|
|
1889
|
+
case IF_HAVE.NO_PROJECT: {
|
|
1890
|
+
return !project(getters);
|
|
1891
|
+
}
|
|
1892
|
+
case IF_HAVE.NOT_V1_ISTIO: {
|
|
1893
|
+
return !isV1Istio(getters);
|
|
1894
|
+
}
|
|
1895
|
+
case IF_HAVE.MULTI_CLUSTER: {
|
|
1896
|
+
return getters.isMultiCluster;
|
|
1897
|
+
}
|
|
1898
|
+
case IF_HAVE.NEUVECTOR_NAMESPACE: {
|
|
1899
|
+
return getters[`cluster/all`](NAMESPACE).find((n) => n.metadata.name === NEU_VECTOR_NAMESPACE);
|
|
1900
|
+
}
|
|
1901
|
+
case IF_HAVE.ADMIN: {
|
|
1902
|
+
return isAdminUser(getters);
|
|
1903
|
+
}
|
|
1904
|
+
case IF_HAVE.MCM_DISABLED: {
|
|
1905
|
+
return !getters['isRancherInHarvester'];
|
|
1906
|
+
}
|
|
1907
|
+
case IF_HAVE.NOT_STANDALONE_HARVESTER: {
|
|
1908
|
+
return !getters['isStandaloneHarvester'];
|
|
1909
|
+
}
|
|
1910
|
+
default:
|
|
1911
|
+
return false;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
// Could list a larger set of resources that typically only an admin user would have
|
|
1916
|
+
export function isAdminUser(getters) {
|
|
1917
|
+
const canEditSettings = (getters['management/schemaFor'](MANAGEMENT.SETTING)?.resourceMethods || []).includes('PUT');
|
|
1918
|
+
const canEditFeatureFlags = (getters['management/schemaFor'](MANAGEMENT.FEATURE)?.resourceMethods || []).includes('PUT');
|
|
1919
|
+
const canInstallApps = (getters['management/schemaFor'](CATALOG.APP)?.resourceMethods || []).includes('PUT');
|
|
1920
|
+
const canAddRepos = (getters['management/schemaFor'](CATALOG.CLUSTER_REPO)?.resourceMethods || []).includes('PUT');
|
|
1921
|
+
const canPutHelmOperations = (getters['management/schemaFor'](CATALOG.OPERATION)?.resourceMethods || []).includes('PUT');
|
|
1922
|
+
|
|
1923
|
+
return canEditSettings && canEditFeatureFlags && canInstallApps && canAddRepos && canPutHelmOperations;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
function _findColumnByName(schema, colName) {
|
|
1927
|
+
const attributes = schema.attributes || {};
|
|
1928
|
+
const columns = attributes.columns || [];
|
|
1929
|
+
|
|
1930
|
+
return findBy(columns, 'name', colName);
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
// Is V1 Istio installed?
|
|
1934
|
+
function isV1Istio(getters) {
|
|
1935
|
+
const cluster = getters['currentCluster'];
|
|
1936
|
+
|
|
1937
|
+
return !!cluster?.status?.istioEnabled;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
function ifHaveVerb(rootGetters, module, verb, haveIds) {
|
|
1941
|
+
for ( const haveId of haveIds ) {
|
|
1942
|
+
const schema = rootGetters[`${ module }/schemaFor`](haveId);
|
|
1943
|
+
const want = verb.toLowerCase();
|
|
1944
|
+
const collectionMethods = schema.collectionMethods || [];
|
|
1945
|
+
const resourceMethods = schema.resourceMethods || [];
|
|
1946
|
+
const have = [...collectionMethods, ...resourceMethods].map((x) => x.toLowerCase());
|
|
1947
|
+
|
|
1948
|
+
if ( !have.includes(want) && !have.includes(`blocked-${ want }`) ) {
|
|
1949
|
+
return false;
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
return true;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
// Look at the namespace filters to determine if a project is selected
|
|
1957
|
+
export function project(getters) {
|
|
1958
|
+
const clusterId = getters['currentCluster']?.id;
|
|
1959
|
+
|
|
1960
|
+
if ( !clusterId ) {
|
|
1961
|
+
return null;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
const filters = getters['namespaceFilters'];
|
|
1965
|
+
const namespaces = [];
|
|
1966
|
+
let projectName = null;
|
|
1967
|
+
|
|
1968
|
+
for (const filter of filters) {
|
|
1969
|
+
const [type, id] = filter.split('://', 2);
|
|
1970
|
+
|
|
1971
|
+
if (type === 'project') {
|
|
1972
|
+
if (projectName !== null) {
|
|
1973
|
+
// More than one project selected
|
|
1974
|
+
return null;
|
|
1975
|
+
}
|
|
1976
|
+
projectName = id;
|
|
1977
|
+
} else if (type === 'ns') {
|
|
1978
|
+
namespaces.push(id);
|
|
1979
|
+
} else {
|
|
1980
|
+
// Something other than project or namespace
|
|
1981
|
+
return null;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
// No project found?
|
|
1986
|
+
if (!projectName) {
|
|
1987
|
+
return null;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
// We have one project and a set of namespaces
|
|
1991
|
+
// Check that all of the namespaces belong to the project
|
|
1992
|
+
const project = getters['management/byId'](MANAGEMENT.PROJECT, `${ clusterId }/${ projectName }`);
|
|
1993
|
+
|
|
1994
|
+
// No additional namespaces means just the project is selected
|
|
1995
|
+
if (namespaces.length === 0) {
|
|
1996
|
+
return project;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
// Convert the project namespaces into a map so we can check existence easily
|
|
2000
|
+
const prjNamespaceMap = project.namespaces.reduce((m, ns) => {
|
|
2001
|
+
m[ns.metadata.name] = true;
|
|
2002
|
+
|
|
2003
|
+
return m;
|
|
2004
|
+
}, {});
|
|
2005
|
+
|
|
2006
|
+
// All of the namespace filters must belong to the project
|
|
2007
|
+
const found = namespaces.reduce((total, ns) => {
|
|
2008
|
+
return prjNamespaceMap[ns] ? total + 1 : 0;
|
|
2009
|
+
}, 0);
|
|
2010
|
+
|
|
2011
|
+
if (found !== namespaces.length) {
|
|
2012
|
+
return null;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
return project;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
function hasCustom(state, rootState, kind, key, fallback) {
|
|
2019
|
+
const cache = state.cache[kind];
|
|
2020
|
+
|
|
2021
|
+
if ( cache[key] !== undefined ) {
|
|
2022
|
+
return cache[key];
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
// Check to see if the custom kind is provided by a plugin (ignore booleans)
|
|
2026
|
+
const pluginComponent = rootState.$plugin.getDynamic(kind, key);
|
|
2027
|
+
|
|
2028
|
+
if (typeof pluginComponent !== 'boolean' && !!pluginComponent) {
|
|
2029
|
+
cache[key] = true;
|
|
2030
|
+
|
|
2031
|
+
return cache[key];
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
// Fallback
|
|
2035
|
+
try {
|
|
2036
|
+
fallback(key);
|
|
2037
|
+
cache[key] = true;
|
|
2038
|
+
} catch (e) {
|
|
2039
|
+
cache[key] = false;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
return cache[key];
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
function loadExtension(rootState, kind, key, fallback) {
|
|
2046
|
+
const ext = rootState.$plugin.getDynamic(kind, key);
|
|
2047
|
+
|
|
2048
|
+
if (ext) {
|
|
2049
|
+
if (typeof ext === 'function') {
|
|
2050
|
+
return defineAsyncComponent(ext);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
return () => defineAsyncComponent(ext);
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
return fallback(key);
|
|
2057
|
+
}
|