dashboard-shell-shell 1.0.122 → 1.0.1000000082
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/.DS_Store +0 -0
- package/assets/brand/harvester/favicon.png +0 -0
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/icons/iconfont.css +19 -3
- package/assets/icons/iconfont.js +1 -1
- package/assets/icons/iconfont.json +28 -0
- package/assets/icons/iconfont.ttf +0 -0
- package/assets/icons/iconfont.woff +0 -0
- package/assets/icons/iconfont.woff2 +0 -0
- package/assets/images/pl/half-logo.svg +2 -23
- package/assets/styles/base/_functions.scss +0 -0
- package/assets/styles/base/_mixins.scss +0 -0
- package/assets/styles/base/_variables.scss +1 -1
- package/assets/styles/global/_labeled-input.scss +0 -1
- package/assets/styles/global/_layout.scss +1 -1
- package/assets/styles/global/_select.scss +4 -2
- package/assets/styles/global/_table.scss +5 -0
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/en-us.yaml +1 -1
- package/assets/translations/zh-hans.yaml +25 -15
- package/chart/monitoring/index.vue +3 -1
- package/chart/monitoring/prometheus/index.vue +13 -10
- package/cloud-credential/aws.vue +2 -0
- package/components/ActionDropdown.vue +1 -1
- package/components/ActionDropdownShell.vue +71 -0
- package/components/ActionMenu.vue +2 -2
- package/components/ActionMenuShell.vue +3 -0
- package/components/AppModal.vue +84 -8
- package/components/AssignTo.vue +25 -11
- package/components/AsyncButton.vue +24 -7
- package/components/BannerGraphic.vue +1 -0
- package/components/ButtonDropdown.vue +26 -4
- package/components/ButtonGroup.vue +4 -0
- package/components/ButtonMultiAction.vue +1 -0
- package/components/CodeMirror.vue +19 -6
- package/components/CommunityLinks.vue +3 -3
- package/components/ConsumptionGauge.vue +24 -5
- package/components/CopyToClipboardText.vue +2 -1
- package/components/CruResource.vue +13 -7
- package/components/CruResourceFooter.vue +2 -2
- package/components/DashboardOptions.vue +29 -17
- package/components/DetailText.vue +5 -0
- package/components/DisableAuthProviderModal.vue +1 -0
- package/components/DotState.vue +84 -0
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +88 -16
- package/components/FixedBanner.vue +19 -12
- package/components/GlobalRoleBindings.vue +5 -1
- package/components/GrafanaDashboard.vue +4 -4
- package/components/GrowlManager.vue +4 -1
- package/components/HardwareResourceGauge.vue +39 -3
- package/components/InfoBox.vue +3 -3
- package/components/InputOrDisplay.vue +28 -2
- package/components/LabelValue.vue +20 -1
- package/components/LandingPagePreference.vue +5 -3
- package/components/LocaleSelector.vue +39 -93
- package/components/ModalManager.vue +55 -0
- package/components/ModalWithCard.vue +13 -3
- package/components/MoveModal.vue +1 -0
- package/components/PodSecurityAdmission.vue +1 -1
- package/components/PromptChangePassword.vue +1 -1
- package/components/PromptModal.vue +16 -3
- package/components/PromptRemove.vue +29 -9
- package/components/PromptRestore.vue +1 -0
- package/components/ResourceCancelModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +52 -17
- package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
- package/components/ResourceDetail/index.vue +54 -16
- package/components/ResourceList/Masthead.vue +26 -4
- package/components/ResourceList/index.vue +4 -3
- package/components/ResourceTable.vue +1 -0
- package/components/SideNav.vue +20 -15
- package/components/SlideInPanelManager.vue +126 -0
- package/components/SortableTable/THead.vue +10 -4
- package/components/SortableTable/actions.js +1 -1
- package/components/SortableTable/index.vue +542 -553
- package/components/SortableTable/selection.js +2 -13
- package/components/StatusBadge.vue +77 -0
- package/components/Tabbed/Tab.vue +3 -3
- package/components/Tabbed/index.vue +47 -29
- package/components/Wizard.vue +2 -2
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/AsyncButton.test.ts +2 -2
- package/components/__tests__/FixedBanner.test.ts +3 -3
- package/components/__tests__/ModalManager.spec.ts +176 -0
- package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
- package/components/auth/Principal.vue +10 -3
- package/components/auth/RoleDetailEdit.vue +1 -1
- package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
- package/components/form/ArrayList.vue +123 -85
- package/components/form/ArrayListGrouped.vue +10 -2
- package/components/form/ArrayListSelect.vue +1 -1
- package/components/form/Command.vue +6 -15
- package/components/form/EnvVars.vue +16 -8
- package/components/form/Footer.vue +10 -7
- package/components/form/HealthCheck.vue +3 -3
- package/components/form/HookOption.vue +11 -16
- package/components/form/InputWithSelect.vue +6 -5
- package/components/form/KeyValue.vue +39 -10
- package/components/form/LabeledSelect.vue +73 -77
- package/components/form/Labels.vue +6 -3
- package/components/form/LifecycleHooks.vue +3 -3
- package/components/form/MatchExpressions.vue +42 -17
- package/components/form/NameNsDescription.vue +163 -116
- package/components/form/Networking.vue +20 -12
- package/components/form/NodeAffinity.vue +31 -23
- package/components/form/NodeScheduling.vue +13 -3
- package/components/form/Password.vue +11 -5
- package/components/form/PodAffinity.vue +47 -48
- package/components/form/Probe.vue +68 -66
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +5 -7
- package/components/form/ResourceQuota/Project.vue +9 -5
- package/components/form/ResourceQuota/ProjectRow.vue +4 -6
- package/components/form/ResourceSelector.vue +7 -9
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +6 -3
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +12 -1
- package/components/form/SSHKnownHosts/index.vue +16 -2
- package/components/form/Security.vue +54 -56
- package/components/form/Select.vue +44 -7
- package/components/form/ShellInput.vue +5 -1
- package/components/form/SimpleSecretSelector.vue +29 -9
- package/components/form/Tolerations.vue +5 -1
- package/components/form/UnitInput.vue +10 -5
- 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__/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 +11 -0
- package/components/form/__tests__/Select.test.ts +37 -0
- package/components/form/__tests__/UnitInput.test.ts +4 -5
- package/components/formatter/BadgeStateFormatter.vue +8 -5
- package/components/formatter/InternalExternalIP.vue +2 -0
- package/components/formatter/LiveDate.vue +3 -3
- package/components/formatter/SecretData.vue +20 -7
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +18 -4
- package/components/nav/Header.vue +39 -13
- package/components/nav/Jump.vue +7 -0
- package/components/nav/NamespaceFilter.vue +21 -11
- package/components/nav/Pinned.vue +1 -1
- package/components/nav/TopLevelMenu.vue +5 -17
- package/components/nav/Type.vue +30 -33
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -40
- package/components/rancherResourceDetail/Masthead.vue +769 -0
- package/components/rancherResourceDetail/__tests__/Masthead.test.ts +65 -0
- package/components/rancherResourceDetail/index.vue +591 -0
- package/components/rancherResourceList/Masthead-btn.vue +225 -0
- package/components/rancherResourceList/Masthead.vue +375 -0
- package/components/rancherResourceList/ResourceLoadingIndicator.vue +140 -0
- package/components/rancherResourceList/index.vue +307 -0
- package/components/rancherResourceList/resource-list.config.js +7 -0
- package/components/rancherResourceTable.vue +783 -0
- package/components/rancherSortableTable/THead.vue +561 -0
- package/components/rancherSortableTable/actions.js +153 -0
- package/components/rancherSortableTable/advanced-filtering.js +272 -0
- package/components/rancherSortableTable/debug.js +117 -0
- package/components/rancherSortableTable/filtering.js +290 -0
- package/components/rancherSortableTable/grouping.js +48 -0
- package/components/rancherSortableTable/index.vue +2712 -0
- package/components/rancherSortableTable/paging.js +155 -0
- package/components/rancherSortableTable/selection.js +629 -0
- package/components/rancherSortableTable/sortable-config.ts +4 -0
- package/components/rancherSortableTable/sorting.js +129 -0
- package/components/templates/blank.vue +4 -1
- package/components/templates/default.vue +8 -0
- package/components/templates/home.vue +10 -1
- package/components/templates/plain.vue +10 -1
- package/composables/focusTrap.ts +11 -3
- package/composables/useRuntimeFlag.ts +29 -0
- package/config/private-label.js +15 -10
- package/config/router/routes.js +21 -13
- package/config/store.js +4 -0
- package/config/table-headers.js +3 -2
- package/config/uiplugins.js +5 -1
- package/core/plugin-routes.ts +5 -115
- package/core/plugins.js +1 -1
- package/core/types.ts +23 -2
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +84 -23
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +13 -3
- package/detail/provisioning.cattle.io.cluster.vue +72 -6
- package/dialog/AddCustomBadgeDialog.vue +1 -0
- package/dialog/DeactivateDriverDialog.vue +5 -4
- package/dialog/ForceMachineRemoveDialog.vue +6 -3
- package/dialog/GitRepoForceUpdateDialog.vue +1 -1
- package/dialog/ScalePoolDownDialog.vue +2 -2
- package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +16 -3
- package/edit/auth/__tests__/oidc.test.ts +162 -88
- 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/__tests__/config.test.ts +0 -14
- package/edit/auth/ldap/config.vue +0 -24
- package/edit/auth/ldap/index.vue +1 -1
- package/edit/auth/oidc.vue +39 -6
- package/edit/auth/saml.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +5 -2
- package/edit/cloudcredential.vue +24 -9
- package/edit/fleet.cattle.io.clustergroup.vue +5 -3
- package/edit/fleet.cattle.io.gitrepo.vue +2 -0
- package/edit/logging-flow/Match.vue +1 -1
- 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/monitoring.coreos.com.alertmanagerconfig/auth.vue +19 -19
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +31 -31
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +36 -12
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +6 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/auth.vue +29 -29
- package/edit/monitoring.coreos.com.receiver/types/email.vue +6 -6
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +5 -5
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +4 -4
- package/edit/namespace.vue +1 -2
- package/edit/networking.k8s.io.ingress/IngressClass.vue +7 -3
- package/edit/networking.k8s.io.ingress/RulePath.vue +1 -1
- 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 -10
- package/edit/provisioning.cattle.io.cluster/rke2.vue +31 -40
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +5 -2
- package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +6 -1
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +33 -2
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +3 -3
- package/edit/service.vue +0 -3
- package/edit/token.vue +32 -11
- package/edit/workload/Job.vue +6 -6
- package/edit/workload/__tests__/Job.test.ts +0 -1
- package/edit/workload/index.vue +1 -0
- package/edit/workload/mixins/workload.js +3 -3
- package/initialize/install-plugins.js +2 -1
- package/list/harvesterhci.io.management.cluster.vue +4 -1
- package/list/management.cattle.io.feature.vue +1 -0
- package/list/namespace.vue +3 -1
- package/list/provisioning.cattle.io.cluster.vue +20 -12
- package/list/workload.vue +7 -6
- package/machine-config/__tests__/vmwarevsphere.test.ts +48 -3
- package/machine-config/azure.vue +16 -4
- package/machine-config/vmwarevsphere.vue +16 -0
- package/mixins/resource-fetch.js +2 -1
- package/models/__tests__/logging.banzaicloud.io.flow.test.ts +88 -0
- package/models/__tests__/namespace.test.ts +25 -1
- package/models/cloudcredential.js +5 -0
- package/models/kontainerdriver.js +6 -3
- package/models/logging.banzaicloud.io.flow.js +2 -1
- package/models/management.cattle.io.node.js +3 -3
- package/models/management.cattle.io.setting.js +2 -1
- package/models/namespace.js +4 -5
- package/models/nodedriver.js +6 -3
- package/models/storage.k8s.io.storageclass.js +2 -2
- package/models/workload.js +4 -1
- package/package.json +1 -1
- package/pages/about.vue +16 -8
- package/pages/account/index.vue +80 -24
- package/pages/account/pri.vue +229 -0
- package/pages/auth/login.vue +195 -44
- package/pages/auth/logout.vue +4 -1
- package/pages/auth/setup.vue +144 -19
- package/pages/auth/verify.vue +13 -8
- package/pages/auth copy/login.vue +595 -0
- package/pages/auth copy/logout.vue +47 -0
- package/pages/auth copy/setup.vue +523 -0
- package/pages/auth copy/verify.vue +203 -0
- package/pages/c/_cluster/_product/namespaces.vue +5 -5
- 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/monitor/index.vue +2 -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/brand.vue +3 -3
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +8 -10
- package/pages/diagnostic.vue +59 -11
- package/pages/fail-whale.vue +14 -8
- package/pages/home.vue +24 -18
- package/pages/prefs.vue +9 -7
- package/pages/support/index.vue +4 -1
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/normalize.js +3 -1
- package/plugins/dashboard-store/resource-class.js +31 -29
- 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/promptRemove/management.cattle.io.fleetworkspace.vue +1 -1
- package/promptRemove/management.cattle.io.globalrole.vue +1 -1
- package/promptRemove/management.cattle.io.project.vue +2 -2
- package/promptRemove/management.cattle.io.roletemplate.vue +1 -1
- package/promptRemove/pod.vue +1 -1
- package/public/index.html +2 -1
- package/rancher-components/BadgeState/BadgeState.vue +5 -1
- package/rancher-components/Banner/Banner.vue +8 -2
- package/rancher-components/Card/Card.vue +3 -6
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +5 -2
- package/rancher-components/Form/Radio/RadioButton.vue +3 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +1 -5
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/RcDropdown/RcDropdownItem.vue +1 -2
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +7 -3
- package/rancher-components/RcDropdown/types.ts +1 -0
- package/scripts/clean +0 -0
- package/scripts/extension/bundle +20 -0
- package/scripts/extension/helm/charts/ui-plugin-server/templates/_helpers.tpl +2 -2
- 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/helm/scripts/package +0 -0
- package/scripts/extension/helm/scripts/patch +0 -0
- package/scripts/extension/helm/scripts/version +0 -0
- package/scripts/extension/helmpatch +44 -31
- package/scripts/extension/parse-tag-name +0 -0
- package/scripts/extension/publish +12 -12
- package/scripts/publish-shell.sh +18 -23
- package/scripts/serve-pkgs +0 -0
- package/scripts/sync-shell-deps +0 -0
- package/scripts/test-plugins-build.sh +4 -6
- package/scripts/typegen.sh +28 -46
- package/server/har-file.js +25 -3
- package/static/favicon.ico +0 -0
- package/static/favicon.png +0 -0
- package/static/loading-indicator.html +2 -2
- package/store/aws.js +9 -2
- package/store/features.js +2 -1
- package/store/i18n.js +3 -3
- package/store/modal.ts +71 -0
- package/store/slideInPanel.ts +47 -0
- package/store/type-map.js +9 -1
- package/types/cloud-shell/index.d.ts +11020 -0
- 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/shell/index.d.ts +118 -128
- package/types/vue-shim.d.ts +4 -1
- package/utils/__tests__/object.test.ts +38 -4
- package/utils/__tests__/string.test.ts +2 -2
- package/utils/auth.js +1 -0
- package/utils/banners.js +0 -45
- package/utils/cluster.js +35 -0
- package/utils/color.js +9 -8
- package/utils/error.js +61 -3
- package/utils/errorTranslate.json +450 -30
- package/utils/object.js +46 -6
- package/utils/router.js +22 -1
- package/utils/select.js +26 -3
- package/utils/string.js +9 -8
- package/utils/title.ts +1 -1
- package/utils/validators/machine-pool.ts +20 -0
- package/vue.config.js +7 -2
- package/components/formatter/ExtensionCache.vue +0 -74
- package/components/formatter/Port.vue +0 -24
- package/components/formatter/SecretType.vue +0 -41
- package/types/resources/fleet.d.ts +0 -57
- package/types/resources/pod-security-admission.ts +0 -36
- package/types/resources/settings.d.ts +0 -93
- package/types/resources/userPreferences.d.ts +0 -13
- package/types/vue-shim.d +0 -20
|
@@ -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: [
|
|
@@ -87,8 +88,17 @@ export default {
|
|
|
87
88
|
type: Boolean,
|
|
88
89
|
default: null
|
|
89
90
|
},
|
|
91
|
+
isLangSelect: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
isOpen: false,
|
|
99
|
+
generatedUid: `s-uid-${ generateRandomAlphaString(12) }`
|
|
100
|
+
};
|
|
90
101
|
},
|
|
91
|
-
|
|
92
102
|
methods: {
|
|
93
103
|
// resizeHandler = in mixin
|
|
94
104
|
getOptionLabel(option) {
|
|
@@ -187,14 +197,26 @@ export default {
|
|
|
187
197
|
return Math.random(100000);
|
|
188
198
|
}
|
|
189
199
|
},
|
|
200
|
+
|
|
190
201
|
report(e) {
|
|
191
202
|
alert(e);
|
|
192
203
|
},
|
|
204
|
+
|
|
193
205
|
handleDropdownOpen(args) {
|
|
194
206
|
// function that prevents the "opening dropdown on focus"
|
|
195
207
|
// default behaviour of v-select
|
|
196
208
|
return args.noDrop || args.disabled ? false : args.open;
|
|
197
|
-
}
|
|
209
|
+
},
|
|
210
|
+
onOpen() {
|
|
211
|
+
this.isOpen = true;
|
|
212
|
+
this.$emit('on-open');
|
|
213
|
+
this.resizeHandler();
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
onClose() {
|
|
217
|
+
this.isOpen = false;
|
|
218
|
+
this.$emit('on-close');
|
|
219
|
+
},
|
|
198
220
|
},
|
|
199
221
|
computed: {
|
|
200
222
|
requiredField() {
|
|
@@ -255,6 +277,10 @@ export default {
|
|
|
255
277
|
[$attrs.class]: $attrs.class
|
|
256
278
|
}"
|
|
257
279
|
:tabindex="disabled || isView ? -1 : 0"
|
|
280
|
+
role="combobox"
|
|
281
|
+
:aria-expanded="isOpen"
|
|
282
|
+
:aria-label="$attrs['aria-label'] || undefined"
|
|
283
|
+
:aria-describedby="$attrs['aria-describedby'] || undefined"
|
|
258
284
|
@click="focusSearch"
|
|
259
285
|
@keydown.enter="focusSearch"
|
|
260
286
|
@keydown.down.prevent="focusSearch"
|
|
@@ -282,15 +308,26 @@ export default {
|
|
|
282
308
|
:modelValue="value != null ? value : ''"
|
|
283
309
|
:dropdownShouldOpen="handleDropdownOpen"
|
|
284
310
|
:tabindex="-1"
|
|
285
|
-
role="
|
|
311
|
+
role="listitem"
|
|
312
|
+
:uid="generatedUid"
|
|
313
|
+
:aria-label="'-'"
|
|
286
314
|
@update:modelValue="$emit('update:value', $event)"
|
|
287
315
|
@search:blur="onBlur"
|
|
288
316
|
@search:focus="onFocus"
|
|
289
|
-
@open="
|
|
317
|
+
@open="onOpen"
|
|
318
|
+
@close="onClose"
|
|
290
319
|
@option:created="(e) => $emit('createdListItem', e)"
|
|
291
320
|
>
|
|
292
|
-
<template #
|
|
293
|
-
|
|
321
|
+
<template #no-options>
|
|
322
|
+
暂无数据
|
|
323
|
+
</template>
|
|
324
|
+
<template
|
|
325
|
+
#option="option"
|
|
326
|
+
>
|
|
327
|
+
<div
|
|
328
|
+
:lang="isLangSelect ? option.value : undefined"
|
|
329
|
+
@mousedown="(e) => onClickOption(option, e)"
|
|
330
|
+
>
|
|
294
331
|
{{ getOptionLabel(option.label) }}
|
|
295
332
|
</div>
|
|
296
333
|
</template>
|
|
@@ -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: {
|
|
@@ -24,13 +24,14 @@ import { _EDIT, _VIEW } from '@shell/config/query-params';
|
|
|
24
24
|
import { TYPES } from '@shell/models/secret';
|
|
25
25
|
import { LABEL_SELECT_KINDS } from '@shell/types/components/labeledSelect';
|
|
26
26
|
import { PaginationParamFilter } from '@shell/types/store/pagination.types';
|
|
27
|
+
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
|
|
27
28
|
|
|
28
29
|
const NONE = '__[[NONE]]__';
|
|
29
30
|
|
|
30
31
|
export default {
|
|
31
32
|
emits: ['updateSecretName', 'updateSecretKey'],
|
|
32
33
|
|
|
33
|
-
components: { LabeledSelect, ResourceLabeledSelect },
|
|
34
|
+
components: { LabeledSelect, ResourceLabeledSelect, LabeledInput },
|
|
34
35
|
|
|
35
36
|
props: {
|
|
36
37
|
test: { type: String, default: '' },
|
|
@@ -186,10 +187,18 @@ export default {
|
|
|
186
187
|
|
|
187
188
|
<template>
|
|
188
189
|
<div class="secret-selector show-key-selector">
|
|
189
|
-
<div class="input-container">
|
|
190
|
-
<
|
|
190
|
+
<div class="input-container row">
|
|
191
|
+
<div class="col span-6">
|
|
192
|
+
<LabeledInput
|
|
193
|
+
v-model:value="name"
|
|
194
|
+
:mode="mode"
|
|
195
|
+
:label="secretNameLabel"
|
|
196
|
+
@update:value="$emit('updateSecretName', $event)"
|
|
197
|
+
:placeholder="'请输入'+secretNameLabel"
|
|
198
|
+
/>
|
|
199
|
+
<!-- <ResourceLabeledSelect
|
|
191
200
|
v-model:value="name"
|
|
192
|
-
|
|
201
|
+
|
|
193
202
|
:disabled="!isView && disabled"
|
|
194
203
|
:loading="$fetchState.pending"
|
|
195
204
|
:label="secretNameLabel"
|
|
@@ -198,16 +207,27 @@ export default {
|
|
|
198
207
|
:paginated-resource-settings="paginateSecretsSetting"
|
|
199
208
|
:all-resources-settings="allSecretsSettings"
|
|
200
209
|
@selecting="updateSecretName"
|
|
201
|
-
/>
|
|
202
|
-
|
|
210
|
+
/> -->
|
|
211
|
+
</div>
|
|
212
|
+
<div class="col span-6">
|
|
213
|
+
<LabeledInput
|
|
214
|
+
v-model:value="key"
|
|
215
|
+
:disabled="isKeyDisabled"
|
|
216
|
+
:mode="mode"
|
|
217
|
+
:label="keyNameLabel"
|
|
218
|
+
@update:value="$emit('updateSecretKey', $event)"
|
|
219
|
+
/>
|
|
220
|
+
<!-- <LabeledSelect
|
|
203
221
|
v-model:value="key"
|
|
204
|
-
|
|
222
|
+
|
|
205
223
|
:disabled="isKeyDisabled"
|
|
206
224
|
:options="keys"
|
|
207
225
|
:label="keyNameLabel"
|
|
208
226
|
:mode="mode"
|
|
209
227
|
@selecting="updateSecretKey"
|
|
210
|
-
/>
|
|
228
|
+
/> -->
|
|
229
|
+
</div>
|
|
230
|
+
|
|
211
231
|
</div>
|
|
212
232
|
</div>
|
|
213
233
|
</template>
|
|
@@ -234,7 +254,7 @@ export default {
|
|
|
234
254
|
&.show-key-selector {
|
|
235
255
|
.input-container > * {
|
|
236
256
|
display: inline-block;
|
|
237
|
-
width: 50%;
|
|
257
|
+
/* width: 50%; */
|
|
238
258
|
|
|
239
259
|
&.labeled-select.focused {
|
|
240
260
|
z-index: 10;
|
|
@@ -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: {
|
|
@@ -206,7 +206,7 @@ export default {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
if (this.outputModifier) {
|
|
209
|
-
out = out === null ? null : `${ inputValue }${ this.unit }`;
|
|
209
|
+
out = out === null ? null : `${ parseInt(inputValue) }${ this.unit }`;
|
|
210
210
|
} else if ( this.outputAs === 'string' ) {
|
|
211
211
|
out = out === null ? '' : `${ inputValue }`;
|
|
212
212
|
} else if (out) {
|
|
@@ -235,13 +235,13 @@ export default {
|
|
|
235
235
|
:required="required"
|
|
236
236
|
:placeholder="placeholder"
|
|
237
237
|
:hide-arrows="hideArrows"
|
|
238
|
-
@
|
|
238
|
+
@update:value="update"
|
|
239
239
|
@blur="update($event.target.value)"
|
|
240
240
|
>
|
|
241
|
-
<template #
|
|
241
|
+
<template #suffixNew>
|
|
242
242
|
<div
|
|
243
243
|
v-if="displayUnit"
|
|
244
|
-
class="
|
|
244
|
+
class="addonNew"
|
|
245
245
|
:class="{'with-tooltip': tooltip || tooltipKey}"
|
|
246
246
|
>
|
|
247
247
|
{{ displayUnit }}
|
|
@@ -251,7 +251,12 @@ export default {
|
|
|
251
251
|
</template>
|
|
252
252
|
|
|
253
253
|
<style lang="scss" scoped>
|
|
254
|
-
.
|
|
254
|
+
.addonNew.with-tooltip {
|
|
255
255
|
padding-right: 42px;
|
|
256
256
|
}
|
|
257
|
+
.addonNew {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
margin-left: 10px;
|
|
261
|
+
}
|
|
257
262
|
</style>
|
|
@@ -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
|
|