mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-06-13 13:32:20 +00:00
feat: add exclusive VLAN field to storage network settings (#914)
Signed-off-by: Renuka Devi Rajendran <renuka.rajendran@suse.com>
This commit is contained in:
parent
b18aebbbd4
commit
44ef9195eb
@ -64,6 +64,9 @@ export default {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
parsedDefaultValue = JSON.parse(this.value.value);
|
parsedDefaultValue = JSON.parse(this.value.value);
|
||||||
|
if (typeof parsedDefaultValue.exclusiveVlan !== 'boolean') {
|
||||||
|
parsedDefaultValue.exclusiveVlan = false;
|
||||||
|
}
|
||||||
networkType = 'vlan' in parsedDefaultValue ? L2VLAN : UNTAGGED; // backend doesn't provide networkType, so we check if vlan is provided instead
|
networkType = 'vlan' in parsedDefaultValue ? L2VLAN : UNTAGGED; // backend doesn't provide networkType, so we check if vlan is provided instead
|
||||||
openVlan = true;
|
openVlan = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -72,7 +75,8 @@ export default {
|
|||||||
vlan: '',
|
vlan: '',
|
||||||
clusterNetwork: '',
|
clusterNetwork: '',
|
||||||
range: '',
|
range: '',
|
||||||
exclude: []
|
exclude: [],
|
||||||
|
exclusiveVlan: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const exclude = parsedDefaultValue?.exclude?.toString().split(',') || [];
|
const exclude = parsedDefaultValue?.exclude?.toString().split(',') || [];
|
||||||
@ -94,6 +98,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
showExclusiveVlan() {
|
||||||
|
return this.networkType === L2VLAN &&
|
||||||
|
Number(this.parsedDefaultValue.vlan) !== 1;
|
||||||
|
},
|
||||||
showVlan() {
|
showVlan() {
|
||||||
return this.networkType === L2VLAN;
|
return this.networkType === L2VLAN;
|
||||||
},
|
},
|
||||||
@ -132,6 +140,18 @@ export default {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
exclusiveVlanOptions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.t('generic.enabled'),
|
||||||
|
value: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.t('generic.disabled'),
|
||||||
|
value: false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@ -174,7 +194,8 @@ export default {
|
|||||||
vlan: '',
|
vlan: '',
|
||||||
clusterNetwork: '',
|
clusterNetwork: '',
|
||||||
range: '',
|
range: '',
|
||||||
exclude: []
|
exclude: [],
|
||||||
|
exclusiveVlan: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -280,7 +301,15 @@ export default {
|
|||||||
label-key="harvester.setting.storageNetwork.vlan"
|
label-key="harvester.setting.storageNetwork.vlan"
|
||||||
@update:value="inputVlan"
|
@update:value="inputVlan"
|
||||||
/>
|
/>
|
||||||
|
<LabeledSelect
|
||||||
|
v-if="showExclusiveVlan"
|
||||||
|
v-model:value="parsedDefaultValue.exclusiveVlan"
|
||||||
|
class="mb-20"
|
||||||
|
:options="exclusiveVlanOptions"
|
||||||
|
:mode="mode"
|
||||||
|
label-key="harvester.setting.storageNetwork.exclusiveVlan"
|
||||||
|
@update:value="update"
|
||||||
|
/>
|
||||||
<LabeledSelect
|
<LabeledSelect
|
||||||
v-model:value="parsedDefaultValue.clusterNetwork"
|
v-model:value="parsedDefaultValue.clusterNetwork"
|
||||||
label-key="harvester.setting.storageNetwork.clusterNetwork"
|
label-key="harvester.setting.storageNetwork.clusterNetwork"
|
||||||
|
|||||||
@ -1310,6 +1310,7 @@ harvester:
|
|||||||
invalid: '"Range" is invalid.'
|
invalid: '"Range" is invalid.'
|
||||||
clusterNetwork: Cluster Network
|
clusterNetwork: Cluster Network
|
||||||
vlan: VLAN ID
|
vlan: VLAN ID
|
||||||
|
exclusiveVlan: Exclusive VLAN
|
||||||
exclude:
|
exclude:
|
||||||
label: Exclude IPs
|
label: Exclude IPs
|
||||||
placeholder: CIDR format, e.g. 172.16.0.10/32
|
placeholder: CIDR format, e.g. 172.16.0.10/32
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user