mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-09 04:37:33 +08:00
- Increase token length
- Make not editable - Add clear trigger
This commit is contained in:
parent
d8e0a38c66
commit
b11bed89bf
@ -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'
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user