mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
feat: add warning message when disabling a device that have not been detached in the backend (#675)
* feat: add wanring message when disabling a device that haven not been detached in the backend Signed-off-by: Jack Yu <jack.yu@suse.com> * fix: remove unused en-us key Signed-off-by: Jack Yu <jack.yu@suse.com> --------- Signed-off-by: Jack Yu <jack.yu@suse.com>
This commit is contained in:
@@ -48,6 +48,13 @@ export default {
|
||||
this[key] = res[key];
|
||||
}
|
||||
|
||||
const vmDevices = this.value?.domain?.devices?.hostDevices || [];
|
||||
const vmDeviceNames = vmDevices.map(({ name }) => name);
|
||||
|
||||
this.devices.forEach((row) => {
|
||||
row.allowDisable = !vmDeviceNames.includes(row.metadata.name);
|
||||
});
|
||||
|
||||
this.selectedDevices = (this.value?.domain?.devices?.hostDevices || [])
|
||||
.map(({ name }) => name)
|
||||
.filter((name) => this.enabledDevices.find((device) => device?.metadata?.name === name));
|
||||
|
||||
Reference in New Issue
Block a user