@rancher/shell 0.1.0
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/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/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 +148 -0
- package/assets/brand/suse/metadata.json +3 -0
- package/assets/brand/suse/rancher-logo.svg +130 -0
- package/assets/data/aws-regions.json +29 -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/field-valid.svg +16 -0
- package/assets/images/generic-catalog.svg +15 -0
- package/assets/images/generic-driver.svg +17 -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/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/aks-black.svg +28 -0
- package/assets/images/providers/aks.svg +31 -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/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/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/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 +35 -0
- package/assets/styles/base/_basic.scss +112 -0
- package/assets/styles/base/_color.scss +11 -0
- package/assets/styles/base/_functions.scss +134 -0
- package/assets/styles/base/_helpers.scss +263 -0
- package/assets/styles/base/_mixins.scss +165 -0
- package/assets/styles/base/_typography.scss +69 -0
- package/assets/styles/base/_variables.scss +58 -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 +182 -0
- package/assets/styles/global/_cards.scss +94 -0
- package/assets/styles/global/_columns.scss +122 -0
- package/assets/styles/global/_form.scss +145 -0
- package/assets/styles/global/_gauges.scss +55 -0
- package/assets/styles/global/_labeled-input.scss +130 -0
- package/assets/styles/global/_resource.scss +89 -0
- package/assets/styles/global/_select.scss +182 -0
- package/assets/styles/global/_table.scss +106 -0
- package/assets/styles/global/_tooltip.scss +197 -0
- package/assets/styles/themes/_dark.scss +204 -0
- package/assets/styles/themes/_light.scss +533 -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-js-modal.scss +12 -0
- package/assets/styles/vendor/vue-select.scss +386 -0
- package/assets/translations/en-us.yaml +6802 -0
- package/assets/translations/zh-hans.yaml +7062 -0
- package/chart/example.vue +18 -0
- package/chart/istio.vue +209 -0
- package/chart/logging/index.vue +70 -0
- package/chart/monitoring/ClusterSelector.vue +213 -0
- package/chart/monitoring/StorageClassSelector.vue +45 -0
- package/chart/monitoring/alerting/index.vue +215 -0
- package/chart/monitoring/grafana/index.vue +319 -0
- package/chart/monitoring/index.vue +276 -0
- package/chart/monitoring/prometheus/index.vue +379 -0
- package/chart/monitoring/steps/uninstall-v1.vue +131 -0
- package/chart/rancher-alerting-drivers.vue +39 -0
- package/chart/rancher-backup/S3.vue +97 -0
- package/chart/rancher-backup/index.vue +218 -0
- package/chart/rancher-gatekeeper.vue +29 -0
- package/cloud-credential/aws.vue +98 -0
- package/cloud-credential/azure.vue +113 -0
- package/cloud-credential/digitalocean.vue +44 -0
- package/cloud-credential/gcp.vue +64 -0
- package/cloud-credential/generic.vue +84 -0
- package/cloud-credential/harvester.vue +149 -0
- package/cloud-credential/linode.vue +44 -0
- package/cloud-credential/s3.vue +152 -0
- package/cloud-credential/vmwarevsphere.vue +99 -0
- package/components/ActionDropdown.vue +249 -0
- package/components/ActionMenu.vue +312 -0
- package/components/AdvancedSection.vue +28 -0
- package/components/Alert.vue +51 -0
- package/components/AlertTable.vue +111 -0
- package/components/AssignTo.vue +162 -0
- package/components/AsyncButton.vue +249 -0
- package/components/BackLink.vue +27 -0
- package/components/BadgeState.vue +99 -0
- package/components/Banner.vue +148 -0
- package/components/BannerGraphic.vue +103 -0
- package/components/BrandImage.vue +85 -0
- package/components/ButtonDropdown.vue +305 -0
- package/components/ButtonGroup.vue +88 -0
- package/components/Card.vue +104 -0
- package/components/ChartHeading.vue +21 -0
- package/components/ChartReadme.vue +80 -0
- package/components/ClusterBadge.vue +34 -0
- package/components/ClusterProviderIcon.vue +95 -0
- package/components/CodeMirror.vue +126 -0
- package/components/Collapse.vue +55 -0
- package/components/CollapsibleCard.vue +113 -0
- package/components/CommunityLinks.vue +128 -0
- package/components/ConsumptionGauge.vue +133 -0
- package/components/ContainerResourceLimit.vue +216 -0
- package/components/CopyCode.vue +66 -0
- package/components/CopyToClipboard.vue +43 -0
- package/components/CopyToClipboardText.vue +39 -0
- package/components/CountBox.vue +104 -0
- package/components/CountGauge.vue +157 -0
- package/components/CruResource.vue +565 -0
- package/components/CruResourceFooter.vue +108 -0
- package/components/DashboardMetrics.vue +106 -0
- package/components/DashboardOptions.vue +136 -0
- package/components/DetailText.vue +192 -0
- package/components/DetailTop.vue +263 -0
- package/components/EmberPage.vue +609 -0
- package/components/EmberPageView.vue +36 -0
- package/components/EtcdInfoBanner.vue +57 -0
- package/components/EventsTable.vue +67 -0
- package/components/FileDiff.vue +174 -0
- package/components/FixedBanner.vue +228 -0
- package/components/Flag.vue +77 -0
- package/components/Glance.vue +70 -0
- package/components/GlobalRoleBindings.vue +376 -0
- package/components/GradientBox.vue +79 -0
- package/components/GrafanaDashboard.vue +269 -0
- package/components/GrowlManager.vue +160 -0
- package/components/HardwareResourceGauge.vue +154 -0
- package/components/HarvesterServiceAddOnConfig.vue +204 -0
- package/components/HarvesterUpgradeProgressBarList.vue +109 -0
- package/components/IconMessage.vue +87 -0
- package/components/Import.vue +206 -0
- package/components/IndentedPanel.vue +24 -0
- package/components/InfoBox.vue +78 -0
- package/components/InputOrDisplay.vue +67 -0
- package/components/KeyValueView.vue +256 -0
- package/components/LabelValue.vue +42 -0
- package/components/LandingPagePreference.vue +141 -0
- package/components/LazyImage.vue +55 -0
- package/components/Loading.vue +72 -0
- package/components/Markdown.vue +96 -0
- package/components/MessageLink.vue +64 -0
- package/components/ModalWithCard.vue +124 -0
- package/components/MoveModal.vue +135 -0
- package/components/NovncConsole.vue +93 -0
- package/components/NovncConsoleWrapper.vue +150 -0
- package/components/PercentageBar.vue +120 -0
- package/components/ProgressBarMulti.vue +156 -0
- package/components/PromptChangePassword.vue +106 -0
- package/components/PromptModal.vue +98 -0
- package/components/PromptRemove.vue +401 -0
- package/components/PromptRestore.vue +299 -0
- package/components/Questions/Array.vue +34 -0
- package/components/Questions/Boolean.vue +26 -0
- package/components/Questions/CloudCredential.vue +51 -0
- package/components/Questions/Enum.vue +29 -0
- package/components/Questions/Float.vue +31 -0
- package/components/Questions/Int.vue +31 -0
- package/components/Questions/Question.js +73 -0
- package/components/Questions/QuestionMap.vue +39 -0
- package/components/Questions/Reference.vue +128 -0
- package/components/Questions/String.vue +41 -0
- package/components/Questions/index.vue +489 -0
- package/components/Random.vue +92 -0
- package/components/RelatedResources.vue +181 -0
- package/components/RelatedWorkloadsTable.vue +44 -0
- package/components/ResourceCancelModal.vue +108 -0
- package/components/ResourceDetail/Masthead.vue +483 -0
- package/components/ResourceDetail/index.vue +386 -0
- package/components/ResourceList/Masthead.vue +176 -0
- package/components/ResourceList/index.vue +149 -0
- package/components/ResourceSummary.vue +163 -0
- package/components/ResourceTable.vue +401 -0
- package/components/ResourceYaml.vue +412 -0
- package/components/RoleBindings.vue +453 -0
- package/components/SelectIconGrid.vue +364 -0
- package/components/SimpleBox.vue +102 -0
- package/components/SingleClusterInfo.vue +171 -0
- package/components/SortableTable/THead.vue +221 -0
- package/components/SortableTable/actions.js +151 -0
- package/components/SortableTable/filtering.js +214 -0
- package/components/SortableTable/grouping.js +41 -0
- package/components/SortableTable/index.vue +1393 -0
- package/components/SortableTable/paging.js +118 -0
- package/components/SortableTable/selection.js +601 -0
- package/components/SortableTable/sorting.js +102 -0
- package/components/StatusTable.vue +55 -0
- package/components/Tabbed/Tab.vue +94 -0
- package/components/Tabbed/index.vue +419 -0
- package/components/TabbedLinks/index.vue +94 -0
- package/components/TableSparkLine.vue +105 -0
- package/components/Tag.vue +19 -0
- package/components/Tip.vue +40 -0
- package/components/TypeDescription.vue +55 -0
- package/components/VMConsoleBar.vue +87 -0
- package/components/Wizard.vue +559 -0
- package/components/YamlEditor.vue +266 -0
- package/components/__tests__/Banner.test.ts +13 -0
- package/components/__tests__/CopyCode.test.ts +21 -0
- package/components/__tests__/CruResource.test.ts +73 -0
- package/components/auth/AllowedPrincipals.vue +107 -0
- package/components/auth/AuthBanner.vue +71 -0
- package/components/auth/Principal.vue +169 -0
- package/components/auth/RoleDetailEdit.vue +724 -0
- package/components/auth/SelectPrincipal.vue +203 -0
- package/components/auth/login/github.vue +19 -0
- package/components/auth/login/ldap.vue +86 -0
- package/components/auth/login/oauth.vue +21 -0
- package/components/auth/login/oidc.vue +21 -0
- package/components/auth/login/saml.vue +23 -0
- package/components/dialog/AddClusterMemberDialog.vue +72 -0
- package/components/dialog/AddCustomBadgeDialog.vue +272 -0
- package/components/dialog/AddProjectMemberDialog.vue +109 -0
- package/components/dialog/AddonConfigConfirmationDialog.vue +76 -0
- package/components/dialog/DrainNode.vue +218 -0
- package/components/dialog/ForceMachineRemoveDialog.vue +106 -0
- package/components/dialog/GenericPrompt.vue +103 -0
- package/components/dialog/RollbackWorkloadDialog.vue +306 -0
- package/components/dialog/RotateCertificatesDialog.vue +196 -0
- package/components/dialog/RotateEncryptionKeyDialog.vue +158 -0
- package/components/dialog/SaveAsRKETemplateDialog.vue +122 -0
- package/components/dialog/ScaleMachineDownDialog.vue +127 -0
- package/components/dialog/harvester/AddHotplugModal.vue +159 -0
- package/components/dialog/harvester/BackupModal.vue +117 -0
- package/components/dialog/harvester/CloneTemplate.vue +125 -0
- package/components/dialog/harvester/EjectCDROMDialog.vue +157 -0
- package/components/dialog/harvester/ExportImageDialog.vue +152 -0
- package/components/dialog/harvester/MaintenanceDialog.vue +94 -0
- package/components/dialog/harvester/MigrationDialog.vue +154 -0
- package/components/dialog/harvester/RestoreDialog.vue +153 -0
- package/components/dialog/harvester/SupportBundle.vue +217 -0
- package/components/dialog/harvester/UnplugVolume.vue +108 -0
- package/components/fleet/FleetBundleResources.vue +86 -0
- package/components/fleet/FleetBundles.vue +127 -0
- package/components/fleet/FleetClusters.vue +103 -0
- package/components/fleet/FleetIntro.vue +60 -0
- package/components/fleet/FleetRepos.vue +150 -0
- package/components/fleet/FleetResources.vue +139 -0
- package/components/fleet/FleetStatus.vue +289 -0
- package/components/fleet/FleetSummary.vue +190 -0
- package/components/fleet/ResourcesSummary.vue +89 -0
- package/components/form/ArrayList.vue +354 -0
- package/components/form/ArrayListGrouped.vue +113 -0
- package/components/form/ArrayListSelect.vue +77 -0
- package/components/form/BannerSettings.vue +211 -0
- package/components/form/ChangePassword.vue +414 -0
- package/components/form/Checkbox.vue +292 -0
- package/components/form/ColorInput.vue +139 -0
- package/components/form/Command.vue +186 -0
- package/components/form/Conditions.vue +93 -0
- package/components/form/Container.vue +143 -0
- package/components/form/EnvVars.vue +146 -0
- package/components/form/FileImageSelector.vue +129 -0
- package/components/form/FileSelector.vue +151 -0
- package/components/form/Footer.vue +107 -0
- package/components/form/GithubPicker.vue +383 -0
- package/components/form/HealthCheck.vue +84 -0
- package/components/form/HookOption.vue +244 -0
- package/components/form/InputWithSelect.vue +310 -0
- package/components/form/KeyValue.vue +668 -0
- package/components/form/LabeledInput.vue +245 -0
- package/components/form/LabeledSelect.vue +476 -0
- package/components/form/LabeledTooltip.vue +116 -0
- package/components/form/Labels.vue +77 -0
- package/components/form/LifecycleHooks.vue +79 -0
- package/components/form/MatchExpressions.vue +278 -0
- package/components/form/Members/ClusterMembershipEditor.vue +63 -0
- package/components/form/Members/ClusterPermissionsEditor.vue +269 -0
- package/components/form/Members/MembershipEditor.vue +198 -0
- package/components/form/Members/ProjectMembershipEditor.vue +64 -0
- package/components/form/NameNsDescription.vue +391 -0
- package/components/form/Networking.vue +271 -0
- package/components/form/NodeAffinity.vue +158 -0
- package/components/form/NodeScheduling.vue +163 -0
- package/components/form/NotificationSettings.vue +71 -0
- package/components/form/Password.vue +137 -0
- package/components/form/PlusMinus.vue +80 -0
- package/components/form/PodAffinity.vue +288 -0
- package/components/form/PodSecurity.vue +152 -0
- package/components/form/Ports.vue +282 -0
- package/components/form/Probe.vue +313 -0
- package/components/form/ProjectMemberEditor.vue +290 -0
- package/components/form/RadioButton.vue +229 -0
- package/components/form/RadioGroup.vue +187 -0
- package/components/form/ResourceQuota/Namespace.vue +117 -0
- package/components/form/ResourceQuota/NamespaceRow.vue +171 -0
- package/components/form/ResourceQuota/Project.vue +90 -0
- package/components/form/ResourceQuota/ProjectRow.vue +78 -0
- package/components/form/ResourceQuota/shared.js +147 -0
- package/components/form/ResourceTabs/index.vue +174 -0
- package/components/form/RuleSelector.vue +170 -0
- package/components/form/Scheduling.vue +115 -0
- package/components/form/SecretSelector.vue +187 -0
- package/components/form/Security.vue +201 -0
- package/components/form/Select.vue +251 -0
- package/components/form/SelectOrCreateAuthSecret.vue +475 -0
- package/components/form/SerialConsole/index.vue +267 -0
- package/components/form/ServiceNameSelect.vue +158 -0
- package/components/form/ServicePorts.vue +281 -0
- package/components/form/ShellInput.vue +89 -0
- package/components/form/SimpleSecretSelector.vue +196 -0
- package/components/form/Taints.vue +83 -0
- package/components/form/TextAreaAutoGrow.vue +127 -0
- package/components/form/ToggleSwitch.vue +127 -0
- package/components/form/Tolerations.vue +220 -0
- package/components/form/UnitInput.vue +237 -0
- package/components/form/ValueFromResource.vue +373 -0
- package/components/form/WorkloadPorts.vue +476 -0
- package/components/form/__tests__/ArrayListGrouped.test.ts +39 -0
- package/components/form/__tests__/KeyValue.test.ts +18 -0
- package/components/form/__tests__/LabeledInput.test.ts +20 -0
- package/components/form/__tests__/UnitInput.test.ts +183 -0
- package/components/formatter/AppSummaryGraph.vue +136 -0
- package/components/formatter/AttachVMWithName.vue +46 -0
- package/components/formatter/BadgeStateFormatter.vue +60 -0
- package/components/formatter/Capitalize.vue +21 -0
- package/components/formatter/Checked.vue +20 -0
- package/components/formatter/CloudInitType.vue +27 -0
- package/components/formatter/ClusterLink.vue +92 -0
- package/components/formatter/CopyToClipboard.vue +18 -0
- package/components/formatter/Date.vue +74 -0
- package/components/formatter/Endpoints.vue +99 -0
- package/components/formatter/ExternalLink.vue +7 -0
- package/components/formatter/FleetSummaryGraph.vue +95 -0
- package/components/formatter/HarvesterBackupTargetValidation.vue +43 -0
- package/components/formatter/HarvesterCPUUsed.vue +122 -0
- package/components/formatter/HarvesterDiskState.vue +66 -0
- package/components/formatter/HarvesterHostName.vue +66 -0
- package/components/formatter/HarvesterIpAddress.vue +71 -0
- package/components/formatter/HarvesterMemoryUsed.vue +140 -0
- package/components/formatter/HarvesterMigrationState.vue +85 -0
- package/components/formatter/HarvesterNodeName.vue +49 -0
- package/components/formatter/HarvesterStorageUsed.vue +194 -0
- package/components/formatter/HarvesterVmState.vue +123 -0
- package/components/formatter/IconIsDefault.vue +34 -0
- package/components/formatter/IconText.vue +46 -0
- package/components/formatter/ImagePercentageBar.vue +86 -0
- package/components/formatter/IngressFullPath.vue +17 -0
- package/components/formatter/IngressTarget.vue +68 -0
- package/components/formatter/InternalExternalIP.vue +45 -0
- package/components/formatter/KeyValue.vue +74 -0
- package/components/formatter/Link.vue +149 -0
- package/components/formatter/LinkDetail.vue +46 -0
- package/components/formatter/LinkDetailImage.vue +31 -0
- package/components/formatter/LinkName.vue +50 -0
- package/components/formatter/List.vue +22 -0
- package/components/formatter/ListLink.vue +29 -0
- package/components/formatter/ListLinkDetail.vue +25 -0
- package/components/formatter/LiveDate.vue +139 -0
- package/components/formatter/LiveExpiryBadgeState.vue +66 -0
- package/components/formatter/LiveExpiryDate.vue +69 -0
- package/components/formatter/MachineSummaryGraph.vue +43 -0
- package/components/formatter/Number.vue +31 -0
- package/components/formatter/Percentage.vue +25 -0
- package/components/formatter/PercentageBar.vue +41 -0
- package/components/formatter/PodImages.vue +56 -0
- package/components/formatter/PodsUsage.vue +49 -0
- package/components/formatter/Port.vue +24 -0
- package/components/formatter/Principal.vue +19 -0
- package/components/formatter/PrincipalGroupBindings.vue +53 -0
- package/components/formatter/QualityText.vue +21 -0
- package/components/formatter/ReceiverIcons.vue +124 -0
- package/components/formatter/RunBookLink.vue +15 -0
- package/components/formatter/Scale.vue +108 -0
- package/components/formatter/ScanResult.vue +30 -0
- package/components/formatter/SecretData.vue +52 -0
- package/components/formatter/SecretType.vue +38 -0
- package/components/formatter/ServiceTargets.vue +109 -0
- package/components/formatter/ServiceType.vue +44 -0
- package/components/formatter/Shortened.vue +49 -0
- package/components/formatter/Si.vue +42 -0
- package/components/formatter/Translate.vue +32 -0
- package/components/formatter/VerticalScroll.vue +17 -0
- package/components/formatter/VirtualServiceGateways.vue +105 -0
- package/components/formatter/Weight.vue +132 -0
- package/components/formatter/WorkloadDetailEndpoints.vue +110 -0
- package/components/formatter/WorkloadHealthScale.vue +279 -0
- package/components/formatter/__tests__/PodsUsage.test.ts +38 -0
- package/components/graph/AspectPreserver.vue +68 -0
- package/components/graph/Bar.vue +70 -0
- package/components/graph/Circle.vue +135 -0
- package/components/graph/HalfCircle.vue +41 -0
- package/components/graph/LinePlot.vue +193 -0
- package/components/graph/ProgressArc.vue +88 -0
- package/components/nav/Favorite.vue +56 -0
- package/components/nav/GlobalLoading.vue +22 -0
- package/components/nav/Group.vue +371 -0
- package/components/nav/HarvesterUpgrade.vue +222 -0
- package/components/nav/Header.vue +875 -0
- package/components/nav/Jump.vue +106 -0
- package/components/nav/NamespaceFilter.vue +841 -0
- package/components/nav/TopLevelMenu.vue +710 -0
- package/components/nav/Type.vue +192 -0
- package/components/nav/WindowManager/ChartReadme.vue +45 -0
- package/components/nav/WindowManager/ContainerLogs.vue +670 -0
- package/components/nav/WindowManager/ContainerShell.vue +415 -0
- package/components/nav/WindowManager/KubectlShell.vue +42 -0
- package/components/nav/WindowManager/MachineSsh.vue +21 -0
- package/components/nav/WindowManager/Window.vue +97 -0
- package/components/nav/WindowManager/index.vue +310 -0
- package/components/nav/WorkspaceSwitcher.vue +147 -0
- package/config/cookies.js +4 -0
- package/config/features.js +3 -0
- package/config/footer.js +19 -0
- package/config/harvester-map.js +44 -0
- package/config/harvester-table-headers.js +27 -0
- package/config/labels-annotations.js +180 -0
- package/config/local-storage.js +6 -0
- package/config/nuxt-paths.js +7 -0
- package/config/page-actions.js +3 -0
- package/config/private-label.js +70 -0
- package/config/product/apps.js +115 -0
- package/config/product/auth.js +215 -0
- package/config/product/backup.js +61 -0
- package/config/product/cis.js +157 -0
- package/config/product/explorer.js +306 -0
- package/config/product/fleet.js +90 -0
- package/config/product/gatekeeper.js +119 -0
- package/config/product/harvester-manager.js +100 -0
- package/config/product/harvester.js +305 -0
- package/config/product/istio.js +79 -0
- package/config/product/legacy.js +201 -0
- package/config/product/logging.js +377 -0
- package/config/product/longhorn.js +49 -0
- package/config/product/manager.js +176 -0
- package/config/product/monitoring.js +286 -0
- package/config/product/multi-cluster-apps.js +73 -0
- package/config/product/navlinks.js +32 -0
- package/config/product/neuvector.js +30 -0
- package/config/product/settings.js +130 -0
- package/config/query-params.js +72 -0
- package/config/roles.ts +365 -0
- package/config/schema.js +32 -0
- package/config/secret.js +15 -0
- package/config/settings.js +194 -0
- package/config/system-namespaces.js +15 -0
- package/config/table-headers.js +908 -0
- package/config/types.js +292 -0
- package/content/docs/en-us/getting-started.md +249 -0
- package/content/docs/en-us/whats-new.md +108 -0
- package/content/docs/zh-hans/getting-started.md +248 -0
- package/content/docs/zh-hans/whats-new.md +56 -0
- package/core/plugin-routes.ts +138 -0
- package/core/plugin.ts +181 -0
- package/core/plugins-loader.js +31 -0
- package/core/plugins.js +293 -0
- package/core/types.ts +114 -0
- package/creators/app/.eslintignore +18 -0
- package/creators/app/.eslintrc.js +173 -0
- package/creators/app/.vscode/settings.json +23 -0
- package/creators/app/app.package.json +9 -0
- package/creators/app/babel.config.js +18 -0
- package/creators/app/init +95 -0
- package/creators/app/nuxt.config.js +6 -0
- package/creators/app/package.json +19 -0
- package/creators/app/tsconfig.json +37 -0
- package/creators/pkg/babel.config.js +1 -0
- package/creators/pkg/index.ts +14 -0
- package/creators/pkg/init +154 -0
- package/creators/pkg/nuxt.config.js +6 -0
- package/creators/pkg/package.json +19 -0
- package/creators/pkg/pkg.package.json +21 -0
- package/creators/pkg/tsconfig.json +49 -0
- package/creators/pkg/vue-shim.ts +4 -0
- package/creators/pkg/vue.config.js +1 -0
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +193 -0
- package/detail/catalog.cattle.io.app.vue +135 -0
- package/detail/catalog.cattle.io.clusterrepo.vue +25 -0
- package/detail/cis.cattle.io.clusterscan.vue +339 -0
- package/detail/configmap.vue +62 -0
- package/detail/constraints.gatekeeper.sh.constraint.vue +46 -0
- package/detail/fleet.cattle.io.bundle.vue +67 -0
- package/detail/fleet.cattle.io.cluster.vue +76 -0
- package/detail/fleet.cattle.io.clustergroup.vue +60 -0
- package/detail/fleet.cattle.io.gitrepo.vue +115 -0
- package/detail/harvesterhci.io.host/HarvesterHostBasic.vue +343 -0
- package/detail/harvesterhci.io.host/HarvesterHostDisk.vue +200 -0
- package/detail/harvesterhci.io.host/HarvesterHostNetwork.vue +89 -0
- package/detail/harvesterhci.io.host/VirtualMachineInstance.vue +134 -0
- package/detail/harvesterhci.io.host/index.vue +243 -0
- package/detail/harvesterhci.io.management.cluster.vue +97 -0
- package/detail/harvesterhci.io.virtualmachinebackup/index.vue +221 -0
- package/detail/harvesterhci.io.virtualmachineimage.vue +118 -0
- package/detail/helm.cattle.io.projecthelmchart.vue +229 -0
- package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue +279 -0
- package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue +75 -0
- package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue +114 -0
- package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue +79 -0
- package/detail/kubevirt.io.virtualmachine/index.vue +213 -0
- package/detail/management.cattle.io.fleetworkspace.vue +85 -0
- package/detail/management.cattle.io.globalrole.vue +8 -0
- package/detail/management.cattle.io.roletemplate.vue +8 -0
- package/detail/management.cattle.io.user.vue +288 -0
- package/detail/namespace.vue +270 -0
- package/detail/networking.k8s.io.ingress.vue +57 -0
- package/detail/node.vue +285 -0
- package/detail/pod.vue +235 -0
- package/detail/provisioning.cattle.io.cluster.vue +719 -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 +226 -0
- package/detail/service.vue +199 -0
- package/detail/workload/index.vue +323 -0
- package/edit/auth/azuread.vue +278 -0
- package/edit/auth/github.vue +231 -0
- package/edit/auth/googleoauth.vue +200 -0
- package/edit/auth/ldap/config.vue +238 -0
- package/edit/auth/ldap/index.vue +136 -0
- package/edit/auth/oidc.vue +259 -0
- package/edit/auth/saml.vue +222 -0
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +51 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +243 -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 +216 -0
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +187 -0
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +61 -0
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +51 -0
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +60 -0
- package/edit/catalog.cattle.io.clusterrepo.vue +109 -0
- package/edit/cis.cattle.io.clusterscan.vue +301 -0
- package/edit/cis.cattle.io.clusterscanbenchmark.vue +107 -0
- package/edit/cis.cattle.io.clusterscanprofile.vue +142 -0
- package/edit/cloudcredential.vue +279 -0
- package/edit/configmap.vue +125 -0
- package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +70 -0
- package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +76 -0
- package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +50 -0
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +331 -0
- package/edit/fleet.cattle.io.cluster.vue +93 -0
- package/edit/fleet.cattle.io.clustergroup.vue +161 -0
- package/edit/fleet.cattle.io.gitrepo.vue +515 -0
- package/edit/group.principal.vue +60 -0
- package/edit/harvesterhci.io.cloudtemplate.vue +123 -0
- package/edit/harvesterhci.io.host/HarvesterDisk.vue +263 -0
- package/edit/harvesterhci.io.host/index.vue +524 -0
- package/edit/harvesterhci.io.keypair.vue +112 -0
- package/edit/harvesterhci.io.managedchart/index.vue +25 -0
- package/edit/harvesterhci.io.managedchart/rancher-monitoring.vue +172 -0
- package/edit/harvesterhci.io.management.cluster.vue +136 -0
- package/edit/harvesterhci.io.networkattachmentdefinition.vue +210 -0
- package/edit/harvesterhci.io.setting/additional-ca.vue +36 -0
- package/edit/harvesterhci.io.setting/backup-target.vue +182 -0
- package/edit/harvesterhci.io.setting/http-proxy.vue +79 -0
- package/edit/harvesterhci.io.setting/index.vue +201 -0
- package/edit/harvesterhci.io.setting/overcommit-config.vue +91 -0
- package/edit/harvesterhci.io.setting/ssl-certificates.vue +117 -0
- package/edit/harvesterhci.io.setting/ssl-parameters.vue +161 -0
- package/edit/harvesterhci.io.setting/support-bundle-image.vue +134 -0
- package/edit/harvesterhci.io.setting/support-bundle-namespaces.vue +73 -0
- package/edit/harvesterhci.io.setting/vip-pools.vue +244 -0
- package/edit/harvesterhci.io.setting/vm-force-reset-policy.vue +81 -0
- package/edit/harvesterhci.io.virtualmachinebackup.vue +256 -0
- package/edit/harvesterhci.io.virtualmachineimage.vue +364 -0
- package/edit/harvesterhci.io.virtualmachinetemplateversion.vue +332 -0
- package/edit/harvesterhci.io.volume.vue +195 -0
- package/edit/helm.cattle.io.projecthelmchart.vue +147 -0
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +210 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue +190 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue +212 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue +94 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue +85 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue +152 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue +278 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue +111 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue +238 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue +142 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue +256 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue +392 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue +86 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +247 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue +225 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue +162 -0
- package/edit/kubevirt.io.virtualmachine/index.vue +633 -0
- package/edit/logging-flow/Match.vue +96 -0
- package/edit/logging-flow/index.vue +419 -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/index.vue +317 -0
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +72 -0
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +79 -0
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +92 -0
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +80 -0
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +206 -0
- package/edit/logging.banzaicloud.io.output/providers/file.vue +42 -0
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +147 -0
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +82 -0
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +129 -0
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +146 -0
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +71 -0
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +56 -0
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +102 -0
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +144 -0
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +71 -0
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +102 -0
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +154 -0
- package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +59 -0
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +189 -0
- package/edit/logging.banzaicloud.io.output/providers/utils.js +27 -0
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +68 -0
- package/edit/management.cattle.io.fleetworkspace.vue +92 -0
- package/edit/management.cattle.io.globalrole.vue +8 -0
- package/edit/management.cattle.io.project.vue +271 -0
- package/edit/management.cattle.io.projectroletemplatebinding.vue +95 -0
- package/edit/management.cattle.io.roletemplate.vue +8 -0
- package/edit/management.cattle.io.setting.vue +157 -0
- package/edit/management.cattle.io.user.vue +251 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +310 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +261 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +367 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +144 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +263 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +126 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +252 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +171 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +133 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +183 -0
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +497 -0
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +192 -0
- package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +106 -0
- package/edit/monitoring.coreos.com.prometheusrule/duration.js +41 -0
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +192 -0
- package/edit/monitoring.coreos.com.receiver/auth.vue +113 -0
- package/edit/monitoring.coreos.com.receiver/index.vue +282 -0
- package/edit/monitoring.coreos.com.receiver/tls.vue +55 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +78 -0
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +211 -0
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +79 -0
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +89 -0
- package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +65 -0
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +24 -0
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +68 -0
- package/edit/monitoring.coreos.com.route.vue +179 -0
- package/edit/namespace.vue +213 -0
- package/edit/network.harvesterhci.io.clusternetwork/index.vue +19 -0
- package/edit/network.harvesterhci.io.clusternetwork/vlan.vue +134 -0
- package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +185 -0
- package/edit/networking.istio.io.destinationrule/index.vue +233 -0
- package/edit/networking.k8s.io.ingress/Certificate.vue +119 -0
- package/edit/networking.k8s.io.ingress/Certificates.vue +101 -0
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +117 -0
- package/edit/networking.k8s.io.ingress/Rule.vue +133 -0
- package/edit/networking.k8s.io.ingress/RulePath.vue +178 -0
- package/edit/networking.k8s.io.ingress/Rules.vue +133 -0
- package/edit/networking.k8s.io.ingress/index.vue +150 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +91 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +50 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +287 -0
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +93 -0
- package/edit/networking.k8s.io.networkpolicy/index.vue +267 -0
- package/edit/node.vue +69 -0
- package/edit/persistentvolume/index.vue +298 -0
- package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +74 -0
- package/edit/persistentvolume/plugins/azureDisk.vue +119 -0
- package/edit/persistentvolume/plugins/azureFile.vue +63 -0
- package/edit/persistentvolume/plugins/cephfs.vue +80 -0
- package/edit/persistentvolume/plugins/cinder.vue +69 -0
- package/edit/persistentvolume/plugins/csi.vue +107 -0
- package/edit/persistentvolume/plugins/fc.vue +82 -0
- package/edit/persistentvolume/plugins/flexVolume.vue +77 -0
- package/edit/persistentvolume/plugins/flocker.vue +35 -0
- package/edit/persistentvolume/plugins/gcePersistentDisk.vue +74 -0
- package/edit/persistentvolume/plugins/glusterfs.vue +60 -0
- package/edit/persistentvolume/plugins/hostPath.vue +72 -0
- package/edit/persistentvolume/plugins/iscsi.vue +125 -0
- package/edit/persistentvolume/plugins/local.vue +32 -0
- package/edit/persistentvolume/plugins/longhorn.vue +88 -0
- package/edit/persistentvolume/plugins/nfs.vue +60 -0
- package/edit/persistentvolume/plugins/photonPersistentDisk.vue +48 -0
- package/edit/persistentvolume/plugins/portworxVolume.vue +61 -0
- package/edit/persistentvolume/plugins/quobyte.vue +68 -0
- package/edit/persistentvolume/plugins/rbd.vue +88 -0
- package/edit/persistentvolume/plugins/scaleIO.vue +101 -0
- package/edit/persistentvolume/plugins/storageos.vue +73 -0
- package/edit/persistentvolume/plugins/vsphereVolume.vue +43 -0
- package/edit/persistentvolumeclaim.vue +271 -0
- package/edit/provisioning.cattle.io.cluster/ACE.vue +82 -0
- package/edit/provisioning.cattle.io.cluster/AgentEnv.vue +37 -0
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +242 -0
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +129 -0
- package/edit/provisioning.cattle.io.cluster/Labels.vue +30 -0
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +239 -0
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +154 -0
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +75 -0
- package/edit/provisioning.cattle.io.cluster/S3Config.vue +121 -0
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +288 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +42 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +174 -0
- package/edit/provisioning.cattle.io.cluster/index.vue +505 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +2095 -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 +252 -0
- package/edit/resources.cattle.io.restore.vue +264 -0
- package/edit/secret/basic.vue +54 -0
- package/edit/secret/generic.vue +63 -0
- package/edit/secret/index.vue +307 -0
- package/edit/secret/registry.vue +127 -0
- package/edit/secret/ssh.vue +74 -0
- package/edit/secret/tls.vue +86 -0
- package/edit/service.vue +487 -0
- package/edit/serviceaccount.vue +148 -0
- package/edit/storage.k8s.io.storageclass/index.vue +212 -0
- package/edit/storage.k8s.io.storageclass/provisioners/custom.vue +20 -0
- package/edit/storage.k8s.io.storageclass/provisioners/driver.longhorn.io.vue +35 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +159 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +65 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +32 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +58 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +105 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +54 -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 +48 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +51 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +62 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +76 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +40 -0
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +67 -0
- package/edit/token.vue +275 -0
- package/edit/ui.cattle.io.navlink.vue +430 -0
- package/edit/workload/Job.vue +235 -0
- package/edit/workload/Upgrading.vue +294 -0
- package/edit/workload/VolumeClaimTemplate.vue +136 -0
- package/edit/workload/index.vue +1106 -0
- package/edit/workload/storage/Mount.vue +153 -0
- package/edit/workload/storage/__tests__/Mount.test.ts +98 -0
- package/edit/workload/storage/__tests__/Storage.test.ts +21 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +54 -0
- package/edit/workload/storage/azureDisk.vue +80 -0
- package/edit/workload/storage/azureFile.vue +52 -0
- package/edit/workload/storage/csi/driver.longhorn.io.vue +41 -0
- package/edit/workload/storage/csi/index.vue +65 -0
- package/edit/workload/storage/ephemeralVolume/index.vue +76 -0
- package/edit/workload/storage/gcePersistentDisk.vue +47 -0
- package/edit/workload/storage/hostPath.vue +100 -0
- package/edit/workload/storage/index.vue +360 -0
- package/edit/workload/storage/nfs.vue +78 -0
- package/edit/workload/storage/persistentVolumeClaim/index.vue +144 -0
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +224 -0
- package/edit/workload/storage/secret.vue +181 -0
- package/edit/workload/storage/vsphereVolume.vue +55 -0
- package/layouts/blank.vue +17 -0
- package/layouts/default.vue +827 -0
- package/layouts/error.vue +119 -0
- package/layouts/home.vue +84 -0
- package/layouts/plain.vue +89 -0
- package/layouts/unauthenticated.vue +26 -0
- package/list/catalog.cattle.io.app.vue +50 -0
- package/list/catalog.cattle.io.clusterrepo.vue +90 -0
- package/list/cis.cattle.io.clusterscan.vue +64 -0
- package/list/fleet.cattle.io.bundle.vue +108 -0
- package/list/fleet.cattle.io.cluster.vue +79 -0
- package/list/fleet.cattle.io.clustergroup.vue +71 -0
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +81 -0
- package/list/fleet.cattle.io.gitrepo.vue +57 -0
- package/list/group.principal.vue +143 -0
- package/list/harvesterhci.io.cloudtemplate.vue +78 -0
- package/list/harvesterhci.io.dashboard/HarvesterUpgrade.vue +210 -0
- package/list/harvesterhci.io.dashboard/index.vue +774 -0
- package/list/harvesterhci.io.host/index.vue +174 -0
- package/list/harvesterhci.io.management.cluster.vue +181 -0
- package/list/harvesterhci.io.networkattachmentdefinition.vue +167 -0
- package/list/harvesterhci.io.setting.vue +241 -0
- package/list/harvesterhci.io.virtualmachinebackup.vue +172 -0
- package/list/harvesterhci.io.virtualmachineimage.vue +47 -0
- package/list/harvesterhci.io.virtualmachinetemplateversion.vue +177 -0
- package/list/harvesterhci.io.volume.vue +122 -0
- package/list/helm.cattle.io.projecthelmchart.vue +124 -0
- package/list/kubevirt.io.virtualmachine.vue +191 -0
- package/list/logging.banzaicloud.io.clusterflow.vue +36 -0
- package/list/logging.banzaicloud.io.flow.vue +41 -0
- package/list/management.cattle.io.cluster.vue +31 -0
- package/list/management.cattle.io.feature.vue +306 -0
- package/list/management.cattle.io.setting.vue +166 -0
- package/list/management.cattle.io.user.vue +121 -0
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +89 -0
- package/list/namespace.vue +44 -0
- package/list/node.vue +191 -0
- package/list/persistentvolume.vue +27 -0
- package/list/provisioning.cattle.io.cluster.vue +162 -0
- package/list/service.vue +43 -0
- package/list/ui.cattle.io.navlink.vue +49 -0
- package/list/workload.vue +130 -0
- package/machine-config/amazonec2.vue +664 -0
- package/machine-config/azure.vue +445 -0
- package/machine-config/digitalocean.vue +228 -0
- package/machine-config/generic.vue +101 -0
- package/machine-config/harvester.vue +528 -0
- package/machine-config/linode.vue +186 -0
- package/machine-config/vmwarevsphere.vue +1018 -0
- package/middleware/authenticated.js +387 -0
- package/middleware/i18n.js +10 -0
- package/mixins/auth-config.js +304 -0
- package/mixins/back-link.js +15 -0
- package/mixins/brand.js +122 -0
- package/mixins/chart.js +384 -0
- package/mixins/child-hook.js +82 -0
- package/mixins/closeable.js +47 -0
- package/mixins/compact-input.js +24 -0
- package/mixins/create-edit-view/impl.js +200 -0
- package/mixins/create-edit-view/index.js +46 -0
- package/mixins/harvester-vm/impl.js +267 -0
- package/mixins/harvester-vm/index.js +1313 -0
- package/mixins/labeled-form-element.js +137 -0
- package/mixins/login.js +31 -0
- package/mixins/metric-poller.js +19 -0
- package/mixins/page-actions.js +34 -0
- package/mixins/v1-workload-metrics.js +43 -0
- package/mixins/vue-select-overrides.js +98 -0
- package/models/app.js +25 -0
- package/models/apps.daemonset.js +4 -0
- package/models/apps.deployment.js +13 -0
- package/models/apps.replicaset.js +4 -0
- package/models/apps.statefulset.js +4 -0
- package/models/autoscaling.horizontalpodautoscaler.js +44 -0
- package/models/batch.cronjob.js +71 -0
- package/models/batch.job.js +4 -0
- package/models/catalog.cattle.io.app.js +315 -0
- package/models/catalog.cattle.io.clusterrepo.js +163 -0
- package/models/catalog.cattle.io.operation.js +43 -0
- package/models/catalog.cattle.io.repo.js +4 -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 +157 -0
- package/models/cis.cattle.io.clusterscanbenchmark.js +18 -0
- package/models/cis.cattle.io.clusterscanprofile.js +14 -0
- package/models/cis.cattle.io.clusterscanreport.js +62 -0
- package/models/cloudcredential.js +172 -0
- package/models/cluster/node.js +411 -0
- package/models/cluster.x-k8s.io.machine.js +244 -0
- package/models/cluster.x-k8s.io.machinedeployment.js +196 -0
- package/models/cluster.x-k8s.io.machineset.js +23 -0
- package/models/clusterroletemplatebinding.js +27 -0
- package/models/configmap.js +20 -0
- package/models/constraints.gatekeeper.sh.constraint.js +75 -0
- package/models/etcdbackup.js +40 -0
- package/models/event.js +23 -0
- package/models/fleet.cattle.io.bundle.js +132 -0
- package/models/fleet.cattle.io.cluster.js +133 -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 +315 -0
- package/models/group.principal.js +71 -0
- package/models/harvester/configmap.js +32 -0
- package/models/harvester/harvesterhci.io.blockdevice.js +55 -0
- package/models/harvester/harvesterhci.io.keypair.js +12 -0
- package/models/harvester/harvesterhci.io.setting.js +127 -0
- package/models/harvester/harvesterhci.io.supportbundle.js +35 -0
- package/models/harvester/harvesterhci.io.upgrade.js +226 -0
- package/models/harvester/harvesterhci.io.virtualmachinebackup.js +113 -0
- package/models/harvester/harvesterhci.io.virtualmachineimage.js +252 -0
- package/models/harvester/harvesterhci.io.virtualmachinerestore.js +43 -0
- package/models/harvester/harvesterhci.io.virtualmachinetemplate.js +69 -0
- package/models/harvester/harvesterhci.io.virtualmachinetemplateversion.js +218 -0
- package/models/harvester/k8s.cni.cncf.io.networkattachmentdefinition.js +32 -0
- package/models/harvester/kubevirt.io.virtualmachine.js +850 -0
- package/models/harvester/kubevirt.io.virtualmachineinstance.js +142 -0
- package/models/harvester/management.cattle.io.managedchart.js +191 -0
- package/models/harvester/management.cattle.io.setting.js +40 -0
- package/models/harvester/network.harvesterhci.io.clusternetwork.js +100 -0
- package/models/harvester/network.harvesterhci.io.nodenetwork.js +34 -0
- package/models/harvester/node.js +260 -0
- package/models/harvester/persistentvolumeclaim.js +166 -0
- package/models/harvester/pod.js +185 -0
- package/models/harvesterhci.io.management.cluster.js +33 -0
- package/models/helm.cattle.io.projecthelmchart.js +39 -0
- package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +93 -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 +110 -0
- package/models/logging.banzaicloud.io.output.js +161 -0
- package/models/management.cattle.io.authconfig.js +69 -0
- package/models/management.cattle.io.cluster.js +427 -0
- package/models/management.cattle.io.clusterroletemplatebinding.js +130 -0
- package/models/management.cattle.io.feature.js +56 -0
- package/models/management.cattle.io.fleetworkspace.js +74 -0
- package/models/management.cattle.io.globalrole.js +127 -0
- package/models/management.cattle.io.globalrolebinding.js +59 -0
- package/models/management.cattle.io.kontainerdriver.js +68 -0
- package/models/management.cattle.io.node.js +139 -0
- package/models/management.cattle.io.nodepool.js +167 -0
- package/models/management.cattle.io.nodetemplate.js +139 -0
- package/models/management.cattle.io.project.js +135 -0
- package/models/management.cattle.io.projectroletemplatebinding.js +150 -0
- package/models/management.cattle.io.roletemplate.js +173 -0
- package/models/management.cattle.io.setting.js +42 -0
- package/models/management.cattle.io.user.js +201 -0
- package/models/metrics.k8s.io.nodemetrics.js +41 -0
- package/models/monitoring.coreos.com.alertmanagerconfig.js +125 -0
- package/models/monitoring.coreos.com.podmonitor.js +23 -0
- package/models/monitoring.coreos.com.prometheusrule.js +29 -0
- package/models/monitoring.coreos.com.receiver.js +195 -0
- package/models/monitoring.coreos.com.route.js +162 -0
- package/models/monitoring.coreos.com.servicemonitor.js +23 -0
- package/models/namespace.js +189 -0
- package/models/networking.istio.io.destinationrule.js +20 -0
- package/models/networking.k8s.io.ingress.js +196 -0
- package/models/persistentvolume.js +142 -0
- package/models/persistentvolumeclaim.js +18 -0
- package/models/pod.js +183 -0
- package/models/principal.js +42 -0
- package/models/projectroletemplatebinding.js +20 -0
- package/models/provisioning.cattle.io.cluster.js +617 -0
- package/models/rbac.authorization.k8s.io.clusterrole.js +17 -0
- package/models/rbac.authorization.k8s.io.role.js +52 -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.vmwarevspheremachinetemplate.js +14 -0
- package/models/rke.cattle.io.etcdsnapshot.js +69 -0
- package/models/schema.js +17 -0
- package/models/secret.js +352 -0
- package/models/service.js +179 -0
- package/models/storage.k8s.io.storageclass.js +121 -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 +853 -0
- package/nuxt.config.js +683 -0
- package/package.json +165 -0
- package/pages/about.vue +209 -0
- package/pages/account/create-key.vue +17 -0
- package/pages/account/index.vue +227 -0
- package/pages/auth/login.vue +426 -0
- package/pages/auth/logout.vue +18 -0
- package/pages/auth/setup.vue +430 -0
- package/pages/auth/verify.vue +134 -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 +91 -0
- package/pages/c/_cluster/_product/namespaces.vue +75 -0
- package/pages/c/_cluster/_product/projectsnamespaces.vue +301 -0
- package/pages/c/_cluster/apps/charts/chart.vue +307 -0
- package/pages/c/_cluster/apps/charts/index.vue +595 -0
- package/pages/c/_cluster/apps/charts/install.vue +1638 -0
- package/pages/c/_cluster/apps/index.vue +17 -0
- package/pages/c/_cluster/auth/config/_id.vue +32 -0
- package/pages/c/_cluster/auth/config/index.vue +104 -0
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +133 -0
- package/pages/c/_cluster/auth/index.vue +19 -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 +193 -0
- package/pages/c/_cluster/backup/index.vue +11 -0
- package/pages/c/_cluster/cis/index.vue +11 -0
- package/pages/c/_cluster/ecm/index.vue +16 -0
- package/pages/c/_cluster/explorer/ConfigBadge.vue +55 -0
- package/pages/c/_cluster/explorer/EventsTable.vue +88 -0
- package/pages/c/_cluster/explorer/explorer-utils.js +17 -0
- package/pages/c/_cluster/explorer/index.vue +559 -0
- package/pages/c/_cluster/explorer/tools/index.vue +482 -0
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +26 -0
- package/pages/c/_cluster/fleet/index.vue +474 -0
- package/pages/c/_cluster/gatekeeper/constraints/index.vue +90 -0
- package/pages/c/_cluster/gatekeeper/index.vue +67 -0
- package/pages/c/_cluster/harvester/airgapupgrade/index.vue +306 -0
- package/pages/c/_cluster/harvester/console/_uid/serial.vue +51 -0
- package/pages/c/_cluster/harvester/console/_uid/vnc.vue +46 -0
- package/pages/c/_cluster/harvester/index.vue +24 -0
- package/pages/c/_cluster/harvester/support/index.vue +154 -0
- package/pages/c/_cluster/harvesterManager/index.vue +24 -0
- package/pages/c/_cluster/index.vue +17 -0
- package/pages/c/_cluster/istio/index.vue +139 -0
- package/pages/c/_cluster/legacy/index.vue +22 -0
- package/pages/c/_cluster/legacy/pages/_page.vue +26 -0
- package/pages/c/_cluster/legacy/project/_page.vue +54 -0
- package/pages/c/_cluster/legacy/project/index.vue +29 -0
- package/pages/c/_cluster/legacy/project/pipelines.vue +74 -0
- package/pages/c/_cluster/logging/index.vue +87 -0
- package/pages/c/_cluster/longhorn/index.vue +68 -0
- package/pages/c/_cluster/manager/cloudCredential/_id.vue +16 -0
- package/pages/c/_cluster/manager/cloudCredential/create.vue +16 -0
- package/pages/c/_cluster/manager/cloudCredential/index.vue +89 -0
- package/pages/c/_cluster/manager/index.vue +22 -0
- package/pages/c/_cluster/manager/pages/_page.vue +23 -0
- package/pages/c/_cluster/mcapps/index.vue +21 -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 +310 -0
- package/pages/c/_cluster/monitoring/alertmanagerconfig/index.vue +24 -0
- package/pages/c/_cluster/monitoring/index.vue +207 -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 +81 -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 +114 -0
- package/pages/c/_cluster/navlinks/_group.vue +42 -0
- package/pages/c/_cluster/neuvector/index.vue +66 -0
- package/pages/c/_cluster/settings/banners.vue +279 -0
- package/pages/c/_cluster/settings/brand.vue +344 -0
- package/pages/c/_cluster/settings/index.vue +22 -0
- package/pages/c/index.vue +9 -0
- package/pages/clusters/index.vue +21 -0
- package/pages/docs/_doc.vue +320 -0
- package/pages/docs/toc.js +27 -0
- package/pages/fail-whale.vue +111 -0
- package/pages/home.vue +447 -0
- package/pages/index.vue +22 -0
- package/pages/plugins.vue +387 -0
- package/pages/prefs.vue +233 -0
- package/pages/rio/mesh.vue +505 -0
- package/pages/support/index.vue +284 -0
- package/pkg/auto-import.js +81 -0
- package/pkg/babel.config.js +8 -0
- package/pkg/dynamic-importer.lib.js +62 -0
- package/pkg/import.js +10 -0
- package/pkg/model-loader.lib.js +3 -0
- package/pkg/tsconfig.json +49 -0
- package/pkg/vue.config.js +120 -0
- package/plugins/axios.js +67 -0
- package/plugins/back-button.js +5 -0
- package/plugins/codemirror-loader.js +5 -0
- package/plugins/codemirror.js +169 -0
- package/plugins/dashboard-store/actions.js +443 -0
- package/plugins/dashboard-store/classify.js +35 -0
- package/plugins/dashboard-store/extensions.js +22 -0
- package/plugins/dashboard-store/getters.js +287 -0
- package/plugins/dashboard-store/index.js +158 -0
- package/plugins/dashboard-store/model-loader.js +73 -0
- package/plugins/dashboard-store/mutations.js +262 -0
- package/plugins/dashboard-store/normalize.js +48 -0
- package/plugins/dashboard-store/rehydrate-all.js +44 -0
- package/plugins/dashboard-store/resource-class.js +1813 -0
- package/plugins/directives.js +41 -0
- package/plugins/extend-router.js +60 -0
- package/plugins/global-formatters.js +10 -0
- package/plugins/i18n.js +101 -0
- package/plugins/int-number.js +19 -0
- package/plugins/js-yaml.js +4 -0
- package/plugins/lookup.js +50 -0
- package/plugins/nuxt-client-init.js +3 -0
- package/plugins/plugin.js +22 -0
- package/plugins/portal.js +4 -0
- package/plugins/replaceall.js +19 -0
- package/plugins/resize.js +5 -0
- package/plugins/shortkey.js +4 -0
- package/plugins/steve/actions.js +373 -0
- package/plugins/steve/getters.js +105 -0
- package/plugins/steve/hybrid-class.js +103 -0
- package/plugins/steve/index.js +70 -0
- package/plugins/steve/mutations.js +27 -0
- package/plugins/steve/norman-class.js +51 -0
- package/plugins/steve/performanceTesting.js +123 -0
- package/plugins/steve/steve-class.js +31 -0
- package/plugins/steve/subscribe.js +633 -0
- package/plugins/steve/urloptions.js +47 -0
- package/plugins/tooltip.js +4 -0
- package/plugins/transitions.js +4 -0
- package/plugins/trim-whitespace.js +37 -0
- package/plugins/v-select.js +4 -0
- package/plugins/vue-clipboard2.js +4 -0
- package/plugins/vue-js-modal.js +4 -0
- package/promptRemove/kubevirt.io.virtualmachine.vue +178 -0
- package/scripts/build-pkg.sh +51 -0
- package/scripts/pkgfile.js +23 -0
- package/scripts/publish-pkg.sh +18 -0
- package/scripts/publish-shell.sh +52 -0
- package/scripts/serve-pkgs +62 -0
- package/server/server-middleware.js +19 -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/server/verdaccio-middleware.js +56 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.png +0 -0
- package/static/loading-indicator.html +39 -0
- package/store/action-menu.js +229 -0
- package/store/auth.js +329 -0
- package/store/aws.js +209 -0
- package/store/catalog.js +661 -0
- package/store/digitalocean.js +198 -0
- package/store/features.js +66 -0
- package/store/github.js +252 -0
- package/store/growl.js +89 -0
- package/store/harvester-common.js +126 -0
- package/store/i18n.js +318 -0
- package/store/index.js +1073 -0
- package/store/linode.js +142 -0
- package/store/plugins.js +222 -0
- package/store/prefs.js +484 -0
- package/store/type-map.js +1839 -0
- package/store/uiplugins.ts +112 -0
- package/store/wm.js +84 -0
- package/types/index.d.ts +7 -0
- package/utils/__tests__/array.test.ts +502 -0
- package/utils/__tests__/object.test.ts +152 -0
- package/utils/__tests__/selector.test.ts +444 -0
- package/utils/alertmanagerconfig.js +162 -0
- package/utils/array.ts +179 -0
- package/utils/auth.js +81 -0
- package/utils/aws.js +0 -0
- package/utils/cluster.js +45 -0
- package/utils/color.js +92 -0
- package/utils/computed.js +45 -0
- package/utils/create-yaml.js +359 -0
- package/utils/crypto/LICENSE.txt +15 -0
- package/utils/crypto/browserHashUtils.js +33 -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 +45 -0
- package/utils/download.js +35 -0
- package/utils/dynamic-importer.js +120 -0
- package/utils/ember-page.js +30 -0
- package/utils/error.js +80 -0
- package/utils/gatekeeper/util.js +35 -0
- package/utils/grafana.js +87 -0
- package/utils/group.js +70 -0
- package/utils/install-redirect.js +55 -0
- package/utils/monitoring.js +73 -0
- package/utils/namespace-filter.js +31 -0
- package/utils/object.js +338 -0
- package/utils/parse-externalid.js +139 -0
- package/utils/platform.js +64 -0
- package/utils/poller-sequential.js +53 -0
- package/utils/poller.js +39 -0
- package/utils/position.js +175 -0
- package/utils/promise.js +95 -0
- package/utils/queue.js +70 -0
- package/utils/router.js +27 -0
- package/utils/select.js +67 -0
- package/utils/selector.js +227 -0
- package/utils/socket.js +315 -0
- package/utils/sort.js +225 -0
- package/utils/stream.js +49 -0
- package/utils/string.js +286 -0
- package/utils/time.js +56 -0
- package/utils/type-helpers.ts +9 -0
- package/utils/units.js +184 -0
- package/utils/url.ts +171 -0
- package/utils/validators/cidr.js +5 -0
- package/utils/validators/cluster-name.js +12 -0
- package/utils/validators/container-images.js +24 -0
- package/utils/validators/cron-schedule.js +9 -0
- package/utils/validators/flow-output.js +15 -0
- package/utils/validators/index.js +243 -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 +19 -0
- package/utils/validators/service.js +136 -0
- package/utils/validators/setting.js +48 -0
- package/utils/validators/vm-datavolumes.js +38 -0
- package/utils/validators/vm-image.js +32 -0
- package/utils/validators/vm.js +214 -0
- package/utils/version.js +127 -0
- package/utils/window.js +46 -0
|
@@ -0,0 +1,1813 @@
|
|
|
1
|
+
import compact from 'lodash/compact';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isFunction from 'lodash/isFunction';
|
|
4
|
+
import isString from 'lodash/isString';
|
|
5
|
+
import jsyaml from 'js-yaml';
|
|
6
|
+
import forIn from 'lodash/forIn';
|
|
7
|
+
import uniq from 'lodash/uniq';
|
|
8
|
+
import Vue from 'vue';
|
|
9
|
+
|
|
10
|
+
import { addObject, addObjects, findBy, removeAt } from '@shell/utils/array';
|
|
11
|
+
import CustomValidators from '@shell/utils/custom-validators';
|
|
12
|
+
import { downloadFile, generateZip } from '@shell/utils/download';
|
|
13
|
+
import { eachLimit } from '@shell/utils/promise';
|
|
14
|
+
import { clone, get } from '@shell/utils/object';
|
|
15
|
+
import { DEV } from '@shell/store/prefs';
|
|
16
|
+
import { sortableNumericSuffix } from '@shell/utils/sort';
|
|
17
|
+
import {
|
|
18
|
+
coerceStringTypeToScalarType,
|
|
19
|
+
escapeHtml,
|
|
20
|
+
ucFirst
|
|
21
|
+
} from '@shell/utils/string';
|
|
22
|
+
import {
|
|
23
|
+
displayKeyFor,
|
|
24
|
+
validateChars,
|
|
25
|
+
validateDnsLikeTypes,
|
|
26
|
+
validateLength,
|
|
27
|
+
validateBoolean
|
|
28
|
+
} from '@shell/utils/validators';
|
|
29
|
+
|
|
30
|
+
import { NORMAN_NAME } from '@shell/config/labels-annotations';
|
|
31
|
+
import {
|
|
32
|
+
AS, _YAML, MODE, _CLONE, _EDIT, _VIEW, _UNFLAG, _CONFIG
|
|
33
|
+
} from '@shell/config/query-params';
|
|
34
|
+
|
|
35
|
+
import { normalizeType } from './normalize';
|
|
36
|
+
|
|
37
|
+
const STRING_LIKE_TYPES = [
|
|
38
|
+
'string',
|
|
39
|
+
'date',
|
|
40
|
+
'blob',
|
|
41
|
+
'enum',
|
|
42
|
+
'multiline',
|
|
43
|
+
'masked',
|
|
44
|
+
'password',
|
|
45
|
+
'dnsLabel',
|
|
46
|
+
'hostname',
|
|
47
|
+
];
|
|
48
|
+
const DNS_LIKE_TYPES = ['dnsLabel', 'dnsLabelRestricted', 'hostname'];
|
|
49
|
+
|
|
50
|
+
const REMAP_STATE = {
|
|
51
|
+
disabled: 'inactive',
|
|
52
|
+
notapplied: 'Not Applied',
|
|
53
|
+
notready: 'Not Ready',
|
|
54
|
+
waitapplied: 'Wait Applied',
|
|
55
|
+
outofsync: 'Out of Sync',
|
|
56
|
+
'in-progress': 'In Progress',
|
|
57
|
+
gitupdating: 'Git Updating',
|
|
58
|
+
errapplied: 'Err Applied',
|
|
59
|
+
waitcheckin: 'Wait Check-In',
|
|
60
|
+
off: 'Disabled',
|
|
61
|
+
waitingforinfrastructure: 'Waiting for Infra',
|
|
62
|
+
waitingfornoderef: 'Waiting for Node Ref'
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const DEFAULT_COLOR = 'warning';
|
|
66
|
+
const DEFAULT_ICON = 'x';
|
|
67
|
+
|
|
68
|
+
const DEFAULT_WAIT_INTERVAL = 1000;
|
|
69
|
+
const DEFAULT_WAIT_TMIMEOUT = 30000;
|
|
70
|
+
|
|
71
|
+
export const STATES_ENUM = {
|
|
72
|
+
IN_USE: 'in-use',
|
|
73
|
+
IN_PROGRESS: 'in-progress',
|
|
74
|
+
PENDING_ROLLBACK: 'pending-rollback',
|
|
75
|
+
PENDING_UPGRADE: 'pending-upgrade',
|
|
76
|
+
ABORTED: 'aborted',
|
|
77
|
+
ACTIVATING: 'activating',
|
|
78
|
+
ACTIVE: 'active',
|
|
79
|
+
AVAILABLE: 'available',
|
|
80
|
+
BACKED_UP: 'backedup',
|
|
81
|
+
BOUND: 'bound',
|
|
82
|
+
BUILDING: 'building',
|
|
83
|
+
COMPLETED: 'completed',
|
|
84
|
+
CORDONED: 'cordoned',
|
|
85
|
+
COUNT: 'count',
|
|
86
|
+
CREATED: 'created',
|
|
87
|
+
CREATING: 'creating',
|
|
88
|
+
DEACTIVATING: 'deactivating',
|
|
89
|
+
DEGRADED: 'degraded',
|
|
90
|
+
DENIED: 'denied',
|
|
91
|
+
DEPLOYED: 'deployed',
|
|
92
|
+
DISABLED: 'disabled',
|
|
93
|
+
DISCONNECTED: 'disconnected',
|
|
94
|
+
DRAINED: 'drained',
|
|
95
|
+
DRAINING: 'draining',
|
|
96
|
+
ERR_APPLIED: 'errapplied',
|
|
97
|
+
ERROR: 'error',
|
|
98
|
+
ERRORING: 'erroring',
|
|
99
|
+
ERRORS: 'errors',
|
|
100
|
+
EXPIRED: 'expired',
|
|
101
|
+
FAIL: 'fail',
|
|
102
|
+
FAILED: 'failed',
|
|
103
|
+
HEALTHY: 'healthy',
|
|
104
|
+
INACTIVE: 'inactive',
|
|
105
|
+
INFO: 'info',
|
|
106
|
+
INITIALIZING: 'initializing',
|
|
107
|
+
INPROGRESS: 'inprogress',
|
|
108
|
+
LOCKED: 'locked',
|
|
109
|
+
MIGRATING: 'migrating',
|
|
110
|
+
MISSING: 'missing',
|
|
111
|
+
MODIFIED: 'modified',
|
|
112
|
+
NOT_APPLICABLE: 'notApplicable',
|
|
113
|
+
NOT_APLLIED: 'notapplied',
|
|
114
|
+
NOT_READY: 'notready',
|
|
115
|
+
OFF: 'off',
|
|
116
|
+
ORPHANED: 'orphaned',
|
|
117
|
+
OTHER: 'other',
|
|
118
|
+
OUT_OF_SYNC: 'outofsync',
|
|
119
|
+
ON_GOING: 'on-going',
|
|
120
|
+
PASS: 'pass',
|
|
121
|
+
PASSED: 'passed',
|
|
122
|
+
PAUSED: 'paused',
|
|
123
|
+
PENDING: 'pending',
|
|
124
|
+
PROVISIONING: 'provisioning',
|
|
125
|
+
PROVISIONED: 'provisioned',
|
|
126
|
+
PURGED: 'purged',
|
|
127
|
+
PURGING: 'purging',
|
|
128
|
+
READY: 'ready',
|
|
129
|
+
RECONNECTING: 'reconnecting',
|
|
130
|
+
REGISTERING: 'registering',
|
|
131
|
+
REINITIALIZING: 'reinitializing',
|
|
132
|
+
RELEASED: 'released',
|
|
133
|
+
REMOVED: 'removed',
|
|
134
|
+
REMOVING: 'removing',
|
|
135
|
+
REQUESTED: 'requested',
|
|
136
|
+
RESTARTING: 'restarting',
|
|
137
|
+
RESTORING: 'restoring',
|
|
138
|
+
RESIZING: 'resizing',
|
|
139
|
+
RUNNING: 'running',
|
|
140
|
+
SKIP: 'skip',
|
|
141
|
+
SKIPPED: 'skipped',
|
|
142
|
+
STARTING: 'starting',
|
|
143
|
+
STOPPED: 'stopped',
|
|
144
|
+
STOPPING: 'stopping',
|
|
145
|
+
SUCCEEDED: 'succeeded',
|
|
146
|
+
SUCCESS: 'success',
|
|
147
|
+
SUCCESSFUL: 'successful',
|
|
148
|
+
SUPERSEDED: 'superseded',
|
|
149
|
+
SUSPENDED: 'suspended',
|
|
150
|
+
UNAVAILABLE: 'unavailable',
|
|
151
|
+
UNHEALTHY: 'unhealthy',
|
|
152
|
+
UNINSTALLED: 'uninstalled',
|
|
153
|
+
UNINSTALLING: 'uninstalling',
|
|
154
|
+
UNKNOWN: 'unknown',
|
|
155
|
+
UNTRIGGERED: 'untriggered',
|
|
156
|
+
UPDATING: 'updating',
|
|
157
|
+
WAIT_APPLIED: 'waitapplied',
|
|
158
|
+
WAIT_CHECKIN: 'waitcheckin',
|
|
159
|
+
WAITING: 'waiting',
|
|
160
|
+
WARNING: 'warning',
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const STATES = {
|
|
164
|
+
[STATES_ENUM.IN_USE]: {
|
|
165
|
+
color: 'success', icon: 'dot-open', label: 'In Use'
|
|
166
|
+
},
|
|
167
|
+
[STATES_ENUM.IN_PROGRESS]: {
|
|
168
|
+
color: 'info', icon: 'tag', label: 'In Progress'
|
|
169
|
+
},
|
|
170
|
+
[STATES_ENUM.PENDING_ROLLBACK]: {
|
|
171
|
+
color: 'info', icon: 'dot-half', label: 'Pending Rollback'
|
|
172
|
+
},
|
|
173
|
+
[STATES_ENUM.PENDING_UPGRADE]: {
|
|
174
|
+
color: 'info', icon: 'dot-half', label: 'Pending Update'
|
|
175
|
+
},
|
|
176
|
+
[STATES_ENUM.ABORTED]: {
|
|
177
|
+
color: 'warning', icon: 'error', label: 'Aborted'
|
|
178
|
+
},
|
|
179
|
+
[STATES_ENUM.ACTIVATING]: {
|
|
180
|
+
color: 'info', icon: 'tag', label: 'Activating'
|
|
181
|
+
},
|
|
182
|
+
[STATES_ENUM.ACTIVE]: {
|
|
183
|
+
color: 'success', icon: 'dot-open', label: 'Active'
|
|
184
|
+
},
|
|
185
|
+
[STATES_ENUM.AVAILABLE]: {
|
|
186
|
+
color: 'success', icon: 'dot-open', label: 'Available'
|
|
187
|
+
},
|
|
188
|
+
[STATES_ENUM.BACKED_UP]: {
|
|
189
|
+
color: 'success', icon: 'backup', label: 'Backed Up'
|
|
190
|
+
},
|
|
191
|
+
[STATES_ENUM.BOUND]: {
|
|
192
|
+
color: 'success', icon: 'dot', label: 'Bound'
|
|
193
|
+
},
|
|
194
|
+
[STATES_ENUM.BUILDING]: {
|
|
195
|
+
color: 'success', icon: 'dot-open', label: 'Building'
|
|
196
|
+
},
|
|
197
|
+
[STATES_ENUM.COMPLETED]: {
|
|
198
|
+
color: 'success', icon: 'dot', label: 'Completed'
|
|
199
|
+
},
|
|
200
|
+
[STATES_ENUM.CORDONED]: {
|
|
201
|
+
color: 'info', icon: 'tag', label: 'Cordoned'
|
|
202
|
+
},
|
|
203
|
+
[STATES_ENUM.COUNT]: {
|
|
204
|
+
color: 'success', icon: 'dot-open', label: 'Count'
|
|
205
|
+
},
|
|
206
|
+
[STATES_ENUM.CREATED]: {
|
|
207
|
+
color: 'info', icon: 'tag', label: 'Created'
|
|
208
|
+
},
|
|
209
|
+
[STATES_ENUM.CREATING]: {
|
|
210
|
+
color: 'info', icon: 'tag', label: 'Creating'
|
|
211
|
+
},
|
|
212
|
+
[STATES_ENUM.DEACTIVATING]: {
|
|
213
|
+
color: 'info', icon: 'adjust', label: 'Deactivating'
|
|
214
|
+
},
|
|
215
|
+
[STATES_ENUM.DEGRADED]: {
|
|
216
|
+
color: 'warning', icon: 'error', label: 'Degraded'
|
|
217
|
+
},
|
|
218
|
+
[STATES_ENUM.DENIED]: {
|
|
219
|
+
color: 'error', icon: 'adjust', label: 'Denied'
|
|
220
|
+
},
|
|
221
|
+
[STATES_ENUM.DEPLOYED]: {
|
|
222
|
+
color: 'success', icon: 'dot-open', label: 'Deployed'
|
|
223
|
+
},
|
|
224
|
+
[STATES_ENUM.DISABLED]: {
|
|
225
|
+
color: 'warning', icon: 'error', label: 'Disabled'
|
|
226
|
+
},
|
|
227
|
+
[STATES_ENUM.DISCONNECTED]: {
|
|
228
|
+
color: 'warning', icon: 'error', label: 'Disconnected'
|
|
229
|
+
},
|
|
230
|
+
[STATES_ENUM.DRAINED]: {
|
|
231
|
+
color: 'info', icon: 'tag', label: 'Drained'
|
|
232
|
+
},
|
|
233
|
+
[STATES_ENUM.DRAINING]: {
|
|
234
|
+
color: 'warning', icon: 'tag', label: 'Draining'
|
|
235
|
+
},
|
|
236
|
+
[STATES_ENUM.ERR_APPLIED]: {
|
|
237
|
+
color: 'error', icon: 'error', label: 'Error Applied'
|
|
238
|
+
},
|
|
239
|
+
[STATES_ENUM.ERROR]: {
|
|
240
|
+
color: 'error', icon: 'error', label: 'Error'
|
|
241
|
+
},
|
|
242
|
+
[STATES_ENUM.ERRORING]: {
|
|
243
|
+
color: 'error', icon: 'error', label: 'Erroring'
|
|
244
|
+
},
|
|
245
|
+
[STATES_ENUM.ERRORS]: {
|
|
246
|
+
color: 'error', icon: 'error', label: 'Errors'
|
|
247
|
+
},
|
|
248
|
+
[STATES_ENUM.EXPIRED]: {
|
|
249
|
+
color: 'warning', icon: 'error', label: 'Expired'
|
|
250
|
+
},
|
|
251
|
+
[STATES_ENUM.FAIL]: {
|
|
252
|
+
color: 'error', icon: 'error', label: 'Fail'
|
|
253
|
+
},
|
|
254
|
+
[STATES_ENUM.FAILED]: {
|
|
255
|
+
color: 'error', icon: 'error', label: 'Failed'
|
|
256
|
+
},
|
|
257
|
+
[STATES_ENUM.HEALTHY]: {
|
|
258
|
+
color: 'success', icon: 'dot-open', label: 'Healthy'
|
|
259
|
+
},
|
|
260
|
+
[STATES_ENUM.INACTIVE]: {
|
|
261
|
+
color: 'error', icon: 'dot', label: 'Inactive'
|
|
262
|
+
},
|
|
263
|
+
[STATES_ENUM.INITIALIZING]: {
|
|
264
|
+
color: 'warning', icon: 'error', label: 'Initializing'
|
|
265
|
+
},
|
|
266
|
+
[STATES_ENUM.INPROGRESS]: {
|
|
267
|
+
color: 'info', icon: 'spinner', label: 'In Progress'
|
|
268
|
+
},
|
|
269
|
+
[STATES_ENUM.INFO]: {
|
|
270
|
+
color: 'info', icon: 'info', label: 'Info'
|
|
271
|
+
},
|
|
272
|
+
[STATES_ENUM.LOCKED]: {
|
|
273
|
+
color: 'warning', icon: 'adjust', label: 'Locked'
|
|
274
|
+
},
|
|
275
|
+
[STATES_ENUM.MIGRATING]: {
|
|
276
|
+
color: 'info', icon: 'info', label: 'Migrated'
|
|
277
|
+
},
|
|
278
|
+
[STATES_ENUM.MISSING]: {
|
|
279
|
+
color: 'warning', icon: 'adjust', label: 'Missing'
|
|
280
|
+
},
|
|
281
|
+
[STATES_ENUM.MODIFIED]: {
|
|
282
|
+
color: 'warning', icon: 'edit', label: 'Modified'
|
|
283
|
+
},
|
|
284
|
+
[STATES_ENUM.NOT_APPLICABLE]: {
|
|
285
|
+
color: 'warning', icon: 'tag', label: 'Not Applicable'
|
|
286
|
+
},
|
|
287
|
+
[STATES_ENUM.NOT_APLLIED]: {
|
|
288
|
+
color: 'warning', icon: 'tag', label: 'Not Applied'
|
|
289
|
+
},
|
|
290
|
+
[STATES_ENUM.NOT_READY]: {
|
|
291
|
+
color: 'warning', icon: 'tag', label: 'Not Ready'
|
|
292
|
+
},
|
|
293
|
+
[STATES_ENUM.OFF]: {
|
|
294
|
+
color: 'darker', icon: 'error', label: 'Off'
|
|
295
|
+
},
|
|
296
|
+
[STATES_ENUM.ON_GOING]: {
|
|
297
|
+
color: 'info', icon: 'info', label: 'Info'
|
|
298
|
+
},
|
|
299
|
+
[STATES_ENUM.ORPHANED]: {
|
|
300
|
+
color: 'warning', icon: 'tag', label: 'Orphaned'
|
|
301
|
+
},
|
|
302
|
+
[STATES_ENUM.OTHER]: {
|
|
303
|
+
color: 'info', icon: 'info', label: 'Other'
|
|
304
|
+
},
|
|
305
|
+
[STATES_ENUM.OUT_OF_SYNC]: {
|
|
306
|
+
color: 'warning', icon: 'tag', label: 'Out Of Sync'
|
|
307
|
+
},
|
|
308
|
+
[STATES_ENUM.PASS]: {
|
|
309
|
+
color: 'success', icon: 'dot-dotfill', label: 'Pass'
|
|
310
|
+
},
|
|
311
|
+
[STATES_ENUM.PASSED]: {
|
|
312
|
+
color: 'success', icon: 'dot-dotfill', label: 'Passed'
|
|
313
|
+
},
|
|
314
|
+
[STATES_ENUM.PAUSED]: {
|
|
315
|
+
color: 'info', icon: 'info', label: 'Paused'
|
|
316
|
+
},
|
|
317
|
+
[STATES_ENUM.PENDING]: {
|
|
318
|
+
color: 'info', icon: 'tag', label: 'Pending'
|
|
319
|
+
},
|
|
320
|
+
[STATES_ENUM.PROVISIONING]: {
|
|
321
|
+
color: 'info', icon: 'dot', label: 'Provisioning'
|
|
322
|
+
},
|
|
323
|
+
[STATES_ENUM.PROVISIONED]: {
|
|
324
|
+
color: 'success', icon: 'dot', label: 'Provisioned'
|
|
325
|
+
},
|
|
326
|
+
[STATES_ENUM.PURGED]: {
|
|
327
|
+
color: 'error', icon: 'purged', label: 'Purged'
|
|
328
|
+
},
|
|
329
|
+
[STATES_ENUM.PURGING]: {
|
|
330
|
+
color: 'info', icon: 'purged', label: 'Purging'
|
|
331
|
+
},
|
|
332
|
+
[STATES_ENUM.READY]: {
|
|
333
|
+
color: 'success', icon: 'dot-open', label: 'Ready'
|
|
334
|
+
},
|
|
335
|
+
[STATES_ENUM.RECONNECTING]: {
|
|
336
|
+
color: 'error', icon: 'error', label: 'Reconnecting'
|
|
337
|
+
},
|
|
338
|
+
[STATES_ENUM.REGISTERING]: {
|
|
339
|
+
color: 'info', icon: 'tag', label: 'Registering'
|
|
340
|
+
},
|
|
341
|
+
[STATES_ENUM.REINITIALIZING]: {
|
|
342
|
+
color: 'warning', icon: 'error', label: 'Reinitializing'
|
|
343
|
+
},
|
|
344
|
+
[STATES_ENUM.RELEASED]: {
|
|
345
|
+
color: 'warning', icon: 'error', label: 'Released'
|
|
346
|
+
},
|
|
347
|
+
[STATES_ENUM.REMOVED]: {
|
|
348
|
+
color: 'error', icon: 'trash', label: 'Removed'
|
|
349
|
+
},
|
|
350
|
+
[STATES_ENUM.REMOVING]: {
|
|
351
|
+
color: 'info', icon: 'trash', label: 'Removing'
|
|
352
|
+
},
|
|
353
|
+
[STATES_ENUM.REQUESTED]: {
|
|
354
|
+
color: 'info', icon: 'tag', label: 'Requested'
|
|
355
|
+
},
|
|
356
|
+
[STATES_ENUM.RESTARTING]: {
|
|
357
|
+
color: 'info', icon: 'adjust', label: 'Restarting'
|
|
358
|
+
},
|
|
359
|
+
[STATES_ENUM.RESTORING]: {
|
|
360
|
+
color: 'info', icon: 'medicalcross', label: 'Restoring'
|
|
361
|
+
},
|
|
362
|
+
[STATES_ENUM.RESIZING]: {
|
|
363
|
+
color: 'warning', icon: 'dot', label: 'Resizing'
|
|
364
|
+
},
|
|
365
|
+
[STATES_ENUM.RUNNING]: {
|
|
366
|
+
color: 'success', icon: 'dot-open', label: 'Running'
|
|
367
|
+
},
|
|
368
|
+
[STATES_ENUM.SKIP]: {
|
|
369
|
+
color: 'info', icon: 'dot-open', label: 'Skip'
|
|
370
|
+
},
|
|
371
|
+
[STATES_ENUM.SKIPPED]: {
|
|
372
|
+
color: 'info', icon: 'dot-open', label: 'Skipped'
|
|
373
|
+
},
|
|
374
|
+
[STATES_ENUM.STARTING]: {
|
|
375
|
+
color: 'info', icon: 'adjust', label: 'Starting'
|
|
376
|
+
},
|
|
377
|
+
[STATES_ENUM.STOPPED]: {
|
|
378
|
+
color: 'error', icon: 'dot', label: 'Stopped'
|
|
379
|
+
},
|
|
380
|
+
[STATES_ENUM.STOPPING]: {
|
|
381
|
+
color: 'info', icon: 'adjust', label: 'Stopping'
|
|
382
|
+
},
|
|
383
|
+
[STATES_ENUM.SUCCEEDED]: {
|
|
384
|
+
color: 'success', icon: 'dot-dotfill', label: 'Succeeded'
|
|
385
|
+
},
|
|
386
|
+
[STATES_ENUM.SUCCESS]: {
|
|
387
|
+
color: 'success', icon: 'dot-open', label: 'Success'
|
|
388
|
+
},
|
|
389
|
+
[STATES_ENUM.SUCCESSFUL]: {
|
|
390
|
+
color: 'success', icon: 'dot-open', label: 'Successful'
|
|
391
|
+
},
|
|
392
|
+
[STATES_ENUM.SUPERSEDED]: {
|
|
393
|
+
color: 'info', icon: 'dot-open', label: 'Superseded'
|
|
394
|
+
},
|
|
395
|
+
[STATES_ENUM.SUSPENDED]: {
|
|
396
|
+
color: 'info', icon: 'pause', label: 'Suspended'
|
|
397
|
+
},
|
|
398
|
+
[STATES_ENUM.UNAVAILABLE]: {
|
|
399
|
+
color: 'error', icon: 'error', label: 'Unavailable'
|
|
400
|
+
},
|
|
401
|
+
[STATES_ENUM.UNHEALTHY]: {
|
|
402
|
+
color: 'error', icon: 'error', label: 'Unhealthy'
|
|
403
|
+
},
|
|
404
|
+
[STATES_ENUM.UNINSTALLED]: {
|
|
405
|
+
color: 'info', icon: 'trash', label: 'Uninstalled'
|
|
406
|
+
},
|
|
407
|
+
[STATES_ENUM.UNINSTALLING]: {
|
|
408
|
+
color: 'info', icon: 'trash', label: 'Uninstalling'
|
|
409
|
+
},
|
|
410
|
+
[STATES_ENUM.UNKNOWN]: {
|
|
411
|
+
color: 'warning', icon: 'x', label: 'Unknown'
|
|
412
|
+
},
|
|
413
|
+
[STATES_ENUM.UNTRIGGERED]: {
|
|
414
|
+
color: 'success', icon: 'tag', label: 'Untriggered'
|
|
415
|
+
},
|
|
416
|
+
[STATES_ENUM.UPDATING]: {
|
|
417
|
+
color: 'warning', icon: 'tag', label: 'Updating'
|
|
418
|
+
},
|
|
419
|
+
[STATES_ENUM.WAIT_APPLIED]: {
|
|
420
|
+
color: 'info', icon: 'tag', label: 'Wait Applied'
|
|
421
|
+
},
|
|
422
|
+
[STATES_ENUM.WAIT_CHECKIN]: {
|
|
423
|
+
color: 'warning', icon: 'tag', label: 'Wait Checkin'
|
|
424
|
+
},
|
|
425
|
+
[STATES_ENUM.WAITING]: {
|
|
426
|
+
color: 'info', icon: 'tag', label: 'Waiting'
|
|
427
|
+
},
|
|
428
|
+
[STATES_ENUM.WARNING]: {
|
|
429
|
+
color: 'warning', icon: 'error', label: 'Warning'
|
|
430
|
+
},
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export function getStatesByType(type = 'info') {
|
|
434
|
+
const out = {
|
|
435
|
+
info: [],
|
|
436
|
+
error: [],
|
|
437
|
+
success: [],
|
|
438
|
+
warning: [],
|
|
439
|
+
unknown: [],
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
forIn(STATES, (state, stateKey) => {
|
|
443
|
+
if (state.color) {
|
|
444
|
+
if (out[state.color]) {
|
|
445
|
+
out[state.color].push(stateKey);
|
|
446
|
+
} else {
|
|
447
|
+
out.unknown.push(stateKey);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
return out;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const SORT_ORDER = {
|
|
456
|
+
error: 1,
|
|
457
|
+
warning: 2,
|
|
458
|
+
info: 3,
|
|
459
|
+
success: 4,
|
|
460
|
+
ready: 5,
|
|
461
|
+
notready: 6,
|
|
462
|
+
other: 7,
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export function getStateLabel(state) {
|
|
466
|
+
const lowercaseState = state.toLowerCase();
|
|
467
|
+
|
|
468
|
+
return STATES[lowercaseState] ? STATES[lowercaseState].label : STATES[STATES_ENUM.UNKNOWN].label;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export function colorForState(state, isError, isTransitioning) {
|
|
472
|
+
if ( isError ) {
|
|
473
|
+
return 'text-error';
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if ( isTransitioning ) {
|
|
477
|
+
return 'text-info';
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const key = (state || 'active').toLowerCase();
|
|
481
|
+
let color;
|
|
482
|
+
|
|
483
|
+
if ( STATES[key] && STATES[key].color ) {
|
|
484
|
+
color = maybeFn.call(this, STATES[key].color);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if ( !color ) {
|
|
488
|
+
color = DEFAULT_COLOR;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return `text-${ color }`;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export function stateDisplay(state) {
|
|
495
|
+
// @TODO use translations
|
|
496
|
+
const key = (state || 'active').toLowerCase();
|
|
497
|
+
|
|
498
|
+
if ( REMAP_STATE[key] ) {
|
|
499
|
+
return REMAP_STATE[key];
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return key.split(/-/).map(ucFirst).join('-');
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export function stateSort(color, display) {
|
|
506
|
+
color = color.replace(/^(text|bg)-/, '');
|
|
507
|
+
|
|
508
|
+
return `${ SORT_ORDER[color] || SORT_ORDER['other'] } ${ display }`;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function maybeFn(val) {
|
|
512
|
+
if ( isFunction(val) ) {
|
|
513
|
+
return val(this);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
return val;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export default class Resource {
|
|
520
|
+
constructor(data, ctx, rehydrateNamespace = null, setClone = false) {
|
|
521
|
+
for ( const k in data ) {
|
|
522
|
+
this[k] = data[k];
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
Object.defineProperty(this, '$ctx', {
|
|
526
|
+
value: ctx,
|
|
527
|
+
enumerable: false,
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
if ( rehydrateNamespace ) {
|
|
531
|
+
Object.defineProperty(this, '__rehydrate', {
|
|
532
|
+
value: rehydrateNamespace,
|
|
533
|
+
enumerable: true,
|
|
534
|
+
configurable: true
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if ( setClone ) {
|
|
539
|
+
Object.defineProperty(this, '__clone', {
|
|
540
|
+
value: true,
|
|
541
|
+
enumerable: true,
|
|
542
|
+
configurable: true,
|
|
543
|
+
writable: true
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
get '$getters'() {
|
|
549
|
+
return this.$ctx.getters;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
get '$rootGetters'() {
|
|
553
|
+
return this.$ctx.rootGetters;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
get '$dispatch'() {
|
|
557
|
+
return this.$ctx.dispatch;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
get '$state'() {
|
|
561
|
+
return this.$ctx.state;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
get '$rootState'() {
|
|
565
|
+
return this.$ctx.rootState;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
get customValidationRules() {
|
|
569
|
+
return [
|
|
570
|
+
/**
|
|
571
|
+
* Essentially a fake schema object with additional params to extend validation
|
|
572
|
+
*
|
|
573
|
+
* @param {nullable} Value is nullable
|
|
574
|
+
* @param {path} Path on the resource to the value to validate
|
|
575
|
+
* @param {required} Value required
|
|
576
|
+
* @param {requiredIf} Value required if value at path not empty
|
|
577
|
+
* @param {translationKey} Human readable display key for param in path e.g. metadata.name === Name
|
|
578
|
+
* @param {type} Type of field to validate
|
|
579
|
+
* @param {validators} array of strings where item is name of exported validator function in custom-validators, args can be passed by prepending args separated by colon. e.g maxLength:63
|
|
580
|
+
*/
|
|
581
|
+
/* {
|
|
582
|
+
nullable: false,
|
|
583
|
+
path: 'spec.ports',
|
|
584
|
+
required: true,
|
|
585
|
+
type: 'array',
|
|
586
|
+
validators: ['servicePort'],
|
|
587
|
+
} */
|
|
588
|
+
];
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
get _key() {
|
|
592
|
+
const m = this.metadata;
|
|
593
|
+
|
|
594
|
+
if ( m ) {
|
|
595
|
+
if ( m.uid ) {
|
|
596
|
+
return m.uid;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if ( m.namespace ) {
|
|
600
|
+
return `${ this.type }/${ m.namespace }/${ m.name }`;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
if ( this.id ) {
|
|
605
|
+
return `${ this.type }/${ this.id }`;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return `${ this.type }/${ Math.random() }`;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
get schema() {
|
|
612
|
+
return this.$getters['schemaFor'](this.type);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
toString() {
|
|
616
|
+
return `[${ this.type }: ${ this.id }]`;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
get typeDisplay() {
|
|
620
|
+
const schema = this.schema;
|
|
621
|
+
|
|
622
|
+
if ( schema ) {
|
|
623
|
+
return this.$rootGetters['type-map/labelFor'](schema);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
return '?';
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
get nameDisplay() {
|
|
630
|
+
return this.displayName || this.spec?.displayName || this.metadata?.annotations?.[NORMAN_NAME] || this.name || this.metadata?.name || this.id;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
get nameSort() {
|
|
634
|
+
return sortableNumericSuffix(this.nameDisplay).toLowerCase();
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
get namespacedName() {
|
|
638
|
+
const namespace = this.metadata?.namespace;
|
|
639
|
+
const name = this.nameDisplay;
|
|
640
|
+
|
|
641
|
+
if ( namespace ) {
|
|
642
|
+
return `${ namespace }:${ name }`;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
return name;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
get namespacedNameSort() {
|
|
649
|
+
return sortableNumericSuffix(this.namespacedName).toLowerCase();
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
get groupByLabel() {
|
|
653
|
+
const name = this.metadata?.namespace;
|
|
654
|
+
let out;
|
|
655
|
+
|
|
656
|
+
if ( name ) {
|
|
657
|
+
out = this.t('resourceTable.groupLabel.namespace', { name: escapeHtml(name) });
|
|
658
|
+
} else {
|
|
659
|
+
out = this.t('resourceTable.groupLabel.notInANamespace');
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return out;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
setLabels(/* val */) {
|
|
666
|
+
throw new Error('Implement setLabels in subclass');
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
setLabel(/* key, val */) {
|
|
670
|
+
throw new Error('Implement setLabel in subclass');
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
setAnnotations(val) {
|
|
674
|
+
throw new Error('Implement setAnnotations in subclass');
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
setAnnotation(key, val) {
|
|
678
|
+
throw new Error('Implement setAnnotation in subclass');
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// You can override the displayed by providing your own stateDisplay (and possibly using the function exported above)
|
|
682
|
+
get stateDisplay() {
|
|
683
|
+
return stateDisplay(this.state);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
get stateColor() {
|
|
687
|
+
return colorForState.call(
|
|
688
|
+
this,
|
|
689
|
+
this.state,
|
|
690
|
+
this.stateObj?.error,
|
|
691
|
+
this.stateObj?.transitioning
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
get stateBackground() {
|
|
696
|
+
return this.stateColor.replace('text-', 'bg-');
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
get stateIcon() {
|
|
700
|
+
let trans = false;
|
|
701
|
+
let error = false;
|
|
702
|
+
|
|
703
|
+
if ( this.metadata && this.metadata.state ) {
|
|
704
|
+
trans = this.metadata.state.transitioning;
|
|
705
|
+
error = this.metadata.state.error;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if ( trans ) {
|
|
709
|
+
return 'icon icon-spinner icon-spin';
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
if ( error ) {
|
|
713
|
+
return 'icon icon-error';
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const key = (this.state || '').toLowerCase();
|
|
717
|
+
let icon;
|
|
718
|
+
|
|
719
|
+
if ( STATES[key] && STATES[key].icon ) {
|
|
720
|
+
icon = maybeFn.call(this, STATES[key].icon);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if ( !icon ) {
|
|
724
|
+
icon = DEFAULT_ICON;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
return `icon icon-${ icon }`;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
get stateSort() {
|
|
731
|
+
return stateSort(this.stateColor, this.stateDisplay);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
get stateDescription() {
|
|
735
|
+
const trans = this.stateObj?.transitioning || false;
|
|
736
|
+
const error = this.stateObj?.error || false;
|
|
737
|
+
const message = this.stateObj?.message;
|
|
738
|
+
|
|
739
|
+
return trans || error ? ucFirst(message) : '';
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
get stateObj() {
|
|
743
|
+
return this.metadata?.state;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// ------------------------------------------------------------------
|
|
747
|
+
|
|
748
|
+
waitForTestFn(fn, msg, timeoutMs, intervalMs) {
|
|
749
|
+
console.log('Starting wait for', msg); // eslint-disable-line no-console
|
|
750
|
+
|
|
751
|
+
if ( !timeoutMs ) {
|
|
752
|
+
timeoutMs = DEFAULT_WAIT_TMIMEOUT;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
if ( !intervalMs ) {
|
|
756
|
+
intervalMs = DEFAULT_WAIT_INTERVAL;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return new Promise((resolve, reject) => {
|
|
760
|
+
// Do a first check immediately
|
|
761
|
+
if ( fn.apply(this) ) {
|
|
762
|
+
console.log('Wait for', msg, 'done immediately'); // eslint-disable-line no-console
|
|
763
|
+
resolve(this);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
const timeout = setTimeout(() => {
|
|
767
|
+
console.log('Wait for', msg, 'timed out'); // eslint-disable-line no-console
|
|
768
|
+
clearInterval(interval);
|
|
769
|
+
clearTimeout(timeout);
|
|
770
|
+
reject(new Error(`Failed while: ${ msg }`));
|
|
771
|
+
}, timeoutMs);
|
|
772
|
+
|
|
773
|
+
const interval = setInterval(() => {
|
|
774
|
+
if ( fn.apply(this) ) {
|
|
775
|
+
console.log('Wait for', msg, 'done'); // eslint-disable-line no-console
|
|
776
|
+
clearInterval(interval);
|
|
777
|
+
clearTimeout(timeout);
|
|
778
|
+
resolve(this);
|
|
779
|
+
} else {
|
|
780
|
+
console.log('Wait for', msg, 'not done yet'); // eslint-disable-line no-console
|
|
781
|
+
}
|
|
782
|
+
}, intervalMs);
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
waitForState(state, timeout, interval) {
|
|
787
|
+
return this.waitForTestFn(() => {
|
|
788
|
+
return (this.state || '').toLowerCase() === state.toLowerCase();
|
|
789
|
+
}, `state=${ state }`, timeout, interval);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
waitForTransition() {
|
|
793
|
+
return this.waitForTestFn(() => {
|
|
794
|
+
return !this.transitioning;
|
|
795
|
+
}, 'transition completion');
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
waitForAction(name) {
|
|
799
|
+
return this.waitForTestFn(() => {
|
|
800
|
+
return this.hasAction(name);
|
|
801
|
+
}, `action=${ name }`);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
waitForLink(name) {
|
|
805
|
+
return this.waitForTestFn(() => {
|
|
806
|
+
return this.hasLink(name);
|
|
807
|
+
}, `link=${ name }`);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
hasCondition(condition) {
|
|
811
|
+
return this.isCondition(condition, null);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
isCondition(condition, withStatus = 'True') {
|
|
815
|
+
if ( !this.status || !this.status.conditions ) {
|
|
816
|
+
return false;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
const entry = findBy((this.status.conditions || []), 'type', condition);
|
|
820
|
+
|
|
821
|
+
if ( !entry ) {
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
if ( !withStatus ) {
|
|
826
|
+
return true;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
return (entry.status || '').toLowerCase() === `${ withStatus }`.toLowerCase();
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
waitForCondition(name, withStatus = 'True', timeoutMs = DEFAULT_WAIT_TMIMEOUT, intervalMs = DEFAULT_WAIT_INTERVAL) {
|
|
833
|
+
return this.waitForTestFn(() => {
|
|
834
|
+
return this.isCondition(name, withStatus);
|
|
835
|
+
}, `condition ${ name }=${ withStatus }`, timeoutMs, intervalMs);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// ------------------------------------------------------------------
|
|
839
|
+
|
|
840
|
+
get availableActions() {
|
|
841
|
+
const all = this._availableActions;
|
|
842
|
+
|
|
843
|
+
// Remove disabled items and consecutive dividers
|
|
844
|
+
let last = null;
|
|
845
|
+
const out = all.filter((item) => {
|
|
846
|
+
if ( item.enabled === false ) {
|
|
847
|
+
return false;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const cur = item.divider;
|
|
851
|
+
const ok = !cur || (cur && !last);
|
|
852
|
+
|
|
853
|
+
last = cur;
|
|
854
|
+
|
|
855
|
+
return ok;
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
// Remove dividers at the beginning
|
|
859
|
+
while ( out.length && out[0].divider ) {
|
|
860
|
+
out.shift();
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// Remove dividers at the end
|
|
864
|
+
while ( out.length && out[out.length - 1].divider ) {
|
|
865
|
+
out.pop();
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// Remove consecutive dividers in the middle
|
|
869
|
+
for ( let i = 1 ; i < out.length ; i++ ) {
|
|
870
|
+
if ( out[i].divider && out[i - 1].divider ) {
|
|
871
|
+
removeAt(out, i, 1);
|
|
872
|
+
i--;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return out;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// You can add custom actions by overriding your own availableActions (and probably reading super._availableActions)
|
|
880
|
+
get _availableActions() {
|
|
881
|
+
const all = [
|
|
882
|
+
{ divider: true },
|
|
883
|
+
{
|
|
884
|
+
action: this.canUpdate ? 'goToEdit' : 'goToViewConfig',
|
|
885
|
+
label: this.t(this.canUpdate ? 'action.edit' : 'action.view'),
|
|
886
|
+
icon: 'icon icon-edit',
|
|
887
|
+
enabled: this.canCustomEdit,
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
action: this.canEditYaml ? 'goToEditYaml' : 'goToViewYaml',
|
|
891
|
+
label: this.t(this.canEditYaml ? 'action.editYaml' : 'action.viewYaml'),
|
|
892
|
+
icon: 'icon icon-file',
|
|
893
|
+
enabled: this.canYaml,
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
action: (this.canCustomEdit ? 'goToClone' : 'cloneYaml'),
|
|
897
|
+
label: this.t('action.clone'),
|
|
898
|
+
icon: 'icon icon-copy',
|
|
899
|
+
enabled: this.canClone && this.canCreate && (this.canCustomEdit || this.canYaml),
|
|
900
|
+
},
|
|
901
|
+
{ divider: true },
|
|
902
|
+
{
|
|
903
|
+
action: 'download',
|
|
904
|
+
label: this.t('action.download'),
|
|
905
|
+
icon: 'icon icon-download',
|
|
906
|
+
bulkable: true,
|
|
907
|
+
bulkAction: 'downloadBulk',
|
|
908
|
+
enabled: this.canYaml,
|
|
909
|
+
weight: -9,
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
action: 'viewInApi',
|
|
913
|
+
label: this.t('action.viewInApi'),
|
|
914
|
+
icon: 'icon icon-external-link',
|
|
915
|
+
enabled: this.canViewInApi,
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
action: 'promptRemove',
|
|
919
|
+
altAction: 'remove',
|
|
920
|
+
label: this.t('action.remove'),
|
|
921
|
+
icon: 'icon icon-trash',
|
|
922
|
+
bulkable: true,
|
|
923
|
+
enabled: this.canDelete,
|
|
924
|
+
bulkAction: 'promptRemove',
|
|
925
|
+
weight: -10, // Delete always goes last
|
|
926
|
+
},
|
|
927
|
+
];
|
|
928
|
+
|
|
929
|
+
return all;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// ------------------------------------------------------------------
|
|
933
|
+
|
|
934
|
+
get canDelete() {
|
|
935
|
+
return this._canDelete;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
get _canDelete() {
|
|
939
|
+
return this.hasLink('remove') && this.$rootGetters['type-map/optionsFor'](this.type).isRemovable;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
get canClone() {
|
|
943
|
+
return true;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
get canUpdate() {
|
|
947
|
+
return this.hasLink('update') && this.$rootGetters['type-map/optionsFor'](this.type).isEditable;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
get canCustomEdit() {
|
|
951
|
+
return this.$rootGetters['type-map/hasCustomEdit'](this.type, this.id);
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
get canCreate() {
|
|
955
|
+
if ( this.schema && !this.schema?.collectionMethods.find(x => x.toLowerCase() === 'post') ) {
|
|
956
|
+
return false;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
return this.$rootGetters['type-map/optionsFor'](this.type).isCreatable;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
get canViewInApi() {
|
|
963
|
+
return this.hasLink('self') && this.$rootGetters['prefs/get'](DEV);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
get canYaml() {
|
|
967
|
+
return this.hasLink('view');
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
get canEditYaml() {
|
|
971
|
+
return this.schema?.resourceMethods?.find(x => x === 'blocked-PUT') ? false : this.canUpdate;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// ------------------------------------------------------------------
|
|
975
|
+
|
|
976
|
+
hasLink(linkName) {
|
|
977
|
+
return !!this.linkFor(linkName);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
linkFor(linkName) {
|
|
981
|
+
return (this.links || {})[linkName];
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
followLink(linkName, opt = {}) {
|
|
985
|
+
if ( !opt.url ) {
|
|
986
|
+
opt.url = (this.links || {})[linkName];
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
if ( opt.urlSuffix ) {
|
|
990
|
+
opt.url += opt.urlSuffix;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if ( !opt.url ) {
|
|
994
|
+
throw new Error(`Unknown link ${ linkName } on ${ this.type } ${ this.id }`);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
return this.$dispatch('request', { opt, type: this.type } );
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
// ------------------------------------------------------------------
|
|
1001
|
+
|
|
1002
|
+
hasAction(actionName) {
|
|
1003
|
+
return !!this.actionLinkFor(actionName);
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
actionLinkFor(actionName) {
|
|
1007
|
+
return (this.actions || this.actionLinks || {})[actionName];
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
doAction(actionName, body, opt = {}) {
|
|
1011
|
+
return this.$dispatch('resourceAction', {
|
|
1012
|
+
resource: this,
|
|
1013
|
+
actionName,
|
|
1014
|
+
body,
|
|
1015
|
+
opt,
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
async doActionGrowl(actionName, body, opt = {}) {
|
|
1020
|
+
try {
|
|
1021
|
+
await this.$dispatch('resourceAction', {
|
|
1022
|
+
resource: this,
|
|
1023
|
+
actionName,
|
|
1024
|
+
body,
|
|
1025
|
+
opt,
|
|
1026
|
+
});
|
|
1027
|
+
} catch (err) {
|
|
1028
|
+
this.$dispatch('growl/fromError', {
|
|
1029
|
+
title: this.$rootGetters['i18n/t']('generic.notification.title.error'),
|
|
1030
|
+
err: err.data || err,
|
|
1031
|
+
}, { root: true });
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// ------------------------------------------------------------------
|
|
1036
|
+
|
|
1037
|
+
patch(data, opt = {}) {
|
|
1038
|
+
if ( !opt.url ) {
|
|
1039
|
+
opt.url = this.linkFor('self');
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
opt.method = 'patch';
|
|
1043
|
+
opt.headers = opt.headers || {};
|
|
1044
|
+
opt.headers['content-type'] = 'application/json-patch+json';
|
|
1045
|
+
opt.data = data;
|
|
1046
|
+
|
|
1047
|
+
return this.$dispatch('request', { opt, type: this.type } );
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
save() {
|
|
1051
|
+
return this._save(...arguments);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
async _save(opt = {}) {
|
|
1055
|
+
delete this.__rehydrate;
|
|
1056
|
+
delete this.__clone;
|
|
1057
|
+
const forNew = !this.id;
|
|
1058
|
+
|
|
1059
|
+
const errors = await this.validationErrors(this, opt.ignoreFields);
|
|
1060
|
+
|
|
1061
|
+
if (!isEmpty(errors)) {
|
|
1062
|
+
return Promise.reject(errors);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
if ( this.metadata?.resourceVersion ) {
|
|
1066
|
+
this.metadata.resourceVersion = `${ this.metadata.resourceVersion }`;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
if ( !opt.url ) {
|
|
1070
|
+
if ( forNew ) {
|
|
1071
|
+
const schema = this.$getters['schemaFor'](this.type);
|
|
1072
|
+
let url = schema.linkFor('collection');
|
|
1073
|
+
|
|
1074
|
+
if ( schema.attributes && schema.attributes.namespaced && this.metadata && this.metadata.namespace ) {
|
|
1075
|
+
url += `/${ this.metadata.namespace }`;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
opt.url = url;
|
|
1079
|
+
} else {
|
|
1080
|
+
opt.url = this.linkFor('update') || this.linkFor('self');
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
if ( !opt.method ) {
|
|
1085
|
+
opt.method = ( forNew ? 'post' : 'put' );
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
if ( !opt.headers ) {
|
|
1089
|
+
opt.headers = {};
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
if ( !opt.headers['content-type'] ) {
|
|
1093
|
+
opt.headers['content-type'] = 'application/json';
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
if ( !opt.headers['accept'] ) {
|
|
1097
|
+
opt.headers['accept'] = 'application/json';
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// @TODO remove this once the API maps steve _type <-> k8s type in both directions
|
|
1101
|
+
opt.data = { ...this };
|
|
1102
|
+
|
|
1103
|
+
if (opt?.data._type) {
|
|
1104
|
+
opt.data.type = opt.data._type;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
if (opt?.data._name) {
|
|
1108
|
+
opt.data.name = opt.data._name;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
if (opt?.data._labels) {
|
|
1112
|
+
opt.data.labels = opt.data._labels;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
if (opt?.data._annotations) {
|
|
1116
|
+
opt.data.annotations = opt.data._annotations;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
try {
|
|
1120
|
+
const res = await this.$dispatch('request', { opt, type: this.type } );
|
|
1121
|
+
|
|
1122
|
+
// console.log('### Resource Save', this.type, this.id);
|
|
1123
|
+
|
|
1124
|
+
// Steve sometimes returns Table responses instead of the resource you just saved.. ignore
|
|
1125
|
+
if ( res && res.kind !== 'Table') {
|
|
1126
|
+
await this.$dispatch('load', { data: res, existing: (forNew ? this : undefined ) });
|
|
1127
|
+
}
|
|
1128
|
+
} catch (e) {
|
|
1129
|
+
if ( this.type && this.id && e?._status === 409) {
|
|
1130
|
+
// If there's a conflict, try to load the new version
|
|
1131
|
+
await this.$dispatch('find', {
|
|
1132
|
+
type: this.type,
|
|
1133
|
+
id: this.id,
|
|
1134
|
+
opt: { force: true }
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
return Promise.reject(e);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
return this;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
remove() {
|
|
1145
|
+
return this._remove(...arguments);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
async _remove(opt = {}) {
|
|
1149
|
+
if ( !opt.url ) {
|
|
1150
|
+
opt.url = this.linkFor('self');
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
opt.method = 'delete';
|
|
1154
|
+
|
|
1155
|
+
const res = await this.$dispatch('request', { opt, type: this.type } );
|
|
1156
|
+
|
|
1157
|
+
if ( res?._status === 204 ) {
|
|
1158
|
+
// If there's no body, assume the resource was immediately deleted
|
|
1159
|
+
// and drop it from the store as if a remove event happened.
|
|
1160
|
+
await this.$dispatch('ws.resource.remove', { data: this });
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// ------------------------------------------------------------------
|
|
1165
|
+
|
|
1166
|
+
currentRoute() {
|
|
1167
|
+
if ( process.server ) {
|
|
1168
|
+
return this.$rootState.$route;
|
|
1169
|
+
} else {
|
|
1170
|
+
return window.$nuxt.$route;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
currentRouter() {
|
|
1175
|
+
if ( process.server ) {
|
|
1176
|
+
return this.$rootState.$router;
|
|
1177
|
+
} else {
|
|
1178
|
+
return window.$nuxt.$router;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
get listLocation() {
|
|
1183
|
+
return {
|
|
1184
|
+
name: `c-cluster-product-resource`,
|
|
1185
|
+
params: {
|
|
1186
|
+
product: this.$rootGetters['productId'],
|
|
1187
|
+
cluster: this.$rootGetters['clusterId'],
|
|
1188
|
+
resource: this.type,
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
get _detailLocation() {
|
|
1194
|
+
const schema = this.$getters['schemaFor'](this.type);
|
|
1195
|
+
|
|
1196
|
+
const id = this.id?.replace(/.*\//, '');
|
|
1197
|
+
|
|
1198
|
+
return {
|
|
1199
|
+
name: `c-cluster-product-resource${ schema?.attributes?.namespaced ? '-namespace' : '' }-id`,
|
|
1200
|
+
params: {
|
|
1201
|
+
product: this.$rootGetters['productId'],
|
|
1202
|
+
cluster: this.$rootGetters['clusterId'],
|
|
1203
|
+
resource: this.type,
|
|
1204
|
+
namespace: this.metadata?.namespace,
|
|
1205
|
+
id,
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
get detailLocation() {
|
|
1211
|
+
return this._detailLocation;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
goToDetail() {
|
|
1215
|
+
this.currentRouter().push(this.detailLocation);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
goToClone(moreQuery = {}) {
|
|
1219
|
+
const location = this.detailLocation;
|
|
1220
|
+
|
|
1221
|
+
location.query = {
|
|
1222
|
+
...location.query,
|
|
1223
|
+
[MODE]: _CLONE,
|
|
1224
|
+
[AS]: _UNFLAG,
|
|
1225
|
+
...moreQuery
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
this.currentRouter().push(location);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
goToEdit(moreQuery = {}) {
|
|
1232
|
+
const location = this.detailLocation;
|
|
1233
|
+
|
|
1234
|
+
location.query = {
|
|
1235
|
+
...location.query,
|
|
1236
|
+
[MODE]: _EDIT,
|
|
1237
|
+
[AS]: _UNFLAG,
|
|
1238
|
+
...moreQuery
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
this.currentRouter().push(location);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
goToViewConfig(moreQuery = {}) {
|
|
1245
|
+
const location = this.detailLocation;
|
|
1246
|
+
|
|
1247
|
+
location.query = {
|
|
1248
|
+
...location.query,
|
|
1249
|
+
[MODE]: _VIEW,
|
|
1250
|
+
[AS]: _CONFIG,
|
|
1251
|
+
...moreQuery
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
this.currentRouter().push(location);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
goToEditYaml() {
|
|
1258
|
+
const location = this.detailLocation;
|
|
1259
|
+
|
|
1260
|
+
location.query = {
|
|
1261
|
+
...location.query,
|
|
1262
|
+
[MODE]: _EDIT,
|
|
1263
|
+
[AS]: _YAML
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
this.currentRouter().push(location);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
goToViewYaml() {
|
|
1270
|
+
const location = this.detailLocation;
|
|
1271
|
+
|
|
1272
|
+
location.query = {
|
|
1273
|
+
...location.query,
|
|
1274
|
+
[MODE]: _VIEW,
|
|
1275
|
+
[AS]: _YAML
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
this.currentRouter().push(location);
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
cloneYaml(moreQuery = {}) {
|
|
1282
|
+
const location = this.detailLocation;
|
|
1283
|
+
|
|
1284
|
+
location.query = {
|
|
1285
|
+
...location.query,
|
|
1286
|
+
[MODE]: _CLONE,
|
|
1287
|
+
[AS]: _YAML,
|
|
1288
|
+
...moreQuery
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
this.currentRouter().push(location);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
async download() {
|
|
1295
|
+
const value = await this.followLink('view', { headers: { accept: 'application/yaml' } });
|
|
1296
|
+
|
|
1297
|
+
downloadFile(`${ this.nameDisplay }.yaml`, value.data, 'application/yaml');
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
async downloadBulk(items) {
|
|
1301
|
+
const files = {};
|
|
1302
|
+
const names = [];
|
|
1303
|
+
|
|
1304
|
+
for ( const item of items ) {
|
|
1305
|
+
let name = `${ item.nameDisplay }.yaml`;
|
|
1306
|
+
let i = 2;
|
|
1307
|
+
|
|
1308
|
+
while ( names.includes(name) ) {
|
|
1309
|
+
name = `${ item.nameDisplay }_${ i++ }.yaml`;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
names.push(name);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
await eachLimit(items, 10, (item, idx) => {
|
|
1316
|
+
return item.followLink('view', { headers: { accept: 'application/yaml' } } ).then((data) => {
|
|
1317
|
+
files[`resources/${ names[idx] }`] = data.data || data;
|
|
1318
|
+
});
|
|
1319
|
+
});
|
|
1320
|
+
|
|
1321
|
+
const zip = await generateZip(files);
|
|
1322
|
+
|
|
1323
|
+
downloadFile('resources.zip', zip, 'application/zip');
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
viewInApi() {
|
|
1327
|
+
window.open(this.links.self, '_blank');
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
promptRemove(resources) {
|
|
1331
|
+
if ( !resources ) {
|
|
1332
|
+
resources = this;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
this.$dispatch('promptRemove', resources);
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
get confirmRemove() {
|
|
1339
|
+
return false;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
applyDefaults() {
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
get urlFromAttrs() {
|
|
1346
|
+
const schema = this.$getters['schemaFor'](this.type);
|
|
1347
|
+
const { metadata:{ namespace = 'default' } } = this;
|
|
1348
|
+
let url = schema.links.collection;
|
|
1349
|
+
|
|
1350
|
+
const attributes = schema?.attributes;
|
|
1351
|
+
|
|
1352
|
+
if (!attributes) {
|
|
1353
|
+
throw new Error('Attributes must be present on the schema');
|
|
1354
|
+
}
|
|
1355
|
+
const { group, resource } = attributes;
|
|
1356
|
+
|
|
1357
|
+
url = `${ url.slice(0, url.indexOf('/v1')) }/apis/${ group }/namespaces/${ namespace }/${ resource }`;
|
|
1358
|
+
|
|
1359
|
+
return url;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
// convert yaml to object, clean for new if creating/cloning
|
|
1363
|
+
// map _type to type
|
|
1364
|
+
cleanYaml(yaml, mode = 'edit') {
|
|
1365
|
+
try {
|
|
1366
|
+
const obj = jsyaml.load(yaml);
|
|
1367
|
+
|
|
1368
|
+
if (mode !== 'edit') {
|
|
1369
|
+
this.$dispatch(`cleanForNew`, obj);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
if (obj._type) {
|
|
1373
|
+
obj.type = obj._type;
|
|
1374
|
+
delete obj._type;
|
|
1375
|
+
}
|
|
1376
|
+
const out = jsyaml.dump(obj, { skipInvalid: true });
|
|
1377
|
+
|
|
1378
|
+
return out;
|
|
1379
|
+
} catch (e) {
|
|
1380
|
+
return null;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
cleanForNew() {
|
|
1385
|
+
this.$dispatch(`cleanForNew`, this);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
cleanForDiff() {
|
|
1389
|
+
this.$dispatch(`cleanForDiff`, this.toJSON());
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
yamlForSave(yaml) {
|
|
1393
|
+
try {
|
|
1394
|
+
const obj = jsyaml.load(yaml);
|
|
1395
|
+
|
|
1396
|
+
if (obj) {
|
|
1397
|
+
if (this._type) {
|
|
1398
|
+
obj._type = obj.type;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
return jsyaml.dump(obj);
|
|
1402
|
+
}
|
|
1403
|
+
} catch (e) {
|
|
1404
|
+
return null;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
async saveYaml(yaml) {
|
|
1409
|
+
/* Multipart support, but need to know the right cluster and work for management store
|
|
1410
|
+
and "apply" seems to only work for create, not update.
|
|
1411
|
+
|
|
1412
|
+
const ary = jsyaml.loadAll(yaml); // will throw on invalid yaml, and return one or more documents (usually one)
|
|
1413
|
+
|
|
1414
|
+
if ( ary.length > 1 ) {
|
|
1415
|
+
await this.$rootGetters['currentCluster'].doAction('apply', {
|
|
1416
|
+
yaml,
|
|
1417
|
+
defaultNamespace: this.metadata.namespace,
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
const parsed = ary[0];
|
|
1422
|
+
*/
|
|
1423
|
+
|
|
1424
|
+
const parsed = jsyaml.load(yaml); // will throw on invalid yaml, and return one or more documents (usually one)
|
|
1425
|
+
|
|
1426
|
+
if ( this.schema?.attributes?.namespaced && !parsed.metadata.namespace ) {
|
|
1427
|
+
const err = this.$rootGetters['i18n/t']('resourceYaml.errors.namespaceRequired');
|
|
1428
|
+
|
|
1429
|
+
throw err;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
let res;
|
|
1433
|
+
const isCreate = !this.id;
|
|
1434
|
+
const headers = {
|
|
1435
|
+
'content-type': 'application/yaml',
|
|
1436
|
+
accept: 'application/json',
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
if ( isCreate ) {
|
|
1440
|
+
res = await this.schema.followLink('collection', {
|
|
1441
|
+
method: 'POST',
|
|
1442
|
+
headers,
|
|
1443
|
+
data: yaml
|
|
1444
|
+
});
|
|
1445
|
+
} else {
|
|
1446
|
+
res = await this.followLink('update', {
|
|
1447
|
+
method: 'PUT',
|
|
1448
|
+
headers,
|
|
1449
|
+
data: yaml
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
await this.$dispatch(`load`, {
|
|
1454
|
+
data: res,
|
|
1455
|
+
existing: (isCreate ? this : undefined)
|
|
1456
|
+
});
|
|
1457
|
+
|
|
1458
|
+
if (this.isSpoofed) {
|
|
1459
|
+
await this.$dispatch('cluster/findAll', { type: this.type, opt: { force: true } }, { root: true });
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
validationErrors(data, ignoreFields) {
|
|
1464
|
+
const errors = [];
|
|
1465
|
+
const {
|
|
1466
|
+
type: originalType,
|
|
1467
|
+
schema
|
|
1468
|
+
} = data;
|
|
1469
|
+
const type = normalizeType(originalType);
|
|
1470
|
+
|
|
1471
|
+
if ( !originalType ) {
|
|
1472
|
+
// eslint-disable-next-line
|
|
1473
|
+
console.warn(this.t('validation.noType'), data);
|
|
1474
|
+
|
|
1475
|
+
return errors;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
if ( !schema ) {
|
|
1479
|
+
// eslint-disable-next-line
|
|
1480
|
+
// console.warn(this.t('validation.noSchema'), originalType, data);
|
|
1481
|
+
|
|
1482
|
+
return errors;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
const fields = schema.resourceFields || {};
|
|
1486
|
+
const keys = Object.keys(fields);
|
|
1487
|
+
let field, key, val, displayKey;
|
|
1488
|
+
|
|
1489
|
+
for ( let i = 0 ; i < keys.length ; i++ ) {
|
|
1490
|
+
const fieldErrors = [];
|
|
1491
|
+
|
|
1492
|
+
key = keys[i];
|
|
1493
|
+
field = fields[key];
|
|
1494
|
+
val = get(data, key);
|
|
1495
|
+
displayKey = displayKeyFor(type, key, this.$rootGetters);
|
|
1496
|
+
|
|
1497
|
+
const fieldType = field?.type ? normalizeType(field.type) : null;
|
|
1498
|
+
const valIsString = isString(val);
|
|
1499
|
+
|
|
1500
|
+
if ( ignoreFields && ignoreFields.includes(key) ) {
|
|
1501
|
+
continue;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
if ( val === undefined ) {
|
|
1505
|
+
val = null;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
if (valIsString) {
|
|
1509
|
+
if (fieldType) {
|
|
1510
|
+
Vue.set(data, key, coerceStringTypeToScalarType(val, fieldType));
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
// Empty strings on nullable string fields -> null
|
|
1514
|
+
if ( field.nullable && val.length === 0 && STRING_LIKE_TYPES.includes(fieldType)) {
|
|
1515
|
+
val = null;
|
|
1516
|
+
|
|
1517
|
+
Vue.set(data, key, val);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
if (fieldType === 'boolean') {
|
|
1521
|
+
validateBoolean(val, field, displayKey, this.$rootGetters, fieldErrors);
|
|
1522
|
+
} else {
|
|
1523
|
+
validateLength(val, field, displayKey, this.$rootGetters, fieldErrors);
|
|
1524
|
+
validateChars(val, field, displayKey, this.$rootGetters, fieldErrors);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
if (fieldErrors.length > 0) {
|
|
1528
|
+
fieldErrors.push(this.t('validation.required', { key: displayKey }));
|
|
1529
|
+
errors.push(...fieldErrors);
|
|
1530
|
+
continue;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
// IDs claim to be these but are lies...
|
|
1534
|
+
if ( key !== 'id' && !isEmpty(val) && DNS_LIKE_TYPES.includes(fieldType) ) {
|
|
1535
|
+
// DNS types should be lowercase
|
|
1536
|
+
const tolower = (val || '').toLowerCase();
|
|
1537
|
+
|
|
1538
|
+
if ( tolower !== val ) {
|
|
1539
|
+
val = tolower;
|
|
1540
|
+
|
|
1541
|
+
Vue.set(data, key, val);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
fieldErrors.push(...validateDnsLikeTypes(val, fieldType, displayKey, this.$rootGetters, fieldErrors));
|
|
1545
|
+
}
|
|
1546
|
+
errors.push(...fieldErrors);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
let { customValidationRules } = this;
|
|
1550
|
+
|
|
1551
|
+
if (!isEmpty(customValidationRules)) {
|
|
1552
|
+
if (isFunction(customValidationRules)) {
|
|
1553
|
+
customValidationRules = customValidationRules();
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
customValidationRules.forEach((rule) => {
|
|
1557
|
+
const {
|
|
1558
|
+
path,
|
|
1559
|
+
requiredIf: requiredIfPath,
|
|
1560
|
+
validators = [],
|
|
1561
|
+
type: fieldType,
|
|
1562
|
+
} = rule;
|
|
1563
|
+
let pathValue = get(data, path);
|
|
1564
|
+
|
|
1565
|
+
const parsedRules = compact((validators || []));
|
|
1566
|
+
let displayKey = path;
|
|
1567
|
+
|
|
1568
|
+
if (rule.translationKey && this.$rootGetters['i18n/exists'](rule.translationKey)) {
|
|
1569
|
+
displayKey = this.t(rule.translationKey);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
if (isString(pathValue)) {
|
|
1573
|
+
pathValue = pathValue.trim();
|
|
1574
|
+
}
|
|
1575
|
+
if (requiredIfPath) {
|
|
1576
|
+
const reqIfVal = get(data, requiredIfPath);
|
|
1577
|
+
|
|
1578
|
+
if (!isEmpty(reqIfVal) && (isEmpty(pathValue) && pathValue !== 0)) {
|
|
1579
|
+
errors.push(this.t('validation.required', { key: displayKey }));
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
validateLength(pathValue, rule, displayKey, this.$rootGetters, errors);
|
|
1584
|
+
validateChars(pathValue, rule, displayKey, this.$rootGetters, errors);
|
|
1585
|
+
|
|
1586
|
+
if ( !isEmpty(pathValue) && DNS_LIKE_TYPES.includes(fieldType) ) {
|
|
1587
|
+
// DNS types should be lowercase
|
|
1588
|
+
const tolower = (pathValue || '').toLowerCase();
|
|
1589
|
+
|
|
1590
|
+
if ( tolower !== pathValue ) {
|
|
1591
|
+
pathValue = tolower;
|
|
1592
|
+
|
|
1593
|
+
Vue.set(data, path, pathValue);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
errors.push(...validateDnsLikeTypes(pathValue, fieldType, displayKey, this.$rootGetters, errors));
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
parsedRules.forEach((validator) => {
|
|
1600
|
+
const validatorAndArgs = validator.split(':');
|
|
1601
|
+
const validatorName = validatorAndArgs.slice(0, 1);
|
|
1602
|
+
const validatorArgs = validatorAndArgs.slice(1) || null;
|
|
1603
|
+
const validatorExists = Object.prototype.hasOwnProperty.call(CustomValidators, validatorName);
|
|
1604
|
+
|
|
1605
|
+
if (!isEmpty(validatorName) && validatorExists) {
|
|
1606
|
+
CustomValidators[validatorName](pathValue, this.$rootGetters, errors, validatorArgs, displayKey, data);
|
|
1607
|
+
} else if (!isEmpty(validatorName) && !validatorExists) {
|
|
1608
|
+
// eslint-disable-next-line
|
|
1609
|
+
console.warn(this.t('validation.custom.missing', { validatorName }));
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
return uniq(errors);
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
get ownersByType() {
|
|
1619
|
+
const ownerReferences = this.metadata?.ownerReferences || [];
|
|
1620
|
+
const ownersByType = {};
|
|
1621
|
+
|
|
1622
|
+
ownerReferences.forEach((owner) => {
|
|
1623
|
+
if (!ownersByType[owner.kind]) {
|
|
1624
|
+
ownersByType[owner.kind] = [owner];
|
|
1625
|
+
} else {
|
|
1626
|
+
ownersByType[owner.kind].push(owner);
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
|
|
1630
|
+
return ownersByType;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
get owners() {
|
|
1634
|
+
const owners = [];
|
|
1635
|
+
|
|
1636
|
+
for ( const kind in this.ownersByType) {
|
|
1637
|
+
const schema = this.$rootGetters['cluster/schema'](kind);
|
|
1638
|
+
|
|
1639
|
+
if (schema) {
|
|
1640
|
+
const type = schema.id;
|
|
1641
|
+
const allOfResourceType = this.$rootGetters['cluster/all']( type );
|
|
1642
|
+
|
|
1643
|
+
this.ownersByType[kind].forEach((resource, idx) => {
|
|
1644
|
+
const resourceInstance = allOfResourceType.find(resourceByType => resourceByType?.metadata?.uid === resource.uid);
|
|
1645
|
+
|
|
1646
|
+
if (resourceInstance) {
|
|
1647
|
+
owners.push(resourceInstance);
|
|
1648
|
+
}
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
return owners;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
get details() {
|
|
1657
|
+
return this._details;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
get _details() {
|
|
1661
|
+
const details = [];
|
|
1662
|
+
|
|
1663
|
+
if (this.owners?.length > 0) {
|
|
1664
|
+
details.push({
|
|
1665
|
+
label: this.t('resourceDetail.detailTop.ownerReferences', { count: this.owners.length }),
|
|
1666
|
+
formatter: 'ListLinkDetail',
|
|
1667
|
+
content: this.owners.map(owner => ({
|
|
1668
|
+
key: owner.id,
|
|
1669
|
+
row: owner,
|
|
1670
|
+
col: {},
|
|
1671
|
+
value: owner.metadata.name
|
|
1672
|
+
}))
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
if (get(this, 'metadata.deletionTimestamp')) {
|
|
1677
|
+
details.push({
|
|
1678
|
+
label: this.t('resourceDetail.detailTop.deleted'),
|
|
1679
|
+
formatter: 'LiveDate',
|
|
1680
|
+
formatterOpts: { addSuffix: true },
|
|
1681
|
+
content: get(this, 'metadata.deletionTimestamp')
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
return details;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
get t() {
|
|
1689
|
+
return this.$rootGetters['i18n/t'];
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
// Returns array of MODELS that own this resource (async, network call)
|
|
1693
|
+
findOwners() {
|
|
1694
|
+
return this._getRelationship('owner', 'from');
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
// Returns array of {type, namespace, id} objects that own this resource (sync)
|
|
1698
|
+
getOwners() {
|
|
1699
|
+
return this._getRelationship('owner', 'from');
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
findOwned() {
|
|
1703
|
+
return this._findRelationship('owner', 'to');
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
_relationshipsFor(rel, direction) {
|
|
1707
|
+
const out = { selectors: [], ids: [] };
|
|
1708
|
+
|
|
1709
|
+
if ( !this.metadata?.relationships?.length ) {
|
|
1710
|
+
return out;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
for ( const r of this.metadata.relationships ) {
|
|
1714
|
+
if ( rel !== 'any' && r.rel !== rel ) {
|
|
1715
|
+
continue;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
if ( !r[`${ direction }Type`] ) {
|
|
1719
|
+
continue;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
if ( r.selector ) {
|
|
1723
|
+
addObjects(out.selectors, {
|
|
1724
|
+
type: r.toType,
|
|
1725
|
+
namespace: r.toNamespace,
|
|
1726
|
+
selector: r.selector
|
|
1727
|
+
});
|
|
1728
|
+
} else {
|
|
1729
|
+
const type = r[`${ direction }Type`];
|
|
1730
|
+
let namespace = r[`${ direction }Namespace`];
|
|
1731
|
+
let name = r[`${ direction }Id`];
|
|
1732
|
+
|
|
1733
|
+
if ( !namespace && name.includes('/') ) {
|
|
1734
|
+
const idx = name.indexOf('/');
|
|
1735
|
+
|
|
1736
|
+
namespace = name.substr(0, idx);
|
|
1737
|
+
name = name.substr(idx + 1);
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
const id = (namespace ? `${ namespace }/` : '') + name;
|
|
1741
|
+
|
|
1742
|
+
addObject(out.ids, {
|
|
1743
|
+
type,
|
|
1744
|
+
namespace,
|
|
1745
|
+
name,
|
|
1746
|
+
id,
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
return out;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
_getRelationship(rel, direction) {
|
|
1755
|
+
const res = this._relationshipsFor(rel, direction);
|
|
1756
|
+
|
|
1757
|
+
if ( res.selectors?.length ) {
|
|
1758
|
+
// eslint-disable-next-line no-console
|
|
1759
|
+
console.warn('Sync request for a relationship that is a selector');
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
return res.ids || [];
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
async _findRelationship(rel, direction) {
|
|
1766
|
+
const { selectors, ids } = this._relationshipsFor(rel, direction);
|
|
1767
|
+
const out = [];
|
|
1768
|
+
|
|
1769
|
+
for ( const sel of selectors ) {
|
|
1770
|
+
const matching = await this.$dispatch('findMatching', sel);
|
|
1771
|
+
|
|
1772
|
+
addObjects(out, matching.data);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
for ( const obj of ids ) {
|
|
1776
|
+
const { type, id } = obj;
|
|
1777
|
+
let matching = this.$getters['byId'](type, id);
|
|
1778
|
+
|
|
1779
|
+
if ( !matching ) {
|
|
1780
|
+
try {
|
|
1781
|
+
matching = await this.$dispatch('find', { type, id });
|
|
1782
|
+
} catch {
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
if (matching) {
|
|
1786
|
+
addObject(out, matching);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
return out;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
get shortId() {
|
|
1794
|
+
const splitId = this.id.split('/');
|
|
1795
|
+
|
|
1796
|
+
return splitId.length > 1 ? splitId[1] : splitId[0];
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
toJSON() {
|
|
1800
|
+
const out = {};
|
|
1801
|
+
const keys = Object.keys(this);
|
|
1802
|
+
|
|
1803
|
+
for ( const k of keys ) {
|
|
1804
|
+
if ( this[k]?.toJSON ) {
|
|
1805
|
+
out[k] = this[k].toJSON();
|
|
1806
|
+
} else {
|
|
1807
|
+
out[k] = clone(this[k]);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
return out;
|
|
1812
|
+
}
|
|
1813
|
+
}
|