aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/StateController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/StateController.js')
-rw-r--r--web/app/view/StateController.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index 3bf76717..c6c1507d 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -22,7 +22,9 @@ Ext.define('Traccar.view.StateController', {
requires: [
'Traccar.AttributeFormatter',
'Traccar.model.Attribute',
- 'Traccar.model.Position'
+ 'Traccar.model.Position',
+ 'Traccar.view.BaseWindow',
+ 'Traccar.view.edit.ComputedAttributes'
],
config: {
@@ -46,6 +48,24 @@ Ext.define('Traccar.view.StateController', {
}
},
+
+ init: function () {
+ if (Traccar.app.getUser().get('admin') ||
+ !Traccar.app.getUser().get('deviceReadonly') && !Traccar.app.getPreference('readonly', false)) {
+ this.lookupReference('computedAttributesButton').setDisabled(
+ Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes'));
+ }
+ },
+
+ onComputedAttributesClick: function () {
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedComputedAttributes,
+ items: {
+ xtype: 'computedAttributesView'
+ }
+ }).show();
+ },
+
keys: (function () {
var i, list, result;
result = {};