mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-04-28 20:57:41 +00:00
fix #4239: ui: show selected but non-existing vmids in backup edit
by adding records manually when using 'setValue' on a vmselector. It'll show up normally but have an 'unknown' nodename, and no type/status/etc. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
e440f8a46a
commit
7a5ca76aa1
@ -132,7 +132,22 @@ Ext.define('PVE.form.VMSelector', {
|
||||
let me = this;
|
||||
|
||||
let store = me.getStore();
|
||||
let selection = value.map(item => store.findRecord('vmid', item, 0, false, true, true)).filter(r => r);
|
||||
let notFound = [];
|
||||
let selection = value.map(item => {
|
||||
let found = store.findRecord('vmid', item, 0, false, true, true);
|
||||
if (!found) {
|
||||
notFound.push(item);
|
||||
}
|
||||
return found;
|
||||
}).filter(r => r);
|
||||
|
||||
for (const vmid of notFound) {
|
||||
let rec = store.add({
|
||||
vmid,
|
||||
node: 'unknown',
|
||||
});
|
||||
selection.push(rec[0]);
|
||||
}
|
||||
|
||||
let sm = me.getSelectionModel();
|
||||
if (selection.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user