diff options
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/UserDialog.js | 5 | ||||
-rw-r--r-- | web/app/view/UserDialogController.js | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/web/app/view/UserDialog.js b/web/app/view/UserDialog.js index 52ec933c..4a90f295 100644 --- a/web/app/view/UserDialog.js +++ b/web/app/view/UserDialog.js @@ -136,10 +136,15 @@ Ext.define('Traccar.view.UserDialog', { reference: 'tokenField', fieldLabel: Strings.userToken, disabled: true, + editable: false, triggers: { generate: { cls: 'iconCls: x-fa fa-refresh', handler: 'generateToken' + }, + clear: { + cls: 'iconCls: x-fa fa-remove', + handler: 'clearToken' } } }] diff --git a/web/app/view/UserDialogController.js b/web/app/view/UserDialogController.js index 020bd801..7dc1d889 100644 --- a/web/app/view/UserDialogController.js +++ b/web/app/view/UserDialogController.js @@ -35,13 +35,17 @@ Ext.define('Traccar.view.UserDialogController', { generateToken: function () { var i, newToken = ''; - for (i = 0; i < 16; i++) { + for (i = 0; i < 20; i++) { newToken += this.symbols.charAt(Math.floor(Math.random() * this.symbols.length)); } this.lookupReference('tokenField').setValue(newToken); }, + clearToken: function () { + this.lookupReference('tokenField').setValue(''); + }, + onSaveClick: function (button) { var dialog, record, store; dialog = button.up('window').down('form'); |