From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 33AB11FF0E1 for ; Mon, 13 Jul 2026 13:42:40 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BE175213A2; Mon, 13 Jul 2026 13:42:39 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [RFC PATCH pve-manager 1/2] ui: iso selector: add 'reload' button Date: Mon, 13 Jul 2026 13:36:59 +0200 Message-ID: <20260713114205.2382258-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260713114205.2382258-1-d.csapak@proxmox.com> References: <20260713114205.2382258-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.396 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NRYCCI6O6I3SDH6T5ZGHWO4ZCZ2MX4HN X-Message-ID-Hash: NRYCCI6O6I3SDH6T5ZGHWO4ZCZ2MX4HN X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: so a user can manually reload the storage list as well as the file list. This sometimes comes up when e.g. creating a new guest and a user uploads a new ISO in a different tab. The new button is added in a new row beneath the file selector and shows the loading progress until the storage as well as the file selector are done loading. Signed-off-by: Dominik Csapak --- www/manager6/form/FileSelector.js | 12 ++++++++++++ www/manager6/form/IsoSelector.js | 27 +++++++++++++++++++++++++++ www/manager6/form/StorageSelector.js | 11 +++++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/www/manager6/form/FileSelector.js b/www/manager6/form/FileSelector.js index b8f6a8c2..af4e4be8 100644 --- a/www/manager6/form/FileSelector.js +++ b/www/manager6/form/FileSelector.js @@ -15,6 +15,18 @@ Ext.define('PVE.form.FileSelector', { }, }, + reload: function (finishCb) { + let me = this; + finishCb ??= Ext.emptyFn; + if (!me.storage || !me.nodename || me.isDisabled()) { + finishCb(); + return; + } + me.store.load(() => { + finishCb(); + }); + }, + setStorage: function (storage, nodename) { var me = this; diff --git a/www/manager6/form/IsoSelector.js b/www/manager6/form/IsoSelector.js index b2d94ed3..48c10427 100644 --- a/www/manager6/form/IsoSelector.js +++ b/www/manager6/form/IsoSelector.js @@ -110,5 +110,32 @@ Ext.define('PVE.form.IsoSelector', { }, }, }, + { + xtype: 'container', + layout: 'hbox', + items: [ + { xtype: 'box', flex: 1 }, // just a spacer + { + xtype: 'button', + reference: 'reloadBtn', + iconCls: 'fa fa-refresh', + text: gettext('Reload'), + handler: function () { + let me = this; + me.setDisabled(true); + me.setIconCls('fa fa-refresh fa-spin'); + let selector = me.up('pveIsoSelector'); + let storage = selector.lookup('storage'); + let fileSelector = selector.lookup('file'); + storage.reloadStorageList(() => { + fileSelector.reload(() => { + me.setDisabled(false); + me.setIconCls('fa fa-refresh'); + }); + }); + }, + }, + ], + }, ], }); diff --git a/www/manager6/form/StorageSelector.js b/www/manager6/form/StorageSelector.js index 0b5e10da..42961f72 100644 --- a/www/manager6/form/StorageSelector.js +++ b/www/manager6/form/StorageSelector.js @@ -68,9 +68,11 @@ Ext.define( ], }, - reloadStorageList: function () { + reloadStorageList: function (finishCb) { let me = this; + finishCb ??= Ext.emptyFn; + if (me.clusterView) { me.getStore().setProxy({ type: 'proxmox', @@ -97,6 +99,7 @@ Ext.define( me.getStore().setFilters(filters); } else { if (!me.nodename) { + finishCb(); return; } @@ -117,7 +120,11 @@ Ext.define( }); } - me.store.load(() => me.validate()); + me.store.load(() => { + let result = me.validate(); + finishCb(); + return result; + }); }, setTargetNode: function (targetNode) { -- 2.47.3