From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager v4 04/12] ui: revert button: add parentXType and reloadCallback
Date: Mon, 31 Aug 2026 14:27:39 +0200 [thread overview]
Message-ID: <20260831122953.2980232-5-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260831122953.2980232-1-d.csapak@proxmox.com>
makes it useful in more situations when the direct parent is not a
PendingObjectGrid but e.g. a pvePendingGrid.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/button/Revert.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/www/manager6/button/Revert.js b/www/manager6/button/Revert.js
index 14b13f5b..d8fcca2c 100644
--- a/www/manager6/button/Revert.js
+++ b/www/manager6/button/Revert.js
@@ -7,11 +7,13 @@ Ext.define('PVE.button.PendingRevert', {
config: {
pendingGrid: null,
apiurl: undefined,
+ parentXType: 'proxmoxPendingObjectGrid',
+ reloadCallback: undefined,
},
handler: function () {
if (!this.pendingGrid) {
- this.pendingGrid = this.up('proxmoxPendingObjectGrid');
+ this.pendingGrid = this.up(this.parentXType);
if (!this.pendingGrid) {
throw 'revert button requires a pendingGrid';
}
@@ -23,7 +25,7 @@ Ext.define('PVE.button.PendingRevert', {
return;
}
- let rowdef = view.rows[rec.data.key] || {};
+ let rowdef = view.rows?.[rec.data.key] || {};
let keys = rowdef.multiKey || [rec.data.key];
Proxmox.Utils.API2Request({
@@ -34,7 +36,7 @@ Ext.define('PVE.button.PendingRevert', {
params: {
revert: keys.join(','),
},
- callback: () => view.reload(),
+ callback: () => (this.reloadCallback ? this.reloadCallback() : view.reload()),
failure: (response) => Ext.Msg.alert('Error', response.htmlStatus),
});
},
--
2.47.3
next prev parent reply other threads:[~2026-08-31 12:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 12:27 [PATCH manager v4 00/12] ui: split out disks and nics into grids Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 01/12] ui: utils: factor out 'media=cdrom' check Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 02/12] ui: factor out the guest key nic regex check Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 03/12] ui: add pending grid Dominik Csapak
2026-08-31 12:27 ` Dominik Csapak [this message]
2026-08-31 12:27 ` [PATCH manager v4 05/12] ui: button: add config remove button Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 06/12] ui: qemu: hardware: wrap in container Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 07/12] ui: qemu: introduce hardware disk grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 08/12] ui: qemu: introduce hardware net grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 09/12] ui: qemu: hardware view: separate disks into own grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 10/12] ui: qemu: hardware view: separate nics " Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 11/12] ui: qemu: hardware view: inline edit/remove/revert button in general grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 12/12] ui: qemu: hardware view: inline 'add efi' menuitem Dominik Csapak
2026-08-31 13:20 ` [PATCH manager v4 00/12] ui: split out disks and nics into grids Jonas Theisen
2026-08-31 14:11 ` Aaron Lauterer
2026-08-31 14:38 ` Jonas Theisen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831122953.2980232-5-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox