* [pve-devel] [PATCH manager] ui: dc/TokenEdit: fix editing existing tokens
@ 2021-02-12 15:01 Dominik Csapak
2021-02-19 15:41 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2021-02-12 15:01 UTC (permalink / raw)
To: pve-devel
we always have to calculate the url correctly, not only on creation
otherwise we try to edit the token by doing a 'PUT' request on
/access/users
and not on
/access/users/USERID/token/TOKENID
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/dc/TokenEdit.js | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/www/manager6/dc/TokenEdit.js b/www/manager6/dc/TokenEdit.js
index 3edf18cc..7039249c 100644
--- a/www/manager6/dc/TokenEdit.js
+++ b/www/manager6/dc/TokenEdit.js
@@ -21,14 +21,12 @@ Ext.define('PVE.dc.TokenEdit', {
let me = this;
let win = me.up('pveDcTokenEdit');
win.url = '/api2/extjs/access/users/';
- if (win.isCreate) {
- let uid = encodeURIComponent(values.userid);
- let tid = encodeURIComponent(values.tokenid);
- delete values.userid;
- delete values.tokenid;
+ let uid = encodeURIComponent(values.userid);
+ let tid = encodeURIComponent(values.tokenid);
+ delete values.userid;
+ delete values.tokenid;
- win.url += `${uid}/token/${tid}`;
- }
+ win.url += `${uid}/token/${tid}`;
return values;
},
column1: [
@@ -36,8 +34,8 @@ Ext.define('PVE.dc.TokenEdit', {
xtype: 'pmxDisplayEditField',
cbind: {
editable: (get) => get('isCreate') && !get('fixedUser'),
- submitValue: (get) => get('isCreate') || get('fixedUser'),
},
+ submitValue: true,
editConfig: {
xtype: 'pveUserSelector',
allowBlank: false,
@@ -54,6 +52,7 @@ Ext.define('PVE.dc.TokenEdit', {
},
name: 'tokenid',
fieldLabel: gettext('Token ID'),
+ submitValue: true,
minLength: 2,
allowBlank: false,
},
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH manager] ui: dc/TokenEdit: fix editing existing tokens
2021-02-12 15:01 [pve-devel] [PATCH manager] ui: dc/TokenEdit: fix editing existing tokens Dominik Csapak
@ 2021-02-19 15:41 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-02-19 15:41 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 12.02.21 16:01, Dominik Csapak wrote:
> we always have to calculate the url correctly, not only on creation
> otherwise we try to edit the token by doing a 'PUT' request on
> /access/users
> and not on
> /access/users/USERID/token/TOKENID
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> www/manager6/dc/TokenEdit.js | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-19 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 15:01 [pve-devel] [PATCH manager] ui: dc/TokenEdit: fix editing existing tokens Dominik Csapak
2021-02-19 15:41 ` [pve-devel] applied: " Thomas Lamprecht
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