[pve-devel] [PATCH widget-toolkit v3 1/3] Proxmox.window.Edit: Introduce separate submitUrl

Dominik Csapak d.csapak at proxmox.com
Thu Sep 3 15:37:21 CEST 2020


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 at 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;
> 





More information about the pve-devel mailing list