From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Lorenz Stechauner <l.stechauner@proxmox.com>
Subject: Re: [pve-devel] [PATCH widget-toolkit 1/1] window: add upidFieldName option
Date: Thu, 29 Apr 2021 14:14:00 +0200 [thread overview]
Message-ID: <abb2cd8b-66f6-97ed-29b8-d56ab997f253@proxmox.com> (raw)
In-Reply-To: <20210428141346.240896-3-l.stechauner@proxmox.com>
as i wrote on the other patches, this is
unnecessary if we split the thing up into two api calls
On 4/28/21 16:13, Lorenz Stechauner wrote:
> Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
> ---
> src/window/Edit.js | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/window/Edit.js b/src/window/Edit.js
> index 53d0e73..867ba9b 100644
> --- a/src/window/Edit.js
> +++ b/src/window/Edit.js
> @@ -53,6 +53,10 @@ Ext.define('Proxmox.window.Edit', {
>
> showTaskViewer: false,
>
> + // name of the upid field in response data
> + // required for showTaskViewer
> + upidFieldName: undefined,
> +
> // gets called if we have a progress bar or taskview and it detected that
> // the task finished. function(success)
> taskDone: Ext.emptyFn,
> @@ -165,9 +169,8 @@ Ext.define('Proxmox.window.Edit', {
> Ext.Msg.alert(gettext('Error'), response.htmlStatus);
> },
> success: function(response, options) {
> - let hasProgressBar =
> - (me.backgroundDelay || me.showProgress || me.showTaskViewer) &&
> - response.result.data;
> + let data = response.result.data;
> + let hasProgressBar = (me.backgroundDelay || me.showProgress || me.showTaskViewer) && data;
>
> me.apiCallDone(true, response, options);
>
> @@ -176,7 +179,7 @@ Ext.define('Proxmox.window.Edit', {
> // when background action is completed
> me.hide();
>
> - let upid = response.result.data;
> + let upid = me.upidFieldName ? data[me.upidFieldName] : data;
> let viewerClass = me.showTaskViewer ? 'Viewer' : 'Progress';
> Ext.create('Proxmox.window.Task' + viewerClass, {
> autoShow: true,
>
next prev parent reply other threads:[~2021-04-29 12:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 14:13 [pve-devel] [PATCH manager 1/1] fix #1710: add retrieve from url button for storage Lorenz Stechauner
2021-04-28 14:13 ` [pve-devel] [PATCH storage 1/1] fix #1710: add retrieve method " Lorenz Stechauner
2021-04-29 11:54 ` Dominik Csapak
2021-04-29 13:22 ` Thomas Lamprecht
2021-04-29 14:01 ` Dominik Csapak
2021-04-29 14:11 ` Thomas Lamprecht
2021-04-28 14:13 ` [pve-devel] [PATCH widget-toolkit 1/1] window: add upidFieldName option Lorenz Stechauner
2021-04-29 12:14 ` Dominik Csapak [this message]
2021-04-29 12:13 ` [pve-devel] [PATCH manager 1/1] fix #1710: add retrieve from url button for storage 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=abb2cd8b-66f6-97ed-29b8-d56ab997f253@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=l.stechauner@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