mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
feat: allow user specify static IP when VM creation (#973)
* feat: allow suer give static IP for VM Signed-off-by: Andy Lee <andy.lee@suse.com> * feat: add feature flag Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
@@ -133,6 +133,10 @@ export default {
|
||||
}];
|
||||
|
||||
return this.isMasquerade ? masquerade : other;
|
||||
},
|
||||
|
||||
staticIPForVMEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('staticIPForVM');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -150,6 +154,7 @@ export default {
|
||||
isSingle(neu) {
|
||||
if (!neu) {
|
||||
this.value['macAddress'] = '';
|
||||
this.value['staticIp'] = '';
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
@@ -163,6 +168,7 @@ export default {
|
||||
if (neu === MANAGEMENT_NETWORK) {
|
||||
this.value.isPod = true;
|
||||
this.value.macAddress = '';
|
||||
this.value.staticIp = '';
|
||||
} else {
|
||||
this.value.isPod = false;
|
||||
}
|
||||
@@ -289,9 +295,30 @@ export default {
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div
|
||||
v-if="showAdvanced"
|
||||
class="row"
|
||||
>
|
||||
<div
|
||||
v-if="staticIPForVMEnabled"
|
||||
data-testid="input-hen-staticIp"
|
||||
class="col span-6"
|
||||
>
|
||||
<InputOrDisplay
|
||||
:name="t('harvester.fields.staticIp')"
|
||||
:value="value.staticIp"
|
||||
:mode="mode"
|
||||
>
|
||||
<LabeledInput
|
||||
v-model:value="value.staticIp"
|
||||
label-key="harvester.fields.staticIp"
|
||||
:mode="mode"
|
||||
:tooltip="t('harvester.virtualMachine.volume.staticIpTip', { nic_name: value.name || 'default' })"
|
||||
@update:value="update"
|
||||
/>
|
||||
</InputOrDisplay>
|
||||
</div>
|
||||
<div
|
||||
v-if="showAdvanced"
|
||||
data-testid="input-hen-macAddress"
|
||||
class="col span-6"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user