public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH widget-toolkit v3 1/3] Proxmox.window.Edit: Introduce separate submitUrl
Date: Thu, 3 Sep 2020 15:37:21 +0200	[thread overview]
Message-ID: <d233e51c-3859-4592-ab47-14f8db0c9f6d@proxmox.com> (raw)
In-Reply-To: <20200825092449.49410-2-d.jaeger@proxmox.com>

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 <d.jaeger@proxmox.com>
> ---
> 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;
> 





  reply	other threads:[~2020-09-03 13:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25  9:24 [pve-devel] [PATCH v3 0/3] Close #2886: Add GUI for importdisk Dominic Jäger
2020-08-25  9:24 ` [pve-devel] [PATCH widget-toolkit v3 1/3] Proxmox.window.Edit: Introduce separate submitUrl Dominic Jäger
2020-09-03 13:37   ` Dominik Csapak [this message]
2020-08-25  9:24 ` [pve-devel] [PATCH qemu-server v3 2/3] Move importdisk from qm to API Dominic Jäger
2020-09-03 13:52   ` Dominik Csapak
2020-09-04  9:10     ` Thomas Lamprecht
2020-08-25  9:24 ` [pve-devel] [PATCH manager v3 3/3] Hardware View: Add GUI for importdisk Dominic Jäger
2020-09-03 14:29   ` Dominik Csapak

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=d233e51c-3859-4592-ab47-14f8db0c9f6d@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal