@rancher/shell 0.3.0 → 0.3.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/_button.scss +5 -1
- package/assets/styles/global/_columns.scss +4 -0
- package/assets/styles/global/_layout.scss +1 -2
- package/assets/styles/global/_select.scss +1 -4
- package/assets/styles/themes/_dark.scss +4 -4
- package/assets/styles/themes/_light.scss +4 -3
- package/assets/styles/themes/_suse.scss +1 -1
- package/assets/styles/vendor/vue-select.scss +4 -3
- package/assets/translations/en-us.yaml +669 -73
- package/assets/translations/zh-hans.yaml +547 -165
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/cloud-credential/azure.vue +23 -0
- package/cloud-credential/harvester.vue +25 -62
- package/cloud-credential/pnap.vue +80 -0
- package/components/.DS_Store +0 -0
- package/components/AdvancedSection.vue +9 -2
- package/components/Alert.vue +2 -2
- package/components/ButtonDropdown.vue +0 -2
- package/components/ButtonGroup.vue +1 -0
- package/components/CollapsibleCard.vue +0 -1
- package/components/CruResource.vue +41 -4
- package/components/DetailTop.vue +58 -3
- package/components/DisableAuthProviderModal.vue +106 -0
- package/{rancher-components/components/Utils/DraggableZone → components}/DraggableZone.vue +0 -0
- package/components/ExplorerMembers.vue +253 -30
- package/components/ExplorerProjectsNamespaces.vue +77 -33
- package/components/GrowlManager.vue +3 -3
- package/components/IconOrSvg.vue +149 -0
- package/components/LogItem.vue +69 -0
- package/components/PodSecurityAdmission.vue +302 -0
- package/components/PromptModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +54 -2
- package/components/ResourceDetail/index.vue +12 -5
- package/components/ResourceList/Masthead.vue +11 -1
- package/components/ResourceList/ResourceLoadingIndicator.vue +12 -2
- package/components/ResourceList/index.vue +53 -12
- package/components/ResourceList/resource-list.config.js +7 -0
- package/components/ResourceTable.vue +31 -6
- package/components/SimpleBox.vue +1 -1
- package/components/SortableTable/THead.vue +15 -5
- package/components/SortableTable/index.vue +21 -10
- package/components/Tabbed/index.vue +20 -15
- package/components/__tests__/.DS_Store +0 -0
- package/components/__tests__/AsyncButton.test.ts +140 -0
- package/components/__tests__/BackLink.test.ts +33 -0
- package/components/__tests__/ButtonGroup.test.ts +124 -0
- package/components/__tests__/ClusterBadge.test.ts +32 -0
- package/components/__tests__/CollapsibleCard.test.ts +64 -0
- package/components/__tests__/ConsumptionGauge.test.ts +88 -0
- package/components/__tests__/CruResource.test.ts +3 -2
- package/components/__tests__/FixedBanner.test.ts +129 -0
- package/components/__tests__/GrowlManager.test.ts +147 -0
- package/components/__tests__/NamespaceFilter.test.ts +33 -25
- package/components/__tests__/PercentageBar.test.ts +32 -0
- package/components/__tests__/PodSecurityAdmission.test.ts +398 -0
- package/components/auth/AuthBanner.vue +20 -10
- package/components/auth/RoleDetailEdit.vue +26 -17
- package/components/auth/SelectPrincipal.vue +36 -5
- package/components/form/ArrayList.vue +3 -35
- package/components/form/ArrayListGrouped.vue +13 -4
- package/components/form/ArrayListSelect.vue +5 -5
- package/components/form/Error.vue +8 -0
- package/components/form/KeyValue.vue +39 -7
- package/components/form/LabeledSelect.vue +5 -2
- package/components/form/Labels.vue +46 -16
- package/components/form/Members/ClusterPermissionsEditor.vue +17 -17
- package/components/form/Members/MembershipEditor.vue +12 -12
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/NodeScheduling.vue +1 -1
- package/components/form/Probe.vue +3 -3
- package/components/form/ResourceQuota/Project.vue +6 -6
- package/components/form/ResourceTabs/index.vue +1 -6
- package/components/form/Security.vue +7 -6
- package/components/form/Select.vue +3 -2
- package/components/form/SelectOrCreateAuthSecret.vue +22 -29
- package/components/form/ServicePorts.vue +8 -0
- package/components/form/WorkloadPorts.vue +7 -1
- package/components/form/__tests__/ArrayList.test.ts +74 -0
- package/components/form/__tests__/ArrayListGrouped.test.ts +6 -4
- package/components/formatter/Checked.vue +1 -1
- package/components/formatter/ClusterLink.vue +5 -0
- package/components/formatter/IconIsDefault.vue +2 -2
- package/components/formatter/InternalExternalIP.vue +11 -8
- package/components/formatter/LiveDuration.vue +78 -0
- package/components/formatter/WorkloadHealthScale.vue +5 -3
- package/components/nav/Header.vue +6 -3
- package/components/nav/NamespaceFilter.vue +146 -63
- package/components/nav/TopLevelMenu.vue +22 -19
- package/components/nav/WindowManager/ContainerLogs.vue +83 -126
- package/components/nav/WindowManager/ContainerShell.vue +9 -7
- package/components/nav/WindowManager/Window.vue +2 -0
- package/components/nav/WindowManager/index.vue +10 -0
- package/config/elemental-types.js +9 -0
- package/config/features.js +2 -0
- package/config/home-links.js +4 -1
- package/config/pod-security-admission.ts +82 -0
- package/config/product/apps.js +1 -1
- package/config/product/auth.js +6 -5
- package/config/product/explorer.js +6 -6
- package/config/product/fleet.js +1 -1
- package/config/product/manager.js +6 -2
- package/config/secret.js +0 -1
- package/config/settings.ts +26 -9
- package/config/table-headers.js +22 -11
- package/config/types.js +4 -1
- package/content/docs/zh-hans/getting-started.md +113 -137
- package/content/docs/zh-hans/whats-new.md +8 -46
- package/creators/pkg/package-lock.json +37 -0
- package/creators/pkg/package.json +1 -1
- package/detail/catalog.cattle.io.app.vue +1 -1
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +35 -9
- package/detail/service.vue +2 -9
- package/detail/workload/index.vue +0 -1
- package/dialog/AddClusterMemberDialog.vue +22 -28
- package/dialog/AddProjectMemberDialog.vue +53 -9
- package/dialog/DiagnosticTimingsDialog.vue +8 -7
- package/dialog/DrainNode.vue +44 -48
- package/dialog/ForceMachineRemoveDialog.vue +5 -7
- package/dialog/GenericPrompt.vue +15 -20
- package/dialog/RollbackWorkloadDialog.vue +15 -46
- package/dialog/RotateCertificatesDialog.vue +5 -7
- package/dialog/RotateEncryptionKeyDialog.vue +5 -9
- package/dialog/SaveAsRKETemplateDialog.vue +5 -13
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/dialog/ScalePoolDownDialog.vue +121 -0
- package/edit/__tests__/management.cattle.io.setting.test.ts +3 -3
- package/edit/auth/azuread.vue +16 -16
- package/edit/auth/github.vue +8 -0
- package/edit/auth/googleoauth.vue +10 -1
- package/edit/auth/ldap/index.vue +10 -0
- package/edit/auth/oidc.vue +10 -0
- package/edit/auth/saml.vue +10 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -1
- package/edit/cloudcredential.vue +3 -7
- package/edit/logging-flow/Match.vue +39 -8
- package/edit/logging-flow/index.vue +27 -4
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +107 -0
- package/edit/management.cattle.io.project.vue +8 -1
- package/edit/management.cattle.io.setting.vue +5 -2
- package/edit/management.cattle.io.user.vue +7 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +23 -7
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -2
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +14 -6
- package/edit/namespace.vue +18 -4
- package/edit/networking.k8s.io.ingress/Certificate.vue +1 -0
- package/edit/networking.k8s.io.ingress/IngressClass.vue +8 -6
- package/edit/networking.k8s.io.ingress/RulePath.vue +12 -6
- package/edit/networking.k8s.io.ingress/index.vue +8 -6
- package/edit/persistentvolume/index.vue +30 -27
- package/edit/persistentvolume/plugins/cephfs.vue +29 -29
- package/edit/persistentvolume/plugins/csi.vue +102 -62
- package/edit/persistentvolume/plugins/fc.vue +19 -19
- package/edit/persistentvolume/plugins/iscsi.vue +45 -45
- package/edit/persistentvolume/plugins/rbd.vue +39 -39
- package/edit/persistentvolumeclaim.vue +78 -75
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -7
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +10 -1
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +87 -27
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +3 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +93 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +29 -6
- package/edit/provisioning.cattle.io.cluster/rke2.vue +440 -152
- package/edit/secret/index.vue +3 -7
- package/edit/service.vue +3 -1
- package/edit/storage.k8s.io.storageclass/index.vue +100 -16
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +114 -0
- package/edit/workload/__tests__/index.test.ts +98 -0
- package/edit/workload/index.vue +58 -8
- package/edit/workload/mixins/workload.js +107 -70
- package/edit/workload/storage/ContainerMountPaths.vue +0 -10
- package/edit/workload/storage/emptyDir.vue +88 -0
- package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
- package/edit/workload/storage/index.vue +8 -0
- package/edit/workload/storage/persistentVolumeClaim/index.vue +1 -1
- package/layouts/default.vue +57 -44
- package/list/__tests__/workload.test.ts +5 -2
- package/list/catalog.cattle.io.app.vue +1 -0
- package/list/cis.cattle.io.clusterscan.vue +1 -0
- package/list/fleet.cattle.io.bundle.vue +5 -6
- package/list/fleet.cattle.io.cluster.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +5 -6
- package/list/fleet.cattle.io.gitrepo.vue +4 -9
- package/list/helm.cattle.io.projecthelmchart.vue +1 -5
- package/list/logging.banzaicloud.io.clusterflow.vue +4 -1
- package/list/logging.banzaicloud.io.flow.vue +6 -5
- package/list/management.cattle.io.cluster.vue +1 -0
- package/list/management.cattle.io.feature.vue +3 -4
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +47 -0
- package/list/management.cattle.io.setting.vue +2 -2
- package/list/management.cattle.io.user.vue +4 -10
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +2 -7
- package/list/node.vue +8 -5
- package/list/persistentvolume.vue +3 -3
- package/list/persistentvolumeclaim.vue +3 -4
- package/list/provisioning.cattle.io.cluster.vue +18 -19
- package/list/service.vue +6 -14
- package/list/workload.vue +43 -38
- package/machine-config/azure.vue +429 -60
- package/machine-config/pnap.vue +288 -0
- package/mixins/auth-config.js +1 -3
- package/mixins/browser-tab-visibility.js +8 -14
- package/mixins/chart.js +1 -1
- package/mixins/create-edit-view/impl.js +4 -0
- package/mixins/create-edit-view/index.js +4 -2
- package/mixins/resource-fetch-namespaced.js +98 -0
- package/mixins/resource-fetch.js +79 -45
- package/mixins/resource-manager.js +1 -23
- package/models/apps.controllerrevision.js +7 -0
- package/models/apps.daemonset.js +18 -0
- package/models/apps.deployment.js +44 -0
- package/models/apps.replicaset.js +7 -0
- package/models/apps.statefulset.js +18 -0
- package/models/batch.job.js +7 -14
- package/models/cluster/node.js +10 -2
- package/models/cluster.x-k8s.io.machine.js +26 -4
- package/models/cluster.x-k8s.io.machinedeployment.js +12 -2
- package/models/event.js +7 -0
- package/models/logging.banzaicloud.io.flow.js +4 -0
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.clusterroletemplatebinding.js +1 -1
- package/models/management.cattle.io.globalrole.js +2 -2
- package/models/management.cattle.io.node.js +37 -2
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +4 -0
- package/models/management.cattle.io.project.js +30 -11
- package/models/management.cattle.io.setting.js +1 -1
- package/models/management.cattle.io.user.js +37 -1
- package/models/namespace.js +42 -5
- package/models/persistentvolume.js +14 -2
- package/models/pod.js +15 -0
- package/models/projectroletemplatebinding.js +7 -0
- package/models/provisioning.cattle.io.cluster.js +61 -10
- package/models/rke-machine.cattle.io.pnapmachinetemplate.js +15 -0
- package/models/service.js +14 -13
- package/models/storage.k8s.io.storageclass.js +33 -18
- package/models/workload.js +38 -7
- package/nuxt.config.js +27 -17
- package/package.json +7 -7
- package/pages/about.vue +14 -2
- package/pages/c/_cluster/apps/charts/index.vue +4 -3
- package/pages/c/_cluster/apps/charts/install.vue +59 -22
- package/pages/c/_cluster/auth/config/_id.vue +6 -0
- package/pages/c/_cluster/auth/config/index.vue +8 -6
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +1 -1
- package/pages/c/_cluster/auth/roles/index.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +12 -6
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +15 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/performance.vue +48 -2
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +34 -1
- package/pages/c/_cluster/uiplugins/index.vue +28 -2
- package/pages/diagnostic.vue +5 -4
- package/pages/home.vue +105 -30
- package/pages/prefs.vue +23 -12
- package/pages/rio/mesh.vue +1 -1
- package/pkg/dynamic-importer.lib.js +8 -0
- package/pkg/vue.config.js +4 -0
- package/plugins/dashboard-store/__tests__/mutations.spec.js +406 -0
- package/plugins/dashboard-store/actions.js +32 -25
- package/plugins/dashboard-store/getters.js +50 -33
- package/plugins/dashboard-store/mutations.js +134 -28
- package/plugins/dashboard-store/resource-class.js +21 -41
- package/plugins/steve/actions.js +30 -0
- package/plugins/steve/caches/resourceCache.js +60 -0
- package/plugins/steve/getters.js +44 -1
- package/plugins/steve/mutations.js +97 -36
- package/plugins/steve/resourceWatcher.js +277 -0
- package/plugins/steve/schema.utils.js +25 -0
- package/plugins/steve/subscribe.js +288 -115
- package/plugins/steve/worker/index.js +17 -0
- package/plugins/steve/worker/web-worker.advanced.js +302 -0
- package/plugins/steve/{web-worker.steve-sub-worker.js → worker/web-worker.basic.js} +3 -44
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
- package/rancher-components/StringList/StringList.test.ts +45 -420
- package/rancher-components/StringList/StringList.vue +1 -10
- package/rancher-components/components/Banner/Banner.test.ts +44 -0
- package/rancher-components/components/Banner/Banner.vue +129 -61
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +13 -22
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +8 -6
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +9 -9
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -1
- package/rancher-components/components/StringList/StringList.test.ts +7 -7
- package/rancher-components/components/StringList/StringList.vue +21 -15
- package/scripts/test-plugins-build.sh +8 -0
- package/static/loading-indicator.html +1 -1
- package/store/index.js +54 -3
- package/store/plugins.js +0 -17
- package/store/pnap.js +128 -0
- package/store/prefs.js +4 -2
- package/store/type-map.js +55 -13
- package/types/pod-security-admission.ts +36 -0
- package/types/shell/index.d.ts +496 -396
- package/utils/__tests__/object.test.ts +17 -1
- package/utils/__tests__/pod-security-admission.test.ts +61 -0
- package/utils/async.ts +36 -0
- package/utils/color.js +45 -0
- package/utils/crypto/browserHashUtils.js +18 -0
- package/utils/dynamic-importer.js +8 -0
- package/utils/install-redirect.js +1 -1
- package/utils/object.js +24 -0
- package/utils/pod-security-admission.ts +39 -0
- package/utils/socket.js +61 -24
- package/utils/string.js +2 -0
- package/utils/svg-filter.js +301 -0
- package/utils/time.js +49 -0
- package/utils/validators/cidr.js +4 -0
- package/utils/validators/formRules/__tests__/index.test.ts +23 -3
- package/utils/validators/formRules/index.ts +14 -0
- package/config/product/harvester-manager.js +0 -162
- package/edit/harvesterhci.io.management.cluster.vue +0 -153
- package/list/harvesterhci.io.management.cluster.vue +0 -241
- package/machine-config/harvester.vue +0 -693
- package/models/harvesterhci.io.management.cluster.js +0 -228
- package/pages/c/_cluster/harvesterManager/index.vue +0 -24
- package/rancher-components/Card/Card.test.ts +0 -39
- package/rancher-components/Utils/DraggableZone/DraggableZone.vue +0 -181
- package/rancher-components/Utils/DraggableZone/index.ts +0 -1
- package/rancher-components/components/Utils/DraggableZone/index.ts +0 -1
package/store/index.js
CHANGED
|
@@ -81,7 +81,13 @@ const getActiveNamespaces = (state, getters) => {
|
|
|
81
81
|
return out;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
let namespaces = [];
|
|
85
|
+
|
|
86
|
+
if (Array.isArray(state.allNamespaces) && state.allNamespaces.length > 0) {
|
|
87
|
+
namespaces = state.allNamespaces;
|
|
88
|
+
} else {
|
|
89
|
+
namespaces = getters[`${ inStore }/all`](NAMESPACE);
|
|
90
|
+
}
|
|
85
91
|
|
|
86
92
|
const filters = state.namespaceFilters.filter(x => !!x && !`${ x }`.startsWith(NAMESPACED_PREFIX));
|
|
87
93
|
const includeAll = getters.isAllNamespaces;
|
|
@@ -169,6 +175,7 @@ export const state = () => {
|
|
|
169
175
|
serverVersion: null,
|
|
170
176
|
systemNamespaces: [],
|
|
171
177
|
isSingleProduct: undefined,
|
|
178
|
+
namespaceFilterMode: null,
|
|
172
179
|
};
|
|
173
180
|
};
|
|
174
181
|
|
|
@@ -205,6 +212,15 @@ export const getters = {
|
|
|
205
212
|
return state.systemNamespaces;
|
|
206
213
|
},
|
|
207
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Namespace Filter Mode supplies a resource type to the NamespaceFilter.
|
|
217
|
+
*
|
|
218
|
+
* Only one of the resource type is allowed to be selected
|
|
219
|
+
*/
|
|
220
|
+
namespaceFilterMode(state) {
|
|
221
|
+
return state.namespaceFilterMode;
|
|
222
|
+
},
|
|
223
|
+
|
|
208
224
|
currentCluster(state, getters) {
|
|
209
225
|
return getters['management/byId'](MANAGEMENT.CLUSTER, state.clusterId);
|
|
210
226
|
},
|
|
@@ -284,6 +300,34 @@ export const getters = {
|
|
|
284
300
|
return state.namespaceFilters.filter(x => !`${ x }`.startsWith(NAMESPACED_PREFIX)).length === 0;
|
|
285
301
|
},
|
|
286
302
|
|
|
303
|
+
isSingleNamespace(state, getters) {
|
|
304
|
+
const product = getters['currentProduct'];
|
|
305
|
+
|
|
306
|
+
if ( !product ) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if ( product.showWorkspaceSwitcher ) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if ( getters.isAllNamespaces ) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const filters = state.namespaceFilters;
|
|
319
|
+
|
|
320
|
+
if ( filters.length !== 1 ) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (filters[0].startsWith('ns://')) {
|
|
325
|
+
return filters[0];
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return false;
|
|
329
|
+
},
|
|
330
|
+
|
|
287
331
|
isMultipleNamespaces(state, getters) {
|
|
288
332
|
const product = getters['currentProduct'];
|
|
289
333
|
|
|
@@ -485,6 +529,10 @@ export const mutations = {
|
|
|
485
529
|
getActiveNamespaces(state, getters);
|
|
486
530
|
},
|
|
487
531
|
|
|
532
|
+
setNamespaceFilterMode(state, mode) {
|
|
533
|
+
state.namespaceFilterMode = mode;
|
|
534
|
+
},
|
|
535
|
+
|
|
488
536
|
pageActions(state, pageActions) {
|
|
489
537
|
state.pageActions = pageActions;
|
|
490
538
|
},
|
|
@@ -808,7 +856,6 @@ export const actions = {
|
|
|
808
856
|
commit('updateNamespaces', {
|
|
809
857
|
filters: filters || [ALL_USER],
|
|
810
858
|
all: res.namespaces,
|
|
811
|
-
...getters
|
|
812
859
|
});
|
|
813
860
|
|
|
814
861
|
commit('clusterReady', true);
|
|
@@ -826,7 +873,11 @@ export const actions = {
|
|
|
826
873
|
[key]: ids
|
|
827
874
|
}
|
|
828
875
|
});
|
|
829
|
-
commit('updateNamespaces', { filters: ids
|
|
876
|
+
commit('updateNamespaces', { filters: ids });
|
|
877
|
+
},
|
|
878
|
+
|
|
879
|
+
setNamespaceFilterMode({ commit }, mode) {
|
|
880
|
+
commit('setNamespaceFilterMode', mode);
|
|
830
881
|
},
|
|
831
882
|
|
|
832
883
|
async cleanNamespaces({ getters, dispatch }) {
|
package/store/plugins.js
CHANGED
|
@@ -125,14 +125,6 @@ export const state = function() {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
export const getters = {
|
|
128
|
-
credentialDrivers() {
|
|
129
|
-
const ctx = require.context('@shell/cloud-credential', true, /.*/);
|
|
130
|
-
|
|
131
|
-
const drivers = ctx.keys().filter(path => !path.match(/\.(vue|js)$/)).map(path => path.substr(2));
|
|
132
|
-
|
|
133
|
-
return drivers;
|
|
134
|
-
},
|
|
135
|
-
|
|
136
128
|
credentialOptions() {
|
|
137
129
|
return (name) => {
|
|
138
130
|
name = (name || '').toLowerCase();
|
|
@@ -157,15 +149,6 @@ export const getters = {
|
|
|
157
149
|
};
|
|
158
150
|
},
|
|
159
151
|
|
|
160
|
-
machineDrivers() {
|
|
161
|
-
// The subset of drivers supported by Vue components
|
|
162
|
-
const ctx = require.context('@shell/machine-config', true, /.*/);
|
|
163
|
-
|
|
164
|
-
const drivers = ctx.keys().filter(path => !path.match(/\.(vue|js)$/)).map(path => path.substr(2));
|
|
165
|
-
|
|
166
|
-
return drivers;
|
|
167
|
-
},
|
|
168
|
-
|
|
169
152
|
clusterDrivers() {
|
|
170
153
|
// The subset of drivers supported by Vue components
|
|
171
154
|
return [];
|
package/store/pnap.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { base64Encode } from '@shell/utils/crypto';
|
|
2
|
+
import { addParam, addParams } from '@shell/utils/url';
|
|
3
|
+
|
|
4
|
+
const ENDPOINT = 'api.phoenixnap.com';
|
|
5
|
+
|
|
6
|
+
export const state = () => {
|
|
7
|
+
return { cache: {} };
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const mutations = {
|
|
11
|
+
setCache(state, { credentialId, key, value }) {
|
|
12
|
+
let cache = state.cache[credentialId];
|
|
13
|
+
|
|
14
|
+
if ( !cache ) {
|
|
15
|
+
cache = {};
|
|
16
|
+
state.cache[credentialId] = cache;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
cache[key] = value;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const getters = {
|
|
24
|
+
fromCache: state => ({ credentialId, key }) => {
|
|
25
|
+
return state.cache[credentialId]?.[key];
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const actions = {
|
|
30
|
+
async osChoices({ dispatch }, { credentialId }) {
|
|
31
|
+
const osList = await dispatch('cachedCommand', { credentialId, command: 'rancher-node-driver/options' });
|
|
32
|
+
|
|
33
|
+
const oses = osList.operatingSystems;
|
|
34
|
+
const result = [];
|
|
35
|
+
|
|
36
|
+
if (Array.isArray(oses)) {
|
|
37
|
+
const map = new Map();
|
|
38
|
+
|
|
39
|
+
for (const os of oses) {
|
|
40
|
+
if (!map.has(os)) {
|
|
41
|
+
map.set(os, true);
|
|
42
|
+
result.push({ value: os, label: os });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
result.push({ value: osList.message });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return result;
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
async allProducts({ dispatch }, { credentialId }) {
|
|
53
|
+
const out = await dispatch('cachedCommand', { credentialId, command: 'billing/v1/products?productCategory=SERVER' });
|
|
54
|
+
|
|
55
|
+
return out;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
async cachedCommand({ getters, commit, dispatch }, { credentialId, command }) {
|
|
59
|
+
let out = getters['fromCache']({ credentialId, key: command });
|
|
60
|
+
|
|
61
|
+
if ( !out ) {
|
|
62
|
+
out = await dispatch('request', { credentialId, command });
|
|
63
|
+
commit('setCache', {
|
|
64
|
+
credentialId, key: command, value: out
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return out;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
async request({ dispatch }, {
|
|
72
|
+
clientId, clientSecret, credentialId, command, opt, out
|
|
73
|
+
}) {
|
|
74
|
+
opt = opt || {};
|
|
75
|
+
|
|
76
|
+
let url = '/meta/proxy/';
|
|
77
|
+
const body = null;
|
|
78
|
+
let method = 'GET';
|
|
79
|
+
|
|
80
|
+
if ( opt.url ) {
|
|
81
|
+
url += opt.url.replace(/^https?:\/\//, '');
|
|
82
|
+
} else {
|
|
83
|
+
url += `${ ENDPOINT }/${ command }`;
|
|
84
|
+
url = addParam(url, 'per_page', opt.per_page || 1000);
|
|
85
|
+
url = addParams(url, opt.params || {});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const headers = { Accept: 'application/json' };
|
|
89
|
+
|
|
90
|
+
if ( credentialId ) {
|
|
91
|
+
headers['X-API-CattleAuth-Header'] = `Bearer credID=${ credentialId } passwordField=token`;
|
|
92
|
+
} else if ( clientId ) {
|
|
93
|
+
const credentials = `${ clientId }:${ clientSecret }`;
|
|
94
|
+
const encoded = base64Encode(credentials);
|
|
95
|
+
|
|
96
|
+
headers['Content-Type'] = 'application/json';
|
|
97
|
+
headers['X-API-Auth-Header'] = `Basic ${ encoded }`;
|
|
98
|
+
url = '/meta/proxy/auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token/';
|
|
99
|
+
// body = `grant_type:client_credentials`;
|
|
100
|
+
method = 'POST';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const res = await dispatch('management/request', {
|
|
104
|
+
url,
|
|
105
|
+
method,
|
|
106
|
+
headers,
|
|
107
|
+
data: body,
|
|
108
|
+
redirectUnauthorized: false,
|
|
109
|
+
}, { root: true });
|
|
110
|
+
|
|
111
|
+
if ( out ) {
|
|
112
|
+
out[command] = out[command].concat(res[command]);
|
|
113
|
+
} else {
|
|
114
|
+
out = res;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// De-pagination
|
|
118
|
+
if ( res?.links?.pages?.next ) {
|
|
119
|
+
opt.url = res.links.pages.next;
|
|
120
|
+
|
|
121
|
+
return dispatch('request', {
|
|
122
|
+
clientId, clientSecret, credentialId, command, opt, out
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
};
|
package/store/prefs.js
CHANGED
|
@@ -74,7 +74,7 @@ export const HIDE_REPOS = create('hide-repos', [], { parseJSON });
|
|
|
74
74
|
export const HIDE_DESC = create('hide-desc', [], { parseJSON });
|
|
75
75
|
export const HIDE_SENSITIVE = create('hide-sensitive', true, { options: [true, false], parseJSON });
|
|
76
76
|
export const SHOW_PRE_RELEASE = create('show-pre-release', false, { options: [false, true], parseJSON });
|
|
77
|
-
export const SHOW_CHART_MODE = create('
|
|
77
|
+
export const SHOW_CHART_MODE = create('chart-mode', 'featured', { parseJSON });
|
|
78
78
|
|
|
79
79
|
export const DATE_FORMAT = create('date-format', 'ddd, MMM D YYYY', {
|
|
80
80
|
options: [
|
|
@@ -109,7 +109,7 @@ export const PLUGIN_DEVELOPER = create('plugin-developer', false, { parseJSON, i
|
|
|
109
109
|
|
|
110
110
|
export const _RKE1 = 'rke1';
|
|
111
111
|
export const _RKE2 = 'rke2';
|
|
112
|
-
export const PROVISIONER = create('provisioner',
|
|
112
|
+
export const PROVISIONER = create('provisioner', _RKE2, { options: [_RKE1, _RKE2] });
|
|
113
113
|
|
|
114
114
|
// Promo for Cluster Tools feature on Cluster Dashboard page
|
|
115
115
|
export const CLUSTER_TOOLS_TIP = create('hide-cluster-tools-tip', false, { parseJSON });
|
|
@@ -120,6 +120,8 @@ export const PSP_DEPRECATION_BANNER = create('hide-psp-deprecation-banner', fals
|
|
|
120
120
|
// Maximum number of clusters to show in the slide-in menu
|
|
121
121
|
export const MENU_MAX_CLUSTERS = create('menu-max-clusters', 4, { options: [2, 3, 4, 5, 6, 7, 8, 9, 10], parseJSON });
|
|
122
122
|
|
|
123
|
+
// Prompt for confirm when scaling down node pool in GUI and save the pref
|
|
124
|
+
export const SCALE_POOL_PROMPT = create('scale-pool-prompt', null, { parseJSON });
|
|
123
125
|
// --------------------
|
|
124
126
|
|
|
125
127
|
const cookiePrefix = 'R_';
|
package/store/type-map.js
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
// category, -- Group to show the product in for the nav hamburger menu
|
|
43
43
|
// typeStoreMap, -- An object mapping types to the store that should be used to retrieve information about the type
|
|
44
44
|
// hideSystemResources -- Hide resources in namespaces where namespace.isSystem === true, or a namespace managed by fleet (per its annotation) and hide those namespaces from ns/project list and nsfilter (default false)
|
|
45
|
+
// hideNamespaceLocation -- Hide the namespace link in the ResourceDetail masthead of namespaced resources and hide the ExplorerProjectsNamespaces namespace link (default false)
|
|
45
46
|
// })
|
|
46
47
|
//
|
|
47
48
|
// externalLink(stringOrFn) The product has an external page (function gets context object
|
|
@@ -137,7 +138,7 @@ import {
|
|
|
137
138
|
ensureRegex, escapeHtml, escapeRegex, ucFirst, pluralize
|
|
138
139
|
} from '@shell/utils/string';
|
|
139
140
|
import {
|
|
140
|
-
importChart, importList, importDetail, importEdit, listProducts, loadProduct, importCustomPromptRemove, resolveList, resolveEdit, resolveWindowComponent, importWindowComponent, resolveChart, resolveDetail, importDialog
|
|
141
|
+
importChart, importList, importDetail, importEdit, listProducts, loadProduct, importCustomPromptRemove, resolveList, resolveEdit, resolveWindowComponent, importWindowComponent, resolveChart, resolveDetail, importDialog, importMachineConfig, resolveMachineConfigComponent, resolveCloudCredentialComponent, importCloudCredential
|
|
141
142
|
} from '@shell/utils/dynamic-importer';
|
|
142
143
|
|
|
143
144
|
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
|
@@ -365,16 +366,19 @@ export const state = function() {
|
|
|
365
366
|
hideBulkActions: {},
|
|
366
367
|
schemaGeneration: 1,
|
|
367
368
|
cache: {
|
|
368
|
-
typeMove:
|
|
369
|
-
groupLabel:
|
|
370
|
-
ignore:
|
|
371
|
-
list:
|
|
372
|
-
chart:
|
|
373
|
-
detail:
|
|
374
|
-
edit:
|
|
375
|
-
componentFor:
|
|
376
|
-
promptRemove:
|
|
377
|
-
windowComponents:
|
|
369
|
+
typeMove: {},
|
|
370
|
+
groupLabel: {},
|
|
371
|
+
ignore: {},
|
|
372
|
+
list: {},
|
|
373
|
+
chart: {},
|
|
374
|
+
detail: {},
|
|
375
|
+
edit: {},
|
|
376
|
+
componentFor: {},
|
|
377
|
+
promptRemove: {},
|
|
378
|
+
windowComponents: {},
|
|
379
|
+
'machine-config': {},
|
|
380
|
+
'cloud-credential': {}
|
|
381
|
+
|
|
378
382
|
},
|
|
379
383
|
};
|
|
380
384
|
};
|
|
@@ -914,7 +918,15 @@ export const getters = {
|
|
|
914
918
|
|
|
915
919
|
item.mode = mode;
|
|
916
920
|
item.weight = weight;
|
|
917
|
-
|
|
921
|
+
|
|
922
|
+
// Ensure labelKey is taken into account... with a mock count
|
|
923
|
+
// This is harmless if the translation doesn't require count
|
|
924
|
+
if (item.labelKey && rootGetters['i18n/exists'](item.labelKey)) {
|
|
925
|
+
item.label = rootGetters['i18n/t'](item.labelKey, { count: 2 }).trim();
|
|
926
|
+
delete item.labelKey; // Label should really take precedence over labelKey, but it doesn't, so remove it
|
|
927
|
+
} else {
|
|
928
|
+
item.label = item.label || item.name;
|
|
929
|
+
}
|
|
918
930
|
|
|
919
931
|
out[id] = item;
|
|
920
932
|
}
|
|
@@ -1010,9 +1022,11 @@ export const getters = {
|
|
|
1010
1022
|
formatter = 'Number';
|
|
1011
1023
|
}
|
|
1012
1024
|
|
|
1025
|
+
const colName = col.name.includes(' ') ? col.name.split(' ').map(word => word.charAt(0).toUpperCase() + word.substring(1) ).join('') : col.name;
|
|
1026
|
+
|
|
1013
1027
|
const exists = rootGetters['i18n/exists'];
|
|
1014
1028
|
const t = rootGetters['i18n/t'];
|
|
1015
|
-
const labelKey = `tableHeaders.${
|
|
1029
|
+
const labelKey = `tableHeaders.${ colName.charAt(0).toLowerCase() + colName.slice(1) }`;
|
|
1016
1030
|
const description = col.description || '';
|
|
1017
1031
|
const tooltip = description && description[description.length - 1] === '.' ? description.slice(0, -1) : description;
|
|
1018
1032
|
|
|
@@ -1104,6 +1118,22 @@ export const getters = {
|
|
|
1104
1118
|
};
|
|
1105
1119
|
},
|
|
1106
1120
|
|
|
1121
|
+
hasCustomMachineConfigComponent(state, getters, rootState) {
|
|
1122
|
+
return (rawType, subType) => {
|
|
1123
|
+
const key = getters.componentFor(rawType, subType);
|
|
1124
|
+
|
|
1125
|
+
return hasCustom(state, rootState, 'machine-config', key, key => resolveMachineConfigComponent(key));
|
|
1126
|
+
};
|
|
1127
|
+
},
|
|
1128
|
+
|
|
1129
|
+
hasCustomCloudCredentialComponent(state, getters, rootState) {
|
|
1130
|
+
return (rawType, subType) => {
|
|
1131
|
+
const key = getters.componentFor(rawType, subType);
|
|
1132
|
+
|
|
1133
|
+
return hasCustom(state, rootState, 'machine-config', key, key => resolveCloudCredentialComponent(key));
|
|
1134
|
+
};
|
|
1135
|
+
},
|
|
1136
|
+
|
|
1107
1137
|
importComponent(state, getters) {
|
|
1108
1138
|
return (path) => {
|
|
1109
1139
|
return importEdit(path);
|
|
@@ -1152,6 +1182,18 @@ export const getters = {
|
|
|
1152
1182
|
};
|
|
1153
1183
|
},
|
|
1154
1184
|
|
|
1185
|
+
importMachineConfig(state, getters, rootState) {
|
|
1186
|
+
return (rawType, subType) => {
|
|
1187
|
+
return loadExtension(rootState, 'machine-config', getters.componentFor(rawType, subType), importMachineConfig);
|
|
1188
|
+
};
|
|
1189
|
+
},
|
|
1190
|
+
|
|
1191
|
+
importCloudCredential(state, getters, rootState) {
|
|
1192
|
+
return (rawType, subType) => {
|
|
1193
|
+
return loadExtension(rootState, 'cloud-credential', getters.componentFor(rawType, subType), importCloudCredential);
|
|
1194
|
+
};
|
|
1195
|
+
},
|
|
1196
|
+
|
|
1155
1197
|
componentFor(state, getters) {
|
|
1156
1198
|
return (type, subType) => {
|
|
1157
1199
|
let key = type;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mode Description
|
|
3
|
+
* - 'enforce': Policy violations will cause the pod to be rejected.
|
|
4
|
+
* - 'audit': Policy violations will trigger the addition of an audit annotation to the event recorded in the audit log, but are otherwise allowed.
|
|
5
|
+
* - 'warn': Policy violations will trigger a user-facing warning, but are otherwise allowed.
|
|
6
|
+
*/
|
|
7
|
+
export type PSAMode = 'enforce' | 'audit' | 'warn';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Pod Security admission places requirements on a Pod's Security Context and other related fields according to the three levels defined by the Pod Security Standards:
|
|
11
|
+
* privileged, baseline, and restricted.
|
|
12
|
+
* Refer to the Pod Security Standards page for an in-depth look at those requirements.
|
|
13
|
+
*/
|
|
14
|
+
export type PSALevel = 'privileged' | 'baseline' | 'restricted';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Usernames: requests from users with an exempt authenticated (or impersonated) username are ignored.
|
|
18
|
+
* RuntimeClassNames: pods and workload resources specifying an exempt runtime class name are ignored.
|
|
19
|
+
* Namespaces: pods and workload resources in an exempt namespace are ignored.
|
|
20
|
+
*/
|
|
21
|
+
export type PSADimension = 'usernames' | 'runtimeClasses' | 'namespaces'
|
|
22
|
+
|
|
23
|
+
export type PSADefaults = Record<PSAMode, PSALevel>
|
|
24
|
+
export type PSAExemptions = Record<PSADimension, string[]>
|
|
25
|
+
|
|
26
|
+
export interface PSAConfig {
|
|
27
|
+
defaults: PSADefaults,
|
|
28
|
+
exemptions: PSAExemptions
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface PSA {
|
|
32
|
+
configuration: PSAConfig,
|
|
33
|
+
metadata: {
|
|
34
|
+
labels: Record<string, string>
|
|
35
|
+
}
|
|
36
|
+
}
|