diff options
Diffstat (limited to 'web/app/view/edit')
-rw-r--r-- | web/app/view/edit/AttributeAliasesController.js | 8 | ||||
-rw-r--r-- | web/app/view/edit/Attributes.js | 2 | ||||
-rw-r--r-- | web/app/view/edit/AttributesController.js | 1 | ||||
-rw-r--r-- | web/app/view/edit/Devices.js | 4 | ||||
-rw-r--r-- | web/app/view/edit/DevicesController.js | 8 | ||||
-rw-r--r-- | web/app/view/edit/GroupsController.js | 7 | ||||
-rw-r--r-- | web/app/view/edit/UsersController.js | 6 |
7 files changed, 28 insertions, 8 deletions
diff --git a/web/app/view/edit/AttributeAliasesController.js b/web/app/view/edit/AttributeAliasesController.js index d1beb135..8ac68bcb 100644 --- a/web/app/view/edit/AttributeAliasesController.js +++ b/web/app/view/edit/AttributeAliasesController.js @@ -61,13 +61,13 @@ Ext.define('Traccar.view.edit.AttributeAliasesController', { this.lookupReference('toolbarRemoveButton').setDisabled(disabled); }, - onDeviceChange: function (combobox, newValue, oldValue) { + onDeviceChange: function (combobox, value) { var manager = Traccar.app.getUser().get('admin') || Traccar.app.getUser().get('userLimit') > 0; this.onSelectionChange(); - if (newValue !== null) { - this.getView().getStore().filter('deviceId', newValue); + if (value !== null) { + this.getView().getStore().filter('deviceId', value); if (manager && this.getView().getStore().getCount() === 0) { - Ext.getStore('AttributeAliases').getProxy().setExtraParam('deviceId', newValue); + Ext.getStore('AttributeAliases').getProxy().setExtraParam('deviceId', value); Ext.getStore('AttributeAliases').load({ addRecords: true }); diff --git a/web/app/view/edit/Attributes.js b/web/app/view/edit/Attributes.js index 84cadea5..a76223b9 100644 --- a/web/app/view/edit/Attributes.js +++ b/web/app/view/edit/Attributes.js @@ -46,7 +46,7 @@ Ext.define('Traccar.view.edit.Attributes', { text: Strings.sharedName, dataIndex: 'name', filter: 'string', - renderer: function (value, metaData) { + renderer: function (value) { var attribute; if (this.attributesStore) { attribute = Ext.getStore(this.attributesStore).getById(value); diff --git a/web/app/view/edit/AttributesController.js b/web/app/view/edit/AttributesController.js index 8d159569..84ff6adf 100644 --- a/web/app/view/edit/AttributesController.js +++ b/web/app/view/edit/AttributesController.js @@ -94,6 +94,7 @@ Ext.define('Traccar.view.edit.AttributesController', { displayField: 'name', valueField: 'key', allowBlank: false, + queryMode: 'local', listeners: { change: 'onNameChange' } diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index c9538c8b..4fdcab00 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -111,6 +111,7 @@ Ext.define('Traccar.view.edit.Devices', { if (status) { return Ext.getStore('DeviceStatuses').getById(status).get('color'); } + return null; } }, @@ -165,7 +166,7 @@ Ext.define('Traccar.view.edit.Devices', { for (i = 0; i < value.length; i++) { name = Traccar.AttributeFormatter.geofenceIdFormatter(value[i]); if (name) { - result += name + ((i < value.length - 1) ? ', ' : ''); + result += name + (i < value.length - 1 ? ', ' : ''); } } } @@ -187,6 +188,7 @@ Ext.define('Traccar.view.edit.Devices', { return status.get('name'); } } + return null; } }, { text: Strings.deviceLastUpdate, diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js index ae65fbb1..df75b1d4 100644 --- a/web/app/view/edit/DevicesController.js +++ b/web/app/view/edit/DevicesController.js @@ -61,6 +61,10 @@ Ext.define('Traccar.view.edit.DevicesController', { deviceReadonly = Traccar.app.getPreference('deviceReadonly', false) && !Traccar.app.getUser().get('admin'); readonly = Traccar.app.getPreference('readonly', false) && !Traccar.app.getUser().get('admin'); this.lookupReference('toolbarAddButton').setDisabled(readonly || deviceReadonly); + this.lookupReference('toolbarDriversButton').setHidden( + Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); + this.lookupReference('toolbarAttributesButton').setHidden( + Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); setInterval(function () { self.getView().getView().refresh(); @@ -151,7 +155,7 @@ Ext.define('Traccar.view.edit.DevicesController', { } }, - selectDevice: function (device, center) { + selectDevice: function (device) { this.getView().getSelectionModel().select([device], false, true); this.updateButtons(this.getView().getSelectionModel()); this.getView().getView().focusRow(device); @@ -163,7 +167,7 @@ Ext.define('Traccar.view.edit.DevicesController', { } }, - onUpdateDevice: function (store, data) { + onUpdateDevice: function () { this.updateButtons(this.getView().getSelectionModel()); }, diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index 21f17ffa..be26cc93 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -32,6 +32,13 @@ Ext.define('Traccar.view.edit.GroupsController', { objectDialog: 'Traccar.view.dialog.Group', removeTitle: Strings.groupDialog, + init: function () { + this.lookupReference('toolbarDriversButton').setHidden( + Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); + this.lookupReference('toolbarAttributesButton').setHidden( + Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); + }, + onGeofencesClick: function () { var admin, group; admin = Traccar.app.getUser().get('admin'); diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index fb7a36e2..3bc7d1c4 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -41,6 +41,12 @@ Ext.define('Traccar.view.edit.UsersController', { init: function () { Ext.getStore('Users').load(); this.lookupReference('userUsersButton').setHidden(!Traccar.app.getUser().get('admin')); + this.lookupReference('userDriversButton').setHidden( + Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); + this.lookupReference('userAttributesButton').setHidden( + Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); + this.lookupReference('userCalendarsButton').setHidden( + Traccar.app.getBooleanAttributePreference('ui.disableCalendars')); }, onEditClick: function () { |