mirror of https://github.com/rancher/dashboard.git
fix volume type picker
This commit is contained in:
parent
79075dd324
commit
f5b0c99080
|
|
@ -65,29 +65,7 @@ export default {
|
||||||
return this.mode === _VIEW;
|
return this.mode === _VIEW;
|
||||||
},
|
},
|
||||||
|
|
||||||
opts() {
|
volumeTypeOpts() {
|
||||||
const hasComponent = require
|
|
||||||
.context('@/edit/workload/storage', false, /^.*\.vue$/)
|
|
||||||
.keys()
|
|
||||||
.map(path => path.replace(/(\.\/)|(.vue)/g, ''))
|
|
||||||
.filter(
|
|
||||||
file => file !== 'index' && file !== 'Mount' && file !== 'PVC'
|
|
||||||
);
|
|
||||||
|
|
||||||
const out = [
|
|
||||||
...hasComponent,
|
|
||||||
'csi',
|
|
||||||
'configMap',
|
|
||||||
'createPVC',
|
|
||||||
'persistentVolumeClaim',
|
|
||||||
];
|
|
||||||
|
|
||||||
out.sort();
|
|
||||||
|
|
||||||
return out;
|
|
||||||
},
|
|
||||||
|
|
||||||
opts2() {
|
|
||||||
const hasComponent = require
|
const hasComponent = require
|
||||||
.context('@/edit/workload/storage', false, /^.*\.vue$/)
|
.context('@/edit/workload/storage', false, /^.*\.vue$/)
|
||||||
.keys()
|
.keys()
|
||||||
|
|
@ -107,7 +85,7 @@ export default {
|
||||||
out.sort();
|
out.sort();
|
||||||
|
|
||||||
return out.map(opt => ({
|
return out.map(opt => ({
|
||||||
label: opt,
|
label: this.t(`workload.storage.subtypes.${ opt }`),
|
||||||
action: this.addVolume,
|
action: this.addVolume,
|
||||||
value: opt,
|
value: opt,
|
||||||
}));
|
}));
|
||||||
|
|
@ -255,9 +233,9 @@ export default {
|
||||||
<ButtonDropdown
|
<ButtonDropdown
|
||||||
v-if="!isView"
|
v-if="!isView"
|
||||||
:button-label="t('workload.storage.addVolume')"
|
:button-label="t('workload.storage.addVolume')"
|
||||||
:dropdown-options="opts"
|
:dropdown-options="volumeTypeOpts"
|
||||||
size="sm"
|
size="sm"
|
||||||
@click-action="addVolume"
|
@click-action="e=>addVolume(e.value)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ArrayListGrouped>
|
</ArrayListGrouped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue