mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
fix: state not update when the TPM checkbox is toggled
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
parent
b92f22fa75
commit
6d5139a994
@ -1422,22 +1422,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setTPM(tpmEnabled) {
|
setTPM({ tpmEnabled = false, tpmPersistentStateEnabled = false } = {}) {
|
||||||
if (tpmEnabled) {
|
if (tpmEnabled) {
|
||||||
set(this.spec.template.spec.domain.devices, 'tpm', {});
|
set(this.spec.template.spec.domain.devices, 'tpm', tpmPersistentStateEnabled ? { persistent: true } : {});
|
||||||
} else {
|
} else {
|
||||||
delete this.spec.template.spec.domain.devices['tpm'];
|
delete this.spec.template.spec.domain.devices['tpm'];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setTPMPersistentStateEnabled(tpmPersistentStateEnabled) {
|
|
||||||
if (tpmPersistentStateEnabled) {
|
|
||||||
set(this.spec.template.spec.domain.devices, 'tpm', { persistent: true });
|
|
||||||
} else {
|
|
||||||
set(this.spec.template.spec.domain.devices, 'tpm', {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
deleteSSHFromUserData(ssh = []) {
|
deleteSSHFromUserData(ssh = []) {
|
||||||
const sshAuthorizedKeys = this.getSSHFromUserData(this.userScript);
|
const sshAuthorizedKeys = this.getSSHFromUserData(this.userScript);
|
||||||
|
|
||||||
@ -1568,11 +1560,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
tpmEnabled(val) {
|
tpmEnabled(val) {
|
||||||
this.setTPM(val);
|
this.setTPM({ tpmEnabled: val, tpmPersistentStateEnabled: this.tpmPersistentStateEnabled });
|
||||||
},
|
},
|
||||||
|
|
||||||
tpmPersistentStateEnabled(val) {
|
tpmPersistentStateEnabled(val) {
|
||||||
this.setTPMPersistentStateEnabled(val);
|
this.setTPM({ tpmEnabled: this.tpmEnabled, tpmPersistentStateEnabled: val });
|
||||||
},
|
},
|
||||||
|
|
||||||
installAgent: {
|
installAgent: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user