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 2FE9660C9F for ; Thu, 3 Sep 2020 15:37:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 23CEC1986C for ; Thu, 3 Sep 2020 15:37:23 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS id 2225219862 for ; Thu, 3 Sep 2020 15:37:22 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DAB96449F5 for ; Thu, 3 Sep 2020 15:37:21 +0200 (CEST) To: pve-devel@lists.proxmox.com References: <20200825092449.49410-1-d.jaeger@proxmox.com> <20200825092449.49410-2-d.jaeger@proxmox.com> From: Dominik Csapak Message-ID: Date: Thu, 3 Sep 2020 15:37:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Thunderbird/81.0 MIME-Version: 1.0 In-Reply-To: <20200825092449.49410-2-d.jaeger@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.772 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.324 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [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: Thu, 03 Sep 2020 13:37:23 -0000 Why is that necessary? can't you just change url on HDEdit before submitting? in HDEdit something like this: --- if (changedmodetoimport) { me.url = 'new url' } --- On 8/25/20 11:24 AM, Dominic Jäger wrote: > 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; >