public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager 3/3] ui: sdn: skip delete confirmation for unsaved wireguard interfaces
Date: Mon, 18 May 2026 17:07:47 +0200	[thread overview]
Message-ID: <20260518150747.103342-4-h.laimer@proxmox.com> (raw)
In-Reply-To: <20260518150747.103342-1-h.laimer@proxmox.com>

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 .../sdn/fabrics/wireguard/InterfacePanel.js   | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/www/manager6/sdn/fabrics/wireguard/InterfacePanel.js b/www/manager6/sdn/fabrics/wireguard/InterfacePanel.js
index 65399451..60f951b9 100644
--- a/www/manager6/sdn/fabrics/wireguard/InterfacePanel.js
+++ b/www/manager6/sdn/fabrics/wireguard/InterfacePanel.js
@@ -239,6 +239,23 @@ Ext.define('PVE.sdn.Fabric.WireGuard.InterfacePanel', {
                                         _e,
                                         rec,
                                     ) {
+                                        let removeRecord = () => {
+                                            let grid = table.up('grid[reference=interfaceGrid]');
+
+                                            let updateSelection = grid.getSelection().includes(rec);
+
+                                            grid.getStore().remove(rec);
+
+                                            if (updateSelection) {
+                                                grid.setSelection(grid.getStore().first());
+                                            }
+                                        };
+
+                                        if (rec.data.isCreate) {
+                                            removeRecord();
+                                            return;
+                                        }
+
                                         Ext.Msg.show({
                                             title: gettext('Confirm'),
                                             icon: Ext.Msg.WARNING,
@@ -254,20 +271,7 @@ Ext.define('PVE.sdn.Fabric.WireGuard.InterfacePanel', {
                                                 if (btn !== 'yes') {
                                                     return;
                                                 }
-
-                                                let grid = table.up(
-                                                    'grid[reference=interfaceGrid]',
-                                                );
-
-                                                let updateSelection = grid
-                                                    .getSelection()
-                                                    .includes(rec);
-
-                                                grid.getStore().remove(rec);
-
-                                                if (updateSelection) {
-                                                    grid.setSelection(grid.getStore().first());
-                                                }
+                                                removeRecord();
                                             },
                                         });
                                     },
-- 
2.47.3





  parent reply	other threads:[~2026-05-18 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 15:07 [PATCH pve-manager 0/3] wireguard fabric node ui touch-ups Hannes Laimer
2026-05-18 15:07 ` [PATCH pve-manager 1/3] ui: sdn: improve wireguard node edit dialog with no interfaces Hannes Laimer
2026-05-18 15:07 ` [PATCH pve-manager 2/3] ui: sdn: avoid flicker when opening wireguard dialogs Hannes Laimer
2026-05-18 15:07 ` Hannes Laimer [this message]
2026-05-18 20:06 ` applied: [PATCH pve-manager 0/3] wireguard fabric node ui touch-ups Thomas Lamprecht

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=20260518150747.103342-4-h.laimer@proxmox.com \
    --to=h.laimer@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal