@rancher/shell 2.0.0 → 3.0.0-rc.1
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/styles/global/_labeled-input.scss +22 -11
- package/assets/styles/global/_layout.scss +4 -4
- package/assets/styles/global/_tooltip.scss +4 -3
- package/assets/translations/en-us.yaml +44 -8
- package/chart/__tests__/S3.test.ts +21 -14
- package/chart/example.vue +1 -1
- package/chart/gatekeeper.vue +4 -4
- package/chart/istio.vue +11 -11
- package/chart/logging/index.vue +8 -8
- package/chart/monitoring/ClusterSelector.vue +13 -13
- package/chart/monitoring/alerting/index.vue +6 -6
- package/chart/monitoring/grafana/index.vue +14 -14
- package/chart/monitoring/index.vue +122 -108
- package/chart/monitoring/prometheus/index.vue +18 -18
- package/chart/rancher-backup/S3.vue +11 -11
- package/chart/rancher-backup/index.vue +68 -60
- package/cloud-credential/__tests__/azure.test.ts +7 -17
- package/cloud-credential/__tests__/harvester.test.ts +2 -2
- package/cloud-credential/aws.vue +3 -3
- package/cloud-credential/azure.vue +4 -4
- package/cloud-credential/digitalocean.vue +1 -1
- package/cloud-credential/gcp.vue +1 -1
- package/cloud-credential/generic.vue +1 -1
- package/cloud-credential/harvester.vue +1 -1
- package/cloud-credential/linode.vue +1 -1
- package/cloud-credential/pnap.vue +2 -2
- package/cloud-credential/s3.vue +8 -8
- package/cloud-credential/vmwarevsphere.vue +4 -4
- package/components/ActionDropdown.vue +3 -3
- package/components/ActionMenu.vue +1 -1
- package/components/AlertTable.vue +18 -8
- package/components/AppModal.vue +20 -9
- package/components/AssignTo.vue +38 -37
- package/components/AsyncButton.vue +4 -7
- package/components/ButtonDropdown.vue +14 -13
- package/components/ButtonGroup.vue +1 -1
- package/components/Carousel.vue +1 -1
- package/components/Certificates.vue +1 -1
- package/components/ChartReadme.vue +7 -7
- package/components/CodeMirror.vue +2 -2
- package/components/CommunityLinks.vue +2 -2
- package/components/ConsumptionGauge.vue +1 -1
- package/components/ContainerResourceLimit.vue +11 -11
- package/components/CountGauge.vue +1 -1
- package/components/CreateDriver.vue +4 -4
- package/components/CruResource.vue +34 -20
- package/components/DashboardMetrics.vue +3 -3
- package/components/DashboardOptions.vue +3 -3
- package/components/DetailTop.vue +3 -3
- package/components/DisableAuthProviderModal.vue +7 -8
- package/components/EmberPage.vue +1 -1
- package/components/EtcdInfoBanner.vue +1 -1
- package/components/ExplorerMembers.vue +8 -9
- package/components/ExplorerProjectsNamespaces.vue +6 -7
- package/components/FileDiff.vue +1 -1
- package/components/FixedBanner.vue +1 -0
- package/components/GlobalRoleBindings.vue +5 -6
- package/components/GradientBox.vue +1 -2
- package/components/GrafanaDashboard.vue +13 -11
- package/components/GrowlManager.vue +1 -1
- package/components/HarvesterServiceAddOnConfig.vue +2 -2
- package/components/IconOrSvg.vue +1 -2
- package/components/Import.vue +4 -3
- package/components/Inactivity.vue +2 -2
- package/components/IndentedPanel.vue +0 -1
- package/components/InputOrDisplay.vue +3 -2
- package/components/KeyValueView.vue +4 -3
- package/components/LandingPagePreference.vue +3 -2
- package/components/LazyImage.vue +1 -1
- package/components/Loading.vue +1 -1
- package/components/LocaleSelector.vue +4 -4
- package/components/Markdown.vue +1 -1
- package/components/ModalWithCard.vue +1 -4
- package/components/MoveModal.vue +10 -11
- package/components/PercentageBar.vue +7 -7
- package/components/PodSecurityAdmission.vue +13 -13
- package/components/PromptChangePassword.vue +9 -9
- package/components/PromptModal.vue +1 -1
- package/components/PromptRemove.vue +35 -37
- package/components/PromptRestore.vue +68 -69
- package/components/Questions/Array.vue +3 -4
- package/components/Questions/Boolean.vue +1 -1
- package/components/Questions/CloudCredential.vue +1 -1
- package/components/Questions/Enum.vue +1 -1
- package/components/Questions/Float.vue +1 -1
- package/components/Questions/Int.vue +1 -1
- package/components/Questions/Question.js +1 -1
- package/components/Questions/QuestionMap.vue +3 -4
- package/components/Questions/Radio.vue +1 -1
- package/components/Questions/Reference.vue +2 -2
- package/components/Questions/String.vue +1 -1
- package/components/Questions/Yaml.vue +1 -1
- package/components/Questions/__tests__/Boolean.test.ts +26 -13
- package/components/Questions/__tests__/Float.test.ts +26 -13
- package/components/Questions/__tests__/Int.test.ts +26 -13
- package/components/Questions/__tests__/String.test.ts +26 -13
- package/components/Questions/__tests__/Yaml.test.ts +26 -14
- package/components/Questions/index.vue +10 -10
- package/components/Random.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +7 -2
- package/components/ResourceDetail/index.vue +6 -3
- package/components/ResourceList/Masthead.vue +4 -0
- package/components/ResourceList/index.vue +10 -4
- package/components/ResourceSummary.vue +1 -1
- package/components/ResourceTable.vue +4 -5
- package/components/ResourceYaml.vue +1 -2
- package/components/RoleBindings.vue +3 -3
- package/components/SideNav.vue +8 -6
- package/components/SimpleBox.vue +0 -1
- package/components/SortableTable/THead.vue +5 -5
- package/components/SortableTable/index.vue +21 -20
- package/components/SortableTable/sortable-config.ts +4 -0
- package/components/StatusTable.vue +1 -1
- package/components/TabTitle.vue +3 -9
- package/components/Tabbed/Tab.vue +1 -1
- package/components/Tabbed/index.vue +2 -4
- package/components/Wizard.vue +8 -3
- package/components/YamlEditor.vue +4 -4
- package/components/__tests__/AppModal.test.ts +33 -25
- package/components/__tests__/ApplicationCard.test.ts +1 -1
- package/components/__tests__/AsyncButton.test.ts +42 -34
- package/components/__tests__/BackLink.test.ts +3 -3
- package/components/__tests__/ButtonGroup.test.ts +5 -5
- package/components/__tests__/Carousel.test.ts +2 -2
- package/components/__tests__/Certificates.test.ts +10 -8
- package/components/__tests__/ClusterBadge.test.ts +2 -2
- package/components/__tests__/CodeMirror.test.ts +94 -85
- package/components/__tests__/Collapse.test.ts +3 -3
- package/components/__tests__/CollapsibleCard.test.ts +6 -6
- package/components/__tests__/ConsumptionGauge.test.ts +6 -6
- package/components/__tests__/CruResource.test.ts +67 -56
- package/components/__tests__/EtcdInfoBanner.test.ts +11 -9
- package/components/__tests__/FixedBanner.test.ts +8 -8
- package/components/__tests__/GrowlManager.test.ts +24 -25
- package/components/__tests__/NamespaceFilter.test.ts +48 -34
- package/components/__tests__/PercentageBar.test.ts +10 -10
- package/components/__tests__/PodSecurityAdmission.test.ts +80 -38
- package/components/__tests__/ProjectRow.test.ts +1 -5
- package/components/__tests__/PromptRestore.test.ts +15 -18
- package/components/__tests__/TabTitle.test.ts +21 -14
- package/components/auth/AllowedPrincipals.vue +4 -5
- package/components/auth/RoleDetailEdit.vue +31 -29
- package/components/auth/SelectPrincipal.vue +2 -4
- package/components/auth/__tests__/RoleDetailEdit.test.ts +18 -14
- package/components/auth/login/ldap.vue +2 -2
- package/components/fleet/FleetClusters.vue +0 -1
- package/components/fleet/FleetRepos.vue +0 -1
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/__tests__/FleetSummary.test.ts +8 -2
- package/components/form/ArrayList.vue +5 -6
- package/components/form/ArrayListGrouped.vue +2 -2
- package/components/form/ArrayListSelect.vue +4 -4
- package/components/form/BannerSettings.vue +10 -10
- package/components/form/ChangePassword.vue +9 -9
- package/components/form/ColorInput.vue +2 -2
- package/components/form/Command.vue +13 -15
- package/components/form/EnvVars.vue +7 -7
- package/components/form/FileImageSelector.vue +1 -1
- package/components/form/GitPicker.vue +7 -7
- package/components/form/HealthCheck.vue +4 -4
- package/components/form/HookOption.vue +13 -13
- package/components/form/InputWithSelect.vue +19 -13
- package/components/form/KeyValue.vue +14 -14
- package/components/form/LabeledSelect.vue +45 -35
- package/components/form/Labels.vue +3 -3
- package/components/form/LifecycleHooks.vue +5 -7
- package/components/form/MatchExpressions.vue +7 -7
- package/components/form/Members/ClusterMembershipEditor.vue +1 -2
- package/components/form/Members/ClusterPermissionsEditor.vue +9 -9
- package/components/form/Members/MembershipEditor.vue +4 -5
- package/components/form/Members/ProjectMembershipEditor.vue +1 -2
- package/components/form/NameNsDescription.vue +12 -13
- package/components/form/Networking.vue +17 -17
- package/components/form/NodeAffinity.vue +9 -10
- package/components/form/NodeScheduling.vue +7 -7
- package/components/form/NotificationSettings.vue +2 -2
- package/components/form/Password.vue +2 -2
- package/components/form/PodAffinity.vue +21 -23
- package/components/form/PodSecurity.vue +6 -6
- package/components/form/Ports.vue +5 -5
- package/components/form/Probe.vue +20 -20
- package/components/form/ProjectMemberEditor.vue +9 -9
- package/components/form/ResourceLabeledSelect.vue +11 -4
- package/components/form/ResourceQuota/Namespace.vue +3 -3
- package/components/form/ResourceQuota/NamespaceRow.vue +3 -3
- package/components/form/ResourceQuota/Project.vue +7 -6
- package/components/form/ResourceQuota/ProjectRow.vue +113 -114
- package/components/form/ResourceSelector.vue +3 -3
- package/components/form/ResourceTabs/index.vue +1 -1
- package/components/form/RuleSelector.vue +7 -6
- package/components/form/SecretSelector.vue +5 -6
- package/components/form/Security.vue +14 -14
- package/components/form/Select.vue +21 -11
- package/components/form/SelectOrCreateAuthSecret.vue +30 -27
- package/components/form/ServiceNameSelect.vue +8 -5
- package/components/form/ServicePorts.vue +4 -4
- package/components/form/ShellInput.vue +3 -3
- package/components/form/SimpleSecretSelector.vue +2 -2
- package/components/form/Taints.vue +18 -11
- package/components/form/Tolerations.vue +12 -12
- package/components/form/UnitInput.vue +1 -1
- package/components/form/ValueFromResource.vue +17 -17
- package/components/form/WorkloadPorts.vue +21 -21
- package/components/form/__tests__/ArrayList.test.ts +14 -11
- package/components/form/__tests__/ArrayListGrouped.test.ts +4 -4
- package/components/form/__tests__/BannerSettings.test.ts +6 -5
- package/components/form/__tests__/Command.test.ts +12 -12
- package/components/form/__tests__/Error.test.ts +5 -5
- package/components/form/__tests__/FileImageSelector.test.ts +5 -5
- package/components/form/__tests__/FileSelector.test.ts +9 -9
- package/components/form/__tests__/InputWithSelect.test.ts +42 -0
- package/components/form/__tests__/KeyValue.test.ts +28 -18
- package/components/form/__tests__/LabeledSelect.test.ts +9 -9
- package/components/form/__tests__/MatchExpressions.test.ts +10 -10
- package/components/form/__tests__/NameNsDescription.test.ts +28 -25
- package/components/form/__tests__/NodeAffinity.test.ts +4 -3
- package/components/form/__tests__/PodAffinity.test.ts +4 -3
- package/components/form/__tests__/Probe.test.ts +6 -6
- package/components/form/__tests__/Security.test.ts +6 -6
- package/components/form/__tests__/Select.test.ts +30 -0
- package/components/form/__tests__/ServiceNameSelect.test.ts +42 -0
- package/components/form/__tests__/Taints.test.ts +71 -0
- package/components/form/__tests__/UnitInput.test.ts +20 -24
- package/components/form/labeled-select-utils/labeled-select.utils.ts +1 -1
- package/components/formatter/AppSummaryGraph.vue +4 -4
- package/components/formatter/ClusterLink.vue +1 -1
- package/components/formatter/Endpoints.vue +4 -1
- package/components/formatter/FleetSummaryGraph.vue +4 -4
- package/components/formatter/ListLink.vue +1 -1
- package/components/formatter/ListLinkDetail.vue +2 -2
- package/components/formatter/LiveExpiryBadgeState.vue +18 -5
- package/components/formatter/LiveExpiryDate.vue +1 -1
- package/components/formatter/MachineSummaryGraph.vue +4 -4
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/Principal.vue +0 -1
- package/components/formatter/PrincipalGroupBindings.vue +5 -5
- package/components/formatter/ReceiverIcons.vue +5 -3
- package/components/formatter/Scale.vue +4 -4
- package/components/formatter/ServiceTargets.vue +1 -1
- package/components/formatter/VirtualServiceGateways.vue +1 -1
- package/components/formatter/Weight.vue +2 -2
- package/components/formatter/WorkloadDetailEndpoints.vue +4 -1
- package/components/formatter/WorkloadHealthScale.vue +5 -6
- package/components/formatter/__tests__/Checked.test.ts +2 -2
- package/components/formatter/__tests__/ClusterLink.test.ts +3 -3
- package/components/formatter/__tests__/Date.test.ts +8 -8
- package/components/formatter/__tests__/LinkDetail.test.ts +10 -10
- package/components/formatter/__tests__/LiveDate.test.ts +21 -15
- package/components/formatter/__tests__/PodsUsage.test.ts +5 -5
- package/components/formatter/__tests__/Si.test.ts +3 -3
- package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +5 -5
- package/components/graph/LinePlot.vue +1 -2
- package/components/nav/Group.vue +11 -6
- package/components/nav/Header.vue +162 -128
- package/components/nav/Jump.vue +1 -1
- package/components/nav/NamespaceFilter.vue +1 -1
- package/components/nav/TopLevelMenu.vue +15 -18
- package/components/nav/Type.vue +7 -7
- package/components/nav/WindowManager/ContainerLogs.vue +53 -38
- package/components/nav/WindowManager/ContainerShell.vue +38 -37
- package/components/nav/WindowManager/Window.vue +1 -1
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +192 -184
- package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +21 -17
- package/components/nav/WindowManager/index.vue +4 -4
- package/components/nav/WorkspaceSwitcher.vue +16 -16
- package/components/nav/__tests__/TopLevelMenu.test.ts +354 -308
- package/components/nav/__tests__/Type.test.ts +194 -111
- package/components/nuxt/nuxt-build-indicator.vue +79 -52
- package/components/nuxt/nuxt-child.js +24 -25
- package/components/nuxt/nuxt-error.vue +48 -18
- package/components/nuxt/nuxt-link.client.js +4 -3
- package/components/nuxt/nuxt-loading.vue +96 -85
- package/components/templates/blank.vue +0 -1
- package/components/templates/default.vue +0 -4
- package/components/templates/home.vue +4 -4
- package/components/templates/plain.vue +3 -2
- package/composables/useI18n.ts +1 -1
- package/composables/useLabeledFormElement.ts +12 -1
- package/composables/useUserRetentionValidation.test.ts +178 -0
- package/composables/useUserRetentionValidation.ts +201 -0
- package/config/__test__/home-links.test.ts +2 -7
- package/config/pagination-table-headers.js +5 -4
- package/config/product/auth.js +1 -1
- package/config/query-params.js +1 -0
- package/config/roles.ts +34 -19
- package/config/router/index.js +10 -7
- package/config/router/navigation-guards/attempt-first-login.js +1 -1
- package/config/router/navigation-guards/authentication.js +2 -1
- package/{middleware/authenticated.js → config/router/navigation-guards/clusters.js} +28 -86
- package/config/router/navigation-guards/history.js +13 -0
- package/config/router/navigation-guards/i18n.js +13 -0
- package/config/router/navigation-guards/index.js +9 -1
- package/config/router/navigation-guards/install-redirect.js +95 -0
- package/config/router/navigation-guards/load-initial-settings.js +1 -1
- package/config/router/navigation-guards/page-title.js +12 -0
- package/config/router/navigation-guards/products.js +15 -0
- package/config/router/navigation-guards/runtime-extension-route.js +31 -0
- package/config/router/navigation-guards/server-upgrade-growl.js +19 -0
- package/config/router/routes.js +49 -23
- package/config/settings.ts +1 -1
- package/config/store.js +2 -5
- package/config/types.js +18 -0
- package/config/uiplugins.js +2 -2
- package/core/plugin-routes.ts +11 -14
- package/core/plugin.ts +10 -10
- package/core/plugins-loader.js +1 -3
- package/core/plugins.js +7 -1
- package/core/types.ts +7 -7
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +3 -3
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +46 -4
- package/detail/__tests__/service.test.ts +6 -6
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +6 -5
- package/detail/catalog.cattle.io.app.vue +2 -2
- package/detail/cis.cattle.io.clusterscan.vue +3 -3
- package/detail/configmap.vue +4 -1
- package/detail/fleet.cattle.io.cluster.vue +2 -1
- package/detail/fleet.cattle.io.clustergroup.vue +2 -1
- package/detail/fleet.cattle.io.gitrepo.vue +2 -1
- package/detail/harvesterhci.io.management.cluster.vue +2 -1
- package/detail/helm.cattle.io.projecthelmchart.vue +3 -3
- package/detail/management.cattle.io.user.vue +2 -1
- package/detail/namespace.vue +2 -1
- package/detail/networking.k8s.io.ingress.vue +4 -2
- package/detail/node.vue +2 -1
- package/detail/provisioning.cattle.io.cluster.vue +10 -11
- package/detail/secret.vue +3 -2
- package/detail/service.vue +2 -1
- package/detail/workload/index.vue +1 -19
- package/dialog/AddClusterMemberDialog.vue +30 -31
- package/dialog/AddCustomBadgeDialog.vue +101 -104
- package/dialog/AddProjectMemberDialog.vue +45 -46
- package/dialog/AddonConfigConfirmationDialog.vue +22 -24
- package/dialog/DeactivateDriverDialog.vue +35 -17
- package/dialog/DiagnosticTimingsDialog.vue +29 -29
- package/dialog/DrainNode.vue +245 -249
- package/dialog/ForceMachineRemoveDialog.vue +32 -34
- package/dialog/GenericPrompt.vue +23 -25
- package/dialog/RollbackWorkloadDialog.vue +68 -71
- package/dialog/RotateCertificatesDialog.vue +17 -18
- package/dialog/RotateEncryptionKeyDialog.vue +46 -47
- package/dialog/SaveAsRKETemplateDialog.vue +46 -47
- package/dialog/ScaleMachineDownDialog.vue +3 -3
- package/dialog/ScalePoolDownDialog.vue +22 -24
- package/dialog/SloDialog.vue +95 -0
- package/directives/clean-html.js +3 -3
- package/directives/clean-tooltip.js +1 -1
- package/directives/focus.js +17 -11
- package/directives/int-number.js +2 -2
- package/directives/positive-int-number.js +2 -2
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +7 -13
- package/edit/__tests__/kontainerDriver.test.ts +23 -20
- package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +31 -29
- package/edit/__tests__/management.cattle.io.setting.test.ts +20 -18
- package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +17 -15
- package/edit/__tests__/namespace.test.ts +29 -26
- package/edit/__tests__/nodeDriver.test.ts +35 -53
- package/edit/__tests__/service.test.ts +20 -17
- package/edit/__tests__/ui.cattle.io.navlink.test.ts +22 -20
- package/edit/auth/__tests__/AuthProviderWarningBanners.test.ts +2 -2
- package/edit/auth/__tests__/azuread.test.ts +43 -45
- package/edit/auth/__tests__/oidc.test.ts +38 -41
- package/edit/auth/azuread.vue +16 -23
- package/edit/auth/github.vue +6 -6
- package/edit/auth/googleoauth.vue +7 -7
- package/edit/auth/ldap/config.vue +29 -29
- package/edit/auth/ldap/index.vue +5 -5
- package/edit/auth/oidc.vue +18 -18
- package/edit/auth/saml.vue +94 -24
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +7 -7
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +18 -16
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +3 -3
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +3 -3
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +12 -12
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +5 -5
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +3 -3
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
- package/edit/catalog.cattle.io.clusterrepo.vue +31 -32
- package/edit/cis.cattle.io.clusterscan.vue +9 -9
- package/edit/cis.cattle.io.clusterscanbenchmark.vue +7 -7
- package/edit/cis.cattle.io.clusterscanprofile.vue +3 -3
- package/edit/cloudcredential.vue +13 -8
- package/edit/configmap.vue +7 -7
- package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +3 -3
- package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +1 -1
- package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +1 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +21 -22
- package/edit/fleet.cattle.io.cluster.vue +2 -1
- package/edit/fleet.cattle.io.clustergroup.vue +3 -2
- package/edit/fleet.cattle.io.gitrepo.vue +18 -18
- package/edit/helm.cattle.io.projecthelmchart.vue +4 -4
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +3 -2
- package/edit/logging-flow/Match.vue +4 -4
- package/edit/logging-flow/index.vue +11 -10
- package/edit/logging.banzaicloud.io.output/__tests__/logging.banzaicloud.io.output.test.ts +79 -73
- package/edit/logging.banzaicloud.io.output/index.vue +4 -4
- package/edit/logging.banzaicloud.io.output/providers/__tests__/loki.test.ts +1 -1
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +5 -5
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +6 -6
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +4 -4
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +16 -16
- package/edit/logging.banzaicloud.io.output/providers/file.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +9 -9
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +5 -5
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +14 -14
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +10 -10
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +5 -5
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +10 -10
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +15 -15
- package/edit/logging.banzaicloud.io.output/providers/redis.vue +5 -5
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +7 -7
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +12 -12
- package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +19 -19
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +1 -1
- package/edit/management.cattle.io.fleetworkspace.vue +6 -4
- package/edit/management.cattle.io.node.vue +1 -1
- package/edit/management.cattle.io.project.vue +13 -10
- package/edit/management.cattle.io.projectroletemplatebinding.vue +3 -3
- package/edit/management.cattle.io.setting.vue +6 -6
- package/edit/management.cattle.io.user.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +2 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +5 -5
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +11 -11
- package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +2 -2
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +10 -9
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +5 -5
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +5 -5
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +9 -9
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +36 -36
- package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +4 -4
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +9 -9
- package/edit/monitoring.coreos.com.receiver/auth.vue +9 -9
- package/edit/monitoring.coreos.com.receiver/index.vue +8 -8
- package/edit/monitoring.coreos.com.receiver/tls.vue +4 -4
- package/edit/monitoring.coreos.com.receiver/types/__tests__/email.test.ts +20 -16
- package/edit/monitoring.coreos.com.receiver/types/email.vue +12 -11
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +11 -11
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +6 -6
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +6 -6
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +7 -7
- package/edit/monitoring.coreos.com.route.vue +10 -10
- package/edit/namespace.vue +7 -7
- package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +12 -12
- package/edit/networking.istio.io.destinationrule/index.vue +15 -15
- package/edit/networking.k8s.io.ingress/Certificate.vue +5 -5
- package/edit/networking.k8s.io.ingress/Certificates.vue +2 -2
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +18 -18
- package/edit/networking.k8s.io.ingress/IngressClass.vue +1 -1
- package/edit/networking.k8s.io.ingress/Rule.vue +9 -7
- package/edit/networking.k8s.io.ingress/RulePath.vue +10 -10
- package/edit/networking.k8s.io.ingress/Rules.vue +3 -3
- package/edit/networking.k8s.io.ingress/index.vue +12 -8
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +4 -4
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +1 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +47 -32
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.test.ts +27 -26
- package/edit/networking.k8s.io.networkpolicy/index.vue +16 -14
- package/edit/node.vue +3 -2
- package/edit/nodeDriver.vue +6 -1
- package/edit/persistentvolume/__tests__/persistentvolume.test.ts +56 -50
- package/edit/persistentvolume/index.vue +23 -23
- package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +8 -8
- package/edit/persistentvolume/plugins/azureDisk.vue +10 -10
- package/edit/persistentvolume/plugins/azureFile.vue +6 -6
- package/edit/persistentvolume/plugins/cephfs.vue +10 -10
- package/edit/persistentvolume/plugins/cinder.vue +8 -8
- package/edit/persistentvolume/plugins/csi.vue +18 -18
- package/edit/persistentvolume/plugins/fc.vue +9 -9
- package/edit/persistentvolume/plugins/flexVolume.vue +9 -9
- package/edit/persistentvolume/plugins/flocker.vue +3 -3
- package/edit/persistentvolume/plugins/gcePersistentDisk.vue +8 -8
- package/edit/persistentvolume/plugins/glusterfs.vue +5 -5
- package/edit/persistentvolume/plugins/hostPath.vue +4 -4
- package/edit/persistentvolume/plugins/iscsi.vue +18 -18
- package/edit/persistentvolume/plugins/local.vue +2 -2
- package/edit/persistentvolume/plugins/longhorn.vue +8 -8
- package/edit/persistentvolume/plugins/nfs.vue +5 -5
- package/edit/persistentvolume/plugins/photonPersistentDisk.vue +5 -5
- package/edit/persistentvolume/plugins/portworxVolume.vue +6 -6
- package/edit/persistentvolume/plugins/quobyte.vue +7 -7
- package/edit/persistentvolume/plugins/rbd.vue +12 -12
- package/edit/persistentvolume/plugins/scaleIO.vue +15 -15
- package/edit/persistentvolume/plugins/storageos.vue +9 -9
- package/edit/persistentvolume/plugins/vsphereVolume.vue +5 -5
- package/edit/persistentvolumeclaim.vue +26 -25
- package/edit/policy.poddisruptionbudget.vue +12 -11
- package/edit/provisioning.cattle.io.cluster/AgentEnv.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +10 -10
- package/edit/provisioning.cattle.io.cluster/Labels.vue +12 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +5 -5
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +40 -36
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +170 -78
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.test.ts +16 -14
- package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +38 -8
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +14 -12
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +18 -19
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +285 -84
- package/edit/provisioning.cattle.io.cluster/import.vue +7 -4
- package/edit/provisioning.cattle.io.cluster/index.vue +32 -13
- package/edit/provisioning.cattle.io.cluster/rke2.vue +149 -78
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +5 -5
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +10 -11
- package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +12 -11
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +62 -24
- package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +9 -9
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +12 -12
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +15 -15
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +6 -6
- package/edit/provisioning.cattle.io.cluster/tabs/networking/ACE.vue +3 -3
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +18 -9
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +16 -12
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryMirrors.vue +4 -4
- package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +64 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +8 -6
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +15 -15
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +4 -4
- package/edit/resources.cattle.io.backup.vue +9 -9
- package/edit/resources.cattle.io.restore.vue +11 -11
- package/edit/secret/basic.vue +2 -2
- package/edit/secret/generic.vue +1 -1
- package/edit/secret/index.vue +12 -10
- package/edit/secret/registry.vue +4 -4
- package/edit/secret/ssh.vue +2 -2
- package/edit/secret/tls.vue +2 -2
- package/edit/service.vue +23 -23
- package/edit/serviceaccount.vue +4 -4
- package/edit/storage.k8s.io.storageclass/index.vue +13 -13
- package/edit/storage.k8s.io.storageclass/provisioners/custom.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
- package/edit/storage.k8s.io.storageclass/provisioners/driver.longhorn.io.vue +4 -4
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +12 -12
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +3 -3
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +3 -3
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +4 -4
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +6 -6
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +9 -9
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +7 -7
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +8 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +11 -11
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +8 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +5 -5
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +7 -7
- package/edit/token.vue +6 -5
- package/edit/ui.cattle.io.navlink.vue +28 -27
- package/edit/workload/Job.vue +16 -16
- package/edit/workload/Upgrading.vue +16 -16
- package/edit/workload/VolumeClaimTemplate.vue +3 -3
- package/edit/workload/__tests__/Job.test.ts +8 -8
- package/edit/workload/__tests__/index.test.ts +32 -29
- package/edit/workload/index.vue +29 -28
- package/edit/workload/mixins/workload.js +30 -30
- package/edit/workload/storage/ContainerMountPaths.vue +3 -4
- package/edit/workload/storage/Mount.vue +3 -3
- package/edit/workload/storage/__tests__/Mount.test.ts +13 -13
- package/edit/workload/storage/__tests__/Storage.test.ts +26 -20
- package/edit/workload/storage/awsElasticBlockStore.vue +4 -4
- package/edit/workload/storage/azureDisk.vue +7 -7
- package/edit/workload/storage/azureFile.vue +5 -5
- package/edit/workload/storage/csi/driver.longhorn.io.vue +3 -3
- package/edit/workload/storage/csi/index.vue +4 -4
- package/edit/workload/storage/emptyDir.vue +4 -4
- package/edit/workload/storage/ephemeralVolume/index.vue +3 -3
- package/edit/workload/storage/gcePersistentDisk.vue +4 -4
- package/edit/workload/storage/hostPath.vue +4 -4
- package/edit/workload/storage/index.vue +3 -4
- package/edit/workload/storage/nfs.vue +4 -4
- package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +18 -16
- package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -5
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +15 -15
- package/edit/workload/storage/secret.vue +9 -9
- package/edit/workload/storage/vsphereVolume.vue +4 -4
- package/initialize/App.vue +10 -8
- package/initialize/app-extended.js +14 -30
- package/initialize/entry-helpers.js +32 -429
- package/initialize/entry.js +11 -10
- package/initialize/install-plugins.js +15 -13
- package/list/__tests__/workload.test.ts +22 -20
- package/list/catalog.cattle.io.app.vue +1 -1
- package/list/cis.cattle.io.clusterscan.vue +1 -2
- package/list/fleet.cattle.io.clustergroup.vue +0 -1
- package/list/group.principal.vue +1 -1
- package/list/management.cattle.io.feature.vue +27 -31
- package/list/management.cattle.io.fleetworkspace.vue +0 -1
- package/list/management.cattle.io.setting.vue +2 -2
- package/list/management.cattle.io.user.vue +1 -1
- package/list/namespace.vue +0 -1
- package/list/node.vue +4 -5
- package/list/provisioning.cattle.io.cluster.vue +1 -1
- package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +0 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +10 -7
- package/machine-config/amazonec2.vue +26 -26
- package/machine-config/azure.vue +31 -31
- package/machine-config/digitalocean.vue +8 -8
- package/machine-config/generic.vue +2 -1
- package/machine-config/linode.vue +4 -4
- package/machine-config/pnap.vue +11 -11
- package/machine-config/vmwarevsphere-config.ts +17 -0
- package/machine-config/vmwarevsphere.vue +400 -410
- package/mixins/__tests__/chart.test.ts +45 -24
- package/mixins/auth-config.js +37 -11
- package/mixins/chart.js +31 -15
- package/mixins/compact-input.ts +2 -3
- package/mixins/labeled-form-element.ts +8 -3
- package/mixins/resource-fetch.js +4 -3
- package/models/__tests__/apps.deployment.test.ts +93 -0
- package/models/apps.deployment.js +18 -4
- package/models/apps.statefulset.js +1 -2
- package/models/batch.cronjob.js +1 -2
- package/models/catalog.cattle.io.clusterrepo.js +1 -2
- package/models/driver.js +3 -2
- package/models/fleet.cattle.io.gitrepo.js +1 -2
- package/models/helm.cattle.io.projecthelmchart.js +2 -3
- package/models/kontainerdriver.js +30 -13
- package/models/management.cattle.io.authconfig.js +2 -2
- package/models/management.cattle.io.cluster.js +2 -2
- package/models/management.cattle.io.roletemplate.js +2 -3
- package/models/namespace.js +1 -2
- package/models/networking.istio.io.destinationrule.js +2 -3
- package/models/nodedriver.js +30 -13
- package/models/persistentvolumeclaim.js +2 -3
- package/models/provisioning.cattle.io.cluster.js +4 -0
- package/models/workload.js +2 -2
- package/package.json +44 -42
- package/pages/404.vue +15 -0
- package/pages/__tests__/prefs.test.ts +44 -44
- package/pages/about.vue +4 -4
- package/pages/account/index.vue +1 -2
- package/pages/auth/login.vue +29 -9
- package/pages/auth/logout.vue +23 -1
- package/pages/auth/setup.vue +35 -31
- package/pages/auth/verify.vue +38 -5
- package/pages/c/_cluster/_product/namespaces.vue +1 -2
- package/pages/c/_cluster/apps/charts/chart.vue +4 -4
- package/pages/c/_cluster/apps/charts/index.vue +16 -16
- package/pages/c/_cluster/apps/charts/install.vue +49 -82
- package/pages/c/_cluster/auth/config/index.vue +2 -2
- package/pages/c/_cluster/auth/roles/index.vue +2 -2
- package/pages/c/_cluster/auth/user.retention/index.vue +34 -95
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +32 -34
- package/pages/c/_cluster/explorer/index.vue +9 -6
- package/pages/c/_cluster/explorer/tools/__tests__/index.test.ts +22 -20
- package/pages/c/_cluster/fleet/index.vue +5 -6
- package/pages/c/_cluster/gatekeeper/index.vue +4 -5
- package/pages/c/_cluster/istio/index.vue +4 -6
- package/pages/c/_cluster/logging/index.vue +9 -5
- package/pages/c/_cluster/longhorn/__tests__/longhorn.index.test.ts +7 -5
- package/pages/c/_cluster/longhorn/index.vue +2 -9
- package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +1 -4
- package/pages/c/_cluster/manager/drivers/nodeDriver/index.vue +1 -4
- package/pages/c/_cluster/manager/jwt.authentication/index.vue +14 -5
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +7 -9
- package/pages/c/_cluster/neuvector/index.vue +7 -10
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +7 -9
- package/pages/c/_cluster/settings/banners.vue +82 -84
- package/pages/c/_cluster/settings/brand.vue +21 -19
- package/pages/c/_cluster/settings/links.vue +6 -4
- package/pages/c/_cluster/settings/performance.vue +25 -21
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +2 -2
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +43 -45
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +5 -5
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -2
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +3 -3
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +20 -15
- package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +12 -9
- package/pages/c/_cluster/uiplugins/index.vue +173 -176
- package/pages/diagnostic.vue +6 -9
- package/pages/fail-whale.vue +3 -1
- package/pages/home.vue +8 -17
- package/pages/index.vue +17 -16
- package/pages/prefs.vue +12 -12
- package/pages/support/index.vue +3 -3
- package/pkg/tsconfig.json +0 -1
- package/plugins/clean-html-directive.js +4 -3
- package/plugins/clean-tooltip-directive.js +4 -3
- package/plugins/dashboard-store/actions.js +1 -1
- package/plugins/dashboard-store/getters.js +1 -1
- package/plugins/dashboard-store/index.js +2 -0
- package/plugins/dashboard-store/mutations.js +5 -5
- package/plugins/dashboard-store/resource-class.js +5 -5
- package/plugins/extend-router.js +62 -42
- package/plugins/floating-vue.js +1 -0
- package/plugins/formatters.js +1 -1
- package/plugins/global-formatters.js +3 -14
- package/plugins/i18n.js +17 -22
- package/plugins/int-number.js +4 -3
- package/plugins/positive-int-number.js +4 -3
- package/plugins/shortkey.js +273 -0
- package/plugins/steve/__tests__/getters.test.ts +6 -3
- package/plugins/steve/getters.js +6 -4
- package/plugins/steve/hybrid-class.js +7 -12
- package/plugins/steve/mutations.js +1 -2
- package/plugins/steve/norman-class.js +10 -11
- package/plugins/steve/subscribe.js +3 -1
- package/plugins/trim-whitespace.js +4 -3
- package/promptRemove/management.cattle.io.globalrole.vue +1 -5
- package/promptRemove/management.cattle.io.project.vue +1 -1
- package/promptRemove/pod.vue +16 -8
- package/public/index.html +53 -52
- package/rancher-components/BadgeState/BadgeState.test.ts +1 -1
- package/rancher-components/BadgeState/BadgeState.vue +1 -1
- package/rancher-components/Banner/Banner.test.ts +2 -2
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +5 -5
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -4
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +5 -5
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +15 -4
- package/rancher-components/Form/Radio/RadioButton.vue +3 -2
- package/rancher-components/Form/Radio/RadioGroup.test.ts +6 -9
- package/rancher-components/Form/Radio/RadioGroup.vue +4 -5
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +18 -1
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +13 -13
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +1 -1
- package/rancher-components/StringList/StringList.test.ts +22 -22
- package/rancher-components/StringList/StringList.vue +10 -9
- package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
- package/scripts/publish-shell.sh +53 -58
- package/scripts/test-plugins-build.sh +44 -38
- package/scripts/vue-migrate.js +7 -4
- package/shell/types/shell/index.d.ts +2 -0
- package/store/__tests__/catalog.test.ts +4 -21
- package/store/auth.js +29 -11
- package/store/index.js +17 -9
- package/store/prefs.js +3 -4
- package/types/resources/settings.d.ts +54 -0
- package/types/store/pagination.types.ts +1 -1
- package/utils/__tests__/kontainer.test.ts +89 -1
- package/utils/auth.js +22 -7
- package/utils/axios.js +1 -1
- package/utils/download.js +1 -1
- package/utils/dynamic-importer.js +14 -12
- package/utils/error.js +4 -4
- package/utils/kontainer.ts +5 -1
- package/utils/object.js +4 -5
- package/utils/router.js +7 -1
- package/utils/select.js +1 -1
- package/utils/settings.ts +3 -1
- package/utils/unit-tests/ChildRenderingRouterLinkStub.ts +4 -4
- package/utils/version.js +2 -1
- package/vue.config.js +404 -396
- package/config/middleware.js +0 -6
- package/config/nuxt-paths.js +0 -7
- package/creators/app/app.package.json +0 -13
- package/creators/app/files/.eslintignore +0 -16
- package/creators/app/files/.eslintrc.js +0 -173
- package/creators/app/files/.gitignore +0 -70
- package/creators/app/files/.gitlab-ci.yml +0 -14
- package/creators/app/files/.vscode/settings.json +0 -21
- package/creators/app/files/babel.config.js +0 -1
- package/creators/app/files/tsconfig.json +0 -42
- package/creators/app/files/vue.config.js +0 -6
- package/creators/app/init +0 -120
- package/creators/app/package.json +0 -25
- package/creators/pkg/files/.github/workflows/build-extension-catalog.yml +0 -24
- package/creators/pkg/files/.github/workflows/build-extension-charts.yml +0 -22
- package/creators/pkg/files/babel.config.js +0 -1
- package/creators/pkg/files/index.ts +0 -14
- package/creators/pkg/files/tsconfig.json +0 -53
- package/creators/pkg/files/vue.config.js +0 -1
- package/creators/pkg/init +0 -286
- package/creators/pkg/package.json +0 -19
- package/creators/pkg/pkg.package.json +0 -21
- package/creators/pkg/vue-shim.ts +0 -4
- package/creators/update/init +0 -56
- package/creators/update/package.json +0 -20
- package/creators/update/upgrade +0 -56
- package/pages/c/_cluster/backup/index.vue +0 -11
- package/pages/c/_cluster/cis/index.vue +0 -11
- package/plugins/directives.js +0 -8
- package/plugins/vue-js-modal.js +0 -4
- package/rancher-components/components/Accordion/Accordion.test.ts +0 -45
- package/rancher-components/components/Accordion/Accordion.vue +0 -86
- package/rancher-components/components/Accordion/index.ts +0 -1
- package/rancher-components/components/BadgeState/BadgeState.test.ts +0 -12
- package/rancher-components/components/BadgeState/BadgeState.vue +0 -111
- package/rancher-components/components/BadgeState/index.ts +0 -1
- package/rancher-components/components/Banner/Banner.test.ts +0 -59
- package/rancher-components/components/Banner/Banner.vue +0 -244
- package/rancher-components/components/Banner/index.ts +0 -1
- package/rancher-components/components/Card/Card.test.ts +0 -37
- package/rancher-components/components/Card/Card.vue +0 -167
- package/rancher-components/components/Card/index.ts +0 -1
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +0 -68
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +0 -421
- package/rancher-components/components/Form/Checkbox/index.ts +0 -1
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +0 -40
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +0 -402
- package/rancher-components/components/Form/LabeledInput/index.ts +0 -1
- package/rancher-components/components/Form/Radio/RadioButton.test.ts +0 -33
- package/rancher-components/components/Form/Radio/RadioButton.vue +0 -293
- package/rancher-components/components/Form/Radio/RadioGroup.test.ts +0 -30
- package/rancher-components/components/Form/Radio/RadioGroup.vue +0 -259
- package/rancher-components/components/Form/Radio/index.ts +0 -2
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +0 -172
- package/rancher-components/components/Form/TextArea/index.ts +0 -1
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +0 -94
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +0 -152
- package/rancher-components/components/Form/ToggleSwitch/index.ts +0 -1
- package/rancher-components/components/Form/index.ts +0 -5
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -156
- package/rancher-components/components/LabeledTooltip/index.ts +0 -1
- package/rancher-components/components/StringList/StringList.test.ts +0 -754
- package/rancher-components/components/StringList/StringList.vue +0 -650
- package/rancher-components/components/StringList/index.ts +0 -1
- package/types/shell/index.d.ts +0 -4585
- package/utils/install-redirect.js +0 -55
- /package/utils/{cookie-universal-nuxt.js → cookie-universal.js} +0 -0
package/vue.config.js
CHANGED
|
@@ -6,13 +6,12 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
6
6
|
const serverMiddlewares = require('./server/server-middleware.js');
|
|
7
7
|
const configHelper = require('./vue-config-helper.js');
|
|
8
8
|
const har = require('./server/har-file');
|
|
9
|
-
const
|
|
9
|
+
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
|
|
10
10
|
|
|
11
11
|
// Suppress info level logging messages from http-proxy-middleware
|
|
12
12
|
// This hides all of the "[HPM Proxy created] ..." messages
|
|
13
13
|
const oldInfoLogger = console.info; // eslint-disable-line no-console
|
|
14
14
|
|
|
15
|
-
// TODO: Add explanation of this logic
|
|
16
15
|
console.info = () => {}; // eslint-disable-line no-console
|
|
17
16
|
|
|
18
17
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
@@ -22,16 +21,28 @@ console.info = oldInfoLogger; // eslint-disable-line no-console
|
|
|
22
21
|
// This is currently hardcoded to avoid importing the TS
|
|
23
22
|
// const { STANDARD } = require('./config/private-label');
|
|
24
23
|
const STANDARD = 1;
|
|
25
|
-
|
|
26
|
-
const
|
|
24
|
+
|
|
25
|
+
const dev = configHelper.dev;
|
|
26
|
+
const devPorts = configHelper.devPorts;
|
|
27
|
+
|
|
28
|
+
// human readable version used on rancher dashboard about page
|
|
29
|
+
const dashboardVersion = process.env.DASHBOARD_VERSION;
|
|
30
|
+
|
|
27
31
|
const pl = process.env.PL || STANDARD;
|
|
28
32
|
const commit = process.env.COMMIT || 'head';
|
|
29
33
|
const perfTest = (process.env.PERF_TEST === 'true'); // Enable performance testing when in dev
|
|
34
|
+
const instrumentCode = (process.env.TEST_INSTRUMENT === 'true'); // Instrument code for code coverage in e2e tests
|
|
35
|
+
|
|
36
|
+
const api = configHelper.api;
|
|
37
|
+
// ===============================================================================================
|
|
38
|
+
// Nuxt configuration
|
|
39
|
+
// ===============================================================================================
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
// Expose a function that can be used by an app to provide a nuxt configuration for building an application
|
|
42
|
+
// This takes the directory of the application as tehfirst argument so that we can derive folder locations
|
|
43
|
+
// from it, rather than from the location of this file
|
|
44
|
+
module.exports = function(dir, _appConfig) {
|
|
45
|
+
// Paths to the shell folder when it is included as a node dependency
|
|
35
46
|
let SHELL_ABS = path.join(dir, 'node_modules/@rancher/shell');
|
|
36
47
|
let COMPONENTS_DIR = path.join(SHELL_ABS, 'rancher-components');
|
|
37
48
|
|
|
@@ -48,441 +59,274 @@ const getShellPaths = (dir) => {
|
|
|
48
59
|
|
|
49
60
|
// If we have a local folder named 'shell' then use that rather than the one in node_modules
|
|
50
61
|
// This will be the case in the main dashboard repository.
|
|
51
|
-
if (fs.existsSync(path.
|
|
52
|
-
SHELL_ABS = path.
|
|
62
|
+
if (fs.existsSync(path.resolve(dir, 'shell'))) {
|
|
63
|
+
SHELL_ABS = path.resolve(dir, 'shell');
|
|
53
64
|
COMPONENTS_DIR = path.join(dir, 'pkg', 'rancher-components', 'src', 'components');
|
|
54
65
|
}
|
|
55
66
|
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
// ===============================================================================================
|
|
68
|
+
// Functions for the UI Pluginas
|
|
69
|
+
// ===============================================================================================
|
|
58
70
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
'/k8s': configHelper.proxyWsOpts(api), // Straight to a remote cluster (/k8s/clusters/<id>/)
|
|
62
|
-
'/pp': configHelper.proxyWsOpts(api), // For (epinio) standalone API
|
|
63
|
-
'/api': configHelper.proxyWsOpts(api), // Management k8s API
|
|
64
|
-
'/apis': configHelper.proxyWsOpts(api), // Management k8s API
|
|
65
|
-
'/v1': configHelper.proxyWsOpts(api), // Management Steve API
|
|
66
|
-
'/v3': configHelper.proxyWsOpts(api), // Rancher API
|
|
67
|
-
'/v3-public': configHelper.proxyOpts(api), // Rancher Unauthed API
|
|
68
|
-
'/api-ui': configHelper.proxyOpts(api), // Browser API UI
|
|
69
|
-
'/meta': configHelper.proxyMetaOpts(api), // Browser API UI
|
|
70
|
-
'/v1-*': configHelper.proxyOpts(api), // SAML, KDM, etc
|
|
71
|
-
'/rancherversion': configHelper.proxyPrimeOpts(api), // Rancher version endpoint
|
|
72
|
-
// These are for Ember embedding
|
|
73
|
-
'/c/*/edit': configHelper.proxyOpts('https://127.0.0.1:8000'), // Can't proxy all of /c because that's used by Vue too
|
|
74
|
-
'/k/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
75
|
-
'/g/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
76
|
-
'/n/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
77
|
-
'/p/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
78
|
-
'/assets': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
79
|
-
'/translations': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
80
|
-
'/engines-dist': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @pkg imports must be resolved to the package that it importing them - this allows a package to use @pkg as an alias
|
|
85
|
-
* to the root of that particular package
|
|
86
|
-
*/
|
|
87
|
-
const getPackageImport = (dir) => new webpack.NormalModuleReplacementPlugin(/^@pkg/, (resource) => {
|
|
88
|
-
const ctx = resource.context.split('/');
|
|
89
|
-
// Find 'pkg' folder in the context
|
|
90
|
-
const index = ctx.findIndex((s) => s === 'pkg');
|
|
91
|
-
|
|
92
|
-
if (index !== -1 && (index + 1) < ctx.length) {
|
|
93
|
-
const pkg = ctx[index + 1];
|
|
94
|
-
let p = path.resolve(dir, 'pkg', pkg, resource.request.substr(5));
|
|
95
|
-
|
|
96
|
-
if (resource.request.startsWith(`@pkg/${ pkg }`)) {
|
|
97
|
-
p = path.resolve(dir, 'pkg', resource.request.substr(5));
|
|
98
|
-
}
|
|
71
|
+
const appConfig = _appConfig || {};
|
|
72
|
+
const excludes = appConfig.excludes || [];
|
|
99
73
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const getLoaders = (SHELL_ABS) => {
|
|
105
|
-
const instrumentCode = (process.env.TEST_INSTRUMENT === 'true'); // Instrument code for code coverage in e2e tests
|
|
106
|
-
// Instrument code for tests
|
|
107
|
-
const babelPlugins = [
|
|
108
|
-
// TODO: Browser support; also add explanation to this TODO
|
|
109
|
-
// ['@babel/plugin-transform-modules-commonjs'],
|
|
110
|
-
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
|
|
111
|
-
['@babel/plugin-proposal-class-properties', { loose: true }]
|
|
74
|
+
const watcherIgnores = [
|
|
75
|
+
/node_modules/,
|
|
76
|
+
/dist-pkg/,
|
|
77
|
+
/scripts\/standalone/
|
|
112
78
|
];
|
|
113
79
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
80
|
+
// Find any UI packages in node_modules
|
|
81
|
+
const NM = path.join(dir, 'node_modules');
|
|
82
|
+
const pkg = require(path.join(dir, 'package.json'));
|
|
83
|
+
const nmPackages = {};
|
|
118
84
|
|
|
119
|
-
|
|
120
|
-
|
|
85
|
+
if (pkg && pkg.dependencies) {
|
|
86
|
+
Object.keys(pkg.dependencies).forEach((pkg) => {
|
|
87
|
+
const f = require(path.join(NM, pkg, 'package.json'));
|
|
121
88
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
test: /web-worker.[a-z-]+.js/i,
|
|
126
|
-
loader: 'worker-loader',
|
|
127
|
-
options: { inline: 'fallback' },
|
|
128
|
-
},
|
|
129
|
-
// Handler for csv files (e.g. ec2 instance data)
|
|
130
|
-
{
|
|
131
|
-
test: /\.csv$/i,
|
|
132
|
-
loader: 'csv-loader',
|
|
133
|
-
options: {
|
|
134
|
-
dynamicTyping: true,
|
|
135
|
-
header: true,
|
|
136
|
-
skipEmptyLines: true
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
// Handler for yaml files (used for i18n files, for example)
|
|
140
|
-
{
|
|
141
|
-
test: /\.ya?ml$/i,
|
|
142
|
-
loader: 'js-yaml-loader',
|
|
143
|
-
options: { name: '[path][name].[ext]' },
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
test: /\.m?[tj]sx?$/,
|
|
147
|
-
// This excludes no modules except for node_modules/@rancher/... so that plugins can properly compile
|
|
148
|
-
// when referencing @rancher/shell
|
|
149
|
-
exclude: /node_modules\/(?!(@rancher)\/).*/,
|
|
150
|
-
use: [
|
|
151
|
-
{
|
|
152
|
-
loader: 'cache-loader',
|
|
153
|
-
options: {
|
|
154
|
-
cacheDirectory: 'node_modules/.cache/babel-loader',
|
|
155
|
-
cacheIdentifier: 'e93f32da'
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
loader: 'babel-loader',
|
|
160
|
-
options: {
|
|
161
|
-
presets: [
|
|
162
|
-
[
|
|
163
|
-
require.resolve('@nuxt/babel-preset-app'),
|
|
164
|
-
{
|
|
165
|
-
corejs: { version: 3 },
|
|
166
|
-
targets: { browsers: ['last 2 versions'] },
|
|
167
|
-
modern: true
|
|
168
|
-
}
|
|
169
|
-
],
|
|
170
|
-
'@babel/preset-typescript',
|
|
171
|
-
],
|
|
172
|
-
plugins: babelPlugins
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
]
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
test: /\.tsx?$/,
|
|
179
|
-
use: [
|
|
180
|
-
{
|
|
181
|
-
loader: 'cache-loader',
|
|
182
|
-
options: {
|
|
183
|
-
cacheDirectory: 'node_modules/.cache/ts-loader',
|
|
184
|
-
cacheIdentifier: '3596741e'
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
loader: 'ts-loader',
|
|
189
|
-
options: {
|
|
190
|
-
transpileOnly: true,
|
|
191
|
-
happyPackMode: false,
|
|
192
|
-
appendTsxSuffixTo: [
|
|
193
|
-
'\\.vue$'
|
|
194
|
-
],
|
|
195
|
-
configFile: path.join(SHELL_ABS, 'tsconfig.json')
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
},
|
|
200
|
-
// Prevent warning in log with the md files in the content folder
|
|
201
|
-
{
|
|
202
|
-
test: /\.md$/,
|
|
203
|
-
use: [
|
|
204
|
-
{
|
|
205
|
-
loader: 'frontmatter-markdown-loader',
|
|
206
|
-
options: { mode: ['body'] }
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
];
|
|
211
|
-
};
|
|
89
|
+
// The package.json must have the 'rancher' property to mark it as a UI package
|
|
90
|
+
if (f.rancher) {
|
|
91
|
+
const id = `${ f.name }-${ f.version }`;
|
|
212
92
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return {
|
|
219
|
-
https: (devPorts ? {
|
|
220
|
-
key: fs.readFileSync(path.resolve(__dirname, 'server/server.key')),
|
|
221
|
-
cert: fs.readFileSync(path.resolve(__dirname, 'server/server.crt'))
|
|
222
|
-
} : null),
|
|
223
|
-
port: (devPorts ? 8005 : 80),
|
|
224
|
-
host: '0.0.0.0',
|
|
225
|
-
public: `https://0.0.0.0:${ devPorts ? 8005 : 80 }`,
|
|
226
|
-
before(app, server) {
|
|
227
|
-
const socketProxies = {};
|
|
228
|
-
|
|
229
|
-
// Close down quickly in response to CTRL + C
|
|
230
|
-
process.once('SIGINT', () => {
|
|
231
|
-
server.close();
|
|
232
|
-
console.log('\n'); // eslint-disable-line no-console
|
|
233
|
-
process.exit(1);
|
|
234
|
-
});
|
|
93
|
+
nmPackages[id] = f.main;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
235
97
|
|
|
236
|
-
|
|
98
|
+
function includePkg(name) {
|
|
99
|
+
if (name.startsWith('.') || name === 'node_modules') {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
237
102
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
app.use(har.harProxy(harData, process.env.HAR_DIR));
|
|
103
|
+
return !excludes || (excludes && !excludes.includes(name));
|
|
104
|
+
}
|
|
241
105
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
106
|
+
// For each package in the pkg folder that is being compiled into the application,
|
|
107
|
+
// Add in the code to automatically import the types from that package
|
|
108
|
+
// This imports models, edit, detail, list etc
|
|
109
|
+
// When built as a UI package, shell/pkg/vue.config.js does the same thing
|
|
110
|
+
const autoImportTypes = {};
|
|
111
|
+
const VirtualModulesPlugin = require('webpack-virtual-modules');
|
|
112
|
+
let reqs = '';
|
|
113
|
+
const pkgFolder = path.relative(dir, './pkg');
|
|
245
114
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
});
|
|
249
|
-
}
|
|
115
|
+
if (fs.existsSync(pkgFolder)) {
|
|
116
|
+
const items = fs.readdirSync(path.relative(dir, './pkg'));
|
|
250
117
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
ws: false // We will handle the web socket upgrade
|
|
255
|
-
});
|
|
118
|
+
// Ignore hidden folders
|
|
119
|
+
items.filter((name) => !name.startsWith('.')).forEach((name) => {
|
|
120
|
+
const f = require(path.join(dir, 'pkg', name, 'package.json'));
|
|
256
121
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
});
|
|
122
|
+
// Package file must have rancher field to be a plugin
|
|
123
|
+
if (includePkg(name) && f.rancher) {
|
|
124
|
+
reqs += `$plugin.initPlugin('${ name }', require(\'~/pkg/${ name }\')); `;
|
|
125
|
+
}
|
|
262
126
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
127
|
+
autoImportTypes[`node_modules/@rancher/auto-import/${ name }`] = generateDynamicTypeImport(`@pkg/${ name }`, path.join(dir, `pkg/${ name }`));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
266
130
|
|
|
267
|
-
|
|
268
|
-
|
|
131
|
+
Object.keys(nmPackages).forEach((m) => {
|
|
132
|
+
reqs += `$plugin.loadAsync('${ m }', '/pkg/${ m }/${ nmPackages[m] }');`;
|
|
133
|
+
});
|
|
269
134
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
console.log(`Unknown Web socket upgrade request for ${ req.url }`); // eslint-disable-line no-console
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
},
|
|
281
|
-
};
|
|
282
|
-
};
|
|
135
|
+
// Generate a virtual module '@rancher/dyanmic.js` which imports all of the packages that should be built into the application
|
|
136
|
+
// This is imported in 'shell/extensions/extension-loader.js` which ensures the all code for plugins to be included is imported in the application
|
|
137
|
+
const virtualModules = new VirtualModulesPlugin({ 'node_modules/@rancher/dynamic.js': `export default function ($plugin) { ${ reqs } };` });
|
|
138
|
+
const autoImport = new webpack.NormalModuleReplacementPlugin(/^@rancher\/auto-import$/, (resource) => {
|
|
139
|
+
const ctx = resource.context.split('/');
|
|
140
|
+
const pkg = ctx[ctx.length - 1];
|
|
283
141
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* This is imported in 'shell/extensions/extension-loader.js` which ensures the all code for plugins to be included is imported in the application
|
|
287
|
-
*/
|
|
288
|
-
const getVirtualModules = (dir, includePkg) => {
|
|
289
|
-
// Find any UI packages in node_modules
|
|
290
|
-
const modulePaths = path.join(dir, 'node_modules');
|
|
291
|
-
const requiredPackages = require(path.join(dir, 'package.json'));
|
|
292
|
-
const librariesIndex = {};
|
|
142
|
+
resource.request = `@rancher/auto-import/${ pkg }`;
|
|
143
|
+
});
|
|
293
144
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
145
|
+
// @pkg imports must be resolved to the package that it importing them - this allows a package to use @pkg as an alis
|
|
146
|
+
// to the root of that particular package
|
|
147
|
+
const pkgImport = new webpack.NormalModuleReplacementPlugin(/^@pkg/, (resource) => {
|
|
148
|
+
const ctx = resource.context.split('/');
|
|
149
|
+
// Find 'pkg' folder in the contxt
|
|
150
|
+
const index = ctx.findIndex((s) => s === 'pkg');
|
|
297
151
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
152
|
+
if (index !== -1 && (index + 1) < ctx.length) {
|
|
153
|
+
const pkg = ctx[index + 1];
|
|
154
|
+
let p = path.resolve(dir, 'pkg', pkg, resource.request.substr(5));
|
|
301
155
|
|
|
302
|
-
|
|
156
|
+
if (resource.request.startsWith(`@pkg/${ pkg }`)) {
|
|
157
|
+
p = path.resolve(dir, 'pkg', resource.request.substr(5));
|
|
303
158
|
}
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
159
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if (fs.existsSync(pkgFolder)) {
|
|
311
|
-
fs.readdirSync(pkgFolder)
|
|
312
|
-
.filter((name) => !name.startsWith('.')) // Ignore hidden folders
|
|
313
|
-
.forEach((name) => {
|
|
314
|
-
const library = require(path.join(dir, 'pkg', name, 'package.json'));
|
|
315
|
-
|
|
316
|
-
// Package file must have rancher field to be a plugin
|
|
317
|
-
if (includePkg(name) && library.rancher) {
|
|
318
|
-
reqs += `$plugin.initPlugin('${ name }', require(\'~/pkg/${ name }\')); `;
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
Object.keys(librariesIndex).forEach((i) => {
|
|
324
|
-
reqs += `$plugin.loadAsync('${ i }', '/pkg/${ i }/${ librariesIndex[i] }');`;
|
|
160
|
+
resource.request = p;
|
|
161
|
+
}
|
|
325
162
|
});
|
|
326
163
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const getAutoImport = () => new webpack.NormalModuleReplacementPlugin(/^@rancher\/auto-import$/, (resource) => {
|
|
331
|
-
const ctx = resource.context.split('/');
|
|
332
|
-
const pkg = ctx[ctx.length - 1];
|
|
164
|
+
// ===============================================================================================
|
|
165
|
+
// Dashboard nuxt configuration
|
|
166
|
+
// ===============================================================================================
|
|
333
167
|
|
|
334
|
-
|
|
335
|
-
|
|
168
|
+
require('events').EventEmitter.defaultMaxListeners = 50;
|
|
169
|
+
require('dotenv').config();
|
|
336
170
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
* This imports models, edit, detail, list etc
|
|
341
|
-
* When built as a UI package, shell/pkg/vue.config.js does the same thing
|
|
342
|
-
*/
|
|
343
|
-
const getVirtualModulesAutoImport = (dir) => {
|
|
344
|
-
const autoImportTypes = {};
|
|
345
|
-
const pkgFolder = path.relative(dir, './pkg');
|
|
171
|
+
let routerBasePath = '/';
|
|
172
|
+
let resourceBase = '';
|
|
173
|
+
let outputDir = 'dist';
|
|
346
174
|
|
|
347
|
-
if (
|
|
348
|
-
|
|
349
|
-
.filter((name) => !name.startsWith('.')) // Ignore hidden folders
|
|
350
|
-
.forEach((name) => {
|
|
351
|
-
autoImportTypes[`node_modules/@rancher/auto-import/${ name }`] = generateDynamicTypeImport(`@pkg/${ name }`, path.join(dir, `pkg/${ name }`));
|
|
352
|
-
});
|
|
175
|
+
if ( typeof process.env.ROUTER_BASE !== 'undefined' ) {
|
|
176
|
+
routerBasePath = process.env.ROUTER_BASE;
|
|
353
177
|
}
|
|
354
178
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
// Get current shell version
|
|
359
|
-
const shellPkgRawData = fs.readFileSync(path.join(__dirname, 'package.json'));
|
|
360
|
-
const shellPkgData = JSON.parse(shellPkgRawData);
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* DefinePlugin does string replacement within our code. We may want to consider replacing it with something else. In code we'll see something like
|
|
364
|
-
* process.env.commit even though process and env aren't even defined objects. This could cause people to be mislead.
|
|
365
|
-
*/
|
|
366
|
-
const createEnvVariablesPlugin = (routerBasePath, rancherEnv) => new webpack.DefinePlugin({
|
|
367
|
-
'process.env.UI_EXTENSIONS_API_VERSION': JSON.stringify(shellPkgData.version),
|
|
368
|
-
'process.env.commit': JSON.stringify(commit),
|
|
369
|
-
'process.env.version': JSON.stringify(dashboardVersion),
|
|
370
|
-
'process.env.dev': JSON.stringify(dev),
|
|
371
|
-
'process.env.pl': JSON.stringify(pl),
|
|
372
|
-
'process.env.perfTest': JSON.stringify(perfTest),
|
|
373
|
-
'process.env.loginLocaleSelector': JSON.stringify(process.env.LOGIN_LOCALE_SELECTOR || 'true'),
|
|
374
|
-
'process.env.excludeOperatorPkg': JSON.stringify(process.env.EXCLUDE_OPERATOR_PKG || 'false'),
|
|
375
|
-
'process.env.rancherEnv': JSON.stringify(rancherEnv),
|
|
376
|
-
'process.env.harvesterPkgUrl': JSON.stringify(process.env.HARVESTER_PKG_URL),
|
|
377
|
-
'process.env.api': JSON.stringify(api),
|
|
378
|
-
// Store the Router Base as env variable that we can use in `shell/config/router.js`
|
|
379
|
-
'process.env.routerBase': JSON.stringify(routerBasePath),
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Ensure we process files in the @rancher/shell folder
|
|
384
|
-
*/
|
|
385
|
-
const processShellFiles = (config, SHELL_ABS) => {
|
|
386
|
-
config.module.rules.forEach((r) => {
|
|
387
|
-
if ('test.js'.match(r.test)) {
|
|
388
|
-
if (r.exclude) {
|
|
389
|
-
const orig = r.exclude;
|
|
390
|
-
|
|
391
|
-
r.exclude = function(modulePath) {
|
|
392
|
-
if (modulePath.indexOf(SHELL_ABS) === 0 || typeof orig !== 'function') {
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
179
|
+
if ( typeof process.env.RESOURCE_BASE !== 'undefined' ) {
|
|
180
|
+
resourceBase = process.env.RESOURCE_BASE;
|
|
181
|
+
}
|
|
395
182
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
};
|
|
183
|
+
if ( typeof process.env.OUTPUT_DIR !== 'undefined' ) {
|
|
184
|
+
outputDir = process.env.OUTPUT_DIR;
|
|
185
|
+
}
|
|
402
186
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
* Need to find the vue loader in the webpack config and update the setting
|
|
407
|
-
*/
|
|
408
|
-
const preserveWhitespace = (config) => {
|
|
409
|
-
config.module.rules.forEach((loader) => {
|
|
410
|
-
if (loader.use) {
|
|
411
|
-
loader.use.forEach((use) => {
|
|
412
|
-
if (use.loader.includes('vue-loader')) {
|
|
413
|
-
use.options.compilerOptions.whitespace = 'preserve';
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
};
|
|
187
|
+
if ( resourceBase && !resourceBase.endsWith('/') ) {
|
|
188
|
+
resourceBase += '/';
|
|
189
|
+
}
|
|
419
190
|
|
|
420
|
-
const printLogs = (dev, dashboardVersion, resourceBase, routerBasePath, pl, rancherEnv) => {
|
|
421
191
|
console.log(`Build: ${ dev ? 'Development' : 'Production' }`); // eslint-disable-line no-console
|
|
422
192
|
|
|
423
|
-
if (!dev) {
|
|
193
|
+
if ( !dev ) {
|
|
424
194
|
console.log(`Version: ${ dashboardVersion }`); // eslint-disable-line no-console
|
|
425
195
|
}
|
|
426
196
|
|
|
427
|
-
if (resourceBase) {
|
|
197
|
+
if ( resourceBase ) {
|
|
428
198
|
console.log(`Resource Base URL: ${ resourceBase }`); // eslint-disable-line no-console
|
|
429
199
|
}
|
|
430
200
|
|
|
431
|
-
if (routerBasePath !== '/') {
|
|
201
|
+
if ( routerBasePath !== '/' ) {
|
|
432
202
|
console.log(`Router Base Path: ${ routerBasePath }`); // eslint-disable-line no-console
|
|
433
203
|
}
|
|
434
204
|
|
|
435
|
-
if (pl !== STANDARD) {
|
|
205
|
+
if ( pl !== STANDARD ) {
|
|
436
206
|
console.log(`PL: ${ pl }`); // eslint-disable-line no-console
|
|
437
207
|
}
|
|
208
|
+
const rancherEnv = process.env.RANCHER_ENV || 'web';
|
|
209
|
+
|
|
210
|
+
const loginLocaleSelector = process.env.LOGIN_LOCALE_SELECTOR || 'true';
|
|
211
|
+
const excludeOperatorPkg = process.env.EXCLUDE_OPERATOR_PKG || 'false';
|
|
438
212
|
|
|
439
213
|
console.log(`API: '${ api }'. Env: '${ rancherEnv }'`); // eslint-disable-line no-console
|
|
440
|
-
|
|
214
|
+
const proxy = {
|
|
215
|
+
...appConfig.proxies,
|
|
216
|
+
'/k8s': configHelper.proxyWsOpts(api), // Straight to a remote cluster (/k8s/clusters/<id>/)
|
|
217
|
+
'/pp': configHelper.proxyWsOpts(api), // For (epinio) standalone API
|
|
218
|
+
'/api': configHelper.proxyWsOpts(api), // Management k8s API
|
|
219
|
+
'/apis': configHelper.proxyWsOpts(api), // Management k8s API
|
|
220
|
+
'/v1': configHelper.proxyWsOpts(api), // Management Steve API
|
|
221
|
+
'/v3': configHelper.proxyWsOpts(api), // Rancher API
|
|
222
|
+
'/v3-public': configHelper.proxyOpts(api), // Rancher Unauthed API
|
|
223
|
+
'/api-ui': configHelper.proxyOpts(api), // Browser API UI
|
|
224
|
+
'/meta': configHelper.proxyMetaOpts(api), // Browser API UI
|
|
225
|
+
'/v1-*': configHelper.proxyOpts(api), // SAML, KDM, etc
|
|
226
|
+
'/rancherversion': configHelper.proxyPrimeOpts(api), // Rancher version endpoint
|
|
227
|
+
// These are for Ember embedding
|
|
228
|
+
'/c/*/edit': configHelper.proxyOpts('https://127.0.0.1:8000'), // Can't proxy all of /c because that's used by Vue too
|
|
229
|
+
'/k/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
230
|
+
'/g/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
231
|
+
'/n/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
232
|
+
'/p/': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
233
|
+
'/assets': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
234
|
+
'/translations': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
235
|
+
'/engines-dist': configHelper.proxyOpts('https://127.0.0.1:8000'),
|
|
236
|
+
};
|
|
441
237
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
* from it, rather than from the location of this file
|
|
446
|
-
*/
|
|
447
|
-
module.exports = function(dir, _appConfig) {
|
|
448
|
-
require('events').EventEmitter.defaultMaxListeners = 20;
|
|
449
|
-
require('dotenv').config();
|
|
238
|
+
// HAR File support - load network responses from the specified .har file and use those rather than communicating to the Rancher server
|
|
239
|
+
const harFile = process.env.HAR_FILE;
|
|
240
|
+
let harData;
|
|
450
241
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const watcherIgnores = [
|
|
455
|
-
/.shell/,
|
|
456
|
-
/dist-pkg/,
|
|
457
|
-
/scripts\/standalone/,
|
|
458
|
-
...excludes.map((e) => new RegExp(`/pkg.${ e }`))
|
|
459
|
-
];
|
|
242
|
+
if (harFile) {
|
|
243
|
+
harData = har.loadFile(harFile, devPorts ? 8005 : 80, ''); // eslint-disable-line no-console
|
|
244
|
+
}
|
|
460
245
|
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
246
|
+
const config = {
|
|
247
|
+
// Vue server
|
|
248
|
+
devServer: {
|
|
249
|
+
client: { webSocketURL: { hostname: '0.0.0.0', port: devPorts ? 8005 : 80 } },
|
|
250
|
+
server: {
|
|
251
|
+
type: 'https',
|
|
252
|
+
options: {
|
|
253
|
+
key: fs.readFileSync(path.resolve(__dirname, 'server/server.key')),
|
|
254
|
+
cert: fs.readFileSync(path.resolve(__dirname, 'server/server.crt'))
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
port: (devPorts ? 8005 : 80),
|
|
258
|
+
host: '0.0.0.0',
|
|
259
|
+
setupMiddlewares(middlewares, devServer) {
|
|
260
|
+
const socketProxies = {};
|
|
465
261
|
|
|
466
|
-
|
|
467
|
-
|
|
262
|
+
if (!devServer) {
|
|
263
|
+
// eslint-disable-next-line no-console
|
|
264
|
+
console.error('webpack-dev-server is not defined');
|
|
468
265
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
const outputDir = process.env.OUTPUT_DIR ?? 'dist';
|
|
472
|
-
const rancherEnv = process.env.RANCHER_ENV || 'web';
|
|
266
|
+
return middlewares;
|
|
267
|
+
}
|
|
473
268
|
|
|
474
|
-
|
|
475
|
-
resourceBase += '/';
|
|
476
|
-
}
|
|
269
|
+
const app = devServer.app;
|
|
477
270
|
|
|
478
|
-
|
|
271
|
+
// Close down quickly in response to CTRL + C
|
|
272
|
+
process.once('SIGINT', () => {
|
|
273
|
+
devServer.close();
|
|
274
|
+
console.log('\n'); // eslint-disable-line no-console
|
|
275
|
+
process.exit(1);
|
|
276
|
+
});
|
|
479
277
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
278
|
+
app.use(serverMiddlewares);
|
|
279
|
+
|
|
280
|
+
if (harData) {
|
|
281
|
+
console.log('Installing HAR file middleware'); // eslint-disable-line no-console
|
|
282
|
+
app.use(har.harProxy(harData, process.env.HAR_DIR));
|
|
283
|
+
|
|
284
|
+
devServer.webSocketProxies.push({
|
|
285
|
+
upgrade(req, socket, head) {
|
|
286
|
+
const responseHeaders = ['HTTP/1.1 101 Web Socket Protocol Handshake', 'Upgrade: WebSocket', 'Connection: Upgrade'];
|
|
287
|
+
|
|
288
|
+
socket.write(`${ responseHeaders.join('\r\n') }\r\n\r\n`);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
Object.keys(proxy).forEach((p) => {
|
|
294
|
+
const px = createProxyMiddleware({
|
|
295
|
+
...proxy[p],
|
|
296
|
+
ws: false // We will handle the web socket upgrade
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
if (proxy[p].ws) {
|
|
300
|
+
socketProxies[p] = px;
|
|
301
|
+
}
|
|
302
|
+
app.use(p, px);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// TODO: Verify after migration completed
|
|
306
|
+
devServer.webSocketProxies.push({
|
|
307
|
+
upgrade(req, socket, head) {
|
|
308
|
+
const path = Object.keys(socketProxies).find((path) => req.url.startsWith(path));
|
|
309
|
+
|
|
310
|
+
if (path) {
|
|
311
|
+
const proxy = socketProxies[path];
|
|
312
|
+
|
|
313
|
+
if (proxy.upgrade) {
|
|
314
|
+
proxy.upgrade(req, socket, head);
|
|
315
|
+
} else {
|
|
316
|
+
console.log(`Upgrade for Proxy is not defined. Cannot upgrade Web socket for ${ req.url }`); // eslint-disable-line no-console
|
|
317
|
+
}
|
|
318
|
+
} else {
|
|
319
|
+
console.log(`Unknown Web socket upgrade request for ${ req.url }`); // eslint-disable-line no-console
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
return middlewares;
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
transpileDependencies: true,
|
|
328
|
+
publicPath: resourceBase || undefined,
|
|
329
|
+
css: {
|
|
486
330
|
extract: false, // inline css styles instead of including with `<links`
|
|
487
331
|
loaderOptions: {
|
|
488
332
|
sass: {
|
|
@@ -496,14 +340,20 @@ module.exports = function(dir, _appConfig) {
|
|
|
496
340
|
}
|
|
497
341
|
}
|
|
498
342
|
},
|
|
343
|
+
|
|
499
344
|
outputDir,
|
|
345
|
+
|
|
500
346
|
pages: {
|
|
501
347
|
index: {
|
|
502
348
|
entry: path.join(SHELL_ABS, '/initialize/entry.js'),
|
|
503
349
|
template: path.join(SHELL_ABS, '/public/index.html')
|
|
504
350
|
}
|
|
505
351
|
},
|
|
352
|
+
|
|
506
353
|
configureWebpack(config) {
|
|
354
|
+
// TODO VUE3: We may want to look into what we want the value to actually be. For the time being this was causing a warning in our CLI because it would set process.env.NODE_ENV to 'development' even thought it was
|
|
355
|
+
// already set to 'dev' and we're using 'dev' in other locations so I don't think we want to do that. Config details found here: https://webpack.js.org/configuration/optimization/#optimizationnodeenv.
|
|
356
|
+
config.optimization.nodeEnv = false;
|
|
507
357
|
config.resolve.alias['~'] = dir;
|
|
508
358
|
config.resolve.alias['@'] = dir;
|
|
509
359
|
config.resolve.alias['~assets'] = path.join(__dirname, 'assets');
|
|
@@ -512,20 +362,59 @@ module.exports = function(dir, _appConfig) {
|
|
|
512
362
|
config.resolve.alias['@pkg'] = path.join(dir, 'pkg');
|
|
513
363
|
config.resolve.alias['./node_modules'] = path.join(dir, 'node_modules');
|
|
514
364
|
config.resolve.alias['@components'] = COMPONENTS_DIR;
|
|
515
|
-
config.resolve.alias['vue$'] = path.resolve(process.cwd(), 'node_modules', 'vue'
|
|
365
|
+
config.resolve.alias['vue$'] = dev ? path.resolve(process.cwd(), 'node_modules', 'vue') : 'vue';
|
|
516
366
|
config.resolve.modules.push(__dirname);
|
|
517
|
-
config.plugins.push(
|
|
518
|
-
config.plugins.push(
|
|
519
|
-
config.plugins.push(
|
|
520
|
-
config.plugins.push(
|
|
521
|
-
config.plugins.push(
|
|
367
|
+
config.plugins.push(virtualModules);
|
|
368
|
+
config.plugins.push(autoImport);
|
|
369
|
+
config.plugins.push(new VirtualModulesPlugin(autoImportTypes));
|
|
370
|
+
config.plugins.push(pkgImport);
|
|
371
|
+
config.plugins.push(new NodePolyfillPlugin()); // required from Webpack 5 to polyfill node modules
|
|
372
|
+
// DefinePlugin does string replacement within our code. We may want to consider replacing it with something else. In code we'll see something like
|
|
373
|
+
// process.env.commit even though process and env aren't even defined objects. This could cause people to be mislead.
|
|
374
|
+
config.plugins.push(new webpack.DefinePlugin({
|
|
375
|
+
'process.env.commit': JSON.stringify(commit),
|
|
376
|
+
'process.env.version': JSON.stringify(dashboardVersion),
|
|
377
|
+
'process.env.dev': JSON.stringify(dev),
|
|
378
|
+
'process.env.pl': JSON.stringify(pl),
|
|
379
|
+
'process.env.perfTest': JSON.stringify(perfTest),
|
|
380
|
+
'process.env.loginLocaleSelector': JSON.stringify(loginLocaleSelector),
|
|
381
|
+
'process.env.excludeOperatorPkg': JSON.stringify(excludeOperatorPkg),
|
|
382
|
+
'process.env.rancherEnv': JSON.stringify(rancherEnv),
|
|
383
|
+
'process.env.harvesterPkgUrl': JSON.stringify(process.env.HARVESTER_PKG_URL),
|
|
384
|
+
'process.env.api': JSON.stringify(api),
|
|
385
|
+
// Store the Router Base as env variable that we can use in `shell/config/router.js`
|
|
386
|
+
'process.env.routerBase': JSON.stringify(routerBasePath),
|
|
387
|
+
|
|
388
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
|
|
389
|
+
|
|
390
|
+
// This is a replacement of the nuxt publicRuntimeConfig
|
|
391
|
+
'nuxt.publicRuntimeConfig': JSON.stringify({
|
|
392
|
+
rancherEnv,
|
|
393
|
+
dashboardVersion
|
|
394
|
+
}),
|
|
395
|
+
|
|
396
|
+
}));
|
|
522
397
|
|
|
523
398
|
// The static assets need to be in the built assets directory in order to get served (primarily the favicon)
|
|
524
|
-
config.plugins.push(new CopyWebpackPlugin([{ from: path.join(SHELL_ABS, 'static'), to: '.' }]));
|
|
399
|
+
config.plugins.push(new CopyWebpackPlugin({ patterns: [{ from: path.join(SHELL_ABS, 'static'), to: '.' }] }));
|
|
525
400
|
|
|
526
401
|
config.resolve.extensions.push(...['.tsx', '.ts', '.js', '.vue', '.scss']);
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Add ignored paths based on env var configuration and known cases
|
|
405
|
+
* TODO: Verify after migration completed
|
|
406
|
+
* In Webpack5 only RegExp, string and [string] types are accepted
|
|
407
|
+
* https://webpack.js.org/configuration/watch/#watchoptionsignored
|
|
408
|
+
* Example conversion:
|
|
409
|
+
* - as list: [/.shell/, /dist-pkg/, /scripts\/standalone/, /\/pkg.test-pkg/, /\/pkg.harvester/]
|
|
410
|
+
* - as chained regex rule: /.shell|dist-pkg|scripts\/standalone|\/pkg.test-pkg|\/pkg.harvester/
|
|
411
|
+
*/
|
|
527
412
|
config.watchOptions = config.watchOptions || {};
|
|
528
|
-
|
|
413
|
+
const ignoredPkgs = excludes.map((excluded) => new RegExp(`/pkg.${ excluded }`));
|
|
414
|
+
const watcherIgnoresPaths = [...watcherIgnores, ...ignoredPkgs];
|
|
415
|
+
const combinedRegex = new RegExp(watcherIgnoresPaths.map(({ source }) => source).join('|'));
|
|
416
|
+
|
|
417
|
+
config.watchOptions.ignored = combinedRegex;
|
|
529
418
|
|
|
530
419
|
if (dev) {
|
|
531
420
|
config.devtool = 'cheap-module-source-map';
|
|
@@ -534,9 +423,128 @@ module.exports = function(dir, _appConfig) {
|
|
|
534
423
|
}
|
|
535
424
|
|
|
536
425
|
config.resolve.symlinks = false;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
426
|
+
|
|
427
|
+
// Ensure we process files in the @rancher/shell folder
|
|
428
|
+
config.module.rules.forEach((r) => {
|
|
429
|
+
if ('test.js'.match(r.test)) {
|
|
430
|
+
if (r.exclude) {
|
|
431
|
+
const orig = r.exclude;
|
|
432
|
+
|
|
433
|
+
r.exclude = function(modulePath) {
|
|
434
|
+
if (modulePath.indexOf(SHELL_ABS) === 0 || typeof orig !== 'function') {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return orig(modulePath);
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// Instrument code for tests
|
|
445
|
+
const babelPlugins = [
|
|
446
|
+
// TODO: Browser support
|
|
447
|
+
// ['@babel/plugin-transform-modules-commonjs'],
|
|
448
|
+
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
|
|
449
|
+
['@babel/plugin-proposal-class-properties', { loose: true }]
|
|
450
|
+
];
|
|
451
|
+
|
|
452
|
+
if (instrumentCode) {
|
|
453
|
+
babelPlugins.push([
|
|
454
|
+
'babel-plugin-istanbul', { extension: ['.js', '.vue'] }, 'add-vue'
|
|
455
|
+
]);
|
|
456
|
+
|
|
457
|
+
console.warn('Instrumenting code for coverage'); // eslint-disable-line no-console
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const loaders = [
|
|
461
|
+
// Ensure there is a fallback for browsers that don't support web workers
|
|
462
|
+
{
|
|
463
|
+
test: /web-worker.[a-z-]+.js/i,
|
|
464
|
+
loader: 'worker-loader',
|
|
465
|
+
options: { inline: 'fallback' },
|
|
466
|
+
},
|
|
467
|
+
// Handler for csv files (e.g. ec2 instance data)
|
|
468
|
+
{
|
|
469
|
+
test: /\.csv$/i,
|
|
470
|
+
loader: 'csv-loader',
|
|
471
|
+
options: {
|
|
472
|
+
dynamicTyping: true,
|
|
473
|
+
header: true,
|
|
474
|
+
skipEmptyLines: true
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
// Handler for yaml files (used for i18n files, for example)
|
|
478
|
+
{
|
|
479
|
+
test: /\.ya?ml$/i,
|
|
480
|
+
loader: 'js-yaml-loader',
|
|
481
|
+
options: { name: '[path][name].[ext]' },
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
test: /\.m?[tj]sx?$/,
|
|
485
|
+
// This excludes no modules except for node_modules/@rancher/... so that plugins can properly compile
|
|
486
|
+
// when referencing @rancher/shell
|
|
487
|
+
exclude: /node_modules\/(?!(@rancher)\/).*/,
|
|
488
|
+
use: [
|
|
489
|
+
{
|
|
490
|
+
loader: 'cache-loader',
|
|
491
|
+
options: {
|
|
492
|
+
cacheDirectory: 'node_modules/.cache/babel-loader',
|
|
493
|
+
cacheIdentifier: 'e93f32da'
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
test: /\.tsx?$/,
|
|
500
|
+
use: [
|
|
501
|
+
{
|
|
502
|
+
loader: 'cache-loader',
|
|
503
|
+
options: {
|
|
504
|
+
cacheDirectory: 'node_modules/.cache/ts-loader',
|
|
505
|
+
cacheIdentifier: '3596741e'
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
loader: 'ts-loader',
|
|
510
|
+
options: {
|
|
511
|
+
transpileOnly: true,
|
|
512
|
+
happyPackMode: false,
|
|
513
|
+
appendTsxSuffixTo: [
|
|
514
|
+
'\\.vue$'
|
|
515
|
+
],
|
|
516
|
+
configFile: path.join(SHELL_ABS, 'tsconfig.json')
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
// Prevent warning in log with the md files in the content folder
|
|
522
|
+
{
|
|
523
|
+
test: /\.md$/,
|
|
524
|
+
use: [
|
|
525
|
+
{
|
|
526
|
+
loader: 'frontmatter-markdown-loader',
|
|
527
|
+
options: { mode: ['body'] }
|
|
528
|
+
}
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
];
|
|
532
|
+
|
|
533
|
+
config.module.rules.push(...loaders);
|
|
534
|
+
|
|
535
|
+
// TODO: Verify after migration completed
|
|
536
|
+
// Update vue-loader to set whitespace to 'preserve'
|
|
537
|
+
// This was the setting with nuxt, but is not the default with vue cli
|
|
538
|
+
// Need to find the vue loader in the webpack config and update the setting
|
|
539
|
+
config.module.rules.forEach((loader) => {
|
|
540
|
+
if (loader.use) {
|
|
541
|
+
loader.use.forEach((use) => {
|
|
542
|
+
if (use.loader.includes('vue-loader')) {
|
|
543
|
+
use.options.compilerOptions = { ...use.options.compilerOptions, whitespace: 'preserve' };
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
});
|
|
540
548
|
},
|
|
541
549
|
};
|
|
542
550
|
|