@rancher/shell 0.3.14 → 0.3.15
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/images/providers/nutanix.svg +1 -0
- package/assets/translations/en-us.yaml +83 -2
- package/chart/gatekeeper.vue +2 -2
- package/chart/monitoring/alerting/index.vue +3 -3
- package/chart/monitoring/index.vue +2 -2
- package/chart/monitoring/prometheus/index.vue +1 -1
- package/chart/rancher-backup/index.vue +2 -2
- package/cloud-credential/harvester.vue +2 -2
- package/components/AssignTo.vue +1 -1
- package/components/AwsComplianceBanner.vue +1 -1
- package/components/BackLink.vue +7 -0
- package/components/BrandImage.vue +3 -3
- package/components/ClusterProviderIcon.vue +1 -1
- package/components/CommunityLinks.vue +2 -2
- package/components/ConsumptionGauge.vue +17 -2
- package/components/CruResource.vue +2 -1
- package/components/DashboardMetrics.vue +8 -0
- package/components/DetailTop.vue +1 -1
- package/components/ExplorerMembers.vue +8 -8
- package/components/ExplorerProjectsNamespaces.vue +9 -9
- package/components/FixedBanner.vue +1 -1
- package/components/GlobalRoleBindings.vue +11 -11
- package/components/GrafanaDashboard.vue +7 -1
- package/components/GrowlManager.vue +1 -1
- package/components/HarvesterServiceAddOnConfig.vue +4 -3
- package/components/IconOrSvg.vue +10 -3
- package/components/LandingPagePreference.vue +2 -2
- package/components/MoveModal.vue +1 -1
- package/components/PodSecurityAdmission.vue +3 -3
- package/components/ProgressBarMulti.vue +2 -2
- package/components/PromptRemove.vue +52 -28
- package/components/PromptRestore.vue +3 -3
- package/components/Questions/index.vue +5 -5
- package/components/RelatedWorkloadsTable.vue +1 -1
- package/components/ResourceList/Masthead.vue +1 -1
- package/components/ResourceTable.vue +3 -3
- package/components/ResourceYaml.vue +1 -1
- package/components/RoleBindings.vue +2 -2
- package/components/SingleClusterInfo.vue +1 -1
- package/components/SortableTable/actions.js +3 -3
- package/components/SortableTable/advanced-filtering.js +7 -7
- package/components/SortableTable/filtering.js +1 -1
- package/components/SortableTable/index.vue +9 -9
- package/components/SortableTable/selection.js +5 -5
- package/components/SortableTable/sorting.js +5 -5
- package/components/Tabbed/index.vue +7 -7
- package/components/TableSparkLine.vue +1 -1
- package/components/Wizard.vue +11 -23
- package/components/__tests__/Collapse.spec.ts +1 -1
- package/components/__tests__/CruResource.test.ts +74 -0
- package/components/__tests__/SimpleBox.spec.ts +1 -1
- package/components/auth/RoleDetailEdit.vue +7 -3
- package/components/auth/SelectPrincipal.vue +3 -3
- package/components/fleet/FleetResources.vue +1 -1
- package/components/fleet/FleetStatus.vue +4 -4
- package/components/fleet/FleetSummary.vue +1 -1
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +1 -1
- package/components/fleet/ForceDirectedTreeChart/index.vue +1 -1
- package/components/form/ArrayList.vue +11 -3
- package/components/form/ArrayListSelect.vue +2 -2
- package/components/form/FileSelector.vue +6 -0
- package/components/form/GitPicker.vue +528 -0
- package/components/form/KeyValue.vue +82 -41
- package/components/form/LabeledSelect.vue +2 -2
- package/components/form/MatchExpressions.vue +2 -2
- package/components/form/Members/ClusterMembershipEditor.vue +1 -2
- package/components/form/Members/ClusterPermissionsEditor.vue +6 -5
- package/components/form/Members/MembershipEditor.vue +4 -4
- package/components/form/Members/ProjectMembershipEditor.vue +1 -2
- package/components/form/NameNsDescription.vue +13 -6
- package/components/form/Networking.vue +2 -2
- package/components/form/NodeScheduling.vue +1 -1
- package/components/form/PodAffinity.vue +1 -1
- package/components/form/ProjectMemberEditor.vue +4 -4
- package/components/form/ResourceQuota/Namespace.vue +2 -2
- package/components/form/ResourceQuota/NamespaceRow.vue +2 -2
- package/components/form/ResourceQuota/Project.vue +1 -1
- package/components/form/ResourceQuota/shared.js +2 -2
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/ResourceTabs/index.vue +1 -1
- package/components/form/RuleSelector.vue +1 -1
- package/components/form/SecretSelector.vue +4 -4
- package/components/form/Select.vue +2 -2
- package/components/form/SelectOrCreateAuthSecret.vue +3 -3
- package/components/form/ServiceNameSelect.vue +1 -1
- package/components/form/ServicePorts.vue +1 -1
- package/components/form/ShellInput.vue +1 -1
- package/components/form/SimpleSecretSelector.vue +4 -4
- package/components/form/Taints.vue +1 -1
- package/components/form/ValueFromResource.vue +3 -3
- package/components/form/WorkloadPorts.vue +8 -7
- package/components/form/__tests__/Error.test.ts +1 -1
- package/components/form/__tests__/KeyValue.test.ts +21 -0
- package/components/formatter/ClusterLink.vue +1 -1
- package/components/formatter/ClusterProvider.vue +13 -2
- package/components/formatter/Endpoints.vue +1 -1
- package/components/formatter/FleetSummaryGraph.vue +2 -2
- package/components/formatter/IngressTarget.vue +2 -2
- package/components/formatter/PodImages.vue +1 -1
- package/components/formatter/PrincipalGroupBindings.vue +1 -1
- package/components/formatter/ReceiverIcons.vue +3 -3
- package/components/formatter/ServiceType.vue +1 -1
- package/components/formatter/WorkloadDetailEndpoints.vue +1 -1
- package/components/formatter/WorkloadHealthScale.vue +1 -1
- package/components/formatter/__tests__/LiveDate.test.ts +1 -1
- package/components/graph/Bar.vue +1 -1
- package/components/graph/LinePlot.vue +3 -3
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +5 -5
- package/components/nav/NamespaceFilter.vue +14 -14
- package/components/nav/TopLevelMenu.vue +76 -11
- package/components/nav/WindowManager/ContainerLogs.vue +2 -2
- package/components/nav/WindowManager/ContainerShell.vue +1 -1
- package/components/nav/WorkspaceSwitcher.vue +1 -1
- package/config/home-links.js +4 -4
- package/config/labels-annotations.js +8 -9
- package/config/pod-security-admission.ts +1 -1
- package/config/product/auth.js +4 -4
- package/config/product/explorer.js +14 -0
- package/config/router.js +5 -0
- package/config/store.js +2 -0
- package/config/table-headers.js +13 -13
- package/config/uiplugins.js +8 -1
- package/core/plugin-routes.ts +3 -2
- package/core/plugin.ts +3 -3
- package/core/plugins.js +7 -7
- package/creators/pkg/files/index.ts +1 -1
- package/detail/cis.cattle.io.clusterscan.vue +3 -3
- package/detail/fleet.cattle.io.bundle.vue +1 -1
- package/detail/helm.cattle.io.projecthelmchart.vue +16 -29
- package/detail/management.cattle.io.user.vue +12 -12
- package/detail/namespace.vue +4 -4
- package/detail/networking.k8s.io.ingress.vue +3 -3
- package/detail/node.vue +2 -2
- package/detail/provisioning.cattle.io.cluster.vue +9 -10
- package/detail/service.vue +1 -1
- package/detail/workload/index.vue +3 -3
- package/dialog/AddProjectMemberDialog.vue +2 -2
- package/dialog/DrainNode.vue +1 -1
- package/dialog/GenericPrompt.vue +9 -5
- package/dialog/RotateEncryptionKeyDialog.vue +2 -2
- package/dialog/ScaleMachineDownDialog.vue +2 -2
- package/edit/auth/azuread.vue +3 -3
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +5 -5
- package/edit/cis.cattle.io.clusterscan.vue +5 -5
- package/edit/cloudcredential.vue +4 -4
- package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +1 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +4 -4
- package/edit/fleet.cattle.io.gitrepo.vue +6 -6
- package/edit/helm.cattle.io.projecthelmchart.vue +3 -3
- package/edit/logging-flow/index.vue +4 -4
- package/edit/logging.banzaicloud.io.output/index.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/redis.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +1 -1
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +1 -1
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +1 -1
- package/edit/management.cattle.io.project.vue +3 -3
- package/edit/management.cattle.io.projectroletemplatebinding.vue +2 -2
- package/edit/management.cattle.io.setting.vue +1 -1
- package/edit/management.cattle.io.user.vue +2 -2
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +2 -2
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +3 -3
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +5 -5
- package/edit/monitoring.coreos.com.prometheusrule/duration.js +1 -1
- package/edit/monitoring.coreos.com.receiver/auth.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/tls.vue +3 -4
- package/edit/monitoring.coreos.com.receiver/types/__tests__/email.test.ts +53 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +2 -0
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +3 -3
- package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +1 -1
- package/edit/monitoring.coreos.com.route.vue +2 -2
- package/edit/namespace.vue +21 -13
- package/edit/networking.k8s.io.ingress/Certificate.vue +2 -2
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
- package/edit/networking.k8s.io.ingress/RulePath.vue +2 -2
- package/edit/networking.k8s.io.ingress/Rules.vue +2 -2
- package/edit/networking.k8s.io.ingress/index.vue +4 -4
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/persistentvolume/index.vue +4 -4
- package/edit/persistentvolumeclaim.vue +3 -3
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +7 -7
- package/edit/provisioning.cattle.io.cluster/rke2.vue +28 -29
- package/edit/resources.cattle.io.backup.vue +2 -2
- package/edit/resources.cattle.io.restore.vue +3 -3
- package/edit/secret/generic.vue +1 -1
- package/edit/secret/index.vue +3 -3
- package/edit/service.vue +3 -21
- package/edit/serviceaccount.vue +2 -2
- package/edit/storage.k8s.io.storageclass/index.vue +4 -4
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +1 -1
- package/edit/token.vue +5 -5
- package/edit/workload/index.vue +1 -1
- package/edit/workload/mixins/workload.js +8 -8
- package/edit/workload/storage/ContainerMountPaths.vue +9 -9
- package/edit/workload/storage/Mount.vue +2 -2
- package/edit/workload/storage/csi/index.vue +1 -1
- package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
- package/edit/workload/storage/index.vue +6 -6
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +2 -2
- package/initialize/client.js +8 -8
- package/initialize/index.js +1 -4
- package/layouts/default.vue +38 -11
- package/list/catalog.cattle.io.clusterrepo.vue +9 -1
- package/list/cis.cattle.io.clusterscan.vue +1 -1
- package/list/fleet.cattle.io.cluster.vue +2 -2
- package/list/group.principal.vue +1 -1
- package/list/helm.cattle.io.projecthelmchart.vue +2 -2
- package/list/management.cattle.io.cluster.vue +1 -1
- package/list/management.cattle.io.feature.vue +1 -1
- package/list/management.cattle.io.user.vue +2 -2
- package/list/node.vue +5 -5
- package/list/provisioning.cattle.io.cluster.vue +4 -5
- package/machine-config/amazonec2.vue +2 -2
- package/machine-config/digitalocean.vue +4 -4
- package/machine-config/linode.vue +4 -4
- package/machine-config/vmwarevsphere.vue +12 -12
- package/middleware/authenticated.js +7 -6
- package/mixins/brand.js +1 -1
- package/mixins/chart.js +6 -6
- package/mixins/fetch.client.js +2 -2
- package/mixins/form-validation.js +7 -7
- package/mixins/resource-fetch-namespaced.js +1 -1
- package/mixins/resource-fetch.js +2 -2
- package/models/apps.statefulset.js +2 -2
- package/models/batch.cronjob.js +1 -1
- package/models/catalog.cattle.io.app.js +4 -4
- package/models/cis.cattle.io.clusterscan.js +1 -1
- package/models/cis.cattle.io.clusterscanbenchmark.js +1 -1
- package/models/cis.cattle.io.clusterscanreport.js +1 -1
- package/models/cloudcredential.js +1 -1
- package/models/cluster/node.js +5 -5
- package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
- package/models/fleet.cattle.io.gitrepo.js +3 -3
- package/models/group.principal.js +4 -4
- package/models/helm.cattle.io.projecthelmchart.js +2 -2
- package/models/logging.banzaicloud.io.clusterflow.js +2 -2
- package/models/logging.banzaicloud.io.flow.js +5 -5
- package/models/logging.banzaicloud.io.output.js +2 -2
- package/models/management.cattle.io.cluster.js +10 -14
- package/models/management.cattle.io.globalrole.js +4 -4
- package/models/management.cattle.io.node.js +2 -2
- package/models/management.cattle.io.nodepool.js +3 -3
- package/models/management.cattle.io.nodetemplate.js +4 -4
- package/models/management.cattle.io.project.js +2 -2
- package/models/management.cattle.io.roletemplate.js +1 -1
- package/models/management.cattle.io.setting.js +1 -1
- package/models/management.cattle.io.user.js +5 -5
- package/models/monitoring.coreos.com.receiver.js +9 -9
- package/models/namespace.js +1 -1
- package/models/networking.k8s.io.ingress.js +5 -5
- package/models/persistentvolume.js +3 -3
- package/models/pod.js +3 -3
- package/models/provisioning.cattle.io.cluster.js +39 -27
- package/models/rbac.authorization.k8s.io.clusterrole.js +2 -2
- package/models/rbac.authorization.k8s.io.role.js +3 -3
- package/models/secret.js +1 -1
- package/models/service.js +2 -2
- package/models/storage.k8s.io.storageclass.js +2 -2
- package/models/token.js +1 -1
- package/models/workload.js +6 -6
- package/models/workload.service.js +5 -21
- package/package.json +2 -1
- package/pages/about.vue +9 -9
- package/pages/account/index.vue +2 -2
- package/pages/auth/login.vue +15 -12
- package/pages/auth/verify.vue +6 -0
- package/pages/c/_cluster/apps/charts/index.vue +4 -4
- package/pages/c/_cluster/apps/charts/install.vue +28 -20
- package/pages/c/_cluster/auth/roles/index.vue +9 -9
- package/pages/c/_cluster/explorer/index.vue +41 -16
- package/pages/c/_cluster/explorer/tools/index.vue +8 -8
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +1 -1
- package/pages/c/_cluster/fleet/index.vue +11 -11
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/settings/links.vue +3 -3
- package/pages/c/_cluster/settings/performance.vue +1 -1
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +6 -6
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +3 -3
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -3
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +3 -3
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +6 -6
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +4 -4
- package/pages/c/_cluster/uiplugins/index.vue +22 -19
- package/pages/diagnostic.vue +6 -6
- package/pages/home.vue +3 -3
- package/pages/prefs.vue +2 -2
- package/pages/rio/mesh.vue +3 -3
- package/pages/support/index.vue +10 -1
- package/pkg/auto-import.js +1 -1
- package/pkg/tsconfig.json +1 -0
- package/pkg/vue.config.js +1 -1
- package/plugins/axios.js +1 -1
- package/plugins/clean-html-directive.js +1 -1
- package/plugins/dashboard-store/__tests__/mutations.spec.js +4 -4
- package/plugins/dashboard-store/actions.js +4 -4
- package/plugins/dashboard-store/getters.js +1 -1
- package/plugins/dashboard-store/index.js +1 -1
- package/plugins/dashboard-store/mutations.js +2 -2
- package/plugins/dashboard-store/resource-class.js +8 -8
- package/plugins/i18n.js +1 -1
- package/plugins/plugin.js +5 -1
- package/plugins/steve/actions.js +3 -3
- package/plugins/steve/getters.js +3 -3
- package/plugins/steve/hybrid-class.js +1 -1
- package/plugins/steve/mutations.js +1 -1
- package/plugins/steve/performanceTesting.js +1 -1
- package/plugins/steve/resourceWatcher.js +1 -1
- package/plugins/steve/subscribe.js +6 -6
- package/plugins/steve/worker/web-worker.basic.js +1 -1
- package/promptRemove/management.cattle.io.project.vue +3 -3
- package/promptRemove/mixin/roleDeletionCheck.js +4 -4
- package/promptRemove/pod.vue +1 -1
- package/rancher-components/StringList/StringList.vue +34 -50
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +2 -2
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +1 -1
- package/rancher-components/components/Form/Radio/RadioButton.test.ts +1 -1
- package/rancher-components/components/Form/Radio/RadioButton.vue +2 -2
- package/rancher-components/components/Form/Radio/RadioGroup.vue +2 -2
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +1 -1
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +7 -7
- package/rancher-components/components/StringList/StringList.test.ts +10 -9
- package/rancher-components/components/StringList/StringList.vue +5 -5
- package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
- package/store/action-menu.js +4 -4
- package/store/auth.js +40 -7
- package/store/aws.js +1 -1
- package/store/catalog.js +12 -11
- package/store/digitalocean.js +4 -4
- package/store/features.js +1 -0
- package/store/github.js +70 -213
- package/store/gitlab.js +159 -0
- package/store/growl.js +1 -1
- package/store/i18n.js +7 -7
- package/store/index.js +63 -22
- package/store/linode.js +1 -1
- package/store/plugins.js +5 -5
- package/store/pnap.js +1 -1
- package/store/prefs.js +6 -6
- package/store/resource-fetch.js +3 -3
- package/store/type-map.js +61 -42
- package/store/uiplugins.ts +2 -1
- package/store/wm.js +5 -4
- package/tsconfig.default.json +10 -0
- package/tsconfig.json +2 -9
- package/types/shell/index.d.ts +21 -13
- package/utils/__tests__/version.test.ts +28 -0
- package/utils/alertmanagerconfig.js +4 -4
- package/utils/array.ts +4 -4
- package/utils/async.ts +1 -1
- package/utils/auth.js +3 -3
- package/utils/axios.js +5 -5
- package/utils/cluster.js +4 -3
- package/utils/color.js +10 -0
- package/utils/create-yaml.js +4 -4
- package/utils/crypto/browserHashUtils.js +1 -1
- package/utils/crypto/browserMd5.js +1 -1
- package/utils/crypto/browserSha1.js +1 -1
- package/utils/crypto/browserSha256.js +1 -1
- package/utils/crypto/index.js +3 -3
- package/utils/favicon.js +2 -3
- package/utils/gatekeeper/util.js +3 -3
- package/utils/gc/gc.ts +2 -2
- package/utils/git.ts +92 -0
- package/utils/grafana.js +4 -4
- package/utils/monitoring.js +2 -2
- package/utils/nuxt.js +2 -2
- package/utils/object.js +5 -5
- package/utils/pod-security-admission.ts +1 -1
- package/utils/projectAndNamespaceFiltering.utils.ts +1 -1
- package/utils/select.js +2 -2
- package/utils/selector.js +2 -2
- package/utils/settings.ts +17 -2
- package/utils/socket.js +30 -6
- package/utils/sort.js +1 -1
- package/utils/string.js +1 -1
- package/utils/url.ts +1 -1
- package/utils/validators/formRules/index.ts +3 -3
- package/utils/validators/role-template.js +4 -4
- package/utils/version.js +14 -1
- package/vue.config.js +19 -13
- package/components/.DS_Store +0 -0
- package/components/__tests__/.DS_Store +0 -0
- package/components/form/GithubPicker.vue +0 -390
- package/creators/pkg/package-lock.json +0 -37
- package/yarn-error.log +0 -196
package/utils/color.js
CHANGED
|
@@ -135,3 +135,13 @@ export function colorToRgb(color) {
|
|
|
135
135
|
r: 0, g: 0, b: 0
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
export function normalizeHex(hex) {
|
|
140
|
+
if (hex.includes('#') && hex.length === 4) {
|
|
141
|
+
return `#${ hex[1] }${ hex[1] }${ hex[2] }${ hex[2] }${ hex[3] }${ hex[3] }`;
|
|
142
|
+
} else if (!hex.includes('#') && hex.length === 3) {
|
|
143
|
+
return `${ hex[0] }${ hex[0] }${ hex[1] }${ hex[1] }${ hex[2] }${ hex[2] }`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return hex;
|
|
147
|
+
}
|
package/utils/create-yaml.js
CHANGED
|
@@ -174,7 +174,7 @@ export function createYaml(
|
|
|
174
174
|
// do not include commented fields if already defined in data
|
|
175
175
|
removeObjects(commentFields, regularFields);
|
|
176
176
|
|
|
177
|
-
const regular = regularFields.map(k => stringifyField(k));
|
|
177
|
+
const regular = regularFields.map((k) => stringifyField(k));
|
|
178
178
|
const comments = commentFields.map((k) => {
|
|
179
179
|
// Don't add a namespace comment for types that aren't namespaced.
|
|
180
180
|
if ( path === 'metadata' && k === 'namespace' ) {
|
|
@@ -189,7 +189,7 @@ export function createYaml(
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
const out = [...regular, ...comments]
|
|
192
|
-
.filter(x => x !== null)
|
|
192
|
+
.filter((x) => x !== null)
|
|
193
193
|
.join('\n')
|
|
194
194
|
.trim();
|
|
195
195
|
|
|
@@ -359,7 +359,7 @@ export function createYaml(
|
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
function comment(lines) {
|
|
362
|
-
return (lines || '').split('\n').map(x => `#${ x.replace(/#/g, '') }`).join('\n');
|
|
362
|
+
return (lines || '').split('\n').map((x) => `#${ x.replace(/#/g, '') }`).join('\n');
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
function indent(lines, depth = 1) {
|
|
@@ -460,7 +460,7 @@ export function dumpBlock(data, options = {}) {
|
|
|
460
460
|
|
|
461
461
|
let out = parsed;
|
|
462
462
|
|
|
463
|
-
const blockFields = Object.keys(data).filter(k => data[k].includes('\n'));
|
|
463
|
+
const blockFields = Object.keys(data).filter((k) => data[k].includes('\n'));
|
|
464
464
|
|
|
465
465
|
if (blockFields.length) {
|
|
466
466
|
for (const key of blockFields) {
|
|
@@ -34,7 +34,7 @@ export function isEmptyData(data) {
|
|
|
34
34
|
*/
|
|
35
35
|
export function convertToBuffer(data) {
|
|
36
36
|
if (typeof data === 'string') {
|
|
37
|
-
// eslint-disable-next-line node/no-deprecated-api
|
|
37
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
38
38
|
data = new Buffer(data, 'utf8');
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -80,7 +80,7 @@ Md5.prototype.digest = function(encoding) {
|
|
|
80
80
|
out.setUint32(i * 4, this.state[i], true);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// eslint-disable-next-line node/no-deprecated-api
|
|
83
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
84
84
|
const buff = new Buffer(out.buffer, out.byteOffset, out.byteLength);
|
|
85
85
|
|
|
86
86
|
return encoding ? buff.toString(encoding) : buff;
|
|
@@ -81,7 +81,7 @@ Sha1.prototype.digest = function(encoding) {
|
|
|
81
81
|
}
|
|
82
82
|
// The value in state is little-endian rather than big-endian, so flip
|
|
83
83
|
// each word into a new Uint8Array
|
|
84
|
-
// eslint-disable-next-line node/no-deprecated-api
|
|
84
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
85
85
|
const out = new Buffer(DIGEST_LENGTH);
|
|
86
86
|
const outView = new DataView(out.buffer);
|
|
87
87
|
|
|
@@ -162,7 +162,7 @@ Sha256.prototype.digest = function(encoding) {
|
|
|
162
162
|
}
|
|
163
163
|
// The value in state is little-endian rather than big-endian, so flip
|
|
164
164
|
// each word into a new Uint8Array
|
|
165
|
-
// eslint-disable-next-line node/no-deprecated-api
|
|
165
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
166
166
|
const out = new Buffer(DIGEST_LENGTH);
|
|
167
167
|
|
|
168
168
|
for (let i = 0; i < 8; i++) {
|
package/utils/crypto/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable node/no-deprecated-api
|
|
1
|
+
/* eslint-disable node/no-deprecated-api */
|
|
2
2
|
import { Buffer } from 'buffer';
|
|
3
3
|
import Md5 from './browserMd5';
|
|
4
4
|
import Sha256 from './browserSha256';
|
|
@@ -26,7 +26,7 @@ export function base64Encode(string, alphabet = NORMAL) {
|
|
|
26
26
|
'/': '_',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
return buf.toString('base64').replace(/[+/]|=+$/g, char => m[char] || '');
|
|
29
|
+
return buf.toString('base64').replace(/[+/]|=+$/g, (char) => m[char] || '');
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
return buf.toString('base64');
|
|
@@ -45,7 +45,7 @@ export function base64DecodeToBuffer(string) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export function base64Decode(string) {
|
|
48
|
-
return !string ? string : base64DecodeToBuffer(string.replace(/[-_]/g, char => char === '-' ? '+' : '/')).toString();
|
|
48
|
+
return !string ? string : base64DecodeToBuffer(string.replace(/[-_]/g, (char) => char === '-' ? '+' : '/')).toString();
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export function md5(data, digest, callback) {
|
package/utils/favicon.js
CHANGED
|
@@ -8,10 +8,9 @@ export function haveSetFavIcon() {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function setFavIcon(store) {
|
|
11
|
-
const app = store.app;
|
|
12
11
|
const res = store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.FAVICON);
|
|
13
12
|
const brandSetting = store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.BRAND);
|
|
14
|
-
const link = findIconLink(
|
|
13
|
+
const link = findIconLink(document.head.getElementsByTagName('link'));
|
|
15
14
|
|
|
16
15
|
if (link) {
|
|
17
16
|
let brandImage;
|
|
@@ -37,7 +36,7 @@ function findIconLink(links) {
|
|
|
37
36
|
for (let i = 0; i < links.length; i++) {
|
|
38
37
|
const link = links[i];
|
|
39
38
|
|
|
40
|
-
if (link.rel
|
|
39
|
+
if (link.rel?.includes('icon')) {
|
|
41
40
|
return link;
|
|
42
41
|
}
|
|
43
42
|
}
|
package/utils/gatekeeper/util.js
CHANGED
|
@@ -2,7 +2,7 @@ import { GATEKEEPER, SCHEMA } from '@shell/config/types';
|
|
|
2
2
|
|
|
3
3
|
export async function findAllConstraints(store) {
|
|
4
4
|
const constraintTypes = await findAllConstraintTypes(store);
|
|
5
|
-
const nestedConstraints = constraintTypes.map(ct => store.dispatch('cluster/findAll', { type: ct, opt: { force: true } }));
|
|
5
|
+
const nestedConstraints = constraintTypes.map((ct) => store.dispatch('cluster/findAll', { type: ct, opt: { force: true } }));
|
|
6
6
|
|
|
7
7
|
return (await Promise.all(nestedConstraints)).flat();
|
|
8
8
|
}
|
|
@@ -30,6 +30,6 @@ export function findTemplateType(schemas) {
|
|
|
30
30
|
|
|
31
31
|
function findConstraintTypes(schemas) {
|
|
32
32
|
return schemas
|
|
33
|
-
.filter(schema => schema?.attributes?.group === 'constraints.gatekeeper.sh')
|
|
34
|
-
.map(schema => schema.id);
|
|
33
|
+
.filter((schema) => schema?.attributes?.group === 'constraints.gatekeeper.sh')
|
|
34
|
+
.map((schema) => schema.id);
|
|
35
35
|
}
|
package/utils/gc/gc.ts
CHANGED
|
@@ -12,7 +12,7 @@ class GarbageCollect {
|
|
|
12
12
|
|
|
13
13
|
private cachedGcPrefs: GC_PREFERENCES = GC_DEFAULTS;
|
|
14
14
|
|
|
15
|
-
private cachedGcPrefsStamp
|
|
15
|
+
private cachedGcPrefsStamp = '';
|
|
16
16
|
|
|
17
17
|
private debugLog = (...args: any) => {
|
|
18
18
|
if (GarbageCollect.ENABLE_DEBUG_LOGGING) {
|
|
@@ -60,7 +60,7 @@ class GarbageCollect {
|
|
|
60
60
|
/**
|
|
61
61
|
* Track when a logged in route changes.
|
|
62
62
|
*/
|
|
63
|
-
private lastRouteChange
|
|
63
|
+
private lastRouteChange = 0;
|
|
64
64
|
|
|
65
65
|
// ------------- GC Enabled ---------------------
|
|
66
66
|
|
package/utils/git.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
interface Repo {
|
|
2
|
+
owner: any,
|
|
3
|
+
description: string,
|
|
4
|
+
// eslint-disable-next-line camelcase
|
|
5
|
+
created_at: string,
|
|
6
|
+
// eslint-disable-next-line camelcase
|
|
7
|
+
updated_at: string,
|
|
8
|
+
htmlUrl: string,
|
|
9
|
+
name: string,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Commit {
|
|
13
|
+
message: string,
|
|
14
|
+
htmlUrl: string,
|
|
15
|
+
sha?: string,
|
|
16
|
+
commitId: string,
|
|
17
|
+
author: object,
|
|
18
|
+
isChecked: false,
|
|
19
|
+
date: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Utils = Record<string, {
|
|
23
|
+
normalize: {
|
|
24
|
+
repo: (data: object) => Repo,
|
|
25
|
+
commit: (data: object) => Commit
|
|
26
|
+
}
|
|
27
|
+
}>
|
|
28
|
+
|
|
29
|
+
function getShortHash(commit: string) {
|
|
30
|
+
return !!commit ? commit.slice(0, 7) : undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const GitUtils: Utils = {
|
|
34
|
+
github: {
|
|
35
|
+
normalize: {
|
|
36
|
+
repo: (data: any) => ({
|
|
37
|
+
owner: {
|
|
38
|
+
name: data.owner?.login,
|
|
39
|
+
htmlUrl: data.owner?.html_url,
|
|
40
|
+
avatarUrl: data.owner?.avatar_url
|
|
41
|
+
},
|
|
42
|
+
description: data.description,
|
|
43
|
+
created_at: data.created_at,
|
|
44
|
+
updated_at: data.updated_at,
|
|
45
|
+
htmlUrl: data.html_url,
|
|
46
|
+
name: data.name
|
|
47
|
+
}),
|
|
48
|
+
commit: (data: any) => ({
|
|
49
|
+
message: data.commit?.message,
|
|
50
|
+
htmlUrl: data.html_url,
|
|
51
|
+
sha: getShortHash(data.sha),
|
|
52
|
+
commitId: data.sha,
|
|
53
|
+
author: {
|
|
54
|
+
name: data.author?.login,
|
|
55
|
+
avatarUrl: data.author?.avatar_url,
|
|
56
|
+
htmlUrl: data.author?.htmlUrl
|
|
57
|
+
},
|
|
58
|
+
isChecked: false,
|
|
59
|
+
date: data.commit?.committer.date
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
gitlab: {
|
|
64
|
+
normalize: {
|
|
65
|
+
repo: (data: any) => ({
|
|
66
|
+
owner: {
|
|
67
|
+
name: data.namespace.name,
|
|
68
|
+
htmlUrl: data.namespace.web_url,
|
|
69
|
+
avatarUrl: data.namespace.avatar_url
|
|
70
|
+
},
|
|
71
|
+
description: data.description,
|
|
72
|
+
created_at: data.created_at,
|
|
73
|
+
updated_at: data.last_activity_at,
|
|
74
|
+
htmlUrl: data.web_url,
|
|
75
|
+
name: data.name
|
|
76
|
+
}),
|
|
77
|
+
commit: (data: any) => ({
|
|
78
|
+
message: data.message,
|
|
79
|
+
htmlUrl: data.web_url,
|
|
80
|
+
sha: data.short_id,
|
|
81
|
+
commitId: data.id,
|
|
82
|
+
author: {
|
|
83
|
+
name: data.author_name,
|
|
84
|
+
avatarUrl: data.avatar_url,
|
|
85
|
+
htmlUrl: data.web_url
|
|
86
|
+
},
|
|
87
|
+
isChecked: false,
|
|
88
|
+
date: data.committed_date
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
};
|
package/utils/grafana.js
CHANGED
|
@@ -14,10 +14,10 @@ export function getClusterPrefix(monitoringVersion, clusterId) {
|
|
|
14
14
|
return clusterId === 'local' ? '' : `/k8s/clusters/${ clusterId }`;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export function computeDashboardUrl(monitoringVersion, embedUrl, clusterId, params) {
|
|
17
|
+
export function computeDashboardUrl(monitoringVersion, embedUrl, clusterId, params, modifyPrefix = true) {
|
|
18
18
|
const url = parseUrl(embedUrl);
|
|
19
19
|
|
|
20
|
-
let newUrl = `${ getClusterPrefix(monitoringVersion, clusterId) }${ url.path }
|
|
20
|
+
let newUrl = modifyPrefix ? `${ getClusterPrefix(monitoringVersion, clusterId) }${ url.path }` : url.path;
|
|
21
21
|
|
|
22
22
|
if (url.query.viewPanel) {
|
|
23
23
|
newUrl = addParam(newUrl, 'viewPanel', url.query.viewPanel);
|
|
@@ -64,9 +64,9 @@ export async function allDashboardsExist(store, clusterId, embeddedUrls, storeNa
|
|
|
64
64
|
|
|
65
65
|
const monitoringVersion = res?.currentVersion;
|
|
66
66
|
|
|
67
|
-
const existPromises = embeddedUrls.map(url => dashboardExists(monitoringVersion, store, clusterId, url, storeName));
|
|
67
|
+
const existPromises = embeddedUrls.map((url) => dashboardExists(monitoringVersion, store, clusterId, url, storeName));
|
|
68
68
|
|
|
69
|
-
return (await Promise.all(existPromises)).every(exists => exists);
|
|
69
|
+
return (await Promise.all(existPromises)).every((exists) => exists);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export function queryGrafana(monitoringVersion, dispatch, clusterId, query, range, step) {
|
package/utils/monitoring.js
CHANGED
|
@@ -46,7 +46,7 @@ const CATTLE_MONITORING_NAMESPACE = 'cattle-monitoring-system';
|
|
|
46
46
|
|
|
47
47
|
export async function haveV1MonitoringWorkloads(store) {
|
|
48
48
|
const workloadsByType = await Promise.all(
|
|
49
|
-
Object.values(WORKLOAD_TYPES).map(type => store.dispatch('cluster/findAll', { type })
|
|
49
|
+
Object.values(WORKLOAD_TYPES).map((type) => store.dispatch('cluster/findAll', { type })
|
|
50
50
|
)
|
|
51
51
|
);
|
|
52
52
|
const workloads = workloadsByType.flat();
|
|
@@ -55,7 +55,7 @@ export async function haveV1MonitoringWorkloads(store) {
|
|
|
55
55
|
const workload = workloads[i];
|
|
56
56
|
|
|
57
57
|
if (!isEmpty(workload?.spec?.template?.spec?.containers) &&
|
|
58
|
-
workload.spec.template.spec.containers.find(c => c.image?.includes('quay.io/coreos/prometheus-operator') ||
|
|
58
|
+
workload.spec.template.spec.containers.find((c) => c.image?.includes('quay.io/coreos/prometheus-operator') ||
|
|
59
59
|
c.image?.includes('rancher/coreos-prometheus-operator')) &&
|
|
60
60
|
workload?.metadata?.namespace !== CATTLE_MONITORING_NAMESPACE) {
|
|
61
61
|
return Promise.resolve(true);
|
package/utils/nuxt.js
CHANGED
|
@@ -31,7 +31,7 @@ export function globalHandleError(error) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export function interopDefault(promise) {
|
|
34
|
-
return promise.then(m => m.default || m);
|
|
34
|
+
return promise.then((m) => m.default || m);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export function hasFetch(vm) {
|
|
@@ -276,7 +276,7 @@ export async function setContext(app, context) {
|
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
278
|
if (process.server) {
|
|
279
|
-
app.context.beforeNuxtRender = fn => context.beforeRenderFns.push(fn);
|
|
279
|
+
app.context.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn);
|
|
280
280
|
}
|
|
281
281
|
if (process.client) {
|
|
282
282
|
app.context.nuxtState = window.__NUXT__;
|
package/utils/object.js
CHANGED
|
@@ -43,7 +43,7 @@ export function getAllValues(obj, path) {
|
|
|
43
43
|
keysInOrder.forEach((currentKey) => {
|
|
44
44
|
currentValue = currentValue.map((indexValue) => {
|
|
45
45
|
if (Array.isArray(indexValue)) {
|
|
46
|
-
return indexValue.map(arr => arr[currentKey]).flat();
|
|
46
|
+
return indexValue.map((arr) => arr[currentKey]).flat();
|
|
47
47
|
} else if (indexValue) {
|
|
48
48
|
return indexValue[currentKey];
|
|
49
49
|
} else {
|
|
@@ -52,7 +52,7 @@ export function getAllValues(obj, path) {
|
|
|
52
52
|
}).flat();
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
return currentValue.filter(val => val !== null);
|
|
55
|
+
return currentValue.filter((val) => val !== null);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export function get(obj, path) {
|
|
@@ -131,7 +131,7 @@ export function isSimpleKeyValue(obj) {
|
|
|
131
131
|
return obj !== null &&
|
|
132
132
|
!Array.isArray(obj) &&
|
|
133
133
|
typeof obj === 'object' &&
|
|
134
|
-
Object.values(obj || {}).every(v => typeof v !== 'object');
|
|
134
|
+
Object.values(obj || {}).every((v) => typeof v !== 'object');
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
/*
|
|
@@ -174,7 +174,7 @@ export function definedKeys(obj) {
|
|
|
174
174
|
if ( Array.isArray(val) ) {
|
|
175
175
|
return key;
|
|
176
176
|
} else if ( isObject(val) ) {
|
|
177
|
-
return ( definedKeys(val) || [] ).map(subkey => `${ key }.${ subkey }`);
|
|
177
|
+
return ( definedKeys(val) || [] ).map((subkey) => `${ key }.${ subkey }`);
|
|
178
178
|
} else {
|
|
179
179
|
return key;
|
|
180
180
|
}
|
|
@@ -375,5 +375,5 @@ export function pickBy(obj = {}, predicate = (value, key) => false) {
|
|
|
375
375
|
* @returns
|
|
376
376
|
*/
|
|
377
377
|
export const toDictionary = (array, callback) => Object.assign(
|
|
378
|
-
{}, ...array.map(item => ({ [item]: callback(item) }))
|
|
378
|
+
{}, ...array.map((item) => ({ [item]: callback(item) }))
|
|
379
379
|
);
|
|
@@ -7,7 +7,7 @@ import { PSA } from '@shell/types/pod-security-admission';
|
|
|
7
7
|
* Return PSA labels present in the resource
|
|
8
8
|
* @returns string[]
|
|
9
9
|
*/
|
|
10
|
-
export const getPSALabels = (resource: PSA): string[] => filter(keys(resource?.metadata?.labels), key => PSALabelsNamespaces.includes(key));
|
|
10
|
+
export const getPSALabels = (resource: PSA): string[] => filter(keys(resource?.metadata?.labels), (key) => PSALabelsNamespaces.includes(key));
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Return boolean value if the label is a PSA label
|
|
@@ -51,7 +51,7 @@ class ProjectAndNamespaceFiltering {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const projectsOrNamespaces = namespaceFilter
|
|
54
|
-
.map(f => f.replace(NAMESPACE_FILTER_NS_FULL_PREFIX, '')
|
|
54
|
+
.map((f) => f.replace(NAMESPACE_FILTER_NS_FULL_PREFIX, '')
|
|
55
55
|
.replace(NAMESPACE_FILTER_P_FULL_PREFIX, ''))
|
|
56
56
|
.join(',');
|
|
57
57
|
|
package/utils/select.js
CHANGED
|
@@ -3,10 +3,10 @@ export function onClickOption(option, e) {
|
|
|
3
3
|
return;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
const getValue = opt => (this.optionKey ? this.get(opt, this.optionKey) : this.getOptionLabel(opt));
|
|
6
|
+
const getValue = (opt) => (this.optionKey ? this.get(opt, this.optionKey) : this.getOptionLabel(opt));
|
|
7
7
|
const optionValue = getValue(option);
|
|
8
8
|
const value = this.value || [];
|
|
9
|
-
const optionIndex = value.findIndex(option => getValue(option) === optionValue);
|
|
9
|
+
const optionIndex = value.findIndex((option) => getValue(option) === optionValue);
|
|
10
10
|
|
|
11
11
|
if (optionIndex < 0) {
|
|
12
12
|
return;
|
package/utils/selector.js
CHANGED
|
@@ -53,7 +53,7 @@ export function parse(labelSelector) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const parts = labelSelector.split(/\s*,\s*/).filter(x => !!x);
|
|
56
|
+
const parts = labelSelector.split(/\s*,\s*/).filter((x) => !!x);
|
|
57
57
|
|
|
58
58
|
for ( let rule of parts ) {
|
|
59
59
|
rule = rule.trim();
|
|
@@ -224,5 +224,5 @@ export function matches(obj, selector, labelKey = 'metadata.labels') {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
export function matching(ary, selector, labelKey) {
|
|
227
|
-
return ary.filter(obj => matches(obj, selector, labelKey));
|
|
227
|
+
return ary.filter((obj) => matches(obj, selector, labelKey));
|
|
228
228
|
}
|
package/utils/settings.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MANAGEMENT } from '@shell/config/types';
|
|
2
2
|
import { Store } from 'vuex';
|
|
3
3
|
import { DEFAULT_PERF_SETTING, SETTING } from '@shell/config/settings';
|
|
4
|
+
import { GC_PREFERENCES } from 'utils/gc/gc-types';
|
|
4
5
|
|
|
5
6
|
export const fetchOrCreateSetting = async(store: Store<any>, id: string, val: string, save = true): Promise<any> => {
|
|
6
7
|
let setting;
|
|
@@ -27,7 +28,7 @@ export const fetchOrCreateSetting = async(store: Store<any>, id: string, val: st
|
|
|
27
28
|
* We fetch all settings - reality is Rancher will have done this already, so there's no overhead in doing
|
|
28
29
|
* this - but if we fetch a specific setting that does not exist, we will get a 404, which we don't want
|
|
29
30
|
*/
|
|
30
|
-
export const fetchSetting = async(store: Store<any>, id: string) => {
|
|
31
|
+
export const fetchSetting = async(store: Store<any>, id: string): Promise<any> => {
|
|
31
32
|
const all = await store.dispatch('management/findAll', { type: MANAGEMENT.SETTING });
|
|
32
33
|
const setting = (all || []).find((setting: any) => setting.id === id);
|
|
33
34
|
|
|
@@ -43,7 +44,21 @@ export const setSetting = async(store: Store<any>, id: string, val: string): Pro
|
|
|
43
44
|
return setting;
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
export const getPerformanceSetting = (rootGetters: Record<string, (arg0: string, arg1: string) => any>)
|
|
47
|
+
export const getPerformanceSetting = (rootGetters: Record<string, (arg0: string, arg1: string) => any>): {
|
|
48
|
+
inactivity: {
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
threshold: number;
|
|
51
|
+
};
|
|
52
|
+
incrementalLoading: {
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
threshold: number;
|
|
55
|
+
};
|
|
56
|
+
manualRefresh: {};
|
|
57
|
+
disableWebsocketNotification: boolean;
|
|
58
|
+
garbageCollection: GC_PREFERENCES;
|
|
59
|
+
forceNsFilterV2: {};
|
|
60
|
+
advancedWorker: {};
|
|
61
|
+
} => {
|
|
47
62
|
const perfSettingResource = rootGetters['management/byId'](MANAGEMENT.SETTING, SETTING.UI_PERFORMANCE);
|
|
48
63
|
let perfSetting = {};
|
|
49
64
|
|
package/utils/socket.js
CHANGED
|
@@ -49,6 +49,7 @@ export default class Socket extends EventTarget {
|
|
|
49
49
|
disconnectCallBacks = [];
|
|
50
50
|
disconnectedAt = 0;
|
|
51
51
|
closingId = 0;
|
|
52
|
+
autoReconnectUrl = null;
|
|
52
53
|
|
|
53
54
|
constructor(url, autoReconnect = true, frameTimeout = null, protocol = null, maxTries = null, idAsTimestamp = false) {
|
|
54
55
|
super();
|
|
@@ -199,6 +200,13 @@ export default class Socket extends EventTarget {
|
|
|
199
200
|
this.autoReconnect = autoReconnect;
|
|
200
201
|
}
|
|
201
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Supply an async fn that will provide a new url to reconnect to
|
|
205
|
+
*/
|
|
206
|
+
setAutoReconnectUrl(autoReconnectUrl) {
|
|
207
|
+
this.autoReconnectUrl = autoReconnectUrl;
|
|
208
|
+
}
|
|
209
|
+
|
|
202
210
|
// "Private"
|
|
203
211
|
_close() {
|
|
204
212
|
const socket = this.socket;
|
|
@@ -329,12 +337,28 @@ export default class Socket extends EventTarget {
|
|
|
329
337
|
// dispatch an event which will trigger a growl from steve-plugin sockets warning users that we've given up trying to reconnect
|
|
330
338
|
this.dispatchEvent(new CustomEvent(EVENT_DISCONNECT_ERROR));
|
|
331
339
|
} else {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this.
|
|
337
|
-
|
|
340
|
+
const reconnect = () => {
|
|
341
|
+
this._log('closed. Attempting to reconnect');
|
|
342
|
+
const delay = Math.max(1000, Math.min(1000 * this.tries, 30000));
|
|
343
|
+
|
|
344
|
+
this.reconnectTimer = setTimeout(() => {
|
|
345
|
+
this.connect();
|
|
346
|
+
}, delay);
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
if (this.autoReconnectUrl) {
|
|
350
|
+
this.autoReconnectUrl()
|
|
351
|
+
.then((url) => {
|
|
352
|
+
this.setUrl(url);
|
|
353
|
+
|
|
354
|
+
reconnect();
|
|
355
|
+
})
|
|
356
|
+
.catch((e) => {
|
|
357
|
+
console.error('Failed to fetch socket auto reconnect url', e); // eslint-disable-line no-console
|
|
358
|
+
});
|
|
359
|
+
} else {
|
|
360
|
+
reconnect();
|
|
361
|
+
}
|
|
338
362
|
}
|
|
339
363
|
} else {
|
|
340
364
|
this.state = STATE_DISCONNECTED;
|
package/utils/sort.js
CHANGED
|
@@ -217,7 +217,7 @@ export function sortableNumericSuffix(str) {
|
|
|
217
217
|
return str;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
return str.split(splitRegex).map(x => x.match(notNumericRegex) ? strPad(x, 10, '0') : x).join('').trim();
|
|
220
|
+
return str.split(splitRegex).map((x) => x.match(notNumericRegex) ? strPad(x, 10, '0') : x).join('').trim();
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
export function isNumeric(num) {
|
package/utils/string.js
CHANGED
|
@@ -272,7 +272,7 @@ const quotedMatch = /[^."']+|"([^"]*)"|'([^']*)'/g;
|
|
|
272
272
|
export function splitObjectPath(path) {
|
|
273
273
|
if ( path.includes('"') || path.includes("'") ) {
|
|
274
274
|
// Path with quoted section
|
|
275
|
-
return path.match(quotedMatch).map(x => x.replace(/['"]/g, ''));
|
|
275
|
+
return path.match(quotedMatch).map((x) => x.replace(/['"]/g, ''));
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
// Regular path
|
package/utils/url.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function removeParam(url: string, key: string): string {
|
|
|
48
48
|
return stringify(parsed);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export function parseLinkHeader(str: string) {
|
|
51
|
+
export function parseLinkHeader(str: string): Record<string, string> {
|
|
52
52
|
const out: { [key: string]: string} = { };
|
|
53
53
|
const lines = (str || '').split(',');
|
|
54
54
|
|
|
@@ -53,7 +53,7 @@ export interface ValidationOptions {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// "t" is the function name we use for getting a translated string
|
|
56
|
-
export default function(t: Translation, { key = 'Value' }: ValidationOptions) {
|
|
56
|
+
export default function(t: Translation, { key = 'Value' }: ValidationOptions): unknown {
|
|
57
57
|
// utility validators these validators only get used by other validators
|
|
58
58
|
const startDot: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(0, 1) === '.' ? t(`validation.dns.${ label }.startDot`, { key }) : undefined;
|
|
59
59
|
|
|
@@ -103,7 +103,7 @@ export default function(t: Translation, { key = 'Value' }: ValidationOptions) {
|
|
|
103
103
|
|
|
104
104
|
if (matchedChars) {
|
|
105
105
|
return t('validation.chars', {
|
|
106
|
-
key, count: matchedChars.length, chars: matchedChars.map(char => char === ' ' ? 'Space' : `"${ char }"`).join(', ')
|
|
106
|
+
key, count: matchedChars.length, chars: matchedChars.map((char) => char === ' ' ? 'Space' : `"${ char }"`).join(', ')
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -386,7 +386,7 @@ export default function(t: Translation, { key = 'Value' }: ValidationOptions) {
|
|
|
386
386
|
};
|
|
387
387
|
|
|
388
388
|
// The existing validator for clusterIp never actually returns an error
|
|
389
|
-
const clusterIp: Validator = val => undefined;
|
|
389
|
+
const clusterIp: Validator = (val) => undefined;
|
|
390
390
|
|
|
391
391
|
const backupTarget: Validator = (val) => {
|
|
392
392
|
const parseValue = JSON.parse(val);
|
|
@@ -2,18 +2,18 @@ import { RBAC } from '@shell/config/types';
|
|
|
2
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
3
|
|
|
4
4
|
export function roleTemplateRules(rules = [], getters, errors, validatorArgs = []) {
|
|
5
|
-
if (rules.some(rule => isEmpty(rule.verbs))) {
|
|
5
|
+
if (rules.some((rule) => isEmpty(rule.verbs))) {
|
|
6
6
|
errors.push(getters['i18n/t']('validation.roleTemplate.roleTemplateRules.missingVerb'));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
if (validatorArgs[0] === RBAC.ROLE) {
|
|
10
|
-
if (rules.some(rule => isEmpty(rule.resources))) {
|
|
10
|
+
if (rules.some((rule) => isEmpty(rule.resources))) {
|
|
11
11
|
errors.push(getters['i18n/t']('validation.roleTemplate.roleTemplateRules.missingResource'));
|
|
12
12
|
}
|
|
13
|
-
if (rules.some(rule => isEmpty(rule.apiGroups))) {
|
|
13
|
+
if (rules.some((rule) => isEmpty(rule.apiGroups))) {
|
|
14
14
|
errors.push(getters['i18n/t']('validation.roleTemplate.roleTemplateRules.missingApiGroup'));
|
|
15
15
|
}
|
|
16
|
-
} else if (rules.some(rule => isEmpty(rule.resources) && isEmpty(rule.nonResourceURLs) && isEmpty(rule.apiGroups))) {
|
|
16
|
+
} else if (rules.some((rule) => isEmpty(rule.resources) && isEmpty(rule.nonResourceURLs) && isEmpty(rule.apiGroups))) {
|
|
17
17
|
errors.push(getters['i18n/t']('validation.roleTemplate.roleTemplateRules.missingOneResource'));
|
|
18
18
|
}
|
|
19
19
|
}
|
package/utils/version.js
CHANGED
|
@@ -17,7 +17,7 @@ export function parse(str) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function sortable(str) {
|
|
20
|
-
return parse(str).map(x => sortableNumericSuffix(x)).join('.');
|
|
20
|
+
return parse(str).map((x) => sortableNumericSuffix(x)).join('.');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function compare(in1, in2) {
|
|
@@ -125,3 +125,16 @@ export async function markReadReleaseNotes(store) {
|
|
|
125
125
|
await store.dispatch('prefs/set', { key: READ_WHATS_NEW, value: getVersionInfo(store).fullVersion });
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
export function generateSupportLink(version) {
|
|
130
|
+
const defaultSupportURL = 'https://rancher.com/support-maintenance-terms';
|
|
131
|
+
|
|
132
|
+
if (!version || isDevBuild(version)) {
|
|
133
|
+
return defaultSupportURL;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const baseUrl = 'https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/rancher-';
|
|
137
|
+
const formattedVersion = version.split('.').join('-');
|
|
138
|
+
|
|
139
|
+
return baseUrl + formattedVersion;
|
|
140
|
+
}
|