mirror of https://github.com/rancher/dashboard.git
83 lines
2.2 KiB
Vue
83 lines
2.2 KiB
Vue
<script>
|
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
|
|
export default {
|
|
components: { LabeledInput, LabeledSelect },
|
|
props: {
|
|
value: {
|
|
type: Object,
|
|
default: () => ({})
|
|
},
|
|
mode: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
},
|
|
data() {
|
|
const mustBeOptions = [
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.anything'),
|
|
value: ''
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.directory'),
|
|
value: 'DirectoryOrCreate'
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.file'),
|
|
value: 'FileOrCreate'
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.existingDirectory'),
|
|
value: 'Directory'
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.existingFile'),
|
|
value: 'File'
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.existingSocket'),
|
|
value: 'Socket'
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.existingCharacter'),
|
|
value: 'CharDevice'
|
|
},
|
|
{
|
|
label: this.t('persistentVolume.hostPath.mustBe.existingBlock'),
|
|
value: 'BlockDevice'
|
|
},
|
|
];
|
|
|
|
this.value.spec['hostPath'] = this.value.spec.hostPath || {};
|
|
this.value.spec.hostPath['type'] = this.value.spec.hostPath.type || mustBeOptions[0].value;
|
|
|
|
return { mustBeOptions };
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div class="row mb-20">
|
|
<div class="col span-6">
|
|
<LabeledInput
|
|
v-model:value="value.spec.hostPath.path"
|
|
:mode="mode"
|
|
:label="t('persistentVolume.hostPath.pathOnTheNode.label')"
|
|
:placeholder="t('persistentVolume.hostPath.pathOnTheNode.placeholder')"
|
|
/>
|
|
</div>
|
|
<div class="col span-6">
|
|
<LabeledSelect
|
|
v-model:value="value.spec.hostPath.type"
|
|
:mode="mode"
|
|
:label="t('persistentVolume.hostPath.mustBe.label')"
|
|
:options="mustBeOptions"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|