From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options
Date: Wed, 6 Mar 2024 15:04:24 +0100 [thread overview]
Message-ID: <20240306140425.4089769-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20240306140425.4089769-1-d.csapak@proxmox.com>
sometimes it's necessary or handy to add custom options to the submit
api call (e.g. timeout). So just expose a `submitOptions` where users
of the edit window can put their custom options.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/window/Edit.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/window/Edit.js b/src/window/Edit.js
index 7f94e30..d4a2b55 100644
--- a/src/window/Edit.js
+++ b/src/window/Edit.js
@@ -31,6 +31,9 @@ Ext.define('Proxmox.window.Edit', {
// custom submitText
submitText: undefined,
+ // custom options for the submit api call
+ submitOptions: {},
+
backgroundDelay: 0,
// string or function, called as (url, values) - useful if the ID of the
@@ -151,7 +154,7 @@ Ext.define('Proxmox.window.Edit', {
values = undefined;
}
- Proxmox.Utils.API2Request({
+ let requestOptions = Ext.apply({
url: url,
waitMsgTarget: me,
method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
@@ -191,7 +194,8 @@ Ext.define('Proxmox.window.Edit', {
me.close();
}
},
- });
+ }, me.submitOptions ?? {});
+ Proxmox.Utils.API2Request(requestOptions);
},
load: function(options) {
--
2.39.2
next prev parent reply other threads:[~2024-03-06 14:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 14:04 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] tape: increase gui timeout for transfer Dominik Csapak
2024-03-06 14:04 ` Dominik Csapak [this message]
2024-03-07 14:22 ` [pbs-devel] applied: [PATCH widget-toolkit 1/1] edit window: add optional custom submit options Thomas Lamprecht
2024-03-06 14:04 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: tape: transfer: increase timeout to 3 minutes 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=20240306140425.4089769-2-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-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