@rancher/shell 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/brand/csp/dark/rancher-logo.svg +148 -0
- package/assets/brand/csp/favicon.png +0 -0
- package/assets/brand/csp/metadata.json +3 -0
- package/assets/brand/csp/rancher-logo.svg +130 -0
- package/assets/styles/app.scss +2 -1
- package/assets/styles/global/_layout.scss +53 -0
- package/assets/styles/themes/_csp.scss +25 -0
- package/assets/styles/themes/_dark.scss +2 -1
- package/assets/styles/themes/_light.scss +2 -1
- package/assets/styles/vendor/vue-select.scss +0 -5
- package/assets/translations/en-us.yaml +45 -28
- package/chart/istio.vue +81 -22
- package/chart/logging/index.vue +20 -6
- package/chart/monitoring/alerting/index.vue +4 -1
- package/chart/monitoring/index.vue +41 -9
- package/chart/monitoring/prometheus/index.vue +33 -29
- package/chart/monitoring/steps/uninstall-v1.vue +8 -4
- package/chart/rancher-backup/S3.vue +43 -8
- package/chart/rancher-backup/index.vue +23 -5
- package/chart/rancher-gatekeeper.vue +10 -2
- package/cloud-credential/aws.vue +8 -2
- package/cloud-credential/digitalocean.vue +4 -1
- package/cloud-credential/gcp.vue +9 -2
- package/cloud-credential/generic.vue +6 -1
- package/cloud-credential/harvester.vue +4 -1
- package/cloud-credential/linode.vue +4 -1
- package/cloud-credential/s3.vue +4 -1
- package/components/.DS_Store +0 -0
- package/components/ActionDropdown.vue +4 -1
- package/components/ActionMenu.vue +17 -4
- package/components/AdvancedSection.vue +6 -1
- package/components/Alert.vue +5 -1
- package/components/AssignTo.vue +24 -6
- package/components/AsyncButton.vue +10 -0
- package/components/AwsComplianceBanner.vue +4 -1
- package/components/BackLink.vue +5 -1
- package/components/BannerGraphic.vue +16 -4
- package/components/BrandImage.vue +4 -1
- package/components/ButtonDropdown.vue +10 -3
- package/components/ButtonGroup.vue +17 -4
- package/components/Carousel.vue +26 -8
- package/components/ChartHeading.vue +5 -1
- package/components/ChartReadme.vue +17 -5
- package/components/ClusterBadge.vue +5 -1
- package/components/ClusterProviderIcon.vue +15 -3
- package/components/Collapse.vue +17 -5
- package/components/CollapsibleCard.vue +10 -4
- package/components/CommunityLinks.vue +32 -9
- package/components/CompoundStatusBadge.vue +4 -1
- package/components/ContainerResourceLimit.vue +12 -3
- package/components/CopyToClipboardText.vue +10 -2
- package/components/CountBox.vue +13 -3
- package/components/CountGauge.vue +28 -5
- package/components/CruResource.vue +88 -23
- package/components/CruResourceFooter.vue +1 -1
- package/components/DashboardMetrics.vue +12 -3
- package/components/DashboardOptions.vue +14 -3
- package/components/DetailText.vue +28 -6
- package/components/DetailTop.vue +57 -12
- package/components/Dialog.vue +17 -5
- package/components/EmberPage.vue +23 -5
- package/components/EmberPageView.vue +4 -1
- package/components/EtcdInfoBanner.vue +5 -1
- package/components/ExplorerMembers.vue +7 -9
- package/components/ExplorerProjectsNamespaces.vue +42 -10
- package/components/FileDiff.vue +5 -1
- package/components/FixedBanner.vue +27 -7
- package/components/Flag.vue +8 -2
- package/components/Glance.vue +11 -2
- package/components/GlobalRoleBindings.vue +24 -5
- package/components/GradientBox.vue +5 -1
- package/components/GrafanaDashboard.vue +19 -5
- package/components/GrowlManager.vue +27 -6
- package/components/HardwareResourceGauge.vue +8 -2
- package/components/HarvesterServiceAddOnConfig.vue +4 -1
- package/components/IconMessage.vue +8 -2
- package/components/Import.vue +37 -8
- package/components/IndentedPanel.vue +4 -1
- package/components/InfoBox.vue +8 -2
- package/components/KeyValueView.vue +29 -7
- package/components/LandingPagePreference.vue +13 -2
- package/components/LazyImage.vue +5 -1
- package/components/Loading.vue +13 -3
- package/components/LocaleSelector.vue +10 -2
- package/components/Markdown.vue +5 -1
- package/components/MessageLink.vue +19 -4
- package/components/ModalWithCard.vue +24 -8
- package/components/MoveModal.vue +35 -7
- package/components/PercentageBar.vue +9 -2
- package/components/ProgressBarMulti.vue +4 -1
- package/components/PromptChangePassword.vue +17 -4
- package/components/PromptModal.vue +7 -1
- package/components/PromptRemove.vue +31 -10
- package/components/PromptRestore.vue +35 -10
- package/components/Questions/Array.vue +4 -1
- package/components/Questions/Boolean.vue +4 -1
- package/components/Questions/Enum.vue +4 -1
- package/components/Questions/Float.vue +4 -1
- package/components/Questions/Int.vue +4 -1
- package/components/Questions/QuestionMap.vue +4 -1
- package/components/Questions/Reference.vue +8 -2
- package/components/Questions/String.vue +4 -1
- package/components/Questions/index.vue +10 -2
- package/components/Random.vue +11 -3
- package/components/RelatedResources.vue +8 -2
- package/components/RelatedWorkloadsTable.vue +5 -1
- package/components/ResourceCancelModal.vue +15 -3
- package/components/ResourceDetail/Masthead.vue +31 -7
- package/components/ResourceList/Masthead.vue +6 -4
- package/components/ResourceList/ResourceLoadingIndicator.vue +8 -2
- package/components/ResourceList/index.vue +11 -8
- package/components/ResourceSummary.vue +13 -3
- package/components/ResourceTable.vue +59 -11
- package/components/ResourceYaml.vue +8 -2
- package/components/RoleBindings.vue +20 -3
- package/components/SelectIconGrid.vue +29 -7
- package/components/SimpleBox.vue +14 -3
- package/components/SingleClusterInfo.vue +40 -9
- package/components/SortableTable/THead.vue +29 -8
- package/components/SortableTable/filtering.js +7 -0
- package/components/SortableTable/index.vue +204 -45
- package/components/Tabbed/Tab.vue +9 -2
- package/components/Tabbed/index.vue +32 -7
- package/components/TableSparkLine.vue +4 -1
- package/components/Tip.vue +4 -1
- package/components/Wizard.vue +105 -23
- package/components/YamlEditor.vue +5 -1
- package/components/__tests__/.DS_Store +0 -0
- package/components/auth/AllowedPrincipals.vue +21 -5
- package/components/auth/AuthBanner.vue +21 -5
- package/components/auth/AzureWarning.vue +5 -1
- package/components/auth/Principal.vue +37 -9
- package/components/auth/RoleDetailEdit.vue +34 -10
- package/components/auth/SelectPrincipal.vue +20 -3
- package/components/auth/login/github.vue +5 -1
- package/components/auth/login/ldap.vue +10 -2
- package/components/auth/login/oauth.vue +6 -1
- package/components/auth/login/oidc.vue +6 -1
- package/components/auth/login/saml.vue +6 -1
- package/components/fleet/FleetBundles.vue +9 -2
- package/components/fleet/FleetClusters.vue +29 -6
- package/components/fleet/FleetIntro.vue +5 -2
- package/components/fleet/FleetRepos.vue +23 -4
- package/components/fleet/FleetStatus.vue +16 -4
- package/components/fleet/FleetSummary.vue +10 -2
- package/components/fleet/ForceDirectedTreeChart/index.vue +5 -3
- package/components/fleet/ResourcesSummary.vue +5 -1
- package/components/form/ArrayList.vue +31 -8
- package/components/form/ArrayListGrouped.vue +9 -3
- package/components/form/ArrayListSelect.vue +6 -1
- package/components/form/BannerSettings.vue +8 -2
- package/components/form/ChangePassword.vue +50 -10
- package/components/form/ColorInput.vue +28 -5
- package/components/form/Command.vue +5 -2
- package/components/form/EnvVars.vue +4 -1
- package/components/form/Error.vue +10 -2
- package/components/form/FileImageSelector.vue +1 -1
- package/components/form/FileSelector.vue +8 -2
- package/components/form/Footer.vue +14 -4
- package/components/form/GithubPicker.vue +16 -9
- package/components/form/HookOption.vue +5 -1
- package/components/form/InputWithSelect.vue +1 -1
- package/components/form/KeyValue.vue +81 -19
- package/components/form/LabeledSelect.vue +55 -8
- package/components/form/Labels.vue +1 -1
- package/components/form/LifecycleHooks.vue +10 -2
- package/components/form/MatchExpressions.vue +11 -3
- package/components/form/Members/ClusterPermissionsEditor.vue +21 -4
- package/components/form/Members/MembershipEditor.vue +11 -2
- package/components/form/NameNsDescription.vue +16 -10
- package/components/form/Networking.vue +3 -3
- package/components/form/NodeAffinity.vue +4 -1
- package/components/form/NodeScheduling.vue +5 -1
- package/components/form/Password.vue +32 -7
- package/components/form/PlusMinus.vue +18 -3
- package/components/form/PodAffinity.vue +12 -5
- package/components/form/PodSecurity.vue +20 -4
- package/components/form/Ports.vue +37 -11
- package/components/form/Probe.vue +18 -4
- package/components/form/ProjectMemberEditor.vue +24 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +4 -1
- package/components/form/ResourceQuota/Project.vue +7 -1
- package/components/form/ResourceQuota/ProjectRow.vue +11 -2
- package/components/form/ResourceSelector.vue +145 -0
- package/components/form/ResourceTabs/index.vue +38 -7
- package/components/form/RuleSelector.vue +15 -4
- package/components/form/SecretSelector.vue +4 -1
- package/components/form/Security.vue +2 -2
- package/components/form/Select.vue +8 -3
- package/components/form/SelectOrCreateAuthSecret.vue +43 -9
- package/components/form/ServiceNameSelect.vue +2 -2
- package/components/form/ServicePorts.vue +58 -17
- package/components/form/Tolerations.vue +34 -7
- package/components/form/ValueFromResource.vue +10 -2
- package/components/form/WorkloadPorts.vue +36 -8
- package/components/form/__tests__/MatchExpressions.test.ts +1 -2
- package/components/formatter/AppSummaryGraph.vue +24 -6
- package/components/formatter/BadgeStateFormatter.vue +4 -1
- package/components/formatter/Checked.vue +4 -1
- package/components/formatter/ClusterLink.vue +4 -1
- package/components/formatter/Date.vue +1 -1
- package/components/formatter/DelayedValue.vue +4 -1
- package/components/formatter/Endpoints.vue +5 -1
- package/components/formatter/ExternalLink.vue +5 -1
- package/components/formatter/FleetSummaryGraph.vue +20 -5
- package/components/formatter/IconText.vue +4 -1
- package/components/formatter/ImagePercentageBar.vue +5 -1
- package/components/formatter/IngressFullPath.vue +6 -1
- package/components/formatter/IngressTarget.vue +22 -5
- package/components/formatter/InternalExternalIP.vue +12 -2
- package/components/formatter/KeyValue.vue +5 -1
- package/components/formatter/Link.vue +30 -6
- package/components/formatter/LinkDetail.vue +4 -1
- package/components/formatter/LinkDetailImage.vue +1 -1
- package/components/formatter/ListLink.vue +10 -2
- package/components/formatter/ListLinkDetail.vue +6 -1
- package/components/formatter/LiveDate.vue +13 -3
- package/components/formatter/LiveExpiryDate.vue +18 -4
- package/components/formatter/LivePodRestarts.vue +4 -1
- package/components/formatter/MachineSummaryGraph.vue +25 -6
- package/components/formatter/Number.vue +4 -1
- package/components/formatter/PodsUsage.vue +4 -1
- package/components/formatter/Principal.vue +5 -1
- package/components/formatter/PrincipalGroupBindings.vue +4 -1
- package/components/formatter/ReceiverIcons.vue +9 -3
- package/components/formatter/RunBookLink.vue +6 -1
- package/components/formatter/Scale.vue +45 -10
- package/components/formatter/ScanResult.vue +4 -1
- package/components/formatter/SecretData.vue +5 -2
- package/components/formatter/SecretType.vue +4 -1
- package/components/formatter/ServiceTargets.vue +16 -4
- package/components/formatter/Shortened.vue +8 -2
- package/components/formatter/VirtualServiceGateways.vue +8 -2
- package/components/formatter/Weight.vue +19 -4
- package/components/formatter/WorkloadDetailEndpoints.vue +5 -1
- package/components/formatter/WorkloadHealthScale.vue +42 -8
- package/components/graph/AspectPreserver.vue +14 -3
- package/components/graph/Bar.vue +14 -3
- package/components/graph/Circle.vue +36 -7
- package/components/graph/HalfCircle.vue +6 -1
- package/components/graph/LinePlot.vue +3 -6
- package/components/graph/ProgressArc.vue +8 -2
- package/components/nav/GlobalLoading.vue +4 -1
- package/components/nav/Group.vue +39 -9
- package/components/nav/Header.vue +154 -37
- package/components/nav/Jump.vue +6 -2
- package/components/nav/NamespaceFilter.vue +112 -24
- package/components/nav/TopLevelMenu.vue +108 -24
- package/components/nav/Type.vue +18 -4
- package/components/nav/WindowManager/ChartReadme.vue +4 -1
- package/components/nav/WindowManager/ContainerLogs.vue +92 -19
- package/components/nav/WindowManager/ContainerShell.vue +26 -6
- package/components/nav/WindowManager/Window.vue +8 -2
- package/components/nav/WindowManager/index.vue +17 -4
- package/config/labels-annotations.js +5 -42
- package/config/private-label.js +5 -2
- package/config/product/explorer.js +8 -2
- package/config/roles.ts +2 -1
- package/config/{settings.js → settings.ts} +33 -50
- package/config/types.js +2 -0
- package/content/docs/en-us/getting-started.md +3 -3
- package/content/docs/en-us/whats-new.md +9 -123
- package/core/plugins.js +11 -8
- package/creators/app/{files/.eslintignore → .eslintignore} +0 -0
- package/creators/app/{files/.eslintrc.js → .eslintrc.js} +0 -0
- package/creators/app/{files/.vscode → .vscode}/settings.json +0 -0
- package/creators/app/{files/babel.config.js → babel.config.js} +0 -0
- package/creators/app/init +17 -16
- package/creators/app/{files/nuxt.config.js → nuxt.config.js} +0 -0
- package/creators/app/package.json +1 -7
- package/creators/app/{files/tsconfig.json → tsconfig.json} +1 -2
- package/creators/pkg/{files/babel.config.js → babel.config.js} +0 -0
- package/creators/pkg/{files/index.ts → index.ts} +0 -0
- package/creators/pkg/init +1 -1
- package/creators/pkg/nuxt.config.js +6 -0
- package/creators/pkg/package-lock.json +37 -0
- package/creators/pkg/package.json +1 -1
- package/creators/pkg/{files/tsconfig.json → tsconfig.json} +12 -13
- package/creators/pkg/{files/vue.config.js → vue.config.js} +0 -0
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +12 -3
- package/detail/catalog.cattle.io.app.vue +41 -8
- package/detail/catalog.cattle.io.clusterrepo.vue +4 -1
- package/detail/cis.cattle.io.clusterscan.vue +23 -5
- package/detail/configmap.vue +18 -4
- package/detail/constraints.gatekeeper.sh.constraint.vue +4 -1
- package/detail/fleet.cattle.io.cluster.vue +14 -3
- package/detail/fleet.cattle.io.clustergroup.vue +9 -2
- package/detail/fleet.cattle.io.gitrepo.vue +16 -3
- package/detail/harvesterhci.io.management.cluster.vue +5 -1
- package/detail/helm.cattle.io.projecthelmchart.vue +49 -13
- package/detail/management.cattle.io.fleetworkspace.vue +19 -4
- package/detail/management.cattle.io.roletemplate.vue +4 -1
- package/detail/management.cattle.io.user.vue +26 -5
- package/detail/namespace.vue +6 -4
- package/detail/networking.k8s.io.ingress.vue +16 -3
- package/detail/node.vue +83 -18
- package/detail/pod.vue +27 -5
- package/detail/provisioning.cattle.io.cluster.vue +195 -43
- package/detail/secret.vue +78 -19
- package/detail/service.vue +9 -2
- package/detail/workload/index.vue +81 -17
- package/dialog/AddClusterMemberDialog.vue +25 -6
- package/dialog/AddCustomBadgeDialog.vue +43 -10
- package/dialog/AddProjectMemberDialog.vue +27 -7
- package/dialog/AddonConfigConfirmationDialog.vue +17 -4
- package/dialog/DiagnosticTimingsDialog.vue +27 -6
- package/dialog/DrainNode.vue +46 -11
- package/dialog/ForceMachineRemoveDialog.vue +35 -8
- package/dialog/GenericPrompt.vue +28 -7
- package/dialog/RollbackWorkloadDialog.vue +45 -11
- package/dialog/RotateCertificatesDialog.vue +31 -6
- package/dialog/RotateEncryptionKeyDialog.vue +41 -10
- package/dialog/SaveAsRKETemplateDialog.vue +31 -7
- package/dialog/ScaleMachineDownDialog.vue +13 -3
- package/edit/__tests__/management.cattle.io.setting.test.ts +87 -0
- package/edit/auth/azuread.vue +20 -6
- package/edit/auth/github.vue +52 -11
- package/edit/auth/googleoauth.vue +81 -17
- package/edit/auth/ldap/config.vue +164 -31
- package/edit/auth/ldap/index.vue +29 -7
- package/edit/auth/oidc.vue +36 -8
- package/edit/auth/saml.vue +57 -12
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +9 -2
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +23 -6
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +8 -2
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +16 -4
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +13 -3
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +9 -2
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +6 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +15 -3
- package/edit/cis.cattle.io.clusterscan.vue +53 -11
- package/edit/cis.cattle.io.clusterscanbenchmark.vue +15 -3
- package/edit/cis.cattle.io.clusterscanprofile.vue +13 -3
- package/edit/configmap.vue +5 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +40 -9
- package/edit/fleet.cattle.io.cluster.vue +6 -2
- package/edit/fleet.cattle.io.clustergroup.vue +12 -3
- package/edit/fleet.cattle.io.gitrepo.vue +25 -5
- package/edit/group.principal.vue +6 -1
- package/edit/harvesterhci.io.management.cluster.vue +22 -5
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +11 -2
- package/edit/logging-flow/Match.vue +2 -2
- package/edit/logging-flow/index.vue +67 -14
- package/edit/logging.banzaicloud.io.output/index.vue +37 -8
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +7 -2
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +19 -4
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +24 -4
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +20 -5
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +21 -5
- package/edit/logging.banzaicloud.io.output/providers/file.vue +6 -1
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +8 -3
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +25 -5
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +46 -8
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +26 -6
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +7 -2
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +20 -4
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +8 -3
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +34 -8
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +25 -5
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +33 -7
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +57 -12
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +10 -2
- package/edit/management.cattle.io.fleetworkspace.vue +17 -4
- package/edit/management.cattle.io.project.vue +7 -1
- package/edit/management.cattle.io.roletemplate.vue +4 -1
- package/edit/management.cattle.io.setting.vue +71 -30
- package/edit/management.cattle.io.user.vue +4 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +24 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +24 -5
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +29 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +12 -3
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +50 -9
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +31 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +29 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +8 -2
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +36 -7
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +24 -6
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +16 -6
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +10 -2
- package/edit/monitoring.coreos.com.receiver/auth.vue +36 -7
- package/edit/monitoring.coreos.com.receiver/index.vue +53 -11
- package/edit/monitoring.coreos.com.receiver/tls.vue +22 -4
- package/edit/monitoring.coreos.com.receiver/types/email.vue +48 -8
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +32 -6
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +22 -4
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +4 -1
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +5 -1
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +31 -6
- package/edit/monitoring.coreos.com.route.vue +71 -15
- package/edit/namespace.vue +35 -7
- package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +12 -3
- package/edit/networking.istio.io.destinationrule/index.vue +5 -3
- package/edit/networking.k8s.io.ingress/Certificate.vue +10 -2
- package/edit/networking.k8s.io.ingress/Certificates.vue +6 -1
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +16 -4
- package/edit/networking.k8s.io.ingress/Rule.vue +21 -5
- package/edit/networking.k8s.io.ingress/RulePath.vue +27 -6
- package/edit/networking.k8s.io.ingress/Rules.vue +7 -1
- package/edit/networking.k8s.io.ingress/index.vue +52 -9
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +20 -4
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +8 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +36 -8
- package/edit/node.vue +13 -3
- package/edit/persistentvolume/index.vue +48 -8
- package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +19 -3
- package/edit/persistentvolume/plugins/azureDisk.vue +20 -3
- package/edit/persistentvolume/plugins/azureFile.vue +18 -3
- package/edit/persistentvolume/plugins/cephfs.vue +35 -6
- package/edit/persistentvolume/plugins/cinder.vue +24 -4
- package/edit/persistentvolume/plugins/csi.vue +72 -12
- package/edit/persistentvolume/plugins/fc.vue +23 -4
- package/edit/persistentvolume/plugins/flexVolume.vue +30 -5
- package/edit/persistentvolume/plugins/flocker.vue +12 -2
- package/edit/persistentvolume/plugins/gcePersistentDisk.vue +19 -3
- package/edit/persistentvolume/plugins/glusterfs.vue +12 -2
- package/edit/persistentvolume/plugins/hostPath.vue +12 -2
- package/edit/persistentvolume/plugins/iscsi.vue +54 -9
- package/edit/persistentvolume/plugins/local.vue +6 -1
- package/edit/persistentvolume/plugins/longhorn.vue +13 -2
- package/edit/persistentvolume/plugins/nfs.vue +12 -2
- package/edit/persistentvolume/plugins/photonPersistentDisk.vue +12 -2
- package/edit/persistentvolume/plugins/portworxVolume.vue +12 -2
- package/edit/persistentvolume/plugins/quobyte.vue +24 -4
- package/edit/persistentvolume/plugins/rbd.vue +47 -8
- package/edit/persistentvolume/plugins/scaleIO.vue +54 -9
- package/edit/persistentvolume/plugins/storageos.vue +30 -5
- package/edit/persistentvolume/plugins/vsphereVolume.vue +24 -4
- package/edit/persistentvolumeclaim.vue +69 -15
- package/edit/policy.poddisruptionbudget.vue +149 -0
- package/edit/provisioning.cattle.io.cluster/ACE.vue +6 -1
- package/edit/provisioning.cattle.io.cluster/AgentEnv.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +61 -15
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +24 -4
- package/edit/provisioning.cattle.io.cluster/Labels.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +31 -8
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +16 -3
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/S3Config.vue +35 -6
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +21 -5
- package/edit/provisioning.cattle.io.cluster/import.vue +23 -5
- package/edit/provisioning.cattle.io.cluster/index.vue +9 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +203 -64
- package/edit/resources.cattle.io.backup.vue +42 -8
- package/edit/resources.cattle.io.restore.vue +53 -11
- package/edit/secret/basic.vue +12 -2
- package/edit/secret/index.vue +29 -7
- package/edit/secret/registry.vue +22 -4
- package/edit/secret/ssh.vue +10 -2
- package/edit/secret/tls.vue +10 -2
- package/edit/service.vue +12 -3
- package/edit/serviceaccount.vue +6 -3
- package/edit/storage.k8s.io.storageclass/index.vue +15 -3
- package/edit/storage.k8s.io.storageclass/provisioners/custom.vue +6 -1
- package/edit/storage.k8s.io.storageclass/provisioners/driver.longhorn.io.vue +6 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +20 -3
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +12 -2
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +18 -3
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +13 -2
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +14 -2
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +54 -9
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +42 -7
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +48 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +66 -11
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +48 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +30 -5
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +36 -6
- package/edit/token.vue +48 -10
- package/edit/workload/Job.vue +20 -5
- package/edit/workload/Upgrading.vue +28 -7
- package/edit/workload/index.vue +244 -48
- package/edit/workload/storage/azureDisk.vue +5 -1
- package/edit/workload/storage/azureFile.vue +5 -1
- package/edit/workload/storage/csi/driver.longhorn.io.vue +6 -1
- package/edit/workload/storage/csi/index.vue +9 -2
- package/edit/workload/storage/ephemeralVolume/index.vue +38 -8
- package/edit/workload/storage/gcePersistentDisk.vue +10 -2
- package/edit/workload/storage/hostPath.vue +18 -3
- package/edit/workload/storage/persistentVolumeClaim/index.vue +4 -1
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +26 -5
- package/edit/workload/storage/vsphereVolume.vue +10 -2
- package/layouts/blank.vue +1 -1
- package/layouts/default.vue +60 -65
- package/layouts/error.vue +25 -5
- package/layouts/home.vue +17 -4
- package/layouts/plain.vue +13 -3
- package/layouts/unauthenticated.vue +1 -1
- package/list/catalog.cattle.io.app.vue +15 -2
- package/list/catalog.cattle.io.clusterrepo.vue +5 -0
- package/list/cis.cattle.io.clusterscan.vue +6 -0
- package/list/fleet.cattle.io.bundle.vue +14 -2
- package/list/fleet.cattle.io.cluster.vue +10 -1
- package/list/fleet.cattle.io.clustergroup.vue +14 -2
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +11 -3
- package/list/fleet.cattle.io.gitrepo.vue +6 -0
- package/list/group.principal.vue +11 -1
- package/list/harvesterhci.io.management.cluster.vue +25 -6
- package/list/helm.cattle.io.projecthelmchart.vue +23 -5
- package/list/logging.banzaicloud.io.clusterflow.vue +11 -1
- package/list/logging.banzaicloud.io.flow.vue +11 -1
- package/list/management.cattle.io.cluster.vue +12 -1
- package/list/management.cattle.io.feature.vue +71 -15
- package/list/management.cattle.io.setting.vue +44 -10
- package/list/management.cattle.io.user.vue +12 -1
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +6 -0
- package/list/namespace.vue +8 -0
- package/list/node.vue +14 -2
- package/list/persistentvolume.vue +13 -1
- package/list/persistentvolumeclaim.vue +6 -0
- package/list/provisioning.cattle.io.cluster.vue +23 -4
- package/list/service.vue +6 -0
- package/list/ui.cattle.io.navlink.vue +20 -3
- package/list/workload.vue +15 -2
- package/machine-config/amazonec2.vue +12 -3
- package/machine-config/azure.vue +16 -7
- package/machine-config/digitalocean.vue +4 -1
- package/machine-config/generic.vue +4 -1
- package/machine-config/harvester.vue +23 -6
- package/machine-config/linode.vue +4 -1
- package/machine-config/vmwarevsphere.vue +91 -21
- package/mixins/__tests__/create-edit-view.test.ts +19 -0
- package/mixins/brand.js +12 -3
- package/mixins/form-validation.js +108 -33
- package/models/clusterroletemplatebinding.js +2 -5
- package/models/management.cattle.io.cluster.js +7 -1
- package/models/secret.js +9 -1
- package/models/workload.js +3 -3
- package/nuxt.config.js +28 -10
- package/package.json +2 -2
- package/pages/about.vue +41 -9
- package/pages/account/index.vue +20 -5
- package/pages/auth/login.vue +83 -22
- package/pages/auth/logout.vue +1 -1
- package/pages/auth/setup.vue +48 -12
- package/pages/auth/verify.vue +1 -1
- package/pages/c/_cluster/_product/members/index.vue +3 -1
- package/pages/c/_cluster/_product/namespaces.vue +4 -1
- package/pages/c/_cluster/apps/charts/chart.vue +124 -27
- package/pages/c/_cluster/apps/charts/index.vue +35 -8
- package/pages/c/_cluster/apps/charts/install.vue +200 -48
- package/pages/c/_cluster/auth/config/_id.vue +4 -1
- package/pages/c/_cluster/auth/config/index.vue +6 -2
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +10 -5
- package/pages/c/_cluster/auth/roles/index.vue +33 -7
- package/pages/c/_cluster/explorer/ConfigBadge.vue +4 -1
- package/pages/c/_cluster/explorer/index.vue +109 -24
- package/pages/c/_cluster/explorer/tools/index.vue +76 -17
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +4 -1
- package/pages/c/_cluster/fleet/index.vue +9 -2
- package/pages/c/_cluster/gatekeeper/index.vue +4 -1
- package/pages/c/_cluster/istio/index.vue +20 -8
- package/pages/c/_cluster/legacy/pages/_page.vue +4 -1
- package/pages/c/_cluster/legacy/project/_page.vue +4 -1
- package/pages/c/_cluster/legacy/project/index.vue +4 -1
- package/pages/c/_cluster/legacy/project/pipelines.vue +27 -5
- package/pages/c/_cluster/logging/index.vue +4 -1
- package/pages/c/_cluster/longhorn/index.vue +16 -5
- package/pages/c/_cluster/manager/cloudCredential/index.vue +15 -3
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +14 -5
- package/pages/c/_cluster/monitoring/monitor/index.vue +24 -6
- package/pages/c/_cluster/monitoring/route-receiver/index.vue +25 -6
- package/pages/c/_cluster/neuvector/index.vue +16 -5
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +25 -7
- package/pages/c/_cluster/settings/banners.vue +10 -2
- package/pages/c/_cluster/settings/brand.vue +75 -17
- package/pages/c/_cluster/settings/links.vue +16 -4
- package/pages/c/_cluster/settings/performance.vue +22 -5
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +19 -4
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +14 -3
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +54 -12
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +18 -4
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +14 -3
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +9 -2
- package/pages/c/_cluster/uiplugins/index.vue +149 -34
- package/pages/diagnostic.vue +14 -5
- package/pages/docs/_doc.vue +22 -5
- package/pages/fail-whale.vue +26 -6
- package/pages/home.vue +54 -14
- package/pages/prefs.vue +65 -22
- package/pages/rio/mesh.vue +6 -2
- package/pages/support/index.vue +35 -7
- package/plugins/steve/subscribe.js +1 -1
- package/promptRemove/management.cattle.io.globalrole.vue +9 -3
- package/promptRemove/management.cattle.io.project.vue +14 -5
- package/promptRemove/management.cattle.io.roletemplate.vue +9 -3
- package/promptRemove/pod.vue +15 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
- package/rancher-components/StringList/StringList.test.ts +80 -0
- package/rancher-components/StringList/StringList.vue +593 -0
- package/rancher-components/StringList/index.ts +1 -0
- package/scripts/publish-shell.sh +5 -38
- package/scripts/test-plugins-build.sh +5 -9
- package/store/prefs.js +1 -1
- package/types/form.ts +1 -0
- package/types/generic.ts +2 -0
- package/types/t.ts +1 -0
- package/types/userPreferences.d.ts +14 -0
- package/utils/array.ts +21 -0
- package/utils/favicon.js +2 -0
- package/utils/settings.ts +50 -0
- package/utils/validators/formRules/__tests__/index.test.ts +22 -1
- package/utils/validators/formRules/index.ts +68 -43
- package/creators/update/init +0 -54
- package/creators/update/package.json +0 -20
- package/creators/update/upgrade +0 -56
- package/scripts/record-deps.js +0 -37
- package/scripts/typegen.sh +0 -84
- package/types/shell/index.d.ts +0 -3046
- package/types/vue-shim.d +0 -20
|
@@ -67,10 +67,7 @@ else
|
|
|
67
67
|
fi
|
|
68
68
|
|
|
69
69
|
export YARN_REGISTRY=http://localhost:4873
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
# Remove test package from previous run, if present
|
|
73
|
-
rm -rf ${BASE_DIR}/pkg/test-pkg
|
|
70
|
+
export NEXT_TELEMETRY_DISABLED=1
|
|
74
71
|
|
|
75
72
|
# We need to patch the version number of the shell, otherwise if we are running
|
|
76
73
|
# with the currently published version, things will fail as those versions
|
|
@@ -80,7 +77,6 @@ rm ${SHELL_DIR}/package.json.bak
|
|
|
80
77
|
|
|
81
78
|
# Publish shell
|
|
82
79
|
echo "Publishing shell packages to local registry"
|
|
83
|
-
yarn install
|
|
84
80
|
${SHELL_DIR}/scripts/publish-shell.sh
|
|
85
81
|
|
|
86
82
|
if [ "${SKIP_STANDALONE}" == "false" ]; then
|
|
@@ -96,21 +92,21 @@ if [ "${SKIP_STANDALONE}" == "false" ]; then
|
|
|
96
92
|
yarn install
|
|
97
93
|
|
|
98
94
|
echo "Building skeleton app"
|
|
99
|
-
|
|
95
|
+
yarn build
|
|
100
96
|
|
|
101
97
|
# Package creator
|
|
102
98
|
echo "Verifying package creator package"
|
|
103
99
|
yarn create @rancher/pkg test-pkg
|
|
104
100
|
|
|
105
101
|
echo "Building test package"
|
|
106
|
-
|
|
102
|
+
yarn build-pkg test-pkg
|
|
107
103
|
|
|
108
104
|
# Add test list component to the test package
|
|
109
105
|
# Validates rancher-components imports
|
|
110
106
|
mkdir pkg/test-pkg/list
|
|
111
107
|
cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue pkg/test-pkg/list
|
|
112
108
|
|
|
113
|
-
|
|
109
|
+
yarn build-pkg test-pkg
|
|
114
110
|
|
|
115
111
|
echo "Cleaning temporary dir"
|
|
116
112
|
popd > /dev/null
|
|
@@ -130,7 +126,7 @@ yarn install
|
|
|
130
126
|
rm -rf ./pkg/test-pkg
|
|
131
127
|
yarn create @rancher/pkg test-pkg -t
|
|
132
128
|
cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue ./pkg/test-pkg/list
|
|
133
|
-
|
|
129
|
+
yarn build-pkg test-pkg
|
|
134
130
|
rm -rf ./pkg/test-pkg
|
|
135
131
|
|
|
136
132
|
echo "All done"
|
package/store/prefs.js
CHANGED
|
@@ -52,7 +52,7 @@ export const CLUSTER = create('cluster', '');
|
|
|
52
52
|
export const LAST_NAMESPACE = create('last-namespace', '');
|
|
53
53
|
export const NAMESPACE_FILTERS = create('ns-by-cluster', {}, { parseJSON });
|
|
54
54
|
export const WORKSPACE = create('workspace', '');
|
|
55
|
-
export const EXPANDED_GROUPS = create('open-groups', ['cluster', 'rbac', 'serviceDiscovery', 'storage', 'workload'], { parseJSON });
|
|
55
|
+
export const EXPANDED_GROUPS = create('open-groups', ['cluster', 'policy', 'rbac', 'serviceDiscovery', 'storage', 'workload'], { parseJSON });
|
|
56
56
|
export const FAVORITE_TYPES = create('fav-type', [], { parseJSON });
|
|
57
57
|
export const GROUP_RESOURCES = create('group-by', 'namespace');
|
|
58
58
|
export const DIFF = create('diff', 'unified', { options: ['unified', 'split'] });
|
package/types/form.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FormMode = 'create' | 'view' | 'edit' | 'clone' | 'stage' | 'import';
|
package/types/generic.ts
ADDED
package/types/t.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Translation = (key: string, args?: Record<string, any>, raw?: boolean) => string
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// eslint-disable-next-line no-unused-vars
|
|
2
|
+
interface UserPreferences {
|
|
3
|
+
'after-login-route': string,
|
|
4
|
+
cluster: string,
|
|
5
|
+
'group-by': string,
|
|
6
|
+
'home-page-cards': string,
|
|
7
|
+
'last-namespace': string,
|
|
8
|
+
'last-visited': string,
|
|
9
|
+
'ns-by-cluster': string,
|
|
10
|
+
provisioner: string,
|
|
11
|
+
'read-whatsnew': string,
|
|
12
|
+
'seen-whatsnew': string,
|
|
13
|
+
theme: string,
|
|
14
|
+
}
|
package/utils/array.ts
CHANGED
|
@@ -155,6 +155,27 @@ export function findBy<T, K, V>(
|
|
|
155
155
|
return findOrFilterBy('find', ary, keyOrObj, val);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
export function findStringIndex(items: string[], item: string, trim = true): number {
|
|
159
|
+
return items.indexOf(trim ? item?.trim() : item);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function hasDuplicatedStrings(items: string[], caseSensitive = true): boolean {
|
|
163
|
+
const normalizedItems = items.map(i => (caseSensitive ? i : i.toLowerCase()).trim());
|
|
164
|
+
|
|
165
|
+
for (let i = 0; i < items.length; i++) {
|
|
166
|
+
const index = findStringIndex(
|
|
167
|
+
normalizedItems,
|
|
168
|
+
(caseSensitive ? items[i] : items[i].toLowerCase()),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
if (i !== index) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
|
|
158
179
|
export function sameContents<T>(aryA: T[], aryB: T[]): boolean {
|
|
159
180
|
return xor(aryA, aryB).length === 0;
|
|
160
181
|
}
|
package/utils/favicon.js
CHANGED
|
@@ -18,6 +18,8 @@ export function setFavIcon(store) {
|
|
|
18
18
|
|
|
19
19
|
if (brandSetting?.value === 'suse') {
|
|
20
20
|
brandImage = require('~shell/assets/brand/suse/favicon.png');
|
|
21
|
+
} else if (brandSetting?.value === 'csp') {
|
|
22
|
+
brandImage = require('~shell/assets/brand/csp/favicon.png');
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
link.href = res?.value || brandImage || defaultFavIcon;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MANAGEMENT } from '@shell/config/types';
|
|
2
|
+
import { Store } from 'vuex';
|
|
3
|
+
import { DEFAULT_PERF_SETTING, SETTING } from '@shell/config/settings';
|
|
4
|
+
|
|
5
|
+
export const fetchOrCreateSetting = async(store: Store<any>, id: string, val: string, save = true): Promise<any> => {
|
|
6
|
+
let setting;
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
setting = await store.dispatch('management/find', { type: MANAGEMENT.SETTING, id });
|
|
10
|
+
} catch {
|
|
11
|
+
const schema = store.getters['management/schemaFor'](MANAGEMENT.SETTING);
|
|
12
|
+
const url = schema.linkFor('collection');
|
|
13
|
+
|
|
14
|
+
setting = await store.dispatch('management/create', {
|
|
15
|
+
type: MANAGEMENT.SETTING, metadata: { name: id }, value: val, default: val || ''
|
|
16
|
+
});
|
|
17
|
+
if ( save ) {
|
|
18
|
+
await setting.save({ url });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return setting;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const setSetting = async(store: Store<any>, id: string, val: string): Promise<any> => {
|
|
26
|
+
const setting = await fetchOrCreateSetting(store, id, val, false);
|
|
27
|
+
|
|
28
|
+
setting.value = val;
|
|
29
|
+
await setting.save();
|
|
30
|
+
|
|
31
|
+
return setting;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const getPerformanceSetting = (rootGetters: Record<string, (arg0: string, arg1: string) => any>) => {
|
|
35
|
+
const perfSetting = rootGetters['management/byId'](MANAGEMENT.SETTING, SETTING.UI_PERFORMANCE);
|
|
36
|
+
let perfConfig = {};
|
|
37
|
+
|
|
38
|
+
if (perfSetting && perfSetting.value) {
|
|
39
|
+
try {
|
|
40
|
+
perfConfig = JSON.parse(perfSetting.value);
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.warn('ui-performance setting contains invalid data'); // eslint-disable-line no-console
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Start with the default and overwrite the values from the setting - ensures we have defaults for newly added options
|
|
47
|
+
perfConfig = Object.assign(DEFAULT_PERF_SETTING, perfConfig);
|
|
48
|
+
|
|
49
|
+
return perfConfig;
|
|
50
|
+
};
|
|
@@ -8,7 +8,7 @@ const mockT = (key: string, args: any) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
describe('formRules', () => {
|
|
11
|
-
const formRules = formRulesGenerator(mockT, {
|
|
11
|
+
const formRules = formRulesGenerator(mockT, { key: 'testDisplayKey' });
|
|
12
12
|
|
|
13
13
|
it('"required" : returns undefined when value supplied', () => {
|
|
14
14
|
const testValue = 'foo';
|
|
@@ -1033,4 +1033,25 @@ describe('formRules', () => {
|
|
|
1033
1033
|
|
|
1034
1034
|
expect(formRuleResult).toStrictEqual(expectedResult);
|
|
1035
1035
|
});
|
|
1036
|
+
|
|
1037
|
+
describe.each([
|
|
1038
|
+
['minValue', 2, [3], [1]],
|
|
1039
|
+
['maxValue', 256, [1], [300]],
|
|
1040
|
+
['betweenValues', [2, 256], [3], [1, 300]],
|
|
1041
|
+
['minLength', 2, ['test'], ['x']],
|
|
1042
|
+
['maxLength', 10, ['x'], ['wrong value']],
|
|
1043
|
+
['betweenLengths', [2, 10], ['test'], ['x', 'wrong value']],
|
|
1044
|
+
])('%p with parameter %p should', (rule, argument, correctValues, wrongValues) => {
|
|
1045
|
+
it.each(wrongValues as [])('return error for value %p', (wrong) => {
|
|
1046
|
+
const formRuleResult = (formRules as any)[rule](argument)(wrong);
|
|
1047
|
+
|
|
1048
|
+
expect(formRuleResult).not.toBeUndefined();
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
it.each(correctValues as [])('return valid for value %p', (correct) => {
|
|
1052
|
+
const formRuleResult = (formRules as any)[rule](argument)(correct);
|
|
1053
|
+
|
|
1054
|
+
expect(formRuleResult).toBeUndefined();
|
|
1055
|
+
});
|
|
1056
|
+
});
|
|
1036
1057
|
});
|
|
@@ -4,6 +4,7 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
4
4
|
import has from 'lodash/has';
|
|
5
5
|
// import uniq from 'lodash/uniq';
|
|
6
6
|
import cronstrue from 'cronstrue';
|
|
7
|
+
import { Translation } from '@shell/types/t';
|
|
7
8
|
|
|
8
9
|
// import uniq from 'lodash/uniq';
|
|
9
10
|
export type Validator = (val: any, arg?: any) => undefined | string;
|
|
@@ -47,25 +48,43 @@ const runValidators = (val: any, validators: Validator[]) => {
|
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
export interface ValidationOptions {
|
|
52
|
+
key?: string,
|
|
53
|
+
}
|
|
53
54
|
|
|
55
|
+
// "t" is the function name we use for getting a translated string
|
|
56
|
+
export default function(t: Translation, { key = 'Value' }: ValidationOptions) {
|
|
54
57
|
// utility validators these validators only get used by other validators
|
|
55
|
-
const startDot: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(0, 1) === '.' ? t(`validation.dns.${ label }.startDot`, { key
|
|
58
|
+
const startDot: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(0, 1) === '.' ? t(`validation.dns.${ label }.startDot`, { key }) : undefined;
|
|
59
|
+
|
|
60
|
+
const endDot = (label: string): Validator => (val: string) => val?.slice(-1) === '.' ? t(`validation.dns.${ label }.endDot`, { key }) : undefined;
|
|
56
61
|
|
|
57
|
-
const
|
|
62
|
+
const startNumber: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(0, 1)?.match(/[0-9]/) ? t(`validation.dns.${ label }.startNumber`, { key }) : undefined;
|
|
58
63
|
|
|
59
|
-
const
|
|
64
|
+
const startHyphen: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(0, 1) === '-' ? t(`validation.dns.${ label }.startHyphen`, { key }) : undefined;
|
|
60
65
|
|
|
61
|
-
const
|
|
66
|
+
const endHyphen: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(-1) === '-' ? t(`validation.dns.${ label }.endHyphen`, { key }) : undefined;
|
|
62
67
|
|
|
63
|
-
const
|
|
68
|
+
const minValue: ValidatorFactory = (min: string) => (val: string | number) => Number(val) < Number(min) ? t('validation.minValue', { key, min }) : undefined;
|
|
69
|
+
|
|
70
|
+
const maxValue: ValidatorFactory = (max: string) => (val: string | number) => Number(val) > Number(max) ? t('validation.maxValue', { key, max }) : undefined;
|
|
71
|
+
|
|
72
|
+
const betweenValues: ValidatorFactory = ([min, max]: string[]) => (val: string | number) => minValue(min)(val) || maxValue(max)(val) ? t('validation.betweenValues', {
|
|
73
|
+
key, min, max
|
|
74
|
+
}) : undefined;
|
|
64
75
|
|
|
65
|
-
const
|
|
76
|
+
const minLength: ValidatorFactory = (min: string) => (val: string) => val.length < Number(min) ? t('validation.minLength', { key, min }) : undefined;
|
|
77
|
+
|
|
78
|
+
const maxLength: ValidatorFactory = (max: string) => (val: string) => val.length > Number(max) ? t('validation.maxLength', { key, max }) : undefined;
|
|
79
|
+
|
|
80
|
+
const betweenLengths: ValidatorFactory = ([min, max]: string[]) => (val: string) => minLength(min)(val) || maxLength(max)(val) ? t('validation.betweenLengths', {
|
|
81
|
+
key, min, max
|
|
82
|
+
}) : undefined;
|
|
83
|
+
|
|
84
|
+
const requiredInt: Validator = (val: string) => isNaN(parseInt(val, 10)) ? t('validation.number.requiredInt', { key }) : undefined;
|
|
66
85
|
|
|
67
86
|
const portNumber: Validator = (val: string) => parseInt(val, 10) < 1 || parseInt(val, 10) > 65535 ? t('validation.number.between', {
|
|
68
|
-
key
|
|
87
|
+
key, min: '1', max: '65535'
|
|
69
88
|
}) : undefined;
|
|
70
89
|
|
|
71
90
|
const dnsChars: Validator = (val: string) => {
|
|
@@ -73,7 +92,7 @@ export default function(t: (key: string, options?: any) => string, opt: {display
|
|
|
73
92
|
|
|
74
93
|
if (matchedChars) {
|
|
75
94
|
return t('validation.chars', {
|
|
76
|
-
key
|
|
95
|
+
key, count: matchedChars.length, chars: matchedChars.map(char => char === ' ' ? 'Space' : `"${ char }"`).join(', ')
|
|
77
96
|
});
|
|
78
97
|
}
|
|
79
98
|
|
|
@@ -82,24 +101,24 @@ export default function(t: (key: string, options?: any) => string, opt: {display
|
|
|
82
101
|
|
|
83
102
|
// the weird edge case here deals with internationalized domain names which are prepended with 'xn--'
|
|
84
103
|
// https://datatracker.ietf.org/doc/html/rfc5891#section-4.2.3.1
|
|
85
|
-
const dnsDoubleDash: Validator = (val: string) => (val?.substr(2, 2) === '--' && val?.substr(0, 2) !== 'xn') ? t(`validation.dns.doubleHyphen`, { key
|
|
104
|
+
const dnsDoubleDash: Validator = (val: string) => (val?.substr(2, 2) === '--' && val?.substr(0, 2) !== 'xn') ? t(`validation.dns.doubleHyphen`, { key }) : undefined;
|
|
86
105
|
|
|
87
|
-
const dnsIanaServiceNameDoubleDash: Validator = (val: string) => (val?.substr(2, 2) === '--' && val?.substr(0, 2) !== 'xn') ? t(`validation.dns.doubleHyphen`, { key
|
|
106
|
+
const dnsIanaServiceNameDoubleDash: Validator = (val: string) => (val?.substr(2, 2) === '--' && val?.substr(0, 2) !== 'xn') ? t(`validation.dns.doubleHyphen`, { key }) : undefined;
|
|
88
107
|
|
|
89
|
-
const dnsEmpty: ValidatorFactory = (label: string): Validator => (val = '') => val.length === 0 ? t(`validation.dns.${ label }.emptyLabel`, { key
|
|
108
|
+
const dnsEmpty: ValidatorFactory = (label: string): Validator => (val = '') => val.length === 0 ? t(`validation.dns.${ label }.emptyLabel`, { key, min: 1 }) : undefined;
|
|
90
109
|
|
|
91
|
-
const dnsTooLong: ValidatorFactory = (label: string, length = 63): Validator => (val = '') => val.length > length ? t(`validation.dns.${ label }.tooLongLabel`, { key
|
|
110
|
+
const dnsTooLong: ValidatorFactory = (label: string, length = 63): Validator => (val = '') => val.length > length ? t(`validation.dns.${ label }.tooLongLabel`, { key, max: length }) : undefined;
|
|
92
111
|
|
|
93
112
|
// eslint-disable-next-line no-unused-vars
|
|
94
|
-
const hostnameEmpty: Validator = (val = '') => val.length === 0 ? t('validation.dns.hostname.empty', { key
|
|
113
|
+
const hostnameEmpty: Validator = (val = '') => val.length === 0 ? t('validation.dns.hostname.empty', { key }) : undefined;
|
|
95
114
|
|
|
96
|
-
const hostnameTooLong: Validator = (val = '') => val.length > 253 ? t('validation.dns.hostname.tooLong', { key
|
|
115
|
+
const hostnameTooLong: Validator = (val = '') => val.length > 253 ? t('validation.dns.hostname.tooLong', { key, max: 253 }) : undefined;
|
|
97
116
|
|
|
98
|
-
const absolutePath: Validator = (val = '') => val[0] !== '/' && val.length > 0 ? t('validation.path', { key
|
|
117
|
+
const absolutePath: Validator = (val = '') => val[0] !== '/' && val.length > 0 ? t('validation.path', { key }) : undefined;
|
|
99
118
|
|
|
100
|
-
const required: Validator = (val: any) => !val && val !== false ? t('validation.required', { key
|
|
119
|
+
const required: Validator = (val: any) => !val && val !== false ? t('validation.required', { key }) : undefined;
|
|
101
120
|
|
|
102
|
-
const noUpperCase: Validator = (val = '') => val.toLowerCase() !== val ? t('validation.noUpperCase', { key
|
|
121
|
+
const noUpperCase: Validator = (val = '') => val.toLowerCase() !== val ? t('validation.noUpperCase', { key }) : undefined;
|
|
103
122
|
|
|
104
123
|
const cronSchedule: Validator = (val: string) => {
|
|
105
124
|
try {
|
|
@@ -115,7 +134,7 @@ export default function(t: (key: string, options?: any) => string, opt: {display
|
|
|
115
134
|
return isHttps;
|
|
116
135
|
};
|
|
117
136
|
|
|
118
|
-
const interval: Validator = (val: string) => !/^\d+[hms]$/.test(val) ? t('validation.monitoring.route.interval', { key
|
|
137
|
+
const interval: Validator = (val: string) => !/^\d+[hms]$/.test(val) ? t('validation.monitoring.route.interval', { key }) : undefined;
|
|
119
138
|
|
|
120
139
|
const containerImage: Validator = (val: any) => !val?.image ? t('workload.validation.containerImage', { name: val.name }) : undefined;
|
|
121
140
|
|
|
@@ -126,7 +145,7 @@ export default function(t: (key: string, options?: any) => string, opt: {display
|
|
|
126
145
|
return t('validation.required', { key: t('workload.container.titles.containers') });
|
|
127
146
|
}
|
|
128
147
|
|
|
129
|
-
// making sure each container has an
|
|
148
|
+
// making sure each container has an image name
|
|
130
149
|
return containers.map((container: any) => containerImage(container)).find((containerError: string) => containerError);
|
|
131
150
|
};
|
|
132
151
|
|
|
@@ -415,7 +434,7 @@ export default function(t: (key: string, options?: any) => string, opt: {display
|
|
|
415
434
|
|
|
416
435
|
if (matchedChars) {
|
|
417
436
|
return t('validation.chars', {
|
|
418
|
-
key
|
|
437
|
+
key, count: matchedChars.length, chars: matchedChars.map((char: string) => char === ' ' ? 'Space' : `"${ char }"`).join(', ')
|
|
419
438
|
});
|
|
420
439
|
}
|
|
421
440
|
|
|
@@ -423,33 +442,39 @@ export default function(t: (key: string, options?: any) => string, opt: {display
|
|
|
423
442
|
};
|
|
424
443
|
|
|
425
444
|
return {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
interval,
|
|
445
|
+
absolutePath,
|
|
446
|
+
backupTarget,
|
|
447
|
+
betweenLengths,
|
|
448
|
+
betweenValues,
|
|
449
|
+
clusterIp,
|
|
450
|
+
clusterName,
|
|
433
451
|
containerImage,
|
|
434
452
|
containerImages,
|
|
435
|
-
|
|
436
|
-
groupsAreValid,
|
|
437
|
-
matching,
|
|
438
|
-
clusterName,
|
|
439
|
-
roleTemplateRules,
|
|
440
|
-
servicePort,
|
|
441
|
-
clusterIp,
|
|
442
|
-
externalName,
|
|
443
|
-
backupTarget,
|
|
444
|
-
imageUrl,
|
|
445
|
-
fileRequired,
|
|
453
|
+
cronSchedule,
|
|
446
454
|
dnsLabel,
|
|
447
455
|
dnsLabelIanaServiceName,
|
|
448
456
|
dnsLabelRestricted,
|
|
457
|
+
externalName,
|
|
458
|
+
fileRequired,
|
|
459
|
+
groupsAreValid,
|
|
449
460
|
hostname,
|
|
450
|
-
|
|
461
|
+
imageUrl,
|
|
462
|
+
interval,
|
|
463
|
+
isHttps,
|
|
464
|
+
matching,
|
|
465
|
+
maxLength,
|
|
466
|
+
maxValue,
|
|
467
|
+
minLength,
|
|
468
|
+
minValue,
|
|
469
|
+
noUpperCase,
|
|
470
|
+
portNumber,
|
|
471
|
+
required,
|
|
472
|
+
requiredInt,
|
|
473
|
+
roleTemplateRules,
|
|
474
|
+
ruleGroups,
|
|
475
|
+
servicePort,
|
|
451
476
|
subDomain,
|
|
452
|
-
|
|
477
|
+
testRule,
|
|
453
478
|
wildcardHostname,
|
|
454
479
|
};
|
|
455
480
|
}
|
package/creators/update/init
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const fs = require('fs-extra');
|
|
5
|
-
const { spawnSync } = require('child_process');
|
|
6
|
-
|
|
7
|
-
const scriptFolder = __dirname;
|
|
8
|
-
const dest = path.resolve('.');
|
|
9
|
-
|
|
10
|
-
// Remove first two args
|
|
11
|
-
let args = process.argv;
|
|
12
|
-
args.splice(0, 2);
|
|
13
|
-
|
|
14
|
-
const res = spawnSync(`${__dirname}/upgrade`, args, {
|
|
15
|
-
cwd: dest,
|
|
16
|
-
shell: false,
|
|
17
|
-
stdio: [ 'ignore', process.stdout, process.stderr ],
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
if (res.status !== 0) {
|
|
21
|
-
process.exit(res.status);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Read the existing package.json
|
|
25
|
-
let rawdata = fs.readFileSync(path.join(dest, 'package.json'));
|
|
26
|
-
const appPackage = JSON.parse(rawdata);
|
|
27
|
-
|
|
28
|
-
// Read the package.json from the app creator
|
|
29
|
-
rawdata = fs.readFileSync(path.join(scriptFolder, 'app', 'package.json'));
|
|
30
|
-
const latestPackage = JSON.parse(rawdata);
|
|
31
|
-
|
|
32
|
-
// Read the package.json from the upgrade creator
|
|
33
|
-
rawdata = fs.readFileSync(path.join(scriptFolder, 'package.json'));
|
|
34
|
-
const upgradePackage = JSON.parse(rawdata);
|
|
35
|
-
|
|
36
|
-
// Update dependency versions to match the latest from the creator
|
|
37
|
-
Object.keys(latestPackage.dependencies).forEach((key) => {
|
|
38
|
-
const version = latestPackage.dependencies[key];
|
|
39
|
-
|
|
40
|
-
appPackage.dependencies[key] = version;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// Update the version of @rancher/shell
|
|
44
|
-
const shellVersion = upgradePackage.version;
|
|
45
|
-
|
|
46
|
-
appPackage.dependencies['@rancher/shell'] = shellVersion;
|
|
47
|
-
|
|
48
|
-
fs.writeFileSync(path.join(dest, 'package.json'), JSON.stringify(appPackage, null, 2));
|
|
49
|
-
|
|
50
|
-
spawnSync(`yarn`, ['install'], {
|
|
51
|
-
cwd: dest,
|
|
52
|
-
shell: false,
|
|
53
|
-
stdio: [ 'ignore', process.stdout, process.stderr ],
|
|
54
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rancher/create-update",
|
|
3
|
-
"description": "Rancher UI Update helper",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"author": "SUSE",
|
|
7
|
-
"private": false,
|
|
8
|
-
"bin": "./init",
|
|
9
|
-
"files": [
|
|
10
|
-
"**/*.*",
|
|
11
|
-
"init",
|
|
12
|
-
"upgrade"
|
|
13
|
-
],
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=12"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"fs-extra": "^10.0.0"
|
|
19
|
-
}
|
|
20
|
-
}
|
package/creators/update/upgrade
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
4
|
-
|
|
5
|
-
echo "Upgrading Rancher Shell"
|
|
6
|
-
|
|
7
|
-
# Get the version number from the package.json file
|
|
8
|
-
VERSION=$(node -p -e "require('${SCRIPT_DIR}/package.json').version")
|
|
9
|
-
|
|
10
|
-
echo "Updating to version: ${VERSION}"
|
|
11
|
-
echo ""
|
|
12
|
-
|
|
13
|
-
FORCE="false"
|
|
14
|
-
|
|
15
|
-
if [ "$1" == "-f" ]; then
|
|
16
|
-
FORCE="true"
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
# Check for a clean git repository
|
|
20
|
-
if [ ! -d ".git" ] && [ "${FORCE}" == "false" ]; then
|
|
21
|
-
echo "Not runnning in a git repository. Re-run with -f to ignore this check"
|
|
22
|
-
echo "Note: This action will update yuor files - running in a git repsository will ensure you have visibility over changes made"
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
if [[ $(git diff --stat) != '' ]] && [ "${FORCE}" == "false" ]; then
|
|
27
|
-
echo "Git repository is not clean. Re-run with -f to ignore this check"
|
|
28
|
-
echo "Note: This action will update yuor files - running in a clean git repsository will ensure you have visibility over changes made"
|
|
29
|
-
exit 1
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
# Check this is a Rancher Extension
|
|
33
|
-
if [ ! -f "./package.json" ]; then
|
|
34
|
-
echo "Can't find package.json - check you're running from the correct folder"
|
|
35
|
-
exit 1
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
HAS_SHELL=$(grep "\"@rancher/shell\"" package.json -c )
|
|
39
|
-
if [ "${HAS_SHELL}" != "1" ]; then
|
|
40
|
-
echo "package.json does not reference @rancher/shell - check you're running from the correct folder"
|
|
41
|
-
exit 1
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
# Copy files for the top-level folder (from the app creator)
|
|
45
|
-
cp ${SCRIPT_DIR}/app/files/* .
|
|
46
|
-
|
|
47
|
-
# Go through each folder in the pkg folder and update their files
|
|
48
|
-
for pkg in ./pkg/*
|
|
49
|
-
do
|
|
50
|
-
if [ -d "${pkg}" ]; then
|
|
51
|
-
pkgName=$(basename $pkg)
|
|
52
|
-
echo "Updating package ${pkgName}"
|
|
53
|
-
|
|
54
|
-
cp ${SCRIPT_DIR}/pkg/files/* ${pkg}
|
|
55
|
-
fi
|
|
56
|
-
done
|
package/scripts/record-deps.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
// Script lives in shell/scripts, so work out top-level dir from there
|
|
5
|
-
const topDir = path.resolve(__dirname, '..', '..');
|
|
6
|
-
const dir = process.cwd();
|
|
7
|
-
|
|
8
|
-
// Read the package.json file
|
|
9
|
-
const topPkgFile = path.join(topDir, 'package.json');
|
|
10
|
-
const pkgFile = path.join(dir, 'package.json');
|
|
11
|
-
|
|
12
|
-
const topPkg = JSON.parse(fs.readFileSync(topPkgFile));
|
|
13
|
-
const mainPkg = JSON.parse(fs.readFileSync(pkgFile));
|
|
14
|
-
|
|
15
|
-
// Look to see if we specify the deps we require
|
|
16
|
-
if (mainPkg._requires) {
|
|
17
|
-
// Map each one to the same version as the main package
|
|
18
|
-
const out = {};
|
|
19
|
-
|
|
20
|
-
mainPkg._requires.forEach((name) => {
|
|
21
|
-
let ver = topPkg.dependencies?.[name] || topPkg.devDependencies?.[name];
|
|
22
|
-
|
|
23
|
-
if (name === '@rancher/components') {
|
|
24
|
-
const componentsPkgFile = path.join(topDir, 'pkg', 'rancher-components', 'package.json');
|
|
25
|
-
const componentsPkg = JSON.parse(fs.readFileSync(componentsPkgFile));
|
|
26
|
-
|
|
27
|
-
ver = componentsPkg.version;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
out[name] = ver;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
mainPkg._pkgs = out;
|
|
34
|
-
delete mainPkg._requires;
|
|
35
|
-
|
|
36
|
-
fs.writeFileSync(pkgFile, JSON.stringify(mainPkg, null, 2), 'utf-8');
|
|
37
|
-
}
|
package/scripts/typegen.sh
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
4
|
-
BASE_DIR="$( cd $SCRIPT_DIR && cd ../.. & pwd)"
|
|
5
|
-
SHELL_DIR=$BASE_DIR/shell
|
|
6
|
-
|
|
7
|
-
echo "Generating typescript definitions"
|
|
8
|
-
|
|
9
|
-
rm -rf ${SHELL_DIR}/tmp
|
|
10
|
-
mkdir -p ${SHELL_DIR}/tmp
|
|
11
|
-
|
|
12
|
-
echo "Generating ..."
|
|
13
|
-
|
|
14
|
-
# utils
|
|
15
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/utils/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils > /dev/null
|
|
16
|
-
|
|
17
|
-
# config
|
|
18
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/config/query-params.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
19
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/config/table-headers.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
20
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/config/types.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
21
|
-
|
|
22
|
-
# store
|
|
23
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/store/features.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
|
|
24
|
-
|
|
25
|
-
# plugins
|
|
26
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/normalize.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
27
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/resource-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# mkixins
|
|
31
|
-
${BASE_DIR}/node_modules/.bin/tsc shell/mixins/create-edit-view/index.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins/create-edit-view > /dev/null
|
|
32
|
-
|
|
33
|
-
#./node_modules/.bin/tsc shell/plugins/dashboard-store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store > /dev/null
|
|
34
|
-
|
|
35
|
-
# Go through all of the folders and combine by wrapping with 'declare module'
|
|
36
|
-
|
|
37
|
-
echo "Combining type definitions ..."
|
|
38
|
-
|
|
39
|
-
DEST=${SHELL_DIR}/types/shell
|
|
40
|
-
mkdir -p ${DEST}
|
|
41
|
-
|
|
42
|
-
INDEX=${DEST}/index.d.ts
|
|
43
|
-
rm -rf ${INDEX}
|
|
44
|
-
|
|
45
|
-
echo "// Auto-generated type definitions for shell" > ${INDEX}
|
|
46
|
-
echo "// Do not modify this file as changes will get overwritten" >> ${INDEX}
|
|
47
|
-
|
|
48
|
-
# Copy in the vue shim type definitions
|
|
49
|
-
if [ -f "$BASE_DIR/shell/types/vue-shim.d" ]; then
|
|
50
|
-
cat "$BASE_DIR/shell/types/vue-shim.d" >> ${INDEX}
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
function processDir() {
|
|
54
|
-
local dir=$1
|
|
55
|
-
local basePkg=$2
|
|
56
|
-
|
|
57
|
-
for entry in $1/*
|
|
58
|
-
do
|
|
59
|
-
local filename=$(basename $entry)
|
|
60
|
-
|
|
61
|
-
if [ -d $entry ]; then
|
|
62
|
-
processDir $entry $basePkg/$filename
|
|
63
|
-
else
|
|
64
|
-
if [[ $filename == *.d.ts ]]; then
|
|
65
|
-
# We use convoluted mechanism here to ensure this works on mac with bash 3.x
|
|
66
|
-
local name=$(echo $filename | rev | cut -c6- | rev)
|
|
67
|
-
|
|
68
|
-
local module=${basePkg}/${name}
|
|
69
|
-
if [ "${name}" == "index" ]; then
|
|
70
|
-
module=${basePkg}
|
|
71
|
-
fi
|
|
72
|
-
|
|
73
|
-
echo -e "\n// ${module}\n" >> ${INDEX}
|
|
74
|
-
echo "declare module '${module}' {" >> ${INDEX}
|
|
75
|
-
cat $entry >> ${INDEX}
|
|
76
|
-
echo -e "}" >> ${INDEX}
|
|
77
|
-
fi
|
|
78
|
-
fi
|
|
79
|
-
done
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
processDir ${SHELL_DIR}/tmp @shell
|
|
83
|
-
|
|
84
|
-
rm -rf ${SHELL_DIR}/tmp
|