From b11bed89bf2ae1643965160fbb7fb2d183a3ff1f Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sun, 20 Nov 2016 09:25:32 +0500 Subject: - Increase token length - Make not editable - Add clear trigger --- web/app/view/UserDialogController.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'web/app/view/UserDialogController.js') 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'); -- cgit v1.2.3 From a1e2bea0ad1cf7512d941ef16e9356301b130ee9 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sun, 20 Nov 2016 13:28:18 +0500 Subject: Reverted editing --- web/app/view/UserDialog.js | 5 ----- web/app/view/UserDialogController.js | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'web/app/view/UserDialogController.js') diff --git a/web/app/view/UserDialog.js b/web/app/view/UserDialog.js index 4a90f295..52ec933c 100644 --- a/web/app/view/UserDialog.js +++ b/web/app/view/UserDialog.js @@ -136,15 +136,10 @@ 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 7dc1d889..0f1c022b 100644 --- a/web/app/view/UserDialogController.js +++ b/web/app/view/UserDialogController.js @@ -35,17 +35,13 @@ Ext.define('Traccar.view.UserDialogController', { generateToken: function () { var i, newToken = ''; - for (i = 0; i < 20; i++) { + for (i = 0; i < 32; 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'); -- cgit v1.2.3