From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8B34663742 for ; Tue, 25 Aug 2020 11:25:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 81F2B24C38 for ; Tue, 25 Aug 2020 11:25:12 +0200 (CEST) Received: from dev.dominic.proxmox.com (212-186-127-178.static.upcbusiness.at [212.186.127.178]) by firstgate.proxmox.com (Proxmox) with ESMTP id 372DC24C12 for ; Tue, 25 Aug 2020 11:25:11 +0200 (CEST) Received: by dev.dominic.proxmox.com (Postfix, from userid 0) id 0DAEF201A2; Tue, 25 Aug 2020 11:25:11 +0200 (CEST) From: =?UTF-8?q?Dominic=20J=C3=A4ger?= To: pve-devel@lists.proxmox.com Date: Tue, 25 Aug 2020 11:24:47 +0200 Message-Id: <20200825092449.49410-2-d.jaeger@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200825092449.49410-1-d.jaeger@proxmox.com> References: <20200825092449.49410-1-d.jaeger@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.383 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods KHOP_HELO_FCRDNS 0.398 Relay HELO differs from its IP's reverse DNS NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH widget-toolkit v3 1/3] Proxmox.window.Edit: Introduce separate submitUrl X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 09:25:42 -0000 Signed-off-by: Dominic Jäger --- v2->v3: - Use a more general approach in the shared code base instead of coding specifically for importdisk src/window/Edit.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/window/Edit.js b/src/window/Edit.js index d7972b6..45b380a 100644 --- a/src/window/Edit.js +++ b/src/window/Edit.js @@ -128,7 +128,16 @@ Ext.define('Proxmox.window.Edit', { values.background_delay = me.backgroundDelay; } - let url = me.url; + /* + * Usually Proxmox.window.Edit windows read a guest configuration from + * nodes/{node}/qemu/{vmid}/config and write changes (clicking the + * submit button) to the same path. + * Use submitUrl to change only the write path to something different. + * Example: importdisk reuses the PVE.qemu.HDEdit window and reads from + * nodes/{node}/qemu/{vmid}/config but needs to write to + * nodes/{node}/qemu/{vmid}/importdisk + */ + let url = me.submitUrl || me.url; if (me.method === 'DELETE') { url = url + "?" + Ext.Object.toQueryString(values); values = undefined; -- 2.20.1