mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
Reset network / user script when choosing ostype from windows to linux (#292)
* reset network / user script when choosing windows Signed-off-by: Andy Lee <andy.lee@suse.com> * change OS type from Windows init user and network data Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
0cd5651c38
commit
63c4810b99
@ -20,6 +20,10 @@ export default {
|
||||
type: String,
|
||||
default: 'create'
|
||||
},
|
||||
osType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
@ -64,6 +68,12 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
osType(neu) {
|
||||
if (neu === 'windows') {
|
||||
this.id = '';
|
||||
}
|
||||
},
|
||||
|
||||
value(neu) {
|
||||
this.yamlScript = neu;
|
||||
},
|
||||
|
||||
@ -28,6 +28,10 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
osType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
userScript: {
|
||||
type: String,
|
||||
default: ''
|
||||
@ -203,6 +207,7 @@ export default {
|
||||
<DataTemplate
|
||||
ref="userTemplate"
|
||||
:value="userScript"
|
||||
:os-type="osType"
|
||||
type="user"
|
||||
:view-code="viewCode"
|
||||
:mode="mode"
|
||||
@ -219,6 +224,7 @@ export default {
|
||||
ref="networkTemplate"
|
||||
:value="networkScript"
|
||||
type="network"
|
||||
:os-type="osType"
|
||||
:view-code="viewCode"
|
||||
:mode="mode"
|
||||
:config-id="configNetworkId"
|
||||
|
||||
@ -862,6 +862,7 @@ export default {
|
||||
ref="yamlEditor"
|
||||
:user-script="userScript"
|
||||
:mode="mode"
|
||||
:os-type="osType"
|
||||
:view-code="isWindows"
|
||||
:namespace="value.metadata.namespace"
|
||||
:network-script="networkScript"
|
||||
|
||||
@ -1533,6 +1533,7 @@ export default {
|
||||
if (val) {
|
||||
this['sshKey'] = [];
|
||||
this['userScript'] = undefined;
|
||||
this['networkScript'] = undefined;
|
||||
this['installAgent'] = false;
|
||||
}
|
||||
},
|
||||
@ -1590,8 +1591,9 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
osType(neu) {
|
||||
const out = this.getUserData({ installAgent: this.installAgent, osType: neu });
|
||||
osType(neu, old) {
|
||||
this.installAgent = old === 'windows' ? true : this.installAgent;
|
||||
const out = old === 'windows' ? this.getInitUserData({ osType: neu }) : this.getUserData({ installAgent: this.installAgent, osType: neu });
|
||||
|
||||
this['userScript'] = out;
|
||||
this.refreshYamlEditor();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user