From 4f4b8ed2e6590c464409cc7df49a0a22a2fa090f Mon Sep 17 00:00:00 2001 From: lvuch Date: Tue, 17 Nov 2020 10:44:43 -0700 Subject: [PATCH 01/13] wip modal delete --- components/PromptRemove.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/PromptRemove.vue b/components/PromptRemove.vue index db7a4ac9fb..7ab742dc48 100644 --- a/components/PromptRemove.vue +++ b/components/PromptRemove.vue @@ -196,7 +196,7 @@ export default { height="auto" styles="background-color: var(--nav-bg); border-radius: var(--border-radius); max-height: 100vh;" > - +

Are you sure?

@@ -223,7 +223,7 @@ export default { Delete -
+ From 21338302b18b8c41bdf49fa20d08679d3e7e3458 Mon Sep 17 00:00:00 2001 From: Cody Jackson Date: Wed, 18 Nov 2020 14:17:44 -0700 Subject: [PATCH 02/13] Hiding Annotations/Labels tab when in view. rancher/dashboard#1862 --- edit/networking.k8s.io.ingress/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/edit/networking.k8s.io.ingress/index.vue b/edit/networking.k8s.io.ingress/index.vue index 211f656e57..ccce111ac9 100644 --- a/edit/networking.k8s.io.ingress/index.vue +++ b/edit/networking.k8s.io.ingress/index.vue @@ -129,6 +129,7 @@ export default { Date: Thu, 19 Nov 2020 16:14:28 +0800 Subject: [PATCH 03/13] Update RBAC and storage chinese translation --- assets/translations/en-us.yaml | 4 ++++ assets/translations/zh-hans.yaml | 33 +++++++++++++++++++++++++++++++- components/form/ArrayList.vue | 13 ++++++++----- components/form/KeyValue.vue | 12 ++++++++---- edit/secret.vue | 4 ++-- store/type-map.js | 14 +++++++++----- 6 files changed, 63 insertions(+), 17 deletions(-) diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 6043761732..04066e9bd5 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -2046,3 +2046,7 @@ workloadPorts: podAffinity: addLabel: Add Pod Selector + +keyValue: + keyPlaceholder: e.g. foo + valuePlaceholder: e.g. bar diff --git a/assets/translations/zh-hans.yaml b/assets/translations/zh-hans.yaml index d426ab1043..c33a15da0d 100644 --- a/assets/translations/zh-hans.yaml +++ b/assets/translations/zh-hans.yaml @@ -962,7 +962,7 @@ servicePorts: label: 协议 target: label: 目标端口 - placeholder: 例如:80 or http + placeholder: 例如:80 或 http serviceTypes: clusterip: 集群IP地址 @@ -1130,6 +1130,23 @@ tableHeaders: value: 值 version: 版本号 weight: 权重 ## doublecheck,这里的权重有什么特殊意义吗? + Capacity: 容量 + 'Access Modes': 访问模式 + 'Reclaim Policy': 重声明策略 + Status: 状态 + Claim: 声明 + StorageClass: 存储类 + Reason: 原因 + VolumeMode: 存储卷模式 + Targets: 目标 + MinPods: 最小Pod数量 + MaxPods: 最大Pod数量 + Replicas: 副本数 + Provisioner: 提供商 + ReclaimPolicy: 重声明策略 + Role: 角色 + Users: 用户 + Groups: 用户组 validation: arrayLength: @@ -1659,6 +1676,16 @@ typeLabel: persistentvolume: 持久卷 service: 服务 node: 节点 + autoscaling.horizontalpodautoscaler: Pod水平自动伸缩 + networking.k8s.io.ingress: Ingress + networking.k8s.io.networkpolicy: 网络策略 + persistentvolumeclaim: 持久卷声明 + storage.k8s.io.storageclass: 存储类 + secret: 密钥 + rbac.authorization.k8s.io.clusterrolebinding: 集群角色绑定 + rbac.authorization.k8s.io.clusterrole: 集群角色 + rbac.authorization.k8s.io.rolebinding: 角色绑定 + rbac.authorization.k8s.io.role: 角色 action: download: 下载YAML @@ -1684,3 +1711,7 @@ workloadPorts: podAffinity: addLabel: 添加 Pod Selector + +keyValue: + keyPlaceholder: '例如: foo' + valuePlaceholder: '例如: bar' diff --git a/components/form/ArrayList.vue b/components/form/ArrayList.vue index 104d0fc86c..ecd39c0373 100644 --- a/components/form/ArrayList.vue +++ b/components/form/ArrayList.vue @@ -72,8 +72,10 @@ export default { }, addLabel: { - type: String, - default: 'Add', + type: String, + default() { + return this.$store.getters['i18n/t']('generic.add'); + }, }, addIcon: { type: String, @@ -85,8 +87,10 @@ export default { }, removeLabel: { - type: String, - default: '', + type: String, + default() { + return this.$store.getters['i18n/t']('generic.remove'); + }, }, removeIcon: { type: String, @@ -295,7 +299,6 @@ export default {
diff --git a/components/form/KeyValue.vue b/components/form/KeyValue.vue index e2e9070943..0d31e3c888 100644 --- a/components/form/KeyValue.vue +++ b/components/form/KeyValue.vue @@ -74,8 +74,10 @@ export default { }, }, keyPlaceholder: { - type: String, - default: 'e.g. foo' + type: String, + default() { + return this.$store.getters['i18n/t']('keyValue.valuePlaceholder'); + }, }, separatorLabel: { @@ -95,8 +97,10 @@ export default { }, }, valuePlaceholder: { - type: String, - default: 'e.g. bar' + type: String, + default() { + return this.$store.getters['i18n/t']('keyValue.valuePlaceholder'); + }, }, valueCanBeEmpty: { type: Boolean, diff --git a/edit/secret.vue b/edit/secret.vue index f0a1668a89..741b17f0ee 100644 --- a/edit/secret.vue +++ b/edit/secret.vue @@ -262,7 +262,7 @@ export default {
- + diff --git a/models/cis.cattle.io.clusterscan.js b/models/cis.cattle.io.clusterscan.js index 8c25c87172..516324298b 100644 --- a/models/cis.cattle.io.clusterscan.js +++ b/models/cis.cattle.io.clusterscan.js @@ -1,5 +1,6 @@ import { CIS } from '@/config/types'; import { downloadFile } from '@/utils/download'; +import { set } from '@/utils/object'; export default { _availableActions() { @@ -28,6 +29,16 @@ export default { return out; }, + applyDefaults() { + return () => { + const spec = this.spec || {}; + + spec.scanProfileName = null; + spec.scanAlertRule = {}; + set(this, 'spec', spec); + }; + }, + hasReport: false, getReport() { @@ -56,4 +67,5 @@ export default { } }; }, + }; diff --git a/models/cis.cattle.io.clusterscanprofile.js b/models/cis.cattle.io.clusterscanprofile.js new file mode 100644 index 0000000000..456837cb8f --- /dev/null +++ b/models/cis.cattle.io.clusterscanprofile.js @@ -0,0 +1,8 @@ + +export default { + warnDeletionMessage() { + return (toRemove = []) => { + return this.$rootGetters['i18n/t']('cis.deleteProfileWarning', { count: toRemove.length }); + }; + } +}; From 79f16872f8aa819a146afbfe777f2ac6bc179fc2 Mon Sep 17 00:00:00 2001 From: Nancy Butler <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Thu, 19 Nov 2020 17:54:03 -0700 Subject: [PATCH 07/13] alerting and scheduling inputs in scan create --- assets/translations/en-us.yaml | 6 +++ edit/cis.cattle.io.clusterscan.vue | 71 +++++++++++++++++++++++++----- 2 files changed, 65 insertions(+), 12 deletions(-) diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 6b9f006b2f..fa4f0711c4 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -327,9 +327,14 @@ chartHeading: cis: addTest: Add Test ID + alertNeeded: To receive alerts, please ensure Rancher's Monitoring and Alerting app is installed and the Receivers and Routes are configured to send out alerts. + alertNotFound: "It looks like alerting isn't configured." alertOnComplete: Alert on scan completion alertOnFailure: Alert on scan failure benchmarkVersion: Benchmark Version + cronSchedule: + label: Schedule + placeholder: "e.g. 0 * * * *" deleteProfileWarning: |- {count, plural, =1 { Any scheduled scans using this profile will no longer work. } @@ -337,6 +342,7 @@ cis: } noProfiles: There are no valid ClusterScanProfiles for this cluster type to select. profile: Profile + retention: Retention testID: Test ID testsToSkip: Tests to Skip scan: diff --git a/edit/cis.cattle.io.clusterscan.vue b/edit/cis.cattle.io.clusterscan.vue index 5e66cbe318..21de68130d 100644 --- a/edit/cis.cattle.io.clusterscan.vue +++ b/edit/cis.cattle.io.clusterscan.vue @@ -1,18 +1,22 @@ + + + diff --git a/components/ResourceList/Masthead.vue b/components/ResourceList/Masthead.vue index edd73f8e4d..a1743adee2 100644 --- a/components/ResourceList/Masthead.vue +++ b/components/ResourceList/Masthead.vue @@ -1,31 +1,30 @@ @@ -62,64 +97,26 @@ export default { {{ typeDisplay }}
- - - - + {{ t('resourceList.head.create') }} + + + {{ t('resourceList.head.createFromYaml') }} +
+ + diff --git a/components/form/Command.vue b/components/form/Command.vue index 0e5a8d35a6..d91cafd4a2 100644 --- a/components/form/Command.vue +++ b/components/form/Command.vue @@ -12,7 +12,7 @@ export default { ShellInput, LabeledSelect, Checkbox, - EnvVars + EnvVars, }, props: { @@ -21,30 +21,40 @@ export default { required: true, }, configMaps: { - type: Array, - default: () => [] - + type: Array, + default: () => [], }, secrets: { - type: Array, - default: () => [] + type: Array, + default: () => [], }, // container spec value: { type: Object, default: () => { return {}; - } - } + }, + }, }, data() { const { - command, args, workingDir, stdin = false, stdinOnce = false, tty = false + command, + args, + workingDir, + stdin = false, + stdinOnce = false, + tty = false, } = this.value; return { - command, args, workingDir, stdin, stdinOnce, tty + args, + command, + commandOptions: ['No', 'Once', 'Yes'], + stdin, + stdinOnce, + tty, + workingDir, }; }, @@ -78,8 +88,8 @@ export default { break; } this.update(); - } - } + }, + }, }, methods: { @@ -93,10 +103,10 @@ export default { args: this.args, workingDir: this.workingDir, tty: this.tty, - }) + }), }; - this.$emit('input', out ); + this.$emit('input', out); }, }, }; @@ -136,18 +146,33 @@ export default { />
-
+
- +
- +

{{ t('workload.container.titles.env') }}

- + diff --git a/components/form/EnvVars.vue b/components/form/EnvVars.vue index a391f5ca6f..e1ad6282b4 100644 --- a/components/form/EnvVars.vue +++ b/components/form/EnvVars.vue @@ -112,8 +112,16 @@ export default { - diff --git a/components/form/KeyValue.vue b/components/form/KeyValue.vue index e2e9070943..62e2cc8653 100644 --- a/components/form/KeyValue.vue +++ b/components/form/KeyValue.vue @@ -11,7 +11,6 @@ import ClickExpand from '@/components/formatter/ClickExpand'; import { get } from '@/utils/object'; import CodeMirror from '@/components/CodeMirror'; import { mapGetters } from 'vuex'; -import ButtonDropdown from '@/components/ButtonDropdown'; import FileSelector from '@/components/form/FileSelector'; import { HIDE_SENSITIVE } from '@/store/prefs'; @@ -22,7 +21,6 @@ export default { TextAreaAutoGrow, ClickExpand, CodeMirror, - ButtonDropdown, FileSelector }, @@ -524,21 +522,10 @@ export default { diff --git a/components/form/LabeledSelect.vue b/components/form/LabeledSelect.vue index 3241c8fd06..2979c627fa 100644 --- a/components/form/LabeledSelect.vue +++ b/components/form/LabeledSelect.vue @@ -4,10 +4,11 @@ import LabeledFormElement from '@/mixins/labeled-form-element'; import { findBy } from '@/utils/array'; import { get } from '@/utils/object'; import LabeledTooltip from '@/components/form/LabeledTooltip'; +import VueSelectOverrides from '@/mixins/vue-select-overrides'; export default { components: { LabeledTooltip }, - mixins: [LabeledFormElement], + mixins: [LabeledFormElement, VueSelectOverrides], props: { value: { @@ -24,15 +25,15 @@ export default { }, disabled: { type: Boolean, - default: false + default: false, }, optionKey: { type: String, - default: null + default: null, }, optionLabel: { type: String, - default: 'label' + default: 'label', }, placement: { type: String, @@ -40,30 +41,34 @@ export default { }, tooltip: { type: String, - default: null + default: null, }, hoverTooltip: { type: Boolean, - default: false + default: false, }, localizedLabel: { type: Boolean, - default: false + default: false, + }, + searchable: { + default: false, + type: Boolean, }, status: { - type: String, - default: null + type: String, + default: null, }, reduce: { - type: Function, + type: Function, default: (e) => { - if ( e && typeof e === 'object' && e.value !== undefined ) { + if (e && typeof e === 'object' && e.value !== undefined) { return e.value; } return e; - } - } + }, + }, }, data() { @@ -74,15 +79,15 @@ export default { currentLabel() { let entry; - if ( this.grouped ) { - for ( let i = 0 ; i < this.options.length && !entry ; i++ ) { + if (this.grouped) { + for (let i = 0; i < this.options.length && !entry; i++) { entry = findBy(this.options[i].items || [], 'value', this.value); } } else { entry = findBy(this.options || [], 'value', this.value); } - if ( entry ) { + if (entry) { return entry.label; } @@ -91,6 +96,11 @@ export default { }, methods: { + focusSearch() { + this.$nextTick(() => { + this.$refs.input.searchEl.focus(); + }); + }, onFocus() { this.selectedVisibility = 'hidden'; this.onFocusLabeled(); @@ -138,7 +148,7 @@ export default { modifiers: [ { name: 'offset', - options: { offset: [0, -1] } + options: { offset: [0, 2] }, }, { name: 'toggleClass', @@ -147,7 +157,8 @@ export default { fn({ state }) { component.$el.setAttribute('x-placement', state.placement); }, - }] + }, + ], }); /** @@ -163,26 +174,42 @@ export default { input.open = true; } }, - get + get, }, }; - diff --git a/components/form/Probe.vue b/components/form/Probe.vue index 0266c698cc..e514c3ebe1 100644 --- a/components/form/Probe.vue +++ b/components/form/Probe.vue @@ -156,9 +156,9 @@ export default { v-if="!isView || kind!=='none'" v-model="kind" :mode="mode" - :label="t('generic.type')" + :label="t('probe.type.label')" :options="kindOptions" - placeholder="Select a check type" + :placeholder="t('probe.type.placeholder')" />
@@ -170,8 +170,8 @@ export default { min="1" max="65535" :mode="mode" - :label="t('workload.container.healthCheck.httpGet.port')" - placeholder="e.g. 80" + :label="t('probe.httpGet.port.label')" + :placeholder="t('probe.httpGet.port.placeholder')" />
@@ -179,8 +179,8 @@ export default {
@@ -191,8 +191,8 @@ export default { min="1" max="65535" :mode="mode" - :label="t('workload.container.healthCheck.httpGet.port')" - placeholder="e.g. 25" + :label="t('probe.httpGet.port.label')" + :placeholder="t('probe.httpGet.port.placeholderDuex')" />
@@ -201,8 +201,8 @@ export default {
@@ -219,30 +219,30 @@ export default {
@@ -256,8 +256,8 @@ export default { type="number" min="1" :mode="mode" - :label="t('workload.container.healthCheck.successThreshold')" - placeholder="Default: 1" + :label="t('probe.successThreshold.label')" + :placeholder="t('probe.successThreshold.placeholder')" />
@@ -266,8 +266,8 @@ export default { type="number" min="1" :mode="mode" - :label="t('workload.container.healthCheck.failureThreshold')" - placeholder="Default: 3" + :label="t('probe.failureThreshold.label')" + :placeholder="t('probe.failureThreshold.label')" />
@@ -284,14 +284,14 @@ export default { :pad-left="false" :as-map="false" :read-allowed="false" - :title="t('workload.container.healthCheck.httpGet.headers')" + :title="t('probe.httpGet.headers.label')" :key-label="t('generic.name')" :value-label="t('generic.value')" :add-label="t('generic.add')" > @@ -308,5 +308,8 @@ export default { .title { margin-bottom: 10px; } + ::v-deep .labeled-select { + height: auto; + } diff --git a/components/form/RuleSelector.vue b/components/form/RuleSelector.vue index e0b660c692..a8c52bc359 100644 --- a/components/form/RuleSelector.vue +++ b/components/form/RuleSelector.vue @@ -2,7 +2,7 @@ import { _VIEW } from '@/config/query-params'; import ArrayList from '@/components/form/ArrayList'; import LabeledInput from '@/components/form/LabeledInput'; -import LabeledSelect from '@/components/form/LabeledSelect'; +import Select from '@/components/form/Select'; const OPERATOR_VALUES = { IS_SET: 'Exists', @@ -15,7 +15,7 @@ export default { components: { ArrayList, LabeledInput, - LabeledSelect + Select }, props: { @@ -132,7 +132,7 @@ export default {
- - diff --git a/components/form/ValueFromResource.vue b/components/form/ValueFromResource.vue index 3cf5d070b6..eee1fe9755 100644 --- a/components/form/ValueFromResource.vue +++ b/components/form/ValueFromResource.vue @@ -258,6 +258,8 @@ export default { :mode="mode" :multiple="false" :options="typeOpts" + option-label="label" + :searchable="false" :reduce="e=>e.value" :label="t('workload.container.command.fromResource.type')" @input="updateRow" diff --git a/components/form/WorkloadPorts.vue b/components/form/WorkloadPorts.vue index 2cf59b1a12..1b7bc24326 100644 --- a/components/form/WorkloadPorts.vue +++ b/components/form/WorkloadPorts.vue @@ -36,7 +36,11 @@ export default { // show host port column if existing port data has any host ports defined const showHostPorts = !!rows.filter(row => !!row.hostPort).length; - return { rows, showHostPorts }; + return { + rows, + showHostPorts, + workloadPortOptions: ['TCP', 'UDP'] + }; }, computed: { @@ -188,9 +192,8 @@ export default { diff --git a/components/nav/ClusterSwitcher.vue b/components/nav/ClusterSwitcher.vue index edc52e1b1e..9803472a65 100644 --- a/components/nav/ClusterSwitcher.vue +++ b/components/nav/ClusterSwitcher.vue @@ -3,17 +3,23 @@ import { MANAGEMENT } from '@/config/types'; import { sortBy } from '@/utils/sort'; import { findBy } from '@/utils/array'; import { mapState } from 'vuex'; +import Select from '@/components/form/Select'; export default { - computed: { + components: { Select }, + computed: { ...mapState(['isMultiCluster']), value: { get() { const options = this.options; - const existing = findBy(options, 'id', this.$store.getters['clusterId']); + const existing = findBy( + options, + 'id', + this.$store.getters['clusterId'] + ); - if ( existing ) { + if (existing) { return existing; } @@ -22,7 +28,7 @@ export default { set(neu) { this.$router.push({ name: 'c-cluster', params: { cluster: neu.id } }); - } + }, }, options() { @@ -43,22 +49,20 @@ export default { methods: { focus() { this.$refs.select.$refs.search.focus(); - } + }, }, }; - diff --git a/components/nav/WindowManager/ContainerLogs.vue b/components/nav/WindowManager/ContainerLogs.vue index a41b0b0320..463e80ec5f 100644 --- a/components/nav/WindowManager/ContainerLogs.vue +++ b/components/nav/WindowManager/ContainerLogs.vue @@ -446,7 +446,7 @@ export default { v-if="containerChoices.length > 0" v-model="container" :disabled="containerChoices.length === 1" - class="containerPicker auto-width" + class="containerPicker" :options="containerChoices" :clearable="false" placement="top" @@ -560,11 +560,11 @@ export default { } } - .containerPicker ::v-deep .vs__search, - .range ::v-deep .vs__search { - width: 0; - padding: 0; - margin: 0; - opacity: 0; + .containerPicker { + ::v-deep &.unlabeled-select { + display: inline-block; + min-width: 200px; + } } + diff --git a/components/nav/WindowManager/ContainerShell.vue b/components/nav/WindowManager/ContainerShell.vue index ebdf93d4ae..406893aa53 100644 --- a/components/nav/WindowManager/ContainerShell.vue +++ b/components/nav/WindowManager/ContainerShell.vue @@ -268,8 +268,8 @@ export default { :disabled="containerChoices.length === 1" class="containerPicker auto-width" :options="containerChoices" - :searchable="false" :clearable="false" + placement="top" @input="switchTo($event)" > diff --git a/mixins/labeled-form-element.js b/mixins/labeled-form-element.js index fd88058821..414b0aff7f 100644 --- a/mixins/labeled-form-element.js +++ b/mixins/labeled-form-element.js @@ -54,10 +54,23 @@ export default { notView() { return (this.mode !== _VIEW); }, + + isSearchable() { + const { searchable } = this; + const options = ( this.options || [] ); + + if (searchable || options.length >= 10) { + return true; + } + + return false; + }, }, methods: { onFocus() { + this.$emit('on-focus'); + return this.onFocusLabeled(); }, @@ -67,6 +80,8 @@ export default { }, onBlur() { + this.$emit('on-blur'); + return this.onBlurLabeled(); }, diff --git a/mixins/vue-select-overrides.js b/mixins/vue-select-overrides.js new file mode 100644 index 0000000000..5938a6eb43 --- /dev/null +++ b/mixins/vue-select-overrides.js @@ -0,0 +1,37 @@ +import $ from 'jquery'; + +export default { + methods: { + mappedKeys(map, vm) { + // Defaults found at - https://github.com/sagalbot/vue-select/blob/master/src/components/Select.vue#L947 + const out = { ...map }; + + // tab + (out[9] = (e) => { + e.preventDefault(); + + const optsLen = vm.filteredOptions.length; + const typeAheadPointer = vm.typeAheadPointer; + + if (e.shiftKey) { + if (typeAheadPointer === 0) { + vm.$refs.search.focus(); + + return vm.onEscape(); + } + + return vm.typeAheadUp(); + } + if (typeAheadPointer + 1 === optsLen) { + $(vm.$el).next().focus(); + + return vm.onEscape(); + } + + return vm.typeAheadDown(); + }); + + return out; + }, + } +}; diff --git a/pages/c/_cluster/apps/install.vue b/pages/c/_cluster/apps/install.vue index 79096d1aaf..999b3168c0 100644 --- a/pages/c/_cluster/apps/install.vue +++ b/pages/c/_cluster/apps/install.vue @@ -803,7 +803,7 @@ export default {
Date: Thu, 19 Nov 2020 10:02:18 -0700 Subject: [PATCH 11/13] PR review removing unneeded code --- assets/styles/app.scss | 1 - components/ResourceList/Masthead.vue | 35 ----------------------- components/form/Select.vue | 1 - components/nav/NamespaceFilter.vue | 15 ---------- components/nav/ProductSwitcher.vue | 3 -- edit/rio.cattle.io.router/Destination.vue | 2 +- 6 files changed, 1 insertion(+), 56 deletions(-) diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 70468145b7..85a1e2f4b5 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -26,7 +26,6 @@ @import "./global/table"; @import "./global/select"; -/* @import 'vue-select/src/scss/vue-select.scss'; */ @import "./vendor/vue-select"; @import "./vendor/vue-js-modal"; @import '@/node_modules/xterm/css/xterm.css'; diff --git a/components/ResourceList/Masthead.vue b/components/ResourceList/Masthead.vue index a1743adee2..4bd9fc7534 100644 --- a/components/ResourceList/Masthead.vue +++ b/components/ResourceList/Masthead.vue @@ -52,41 +52,6 @@ export default { return this.resource; }, }, - - methods: { - createButtonOptions() { - const { isCreatable, isYamlCreatable } = this; - - if (isCreatable || isYamlCreatable) { - if (isCreatable) { - return this.t('resourceList.head.create'); - } else if (!isCreatable && isYamlCreatable) { - return this.t('resourceList.head.createFromYaml'); - } else { - return this.t('resourceList.head.create'); - } - } - }, - dropdownOptions() { - return [ - { - label: this.t('resourceList.head.createResource', { resourceName: this.resourceName }), - to: this.createLocation, - disabled: !this.isCreatable, - }, - { - label: this.t('resourceList.head.createFromYaml'), - to: this.yamlCreateLocation, - disabled: !this.isYamlCreatable, - }, - ]; - }, - menuAction(option) { - if (!option?.disabled) { - this.$router.push(option.to); - } - }, - }, }; diff --git a/components/form/Select.vue b/components/form/Select.vue index cfa90b051a..5019ea7a0e 100644 --- a/components/form/Select.vue +++ b/components/form/Select.vue @@ -1,7 +1,6 @@