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