@rancher/shell 0.3.0 → 0.3.2
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/_gauges.scss +1 -1
- package/assets/styles/global/_layout.scss +5 -2
- package/assets/styles/global/_select.scss +1 -4
- package/assets/styles/themes/_dark.scss +5 -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 +673 -73
- package/assets/translations/zh-hans.yaml +720 -207
- 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/ActionMenu.vue +28 -7
- 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 +72 -4
- 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/ExtensionPanel.vue +42 -0
- package/components/GrowlManager.vue +3 -3
- package/components/IconOrSvg.vue +178 -0
- package/components/LogItem.vue +69 -0
- package/components/PodSecurityAdmission.vue +302 -0
- package/components/PromptModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +69 -4
- 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 +66 -12
- package/components/ResourceList/resource-list.config.js +7 -0
- package/components/ResourceTable.vue +33 -6
- package/components/SimpleBox.vue +1 -1
- package/components/SortableTable/THead.vue +21 -14
- package/components/SortableTable/filtering.js +1 -1
- package/components/SortableTable/index.vue +21 -10
- package/components/SortableTable/selection.js +15 -3
- package/components/Tabbed/Tab.vue +1 -1
- 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 +24 -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 +74 -7
- 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/backup.js +1 -1
- package/config/product/explorer.js +6 -6
- package/config/product/fleet.js +1 -1
- package/config/product/manager.js +6 -2
- package/config/query-params.js +1 -0
- 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/config/uiplugins.js +3 -3
- package/content/docs/zh-hans/getting-started.md +113 -137
- package/content/docs/zh-hans/whats-new.md +8 -46
- package/core/plugin-helpers.js +171 -0
- package/core/plugin.ts +61 -1
- package/core/plugins.js +33 -0
- package/core/types.ts +128 -2
- 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/catalog.cattle.io.clusterrepo.vue +3 -0
- 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 +36 -8
- 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 +96 -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 +445 -154
- 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 +21 -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 +51 -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/DeveloperInstallDialog.vue +2 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +42 -2
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -0
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +1 -0
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +2 -0
- package/pages/c/_cluster/uiplugins/index.vue +42 -3
- 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 +37 -42
- 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 +130 -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/action-menu.js +4 -3
- 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 +81 -13
- package/types/pod-security-admission.ts +36 -0
- package/types/shell/index.d.ts +497 -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
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { Card } from '@components/Card';
|
|
3
3
|
import ProjectMemberEditor from '@shell/components/form/ProjectMemberEditor';
|
|
4
|
+
import AsyncButton from '@shell/components/AsyncButton';
|
|
5
|
+
import Banner from '@components/Banner/Banner.vue';
|
|
4
6
|
import { NORMAN } from '@shell/config/types';
|
|
5
7
|
|
|
6
8
|
export default {
|
|
7
9
|
components: {
|
|
8
10
|
Card,
|
|
9
|
-
ProjectMemberEditor
|
|
11
|
+
ProjectMemberEditor,
|
|
12
|
+
AsyncButton,
|
|
13
|
+
Banner
|
|
10
14
|
},
|
|
11
15
|
|
|
12
16
|
props: {
|
|
13
17
|
resources: {
|
|
14
18
|
type: Array,
|
|
15
19
|
required: true
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
onAdd: {
|
|
23
|
+
type: Function,
|
|
24
|
+
default: () => {}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
projectId: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
saveInModal: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
16
35
|
}
|
|
17
36
|
},
|
|
18
37
|
|
|
@@ -22,17 +41,13 @@ export default {
|
|
|
22
41
|
permissionGroup: 'member',
|
|
23
42
|
custom: {},
|
|
24
43
|
principalId: '',
|
|
25
|
-
projectId: null,
|
|
26
44
|
roleTemplateIds: []
|
|
27
|
-
}
|
|
45
|
+
},
|
|
46
|
+
error: null
|
|
28
47
|
};
|
|
29
48
|
},
|
|
30
49
|
|
|
31
50
|
computed: {
|
|
32
|
-
onAdd() {
|
|
33
|
-
return this.resources[0];
|
|
34
|
-
},
|
|
35
|
-
|
|
36
51
|
principal() {
|
|
37
52
|
const principalId = this.member.principalId.replace(/\//g, '%2F');
|
|
38
53
|
|
|
@@ -66,10 +81,26 @@ export default {
|
|
|
66
81
|
type: NORMAN.PROJECT_ROLE_TEMPLATE_BINDING,
|
|
67
82
|
roleTemplateId,
|
|
68
83
|
[principalProperty]: this.member.principalId,
|
|
69
|
-
projectId: this.
|
|
84
|
+
projectId: this.projectId,
|
|
70
85
|
}));
|
|
71
86
|
|
|
72
87
|
return Promise.all(promises);
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
saveBindings(btnCB) {
|
|
91
|
+
this.error = null;
|
|
92
|
+
this.createBindings()
|
|
93
|
+
.then((bindings) => {
|
|
94
|
+
return Promise.all(bindings.map(b => b.save()));
|
|
95
|
+
})
|
|
96
|
+
.then(() => {
|
|
97
|
+
btnCB(true);
|
|
98
|
+
setTimeout(this.close, 500);
|
|
99
|
+
})
|
|
100
|
+
.catch((err) => {
|
|
101
|
+
this.error = err;
|
|
102
|
+
btnCB(false);
|
|
103
|
+
});
|
|
73
104
|
}
|
|
74
105
|
}
|
|
75
106
|
};
|
|
@@ -89,8 +120,14 @@ export default {
|
|
|
89
120
|
|
|
90
121
|
<div
|
|
91
122
|
slot="body"
|
|
92
|
-
class="pl-10 pr-10
|
|
123
|
+
class="pl-10 pr-10"
|
|
93
124
|
>
|
|
125
|
+
<Banner
|
|
126
|
+
v-if="error"
|
|
127
|
+
color="error"
|
|
128
|
+
>
|
|
129
|
+
{{ error }}
|
|
130
|
+
</Banner>
|
|
94
131
|
<ProjectMemberEditor
|
|
95
132
|
v-model="member"
|
|
96
133
|
:use-two-columns-for-custom="true"
|
|
@@ -108,7 +145,14 @@ export default {
|
|
|
108
145
|
{{ t('generic.cancel') }}
|
|
109
146
|
</button>
|
|
110
147
|
|
|
148
|
+
<AsyncButton
|
|
149
|
+
v-if="saveInModal"
|
|
150
|
+
mode="create"
|
|
151
|
+
@click="cb=>saveBindings(cb)"
|
|
152
|
+
/>
|
|
153
|
+
|
|
111
154
|
<button
|
|
155
|
+
v-else
|
|
112
156
|
class="btn role-primary"
|
|
113
157
|
@click="apply"
|
|
114
158
|
>
|
|
@@ -13,8 +13,12 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
props: {
|
|
16
|
-
|
|
17
|
-
type:
|
|
16
|
+
downloadData: {
|
|
17
|
+
type: Function,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
gatherResponseTimes: {
|
|
21
|
+
type: Function,
|
|
18
22
|
required: true
|
|
19
23
|
}
|
|
20
24
|
},
|
|
@@ -24,9 +28,6 @@ export default {
|
|
|
24
28
|
},
|
|
25
29
|
|
|
26
30
|
computed: {
|
|
27
|
-
config() {
|
|
28
|
-
return this.resources[0];
|
|
29
|
-
},
|
|
30
31
|
|
|
31
32
|
applyMode() {
|
|
32
33
|
return 'diagnostic';
|
|
@@ -48,7 +49,7 @@ export default {
|
|
|
48
49
|
|
|
49
50
|
apply(btnCb) {
|
|
50
51
|
try {
|
|
51
|
-
this.
|
|
52
|
+
this.downloadData(btnCb);
|
|
52
53
|
this.close();
|
|
53
54
|
} catch (err) {
|
|
54
55
|
console.error(err); // eslint-disable-line
|
|
@@ -84,7 +85,7 @@ export default {
|
|
|
84
85
|
<AsyncButton
|
|
85
86
|
mode="timing"
|
|
86
87
|
class="row mt-20"
|
|
87
|
-
@click="
|
|
88
|
+
@click="gatherResponseTimes"
|
|
88
89
|
/>
|
|
89
90
|
</div>
|
|
90
91
|
</slot>
|
package/dialog/DrainNode.vue
CHANGED
|
@@ -19,9 +19,14 @@ export default {
|
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
props: {
|
|
22
|
-
|
|
23
|
-
type:
|
|
24
|
-
|
|
22
|
+
kubeNodes: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
normanNodeId: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
25
30
|
}
|
|
26
31
|
},
|
|
27
32
|
|
|
@@ -66,15 +71,6 @@ export default {
|
|
|
66
71
|
};
|
|
67
72
|
},
|
|
68
73
|
|
|
69
|
-
computed: {
|
|
70
|
-
kubeNodes() {
|
|
71
|
-
return this.resources[0];
|
|
72
|
-
},
|
|
73
|
-
normanNodeId() {
|
|
74
|
-
return this.resources[1];
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
|
|
78
74
|
watch: {
|
|
79
75
|
gracePeriod(neu) {
|
|
80
76
|
if (neu && !this.body.gracePeriod) {
|
|
@@ -130,13 +126,13 @@ export default {
|
|
|
130
126
|
</script>
|
|
131
127
|
|
|
132
128
|
<template>
|
|
133
|
-
<Card
|
|
134
|
-
class="prompt-rotate"
|
|
135
|
-
:show-highlight-border="false"
|
|
129
|
+
<Card
|
|
130
|
+
class="prompt-rotate"
|
|
131
|
+
:show-highlight-border="false"
|
|
136
132
|
>
|
|
137
|
-
<h4
|
|
138
|
-
slot="title"
|
|
139
|
-
class="text-default-text"
|
|
133
|
+
<h4
|
|
134
|
+
slot="title"
|
|
135
|
+
class="text-default-text"
|
|
140
136
|
>
|
|
141
137
|
<template v-if="kubeNodes.length > 1">
|
|
142
138
|
{{ t('drainNode.titleMultiple', { count: kubeNodes.length }) }}
|
|
@@ -146,9 +142,9 @@ export default {
|
|
|
146
142
|
</template>
|
|
147
143
|
</h4>
|
|
148
144
|
|
|
149
|
-
<div
|
|
150
|
-
slot="body"
|
|
151
|
-
class="pl-10 pr-10"
|
|
145
|
+
<div
|
|
146
|
+
slot="body"
|
|
147
|
+
class="pl-10 pr-10"
|
|
152
148
|
>
|
|
153
149
|
<div>
|
|
154
150
|
<RadioGroup
|
|
@@ -162,22 +158,22 @@ export default {
|
|
|
162
158
|
<h5>{{ t('drainNode.deleteLocalData') }}</h5>
|
|
163
159
|
</template>
|
|
164
160
|
</RadioGroup>
|
|
165
|
-
<RadioGroup
|
|
166
|
-
v-model="body.force"
|
|
167
|
-
name="force"
|
|
168
|
-
:options="radioOptions"
|
|
169
|
-
:row="true"
|
|
170
|
-
class="mb-15"
|
|
161
|
+
<RadioGroup
|
|
162
|
+
v-model="body.force"
|
|
163
|
+
name="force"
|
|
164
|
+
:options="radioOptions"
|
|
165
|
+
:row="true"
|
|
166
|
+
class="mb-15"
|
|
171
167
|
>
|
|
172
168
|
<template #label>
|
|
173
169
|
<h5>{{ t('drainNode.force') }}</h5>
|
|
174
170
|
</template>
|
|
175
171
|
</RadioGroup>
|
|
176
|
-
<RadioGroup
|
|
177
|
-
v-model="gracePeriod"
|
|
178
|
-
name="gracePeriod"
|
|
179
|
-
:options="gracePeriodOptions"
|
|
180
|
-
class="mb-15"
|
|
172
|
+
<RadioGroup
|
|
173
|
+
v-model="gracePeriod"
|
|
174
|
+
name="gracePeriod"
|
|
175
|
+
:options="gracePeriodOptions"
|
|
176
|
+
class="mb-15"
|
|
181
177
|
>
|
|
182
178
|
<template #label>
|
|
183
179
|
<h5>{{ t('drainNode.gracePeriod.title') }}</h5>
|
|
@@ -192,11 +188,11 @@ export default {
|
|
|
192
188
|
:placeholder="t('drainNode.gracePeriod.placeholder')"
|
|
193
189
|
class="mb-10"
|
|
194
190
|
/>
|
|
195
|
-
<RadioGroup
|
|
196
|
-
v-model="timeout"
|
|
197
|
-
name="timeout"
|
|
198
|
-
:options="timeoutOptions"
|
|
199
|
-
class="mb-15"
|
|
191
|
+
<RadioGroup
|
|
192
|
+
v-model="timeout"
|
|
193
|
+
name="timeout"
|
|
194
|
+
:options="timeoutOptions"
|
|
195
|
+
class="mb-15"
|
|
200
196
|
>
|
|
201
197
|
<template #label>
|
|
202
198
|
<h5>{{ t('drainNode.timeout.title') }}</h5>
|
|
@@ -212,21 +208,21 @@ export default {
|
|
|
212
208
|
:placeholder="t('drainNode.timeout.placeholder')"
|
|
213
209
|
/>
|
|
214
210
|
</div>
|
|
215
|
-
<Banner
|
|
216
|
-
v-for="(err, i) in errors"
|
|
217
|
-
:key="i"
|
|
218
|
-
color="error"
|
|
219
|
-
:label="err"
|
|
211
|
+
<Banner
|
|
212
|
+
v-for="(err, i) in errors"
|
|
213
|
+
:key="i"
|
|
214
|
+
color="error"
|
|
215
|
+
:label="err"
|
|
220
216
|
/>
|
|
221
217
|
</div>
|
|
222
218
|
|
|
223
|
-
<div
|
|
224
|
-
slot="actions"
|
|
225
|
-
class="buttons"
|
|
219
|
+
<div
|
|
220
|
+
slot="actions"
|
|
221
|
+
class="buttons"
|
|
226
222
|
>
|
|
227
|
-
<button
|
|
228
|
-
class="btn role-secondary mr-10"
|
|
229
|
-
@click="close"
|
|
223
|
+
<button
|
|
224
|
+
class="btn role-secondary mr-10"
|
|
225
|
+
@click="close"
|
|
230
226
|
>
|
|
231
227
|
{{ t('generic.cancel') }}
|
|
232
228
|
</button>
|
|
@@ -16,9 +16,11 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
|
|
18
18
|
props: {
|
|
19
|
-
|
|
20
|
-
type:
|
|
21
|
-
|
|
19
|
+
machine: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
26
|
|
|
@@ -29,10 +31,6 @@ export default {
|
|
|
29
31
|
computed: {
|
|
30
32
|
...mapGetters({ t: 'i18n/t' }),
|
|
31
33
|
|
|
32
|
-
machine() {
|
|
33
|
-
return this.resources[0];
|
|
34
|
-
},
|
|
35
|
-
|
|
36
34
|
nameToMatch() {
|
|
37
35
|
return this.machine.spec.infrastructureRef.name;
|
|
38
36
|
},
|
package/dialog/GenericPrompt.vue
CHANGED
|
@@ -11,32 +11,27 @@ export default {
|
|
|
11
11
|
Banner,
|
|
12
12
|
},
|
|
13
13
|
props: {
|
|
14
|
-
|
|
15
|
-
type:
|
|
16
|
-
|
|
14
|
+
applyAction: {
|
|
15
|
+
type: Function,
|
|
16
|
+
default: () => {}
|
|
17
|
+
},
|
|
18
|
+
applyMode: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'create'
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
body: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
17
29
|
}
|
|
18
30
|
},
|
|
19
31
|
data() {
|
|
20
32
|
return { errors: [] };
|
|
21
33
|
},
|
|
22
|
-
computed: {
|
|
23
|
-
config() {
|
|
24
|
-
return this.resources[0];
|
|
25
|
-
},
|
|
26
|
-
applyAction() {
|
|
27
|
-
return this.config.applyAction;
|
|
28
|
-
},
|
|
29
|
-
applyMode() {
|
|
30
|
-
return this.config.applyMode || 'create';
|
|
31
|
-
},
|
|
32
|
-
title() {
|
|
33
|
-
return this.config.title;
|
|
34
|
-
},
|
|
35
|
-
body() {
|
|
36
|
-
return this.config.body;
|
|
37
|
-
},
|
|
38
34
|
|
|
39
|
-
},
|
|
40
35
|
methods: {
|
|
41
36
|
close() {
|
|
42
37
|
this.$emit('close');
|
|
@@ -37,8 +37,8 @@ export default {
|
|
|
37
37
|
YamlEditor,
|
|
38
38
|
},
|
|
39
39
|
props: {
|
|
40
|
-
|
|
41
|
-
type:
|
|
40
|
+
workload: {
|
|
41
|
+
type: Object,
|
|
42
42
|
required: true
|
|
43
43
|
}
|
|
44
44
|
},
|
|
@@ -55,46 +55,17 @@ export default {
|
|
|
55
55
|
computed: {
|
|
56
56
|
...mapGetters({ t: 'i18n/t' }),
|
|
57
57
|
...mapGetters(['currentCluster']),
|
|
58
|
-
workload() {
|
|
59
|
-
return this.resources[0];
|
|
60
|
-
},
|
|
61
58
|
workloadName() {
|
|
62
59
|
return this.workload.metadata.name;
|
|
63
60
|
},
|
|
64
61
|
workloadNamespace() {
|
|
65
62
|
return this.workload.metadata.namespace;
|
|
66
63
|
},
|
|
67
|
-
|
|
68
|
-
return this.workload.
|
|
64
|
+
workloadType() {
|
|
65
|
+
return this.workload.kind.toLowerCase();
|
|
69
66
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Build the request body in the same format that kubectl
|
|
76
|
-
// uses to call the Kubernetes API to roll back a workload.
|
|
77
|
-
// To see an example request body, run:
|
|
78
|
-
// kubectl rollout undo deployment/[deployment name] --to-revision=[revision number] -v=8
|
|
79
|
-
const body = [
|
|
80
|
-
{
|
|
81
|
-
op: 'replace',
|
|
82
|
-
path: '/spec/template',
|
|
83
|
-
value: {
|
|
84
|
-
metadata: {
|
|
85
|
-
creationTimestamp: null,
|
|
86
|
-
labels: { 'workload.user.cattle.io/workloadselector': this.selectedRevision.spec.template.metadata.labels['workload.user.cattle.io/workloadselector'] }
|
|
87
|
-
},
|
|
88
|
-
spec: this.selectedRevision.spec.template.spec
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
op: 'replace',
|
|
92
|
-
path: '/metadata/annotations',
|
|
93
|
-
value: { 'deployment.kubernetes.io/revision': this.selectedRevision.metadata.annotations['deployment.kubernetes.io/revision'] }
|
|
94
|
-
}
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
return body;
|
|
67
|
+
revisionsType() {
|
|
68
|
+
return this.workloadType === 'deployment' ? WORKLOAD_TYPES.REPLICA_SET : 'apps.controllerrevision';
|
|
98
69
|
},
|
|
99
70
|
selectedRevisionId() {
|
|
100
71
|
return this.selectedRevision.id;
|
|
@@ -111,9 +82,9 @@ export default {
|
|
|
111
82
|
},
|
|
112
83
|
fetch() {
|
|
113
84
|
// Fetch revisions of the current workload
|
|
114
|
-
this.$store.dispatch('cluster/findAll', { type:
|
|
85
|
+
this.$store.dispatch('cluster/findAll', { type: this.revisionsType })
|
|
115
86
|
.then(( response ) => {
|
|
116
|
-
const
|
|
87
|
+
const allRevisions = response;
|
|
117
88
|
|
|
118
89
|
const hasRelationshipWithCurrentWorkload = ( replicaSet ) => {
|
|
119
90
|
const relationshipsOfReplicaSet = replicaSet.metadata.relationships;
|
|
@@ -127,15 +98,13 @@ export default {
|
|
|
127
98
|
return revisionsOfCurrentWorkload.length > 0;
|
|
128
99
|
};
|
|
129
100
|
|
|
130
|
-
const workloadRevisions =
|
|
101
|
+
const workloadRevisions = allRevisions.filter(( replicaSet ) => {
|
|
131
102
|
return hasRelationshipWithCurrentWorkload( replicaSet );
|
|
132
103
|
});
|
|
133
104
|
|
|
134
105
|
const revisionOptions = workloadRevisions
|
|
135
106
|
.map( (revision ) => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (isCurrentRevision) {
|
|
107
|
+
if (this.isCurrentRevision(revision)) {
|
|
139
108
|
this.currentRevision = revision;
|
|
140
109
|
}
|
|
141
110
|
|
|
@@ -155,18 +124,18 @@ export default {
|
|
|
155
124
|
},
|
|
156
125
|
async save() {
|
|
157
126
|
try {
|
|
158
|
-
await this.workload.
|
|
127
|
+
await this.workload.rollBack(this.currentCluster, this.workload, this.selectedRevision);
|
|
159
128
|
this.close();
|
|
160
129
|
} catch (err) {
|
|
161
130
|
this.errors = exceptionToErrorsArray(err);
|
|
162
131
|
}
|
|
163
132
|
},
|
|
164
|
-
|
|
165
|
-
return revision.
|
|
133
|
+
isCurrentRevision(revision) {
|
|
134
|
+
return revision.revisionNumber === this.workload.currentRevisionNumber;
|
|
166
135
|
},
|
|
167
136
|
buildRevisionOption( revision ) {
|
|
168
|
-
const revisionNumber =
|
|
169
|
-
const isCurrentRevision =
|
|
137
|
+
const { revisionNumber } = revision;
|
|
138
|
+
const isCurrentRevision = this.isCurrentRevision(revision);
|
|
170
139
|
const now = day();
|
|
171
140
|
const createdDate = day(revision.metadata.creationTimestamp);
|
|
172
141
|
const createdDateFormatted = createdDate.format(this.timeFormatStr);
|
|
@@ -19,9 +19,11 @@ export default {
|
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
props: {
|
|
22
|
-
|
|
23
|
-
type:
|
|
24
|
-
|
|
22
|
+
cluster: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
|
|
@@ -34,10 +36,6 @@ export default {
|
|
|
34
36
|
},
|
|
35
37
|
|
|
36
38
|
computed: {
|
|
37
|
-
cluster() {
|
|
38
|
-
return this.resources?.[0];
|
|
39
|
-
},
|
|
40
|
-
|
|
41
39
|
serviceOptions() {
|
|
42
40
|
if (this.cluster.isRke2) {
|
|
43
41
|
const options = [
|
|
@@ -19,9 +19,11 @@ export default {
|
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
props: {
|
|
22
|
-
|
|
23
|
-
type:
|
|
24
|
-
|
|
22
|
+
cluster: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
|
|
@@ -51,12 +53,6 @@ export default {
|
|
|
51
53
|
return { errors: [], latestBackup: null };
|
|
52
54
|
},
|
|
53
55
|
|
|
54
|
-
computed: {
|
|
55
|
-
cluster() {
|
|
56
|
-
return this.resources?.[0];
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
|
|
60
56
|
methods: {
|
|
61
57
|
close(buttonDone) {
|
|
62
58
|
if (buttonDone && typeof buttonDone === 'function') {
|
|
@@ -15,25 +15,17 @@ export default {
|
|
|
15
15
|
LabeledInput,
|
|
16
16
|
},
|
|
17
17
|
props: {
|
|
18
|
-
|
|
19
|
-
type:
|
|
20
|
-
|
|
18
|
+
cluster: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
data() {
|
|
24
26
|
return { errors: [], name: '' };
|
|
25
27
|
},
|
|
26
|
-
computed: {
|
|
27
|
-
cluster() {
|
|
28
|
-
if (this.resources?.length === 1) {
|
|
29
|
-
const c = this.resources[0];
|
|
30
|
-
|
|
31
|
-
return c;
|
|
32
|
-
}
|
|
33
28
|
|
|
34
|
-
return {};
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
29
|
mounted() {
|
|
38
30
|
this.$nextTick(() => {
|
|
39
31
|
this.$refs.templateName.focus();
|