From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit 1/1] window: add upidFieldName option
Date: Wed, 28 Apr 2021 16:13:46 +0200 [thread overview]
Message-ID: <20210428141346.240896-3-l.stechauner@proxmox.com> (raw)
In-Reply-To: <20210428141346.240896-1-l.stechauner@proxmox.com>
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,
--
2.20.1
next prev parent reply other threads:[~2021-04-28 14: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 ` Lorenz Stechauner [this message]
2021-04-29 12:14 ` [pve-devel] [PATCH widget-toolkit 1/1] window: add upidFieldName option Dominik Csapak
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=20210428141346.240896-3-l.stechauner@proxmox.com \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal