@rancher/shell 3.0.4 → 3.0.5-rc.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/images/providers/sks.svg +1 -0
- package/assets/styles/base/_basic.scss +6 -0
- package/assets/styles/base/_helpers.scss +4 -0
- package/assets/styles/base/_variables.scss +1 -0
- package/assets/styles/global/_button.scss +1 -0
- package/assets/translations/en-us.yaml +65 -15
- package/assets/translations/zh-hans.yaml +4 -3
- package/chart/monitoring/index.vue +3 -1
- package/cloud-credential/aws.vue +2 -0
- package/components/ActionDropdownShell.vue +71 -0
- package/components/AppModal.vue +18 -4
- package/components/AsyncButton.vue +24 -7
- package/components/BannerGraphic.vue +1 -0
- package/components/CommunityLinks.vue +4 -59
- package/components/CopyToClipboardText.vue +2 -1
- package/components/CruResource.vue +6 -1
- package/components/DetailText.vue +5 -0
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +68 -18
- package/components/GlobalRoleBindings.vue +5 -1
- package/components/GrowlManager.vue +1 -0
- package/components/LandingPagePreference.vue +7 -3
- package/components/LocaleSelector.vue +39 -95
- package/components/ModalManager.vue +55 -0
- package/components/ModalWithCard.vue +1 -0
- package/components/PromptModal.vue +47 -8
- package/components/PromptRemove.vue +1 -0
- package/components/PromptRestore.vue +1 -0
- package/components/ResourceCancelModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +38 -12
- package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
- package/components/ResourceDetail/index.vue +47 -12
- package/components/ResourceTable.vue +54 -19
- package/components/SideNav.vue +5 -1
- package/components/SlideInPanelManager.vue +126 -0
- package/components/SortableTable/THead.vue +5 -2
- package/components/SortableTable/actions.js +1 -1
- package/components/SortableTable/index.vue +64 -51
- package/components/SortableTable/paging.js +16 -19
- package/components/SortableTable/selection.js +0 -11
- package/components/Wizard.vue +2 -2
- package/components/__tests__/AsyncButton.test.ts +2 -2
- package/components/__tests__/ModalManager.spec.ts +176 -0
- package/components/__tests__/PromptModal.test.ts +148 -0
- package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
- package/components/auth/AuthBanner.vue +13 -11
- package/components/auth/Principal.vue +1 -0
- package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
- package/components/auth/login/ldap.vue +1 -1
- package/components/fleet/FleetResources.vue +21 -6
- package/components/form/ArrayList.vue +76 -60
- package/components/form/BannerSettings.vue +17 -2
- package/components/form/ColorInput.vue +35 -6
- package/components/form/Command.vue +6 -15
- package/components/form/EnvVars.vue +16 -8
- package/components/form/HealthCheck.vue +3 -3
- package/components/form/HookOption.vue +11 -16
- package/components/form/LabeledSelect.vue +18 -22
- package/components/form/LifecycleHooks.vue +3 -3
- package/components/form/MatchExpressions.vue +14 -8
- package/components/form/NameNsDescription.vue +128 -104
- package/components/form/Networking.vue +20 -12
- package/components/form/NodeAffinity.vue +31 -23
- package/components/form/NodeScheduling.vue +13 -3
- package/components/form/NotificationSettings.vue +15 -1
- package/components/form/Password.vue +1 -0
- package/components/form/PodAffinity.vue +43 -43
- package/components/form/Probe.vue +68 -66
- package/components/form/ResourceQuota/Project.vue +5 -1
- package/components/form/ResourceSelector.vue +7 -9
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +16 -24
- package/components/form/SSHKnownHosts/index.vue +30 -13
- package/components/form/Security.vue +54 -56
- package/components/form/Select.vue +32 -21
- package/components/form/ShellInput.vue +5 -1
- package/components/form/Tolerations.vue +5 -1
- package/components/form/ValueFromResource.vue +134 -121
- package/components/form/WorkloadPorts.vue +18 -18
- package/components/form/__tests__/ArrayList.test.ts +5 -2
- package/components/form/__tests__/ColorInput.test.ts +35 -0
- package/components/form/__tests__/LabeledSelect.test.ts +40 -0
- package/components/form/__tests__/MatchExpressions.test.ts +12 -12
- package/components/form/__tests__/NameNsDescription.test.ts +115 -14
- package/components/form/__tests__/Probe.test.ts +12 -8
- package/components/form/__tests__/SSHKnownHosts.test.ts +22 -2
- package/components/form/__tests__/Select.test.ts +37 -0
- package/components/formatter/InternalExternalIP.vue +2 -0
- package/components/formatter/SecretData.vue +20 -7
- package/components/nav/Group.vue +27 -5
- package/components/nav/Header.vue +17 -43
- package/components/nav/NamespaceFilter.vue +134 -86
- package/components/nav/TopLevelMenu.vue +4 -5
- package/components/nav/Type.vue +12 -1
- package/components/nav/WindowManager/ContainerLogs.vue +87 -61
- package/components/nav/WindowManager/ContainerLogsActions.vue +76 -0
- package/components/templates/blank.vue +4 -1
- package/components/templates/default.vue +8 -3
- package/components/templates/home.vue +10 -1
- package/components/templates/plain.vue +10 -4
- package/composables/focusTrap.ts +12 -4
- package/composables/useRuntimeFlag.ts +29 -0
- package/config/router/routes.js +20 -13
- package/config/store.js +4 -0
- package/config/uiplugins.js +5 -1
- package/core/types.ts +12 -6
- package/detail/catalog.cattle.io.app.vue +6 -1
- package/detail/fleet.cattle.io.bundle.vue +70 -6
- package/detail/fleet.cattle.io.gitrepo.vue +1 -1
- package/detail/namespace.vue +0 -3
- package/detail/node.vue +17 -13
- package/detail/provisioning.cattle.io.cluster.vue +72 -6
- package/dialog/AddCustomBadgeDialog.vue +1 -1
- package/{pages/c/_cluster/uiplugins/AddExtensionRepos.vue → dialog/AddExtensionReposDialog.vue} +72 -42
- package/{components/AssignTo.vue → dialog/AssignToDialog.vue} +71 -80
- package/dialog/ChangePasswordDialog.vue +106 -0
- package/dialog/DeactivateDriverDialog.vue +1 -0
- package/{pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue → dialog/DeveloperLoadExtensionDialog.vue} +74 -71
- package/dialog/DisableAuthProviderDialog.vue +101 -0
- package/dialog/DrainNode.vue +1 -1
- package/{pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue → dialog/ExtensionCatalogInstallDialog.vue} +100 -88
- package/{pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue → dialog/ExtensionCatalogUninstallDialog.vue} +69 -57
- package/dialog/FeatureFlagListDialog.vue +288 -0
- package/dialog/ForceMachineRemoveDialog.vue +5 -2
- package/{components/Import.vue → dialog/ImportDialog.vue} +0 -5
- package/{pages/c/_cluster/uiplugins/InstallDialog.vue → dialog/InstallExtensionDialog.vue} +124 -106
- package/{components/form/SSHKnownHosts → dialog}/KnownHostsEditDialog.vue +52 -59
- package/dialog/MoveNamespaceDialog.vue +157 -0
- package/dialog/ScalePoolDownDialog.vue +1 -1
- package/{components/nav/Jump.vue → dialog/SearchDialog.vue} +34 -14
- package/{pages/c/_cluster/uiplugins/UninstallDialog.vue → dialog/UninstallExtensionDialog.vue} +67 -58
- package/dialog/WechatDialog.vue +57 -0
- package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +16 -3
- package/edit/auth/__tests__/oidc.test.ts +152 -109
- package/edit/auth/azuread.vue +2 -1
- package/edit/auth/github.vue +1 -1
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/auth/ldap/index.vue +1 -1
- package/edit/auth/oidc.vue +38 -5
- package/edit/auth/saml.vue +1 -1
- package/edit/cloudcredential.vue +24 -9
- package/edit/logging.banzaicloud.io.output/__tests__/logging.banzaicloud.io.output.test.ts +40 -9
- package/edit/management.cattle.io.user.vue +28 -3
- package/edit/namespace.vue +1 -4
- package/edit/networking.k8s.io.ingress/IngressClass.vue +7 -3
- package/edit/networking.k8s.io.ingress/__tests__/IngressClass.test.ts +58 -0
- package/edit/persistentvolume/__tests__/persistentvolume.test.ts +14 -2
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +26 -9
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +8 -8
- package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +26 -12
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +66 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/rke2-test-data.ts +58 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +49 -41
- package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +6 -1
- package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +5 -3
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +33 -2
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +2 -2
- package/edit/token.vue +2 -0
- package/edit/workload/index.vue +1 -0
- package/edit/workload/mixins/workload.js +0 -2
- package/initialize/install-plugins.js +2 -1
- package/list/harvesterhci.io.management.cluster.vue +4 -1
- package/list/management.cattle.io.feature.vue +4 -287
- package/list/provisioning.cattle.io.cluster.vue +20 -12
- package/machine-config/azure.vue +16 -4
- package/mixins/vue-select-overrides.js +0 -4
- package/models/__tests__/namespace.test.ts +25 -1
- package/models/cloudcredential.js +5 -0
- package/models/fleet.cattle.io.cluster.js +8 -2
- package/models/fleet.cattle.io.gitrepo.js +8 -34
- package/models/kontainerdriver.js +6 -3
- package/models/management.cattle.io.feature.js +7 -1
- package/models/management.cattle.io.node.js +3 -3
- package/models/namespace.js +11 -6
- package/models/nodedriver.js +6 -3
- package/models/workload.js +4 -1
- package/package.json +3 -3
- package/pages/about.vue +13 -3
- package/pages/account/index.vue +16 -6
- package/pages/auth/login.vue +18 -7
- package/pages/auth/logout.vue +4 -1
- package/pages/auth/setup.vue +2 -0
- package/pages/auth/verify.vue +13 -8
- package/pages/c/_cluster/apps/charts/chart.vue +1 -1
- package/pages/c/_cluster/apps/charts/install.vue +26 -26
- package/pages/c/_cluster/auth/config/index.vue +10 -12
- package/pages/c/_cluster/explorer/EventsTable.vue +38 -33
- package/pages/c/_cluster/explorer/index.vue +17 -15
- package/pages/c/_cluster/istio/index.vue +2 -2
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +4 -2
- package/pages/c/_cluster/monitoring/monitor/create.vue +4 -2
- package/pages/c/_cluster/monitoring/route-receiver/_id.vue +4 -2
- package/pages/c/_cluster/monitoring/route-receiver/create.vue +5 -2
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/banners.vue +4 -3
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +8 -10
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +4 -7
- package/pages/c/_cluster/uiplugins/index.vue +98 -55
- package/pages/diagnostic.vue +59 -11
- package/pages/fail-whale.vue +14 -8
- package/pages/home.vue +24 -18
- package/pages/prefs.vue +7 -6
- package/pages/support/index.vue +4 -1
- package/plugins/internal-api/index.ts +37 -0
- package/plugins/internal-api/shared/base-api.ts +13 -0
- package/plugins/internal-api/shell/shell.api.ts +108 -0
- package/plugins/steve/actions.js +0 -12
- package/public/index.html +1 -0
- package/rancher-components/Card/Card.vue +1 -1
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +59 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +27 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +47 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +20 -2
- package/rancher-components/Form/Radio/RadioButton.test.ts +36 -1
- package/rancher-components/Form/Radio/RadioButton.vue +20 -4
- package/rancher-components/Form/Radio/RadioGroup.test.ts +60 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +52 -10
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +17 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +5 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +10 -1
- package/rancher-components/RcButton/RcButton.vue +2 -1
- package/rancher-components/RcButton/types.ts +1 -0
- package/rancher-components/RcDropdown/RcDropdown.vue +18 -6
- package/rancher-components/RcDropdown/RcDropdownItem.vue +3 -56
- package/rancher-components/RcDropdown/RcDropdownItemCheckbox.vue +68 -0
- package/rancher-components/RcDropdown/RcDropdownItemSelect.vue +92 -0
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +10 -0
- package/rancher-components/RcDropdown/index.ts +2 -0
- package/rancher-components/RcDropdown/useDropdownCollection.ts +8 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +9 -3
- package/rancher-components/RcDropdown/useDropdownItem.ts +63 -0
- package/scripts/extension/bundle +20 -0
- package/scripts/extension/helm/charts/ui-plugin-server/templates/cr.yaml +2 -1
- package/scripts/extension/helm/charts/ui-plugin-server/values.yaml +2 -0
- package/scripts/extension/helmpatch +44 -31
- package/scripts/extension/publish +12 -12
- package/scripts/typegen.sh +2 -4
- package/server/har-file.js +25 -3
- package/store/action-menu.js +26 -56
- package/store/features.js +2 -1
- package/store/index.js +5 -0
- package/store/modal.ts +71 -0
- package/store/slideInPanel.ts +47 -0
- package/store/type-map.js +12 -1
- package/store/type-map.utils.ts +4 -4
- package/types/global-vue.d.ts +5 -0
- package/types/internal-api/shell/growl.d.ts +25 -0
- package/types/internal-api/shell/modal.d.ts +77 -0
- package/types/internal-api/shell/slideIn.d.ts +15 -0
- package/types/resources/fleet.d.ts +0 -14
- package/types/shell/index.d.ts +43 -24
- package/types/vue-shim.d.ts +4 -1
- package/utils/__mocks__/tabbable.js +13 -0
- package/utils/__tests__/object.test.ts +38 -4
- package/utils/cluster.js +35 -0
- package/utils/fleet.ts +15 -73
- package/utils/object.js +48 -5
- package/utils/validators/formRules/__tests__/index.test.ts +10 -1
- package/utils/validators/formRules/index.ts +27 -3
- package/utils/validators/machine-pool.ts +20 -0
- package/components/DisableAuthProviderModal.vue +0 -114
- package/components/MoveModal.vue +0 -166
- package/components/PromptChangePassword.vue +0 -123
- package/components/fleet/FleetBundleResources.vue +0 -86
- package/components/formatter/ExtensionCache.vue +0 -74
- package/components/formatter/Port.vue +0 -24
- package/components/formatter/SecretType.vue +0 -41
- package/types/vue-shim.d +0 -20
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
|
-
import KnownHostsEditDialog from './KnownHostsEditDialog.vue';
|
|
4
3
|
import { _EDIT, _VIEW } from '@shell/config/query-params';
|
|
5
4
|
|
|
6
5
|
export default defineComponent({
|
|
@@ -20,8 +19,6 @@ export default defineComponent({
|
|
|
20
19
|
},
|
|
21
20
|
},
|
|
22
21
|
|
|
23
|
-
components: { KnownHostsEditDialog },
|
|
24
|
-
|
|
25
22
|
computed: {
|
|
26
23
|
isViewMode() {
|
|
27
24
|
return this.mode === _VIEW;
|
|
@@ -40,7 +37,20 @@ export default defineComponent({
|
|
|
40
37
|
methods: {
|
|
41
38
|
openDialog() {
|
|
42
39
|
(this.$refs.button as HTMLInputElement)?.blur();
|
|
43
|
-
|
|
40
|
+
|
|
41
|
+
this.$store.dispatch('management/promptModal', {
|
|
42
|
+
component: 'KnownHostsEditDialog',
|
|
43
|
+
returnFocusSelector: '#known-ssh-hosts-trigger',
|
|
44
|
+
testId: 'sshKnownHostsDialog',
|
|
45
|
+
height: 'auto',
|
|
46
|
+
componentProps: {
|
|
47
|
+
mode: this.mode,
|
|
48
|
+
value: this.value,
|
|
49
|
+
closed: (res: any) => {
|
|
50
|
+
this.dialogClosed(res);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
44
54
|
},
|
|
45
55
|
|
|
46
56
|
dialogClosed(result: any) {
|
|
@@ -65,20 +75,19 @@ export default defineComponent({
|
|
|
65
75
|
</div>
|
|
66
76
|
<template v-if="!isViewMode">
|
|
67
77
|
<button
|
|
78
|
+
id="known-ssh-hosts-trigger"
|
|
68
79
|
ref="button"
|
|
80
|
+
role="button"
|
|
81
|
+
:aria-label="t('secret.ssh.editKnownHosts.title')"
|
|
69
82
|
data-testid="input-known-ssh-hosts_open-dialog"
|
|
70
83
|
class="show-dialog-btn btn"
|
|
71
84
|
@click="openDialog"
|
|
72
85
|
>
|
|
73
|
-
<i
|
|
86
|
+
<i
|
|
87
|
+
class="icon icon-edit"
|
|
88
|
+
:alt="t('secret.ssh.editKnownHosts.title')"
|
|
89
|
+
/>
|
|
74
90
|
</button>
|
|
75
|
-
|
|
76
|
-
<KnownHostsEditDialog
|
|
77
|
-
ref="editDialog"
|
|
78
|
-
:value="value"
|
|
79
|
-
:mode="mode"
|
|
80
|
-
@closed="dialogClosed"
|
|
81
|
-
/>
|
|
82
91
|
</template>
|
|
83
92
|
</div>
|
|
84
93
|
</template>
|
|
@@ -94,8 +103,16 @@ export default defineComponent({
|
|
|
94
103
|
}
|
|
95
104
|
|
|
96
105
|
.show-dialog-btn {
|
|
97
|
-
display: contents;
|
|
98
106
|
background-color: transparent;
|
|
107
|
+
padding: 4px;
|
|
108
|
+
height: 22px;
|
|
109
|
+
margin: -3px -3px 0 0;
|
|
110
|
+
min-height: unset;
|
|
111
|
+
|
|
112
|
+
&:focus-visible {
|
|
113
|
+
@include focus-outline;
|
|
114
|
+
outline-offset: 1px;
|
|
115
|
+
}
|
|
99
116
|
}
|
|
100
117
|
}
|
|
101
118
|
</style>
|
|
@@ -5,6 +5,45 @@ import { _VIEW } from '@shell/config/query-params';
|
|
|
5
5
|
import { mapGetters } from 'vuex';
|
|
6
6
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
7
7
|
|
|
8
|
+
const allCapabilities = ['ALL',
|
|
9
|
+
'AUDIT_CONTROL',
|
|
10
|
+
'AUDIT_WRITE',
|
|
11
|
+
'BLOCK_SUSPEND',
|
|
12
|
+
'CHOWN',
|
|
13
|
+
'DAC_OVERRIDE',
|
|
14
|
+
'DAC_READ_SEARCH',
|
|
15
|
+
'FOWNER',
|
|
16
|
+
'FSETID',
|
|
17
|
+
'IPC_LOCK',
|
|
18
|
+
'IPC_OWNER',
|
|
19
|
+
'KILL',
|
|
20
|
+
'LEASE',
|
|
21
|
+
'LINUX_IMMUTABLE',
|
|
22
|
+
'MAC_ADMIN',
|
|
23
|
+
'MAC_OVERRIDE',
|
|
24
|
+
'MKNOD',
|
|
25
|
+
'NET_ADMIN',
|
|
26
|
+
'NET_BIND_SERVICE',
|
|
27
|
+
'NET_BROADCAST',
|
|
28
|
+
'NET_RAW',
|
|
29
|
+
'SETFCAP',
|
|
30
|
+
'SETGID',
|
|
31
|
+
'SETPCAP',
|
|
32
|
+
'SETUID',
|
|
33
|
+
'SYSLOG',
|
|
34
|
+
'SYS_ADMIN',
|
|
35
|
+
'SYS_BOOT',
|
|
36
|
+
'SYS_CHROOT',
|
|
37
|
+
'SYS_MODULE',
|
|
38
|
+
'SYS_NICE',
|
|
39
|
+
'SYS_PACCT',
|
|
40
|
+
'SYS_PTRACE',
|
|
41
|
+
'SYS_RAWIO',
|
|
42
|
+
'SYS_RESOURCE',
|
|
43
|
+
'SYS_TIME',
|
|
44
|
+
'SYS_TTY_CONFIG',
|
|
45
|
+
'WAKE_ALARM'];
|
|
46
|
+
|
|
8
47
|
export default {
|
|
9
48
|
emits: ['update:value'],
|
|
10
49
|
|
|
@@ -25,68 +64,27 @@ export default {
|
|
|
25
64
|
},
|
|
26
65
|
|
|
27
66
|
data() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'KILL',
|
|
40
|
-
'LEASE',
|
|
41
|
-
'LINUX_IMMUTABLE',
|
|
42
|
-
'MAC_ADMIN',
|
|
43
|
-
'MAC_OVERRIDE',
|
|
44
|
-
'MKNOD',
|
|
45
|
-
'NET_ADMIN',
|
|
46
|
-
'NET_BIND_SERVICE',
|
|
47
|
-
'NET_BROADCAST',
|
|
48
|
-
'NET_RAW',
|
|
49
|
-
'SETFCAP',
|
|
50
|
-
'SETGID',
|
|
51
|
-
'SETPCAP',
|
|
52
|
-
'SETUID',
|
|
53
|
-
'SYSLOG',
|
|
54
|
-
'SYS_ADMIN',
|
|
55
|
-
'SYS_BOOT',
|
|
56
|
-
'SYS_CHROOT',
|
|
57
|
-
'SYS_MODULE',
|
|
58
|
-
'SYS_NICE',
|
|
59
|
-
'SYS_PACCT',
|
|
60
|
-
'SYS_PTRACE',
|
|
61
|
-
'SYS_RAWIO',
|
|
62
|
-
'SYS_RESOURCE',
|
|
63
|
-
'SYS_TIME',
|
|
64
|
-
'SYS_TTY_CONFIG',
|
|
65
|
-
'WAKE_ALARM'];
|
|
67
|
+
return {
|
|
68
|
+
privileged: this.value.privileged || false,
|
|
69
|
+
allowPrivilegeEscalation: this.value.allowPrivilegeEscalation || false,
|
|
70
|
+
allCapabilities,
|
|
71
|
+
runAsNonRoot: this.value.runAsNonRoot || false,
|
|
72
|
+
readOnlyRootFilesystem: this.value.readOnlyRootFilesystem || false,
|
|
73
|
+
add: [],
|
|
74
|
+
drop: [],
|
|
75
|
+
runAsUser: this.value.runAsUser
|
|
76
|
+
};
|
|
77
|
+
},
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
runAsNonRoot = false,
|
|
70
|
-
readOnlyRootFilesystem = false,
|
|
71
|
-
privileged = false,
|
|
72
|
-
allowPrivilegeEscalation = false,
|
|
73
|
-
runAsUser
|
|
74
|
-
} = this.value;
|
|
79
|
+
created() {
|
|
80
|
+
const { capabilities = {} } = this.value;
|
|
75
81
|
const {
|
|
76
82
|
add = [],
|
|
77
83
|
drop = []
|
|
78
84
|
} = capabilities;
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
allowPrivilegeEscalation,
|
|
83
|
-
allCapabilities,
|
|
84
|
-
runAsNonRoot,
|
|
85
|
-
readOnlyRootFilesystem,
|
|
86
|
-
add,
|
|
87
|
-
drop,
|
|
88
|
-
runAsUser
|
|
89
|
-
};
|
|
86
|
+
this.add = add;
|
|
87
|
+
this.drop = drop;
|
|
90
88
|
},
|
|
91
89
|
|
|
92
90
|
computed: {
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { get } from '@shell/utils/object';
|
|
3
3
|
import LabeledFormElement from '@shell/mixins/labeled-form-element';
|
|
4
4
|
import VueSelectOverrides from '@shell/mixins/vue-select-overrides';
|
|
5
|
+
import { generateRandomAlphaString } from '@shell/utils/string';
|
|
5
6
|
import { LabeledTooltip } from '@components/LabeledTooltip';
|
|
6
7
|
import { onClickOption, calculatePosition } from '@shell/utils/select';
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
|
-
emits: ['update:value', 'createdListItem'],
|
|
10
|
+
emits: ['update:value', 'createdListItem', 'on-open', 'on-close'],
|
|
10
11
|
|
|
11
12
|
components: { LabeledTooltip },
|
|
12
13
|
mixins: [
|
|
@@ -90,9 +91,14 @@ export default {
|
|
|
90
91
|
isLangSelect: {
|
|
91
92
|
type: Boolean,
|
|
92
93
|
default: false
|
|
93
|
-
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
isOpen: false,
|
|
99
|
+
generatedUid: `s-uid-${ generateRandomAlphaString(12) }`
|
|
100
|
+
};
|
|
94
101
|
},
|
|
95
|
-
|
|
96
102
|
methods: {
|
|
97
103
|
// resizeHandler = in mixin
|
|
98
104
|
getOptionLabel(option) {
|
|
@@ -119,21 +125,6 @@ export default {
|
|
|
119
125
|
},
|
|
120
126
|
|
|
121
127
|
focusSearch() {
|
|
122
|
-
// we need this override as in a "closeOnSelect" type of component
|
|
123
|
-
// if we don't have this override, it would open again
|
|
124
|
-
if (this.overridesMixinPreventDoubleTriggerKeysOpen) {
|
|
125
|
-
this.$nextTick(() => {
|
|
126
|
-
const el = this.$refs['select'];
|
|
127
|
-
|
|
128
|
-
if ( el ) {
|
|
129
|
-
el.focus();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
this.overridesMixinPreventDoubleTriggerKeysOpen = false;
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
128
|
this.$refs['select-input'].open = true;
|
|
138
129
|
|
|
139
130
|
this.$nextTick(() => {
|
|
@@ -191,14 +182,26 @@ export default {
|
|
|
191
182
|
return Math.random(100000);
|
|
192
183
|
}
|
|
193
184
|
},
|
|
185
|
+
|
|
194
186
|
report(e) {
|
|
195
187
|
alert(e);
|
|
196
188
|
},
|
|
189
|
+
|
|
197
190
|
handleDropdownOpen(args) {
|
|
198
191
|
// function that prevents the "opening dropdown on focus"
|
|
199
192
|
// default behaviour of v-select
|
|
200
193
|
return args.noDrop || args.disabled ? false : args.open;
|
|
201
|
-
}
|
|
194
|
+
},
|
|
195
|
+
onOpen() {
|
|
196
|
+
this.isOpen = true;
|
|
197
|
+
this.$emit('on-open');
|
|
198
|
+
this.resizeHandler();
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
onClose() {
|
|
202
|
+
this.isOpen = false;
|
|
203
|
+
this.$emit('on-close');
|
|
204
|
+
},
|
|
202
205
|
},
|
|
203
206
|
computed: {
|
|
204
207
|
requiredField() {
|
|
@@ -259,6 +262,10 @@ export default {
|
|
|
259
262
|
[$attrs.class]: $attrs.class
|
|
260
263
|
}"
|
|
261
264
|
:tabindex="disabled || isView ? -1 : 0"
|
|
265
|
+
role="combobox"
|
|
266
|
+
:aria-expanded="isOpen"
|
|
267
|
+
:aria-label="$attrs['aria-label'] || undefined"
|
|
268
|
+
:aria-describedby="$attrs['aria-describedby'] || undefined"
|
|
262
269
|
@click="focusSearch"
|
|
263
270
|
@keydown.enter="focusSearch"
|
|
264
271
|
@keydown.down.prevent="focusSearch"
|
|
@@ -286,12 +293,16 @@ export default {
|
|
|
286
293
|
:modelValue="value != null ? value : ''"
|
|
287
294
|
:dropdownShouldOpen="handleDropdownOpen"
|
|
288
295
|
:tabindex="-1"
|
|
289
|
-
role="
|
|
296
|
+
role="listitem"
|
|
297
|
+
:uid="generatedUid"
|
|
298
|
+
:aria-label="'-'"
|
|
290
299
|
@update:modelValue="$emit('update:value', $event)"
|
|
291
300
|
@search:blur="onBlur"
|
|
292
301
|
@search:focus="onFocus"
|
|
293
|
-
@open="
|
|
302
|
+
@open="onOpen"
|
|
303
|
+
@close="onClose"
|
|
294
304
|
@option:created="(e) => $emit('createdListItem', e)"
|
|
305
|
+
@keydown.enter.stop
|
|
295
306
|
>
|
|
296
307
|
<template
|
|
297
308
|
#option="option"
|
|
@@ -21,6 +21,10 @@ export default {
|
|
|
21
21
|
causes $emit 'input' of ["-c", "sleep 600"]
|
|
22
22
|
*/
|
|
23
23
|
data() {
|
|
24
|
+
return { userValue: '' };
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
created() {
|
|
24
28
|
let userValue = '';
|
|
25
29
|
|
|
26
30
|
if ( this.value ) {
|
|
@@ -36,7 +40,7 @@ export default {
|
|
|
36
40
|
}, '').trim();
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
this.userValue = userValue;
|
|
40
44
|
},
|
|
41
45
|
|
|
42
46
|
methods: {
|
|
@@ -29,6 +29,10 @@ export default {
|
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
data() {
|
|
32
|
+
return { rules: [] };
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
created() {
|
|
32
36
|
const rules = [];
|
|
33
37
|
|
|
34
38
|
// on creation in agent configuration, the backend "eats"
|
|
@@ -49,7 +53,7 @@ export default {
|
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
this.rules = rules;
|
|
53
57
|
},
|
|
54
58
|
|
|
55
59
|
computed: {
|
|
@@ -4,6 +4,7 @@ import { get } from '@shell/utils/object';
|
|
|
4
4
|
import { _VIEW } from '@shell/config/query-params';
|
|
5
5
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
6
6
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
7
|
+
import { ref, watch } from 'vue';
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
emits: ['update:value', 'remove'],
|
|
@@ -44,84 +45,164 @@ export default {
|
|
|
44
45
|
},
|
|
45
46
|
|
|
46
47
|
data() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
48
|
+
return {
|
|
49
|
+
typeOpts: [
|
|
50
|
+
{ value: 'simple', label: 'Key/Value Pair' },
|
|
51
|
+
{ value: 'resourceFieldRef', label: 'Resource' },
|
|
52
|
+
{ value: 'configMapKeyRef', label: 'ConfigMap Key' },
|
|
53
|
+
{ value: 'secretKeyRef', label: 'Secret key' },
|
|
54
|
+
{ value: 'fieldRef', label: 'Pod Field' },
|
|
55
|
+
{ value: 'secretRef', label: 'Secret' },
|
|
56
|
+
{ value: 'configMapRef', label: 'ConfigMap' },
|
|
57
|
+
],
|
|
58
|
+
secrets: this.allSecrets,
|
|
59
|
+
resourceKeyOpts: ['limits.cpu', 'limits.ephemeral-storage', 'limits.memory', 'requests.cpu', 'requests.ephemeral-storage', 'requests.memory'],
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
setup(props, { emit }) {
|
|
64
|
+
const type = ref(null);
|
|
65
|
+
|
|
66
|
+
if (props.value.secretRef) {
|
|
67
|
+
type.value = 'secretRef';
|
|
68
|
+
} else if (props.value.configMapRef) {
|
|
69
|
+
type.value = 'configMapRef';
|
|
70
|
+
} else if (props.value.value) {
|
|
71
|
+
type.value = 'simple';
|
|
72
|
+
} else if (props.value.valueFrom) {
|
|
73
|
+
type.value = Object.keys((props.value.valueFrom))[0] || 'simple';
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const keys = [];
|
|
76
|
+
const refName = ref('');
|
|
77
|
+
const name = ref('');
|
|
78
|
+
const fieldPath = ref('');
|
|
79
|
+
const referenced = ref(null);
|
|
80
|
+
const key = ref(null);
|
|
81
|
+
const valStr = ref('');
|
|
82
|
+
const keys = ref([]);
|
|
77
83
|
|
|
78
|
-
switch (type) {
|
|
84
|
+
switch (type.value) {
|
|
79
85
|
case 'resourceFieldRef':
|
|
80
|
-
name =
|
|
81
|
-
refName =
|
|
82
|
-
key =
|
|
86
|
+
name.value = props.value.name;
|
|
87
|
+
refName.value = props.value.valueFrom[type.value].containerName;
|
|
88
|
+
key.value = props.value.valueFrom[type.value].resource || '';
|
|
83
89
|
break;
|
|
84
90
|
case 'configMapKeyRef':
|
|
85
|
-
name =
|
|
86
|
-
key =
|
|
87
|
-
refName =
|
|
88
|
-
referenced =
|
|
89
|
-
return resource.metadata.name === refName;
|
|
91
|
+
name.value = props.value.name;
|
|
92
|
+
key.value = props.value.valueFrom[type.value].key || '';
|
|
93
|
+
refName.value = props.value.valueFrom[type.value].name;
|
|
94
|
+
referenced.value = props.allConfigMaps.filter((resource) => {
|
|
95
|
+
return resource.metadata.name === refName.value;
|
|
90
96
|
})[0];
|
|
91
|
-
if (referenced && referenced.data) {
|
|
92
|
-
keys.push(...Object.keys(referenced.data));
|
|
97
|
+
if (referenced.value && referenced.value.data) {
|
|
98
|
+
keys.value.push(...Object.keys(referenced.value.data));
|
|
93
99
|
}
|
|
94
100
|
break;
|
|
95
101
|
case 'secretRef':
|
|
96
102
|
case 'configMapRef':
|
|
97
|
-
name =
|
|
98
|
-
refName =
|
|
103
|
+
name.value = props.value.prefix;
|
|
104
|
+
refName.value = props.value[type.value].name;
|
|
99
105
|
break;
|
|
100
106
|
case 'secretKeyRef':
|
|
101
|
-
name =
|
|
102
|
-
key =
|
|
103
|
-
refName =
|
|
104
|
-
referenced =
|
|
105
|
-
return resource.metadata.name === refName;
|
|
107
|
+
name.value = props.value.name;
|
|
108
|
+
key.value = props.value.valueFrom[type.value].key || '';
|
|
109
|
+
refName.value = props.value.valueFrom[type.value].name;
|
|
110
|
+
referenced.value = props.allSecrets.filter((resource) => {
|
|
111
|
+
return resource.metadata.name === refName.value;
|
|
106
112
|
})[0];
|
|
107
|
-
if (referenced && referenced.data) {
|
|
108
|
-
keys.push(...Object.keys(referenced.data));
|
|
113
|
+
if (referenced.value && referenced.value.data) {
|
|
114
|
+
keys.value.push(...Object.keys(referenced.value.data));
|
|
109
115
|
}
|
|
110
116
|
break;
|
|
111
117
|
case 'fieldRef':
|
|
112
|
-
fieldPath = get(
|
|
113
|
-
name =
|
|
118
|
+
fieldPath.value = get(props.value.valueFrom, `${ type.value }.fieldPath`) || '';
|
|
119
|
+
name.value = props.value.name;
|
|
114
120
|
break;
|
|
115
121
|
default:
|
|
116
|
-
name =
|
|
117
|
-
valStr =
|
|
122
|
+
name.value = props.value.name;
|
|
123
|
+
valStr.value = props.value.value;
|
|
118
124
|
break;
|
|
119
125
|
}
|
|
120
126
|
|
|
127
|
+
referenced.value = refName.value;
|
|
128
|
+
|
|
129
|
+
const updateRow = () => {
|
|
130
|
+
if (!name.value?.length && !refName.value?.length) {
|
|
131
|
+
if (type.value !== 'fieldRef') {
|
|
132
|
+
emit('update:value', null);
|
|
133
|
+
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
let out = { name: name.value || refName.value };
|
|
138
|
+
|
|
139
|
+
switch (type.value) {
|
|
140
|
+
case 'configMapKeyRef':
|
|
141
|
+
case 'secretKeyRef':
|
|
142
|
+
out.valueFrom = {
|
|
143
|
+
[type.value]: {
|
|
144
|
+
key: key.value, name: refName.value, optional: false
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
break;
|
|
148
|
+
case 'resourceFieldRef':
|
|
149
|
+
out.valueFrom = {
|
|
150
|
+
[type.value]: {
|
|
151
|
+
containerName: refName.value, divisor: 1, resource: key.value
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
break;
|
|
155
|
+
case 'fieldRef':
|
|
156
|
+
if (!fieldPath.value || !fieldPath.value.length) {
|
|
157
|
+
out = null; break;
|
|
158
|
+
}
|
|
159
|
+
out.valueFrom = { [type.value]: { apiVersion: 'v1', fieldPath: fieldPath.value } };
|
|
160
|
+
break;
|
|
161
|
+
case 'simple':
|
|
162
|
+
out.value = valStr.value;
|
|
163
|
+
break;
|
|
164
|
+
default:
|
|
165
|
+
delete out.name;
|
|
166
|
+
out.prefix = name.value;
|
|
167
|
+
out[type.value] = { name: refName.value, optional: false };
|
|
168
|
+
}
|
|
169
|
+
emit('update:value', out);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
watch(type, () => {
|
|
173
|
+
referenced.value = null;
|
|
174
|
+
key.value = '';
|
|
175
|
+
refName.value = '';
|
|
176
|
+
keys.value = [];
|
|
177
|
+
key.value = '';
|
|
178
|
+
valStr.value = '';
|
|
179
|
+
fieldPath.value = '';
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
watch(referenced, (neu, old) => {
|
|
183
|
+
if (neu) {
|
|
184
|
+
if ((neu.type === SECRET || neu.type === CONFIG_MAP) && neu.data) {
|
|
185
|
+
keys.value = Object.keys(neu.data);
|
|
186
|
+
}
|
|
187
|
+
refName.value = neu?.metadata?.name;
|
|
188
|
+
}
|
|
189
|
+
updateRow();
|
|
190
|
+
});
|
|
191
|
+
|
|
121
192
|
return {
|
|
122
|
-
|
|
193
|
+
type,
|
|
194
|
+
refName,
|
|
195
|
+
referenced,
|
|
196
|
+
keys,
|
|
197
|
+
key,
|
|
198
|
+
fieldPath,
|
|
199
|
+
name,
|
|
200
|
+
valStr,
|
|
201
|
+
updateRow,
|
|
202
|
+
get,
|
|
123
203
|
};
|
|
124
204
|
},
|
|
205
|
+
|
|
125
206
|
computed: {
|
|
126
207
|
isView() {
|
|
127
208
|
return this.mode === _VIEW;
|
|
@@ -189,74 +270,6 @@ export default {
|
|
|
189
270
|
return ['resourceFieldRef', 'configMapKeyRef', 'secretKeyRef'].includes(this.type);
|
|
190
271
|
},
|
|
191
272
|
},
|
|
192
|
-
|
|
193
|
-
watch: {
|
|
194
|
-
type() {
|
|
195
|
-
this.referenced = null;
|
|
196
|
-
this.key = '';
|
|
197
|
-
this.refName = '';
|
|
198
|
-
this.keys = [];
|
|
199
|
-
this.key = '';
|
|
200
|
-
this.valStr = '';
|
|
201
|
-
this.fieldPath = '';
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
referenced(neu, old) {
|
|
205
|
-
if (neu) {
|
|
206
|
-
if ((neu.type === SECRET || neu.type === CONFIG_MAP) && neu.data) {
|
|
207
|
-
this.keys = Object.keys(neu.data);
|
|
208
|
-
}
|
|
209
|
-
this.refName = neu?.metadata?.name;
|
|
210
|
-
}
|
|
211
|
-
this.updateRow();
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
methods: {
|
|
216
|
-
updateRow() {
|
|
217
|
-
if (!this.name?.length && !this.refName?.length) {
|
|
218
|
-
if (this.type !== 'fieldRef') {
|
|
219
|
-
this.$emit('update:value', null);
|
|
220
|
-
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
let out = { name: this.name || this.refName };
|
|
225
|
-
|
|
226
|
-
switch (this.type) {
|
|
227
|
-
case 'configMapKeyRef':
|
|
228
|
-
case 'secretKeyRef':
|
|
229
|
-
out.valueFrom = {
|
|
230
|
-
[this.type]: {
|
|
231
|
-
key: this.key, name: this.refName, optional: false
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
break;
|
|
235
|
-
case 'resourceFieldRef':
|
|
236
|
-
out.valueFrom = {
|
|
237
|
-
[this.type]: {
|
|
238
|
-
containerName: this.refName, divisor: 1, resource: this.key
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
break;
|
|
242
|
-
case 'fieldRef':
|
|
243
|
-
if (!this.fieldPath || !this.fieldPath.length) {
|
|
244
|
-
out = null; break;
|
|
245
|
-
}
|
|
246
|
-
out.valueFrom = { [this.type]: { apiVersion: 'v1', fieldPath: this.fieldPath } };
|
|
247
|
-
break;
|
|
248
|
-
case 'simple':
|
|
249
|
-
out.value = this.valStr;
|
|
250
|
-
break;
|
|
251
|
-
default:
|
|
252
|
-
delete out.name;
|
|
253
|
-
out.prefix = this.name;
|
|
254
|
-
out[this.type] = { name: this.refName, optional: false };
|
|
255
|
-
}
|
|
256
|
-
this.$emit('update:value', out);
|
|
257
|
-
},
|
|
258
|
-
get
|
|
259
|
-
}
|
|
260
273
|
};
|
|
261
274
|
</script>
|
|
262
275
|
|