From a6765559b9388cea4ebc056cc207d7fc05206065 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 10 May 2017 12:14:44 +0500 Subject: Implement computed attributes --- web/app/Application.js | 4 +- web/app/controller/Root.js | 1 + web/app/model/ComputedAttribute.js | 39 +++++++++++++++ web/app/store/AllComputedAttributes.js | 30 +++++++++++ web/app/store/ComputedAttributes.js | 30 +++++++++++ web/app/view/SettingsMenu.js | 6 +++ web/app/view/SettingsMenuController.js | 12 +++++ web/app/view/dialog/ComputedAttribute.js | 61 +++++++++++++++++++++++ web/app/view/edit/ComputedAttributes.js | 58 +++++++++++++++++++++ web/app/view/edit/ComputedAttributesController.js | 31 ++++++++++++ web/app/view/edit/Devices.js | 8 +++ web/app/view/edit/DevicesController.js | 17 +++++++ web/app/view/edit/Groups.js | 8 +++ web/app/view/edit/GroupsController.js | 19 +++++++ web/app/view/edit/Users.js | 7 +++ web/app/view/edit/UsersController.js | 19 +++++++ web/app/view/permissions/DeviceAttributes.js | 31 ++++++++++++ web/app/view/permissions/GroupAttributes.js | 31 ++++++++++++ web/app/view/permissions/UserAttributes.js | 31 ++++++++++++ 19 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 web/app/model/ComputedAttribute.js create mode 100644 web/app/store/AllComputedAttributes.js create mode 100644 web/app/store/ComputedAttributes.js create mode 100644 web/app/view/dialog/ComputedAttribute.js create mode 100644 web/app/view/edit/ComputedAttributes.js create mode 100644 web/app/view/edit/ComputedAttributesController.js create mode 100644 web/app/view/permissions/DeviceAttributes.js create mode 100644 web/app/view/permissions/GroupAttributes.js create mode 100644 web/app/view/permissions/UserAttributes.js (limited to 'web/app') diff --git a/web/app/Application.js b/web/app/Application.js index b9d074e..2a4149d 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -83,7 +83,9 @@ Ext.define('Traccar.Application', { 'GeofenceAttributes', 'GroupAttributes', 'ServerAttributes', - 'UserAttributes' + 'UserAttributes', + 'ComputedAttributes', + 'AllComputedAttributes' ], controllers: [ diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 4816875..b69fb0f 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -84,6 +84,7 @@ Ext.define('Traccar.controller.Root', { Ext.getStore('Geofences').load(); Ext.getStore('Calendars').load(); Ext.getStore('AttributeAliases').load(); + Ext.getStore('ComputedAttributes').load(); this.initReportEventTypesStore(); Ext.getStore('Devices').load({ scope: this, diff --git a/web/app/model/ComputedAttribute.js b/web/app/model/ComputedAttribute.js new file mode 100644 index 0000000..16a78ef --- /dev/null +++ b/web/app/model/ComputedAttribute.js @@ -0,0 +1,39 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.model.ComputedAttribute', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'id', + type: 'int' + }, { + name: 'description', + type: 'string' + }, { + name: 'type', + type: 'string' + }, { + name: 'attribute', + type: 'string' + }, { + name: 'expression', + type: 'string' + }] +}); diff --git a/web/app/store/AllComputedAttributes.js b/web/app/store/AllComputedAttributes.js new file mode 100644 index 0000000..e63feb1 --- /dev/null +++ b/web/app/store/AllComputedAttributes.js @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.store.AllComputedAttributes', { + extend: 'Ext.data.Store', + model: 'Traccar.model.ComputedAttribute', + + proxy: { + type: 'rest', + url: 'api/attributes/computed', + extraParams: { + all: true + } + } +}); diff --git a/web/app/store/ComputedAttributes.js b/web/app/store/ComputedAttributes.js new file mode 100644 index 0000000..33d7829 --- /dev/null +++ b/web/app/store/ComputedAttributes.js @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.store.ComputedAttributes', { + extend: 'Ext.data.Store', + model: 'Traccar.model.ComputedAttribute', + + proxy: { + type: 'rest', + url: 'api/attributes/computed', + writer: { + writeAllFields: true + } + } +}); diff --git a/web/app/view/SettingsMenu.js b/web/app/view/SettingsMenu.js index 423dc42..db426bb 100644 --- a/web/app/view/SettingsMenu.js +++ b/web/app/view/SettingsMenu.js @@ -72,6 +72,12 @@ Ext.define('Traccar.view.SettingsMenu', { glyph: 'xf02c@FontAwesome', handler: 'onAttributeAliasesClick', reference: 'settingsAttributeAliasesButton' + }, { + hidden: true, + text: Strings.sharedComputedAttributes, + glyph: 'xf0ae@FontAwesome', + handler: 'onComputedAttributesClick', + reference: 'settingsComputedAttributesButton' }, { hidden: true, text: Strings.sharedDeviceDistance, diff --git a/web/app/view/SettingsMenuController.js b/web/app/view/SettingsMenuController.js index 5fc499e..2bd4b98 100644 --- a/web/app/view/SettingsMenuController.js +++ b/web/app/view/SettingsMenuController.js @@ -28,6 +28,7 @@ Ext.define('Traccar.view.SettingsMenuController', { 'Traccar.view.edit.Geofences', 'Traccar.view.Notifications', 'Traccar.view.edit.AttributeAliases', + 'Traccar.view.edit.ComputedAttributes', 'Traccar.view.Statistics', 'Traccar.view.dialog.DeviceDistance', 'Traccar.view.edit.Calendars', @@ -57,6 +58,7 @@ Ext.define('Traccar.view.SettingsMenuController', { } if (admin || (!deviceReadonly && !readonly)) { this.lookupReference('settingsAttributeAliasesButton').setHidden(false); + this.lookupReference('settingsComputedAttributesButton').setHidden(false); } }, @@ -127,6 +129,16 @@ Ext.define('Traccar.view.SettingsMenuController', { }).show(); }, + onComputedAttributesClick: function () { + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedComputedAttributes, + modal: false, + items: { + xtype: 'computedAttributesView' + } + }).show(); + }, + onStatisticsClick: function () { Ext.create('Traccar.view.BaseWindow', { title: Strings.statisticsTitle, diff --git a/web/app/view/dialog/ComputedAttribute.js b/web/app/view/dialog/ComputedAttribute.js new file mode 100644 index 0000000..df07491 --- /dev/null +++ b/web/app/view/dialog/ComputedAttribute.js @@ -0,0 +1,61 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.view.dialog.ComputedAttribute', { + extend: 'Traccar.view.dialog.BaseEdit', + + title: Strings.sharedComputedAttribute, + + items: { + xtype: 'form', + items: [{ + xtype: 'textfield', + name: 'description', + fieldLabel: Strings.sharedDescription + }, { + xtype: 'textfield', + name: 'attribute', + fieldLabel: Strings.sharedAttribute, + allowBlank: false + }, { + xtype: 'textareafield', + name: 'expression', + fieldLabel: Strings.sharedExpression, + allowBlank: false + }, { + xtype: 'textfield', + name: 'type', + fieldLabel: Strings.sharedType, + allowBlank: false + }] + }, + + buttons: [{ + glyph: 'xf00c@FontAwesome', + tooltip: Strings.sharedSave, + tooltipType: 'title', + minWidth: 0, + handler: 'onSaveClick' + }, { + glyph: 'xf00d@FontAwesome', + tooltip: Strings.sharedCancel, + tooltipType: 'title', + minWidth: 0, + handler: 'closeView' + }] +}); diff --git a/web/app/view/edit/ComputedAttributes.js b/web/app/view/edit/ComputedAttributes.js new file mode 100644 index 0000000..87d3b8d --- /dev/null +++ b/web/app/view/edit/ComputedAttributes.js @@ -0,0 +1,58 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.view.edit.ComputedAttributes', { + extend: 'Ext.grid.Panel', + xtype: 'computedAttributesView', + + requires: [ + 'Traccar.view.edit.ComputedAttributesController', + 'Traccar.view.edit.Toolbar' + ], + + controller: 'computedAttributes', + store: 'ComputedAttributes', + + tbar: { + xtype: 'editToolbar' + }, + + listeners: { + selectionchange: 'onSelectionChange' + }, + + columns: { + defaults: { + flex: 1, + minWidth: Traccar.Style.columnWidthNormal + }, + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description' + }, { + text: Strings.sharedAttribute, + dataIndex: 'attribute' + }, { + text: Strings.sharedExpression, + dataIndex: 'expression' + }, { + text: Strings.sharedType, + dataIndex: 'type' + }] + } +}); diff --git a/web/app/view/edit/ComputedAttributesController.js b/web/app/view/edit/ComputedAttributesController.js new file mode 100644 index 0000000..6ae1410 --- /dev/null +++ b/web/app/view/edit/ComputedAttributesController.js @@ -0,0 +1,31 @@ +/* + * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.view.edit.ComputedAttributesController', { + extend: 'Traccar.view.edit.ToolbarController', + alias: 'controller.computedAttributes', + + requires: [ + 'Traccar.view.dialog.ComputedAttribute', + 'Traccar.model.ComputedAttribute' + ], + + objectModel: 'Traccar.model.ComputedAttribute', + objectDialog: 'Traccar.view.dialog.ComputedAttribute', + removeTitle: Strings.sharedComputedAttribute +}); diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index b5b6bad..fe3de42 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -74,6 +74,14 @@ Ext.define('Traccar.view.edit.Devices', { glyph: 'xf21d@FontAwesome', tooltip: Strings.sharedGeofences, tooltipType: 'title' + }, { + xtype: 'button', + disabled: true, + handler: 'onAttributesClick', + reference: 'toolbarAttributesButton', + glyph: 'xf0ae@FontAwesome', + tooltip: Strings.sharedComputedAttributes, + tooltipType: 'title' }, { disabled: true, handler: 'onCommandClick', diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js index 0d18c18..2457d5c 100644 --- a/web/app/view/edit/DevicesController.js +++ b/web/app/view/edit/DevicesController.js @@ -23,6 +23,7 @@ Ext.define('Traccar.view.edit.DevicesController', { 'Traccar.view.dialog.Command', 'Traccar.view.dialog.Device', 'Traccar.view.permissions.DeviceGeofences', + 'Traccar.view.permissions.DeviceAttributes', 'Traccar.view.BaseWindow', 'Traccar.model.Device', 'Traccar.model.Command' @@ -77,6 +78,21 @@ Ext.define('Traccar.view.edit.DevicesController', { }).show(); }, + onAttributesClick: function () { + var device = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedComputedAttributes, + items: { + xtype: 'deviceAttributesView', + baseObjectName: 'deviceId', + linkObjectName: 'attributeId', + storeName: 'ComputedAttributes', + urlApi: 'api/devices/attributes', + baseObject: device.getId() + } + }).show(); + }, + onCommandClick: function () { var device, deviceId, command, dialog, typesStore, online; device = this.getView().getSelectionModel().getSelection()[0]; @@ -105,6 +121,7 @@ Ext.define('Traccar.view.edit.DevicesController', { this.lookupReference('toolbarEditButton').setDisabled(empty || readonly || deviceReadonly); this.lookupReference('toolbarRemoveButton').setDisabled(empty || readonly || deviceReadonly); this.lookupReference('toolbarGeofencesButton').setDisabled(empty || readonly); + this.lookupReference('toolbarAttributesButton').setDisabled(empty || readonly); this.lookupReference('deviceCommandButton').setDisabled(empty || readonly); }, diff --git a/web/app/view/edit/Groups.js b/web/app/view/edit/Groups.js index 43ae877..88bbd7b 100644 --- a/web/app/view/edit/Groups.js +++ b/web/app/view/edit/Groups.js @@ -37,6 +37,14 @@ Ext.define('Traccar.view.edit.Groups', { glyph: 'xf21d@FontAwesome', tooltip: Strings.sharedGeofences, tooltipType: 'title' + }, { + xtype: 'button', + disabled: true, + handler: 'onAttributesClick', + reference: 'toolbarAttributesButton', + glyph: 'xf0ae@FontAwesome', + tooltip: Strings.sharedComputedAttributes, + tooltipType: 'title' }] }, diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index 36154b4..602bb09 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -22,6 +22,7 @@ Ext.define('Traccar.view.edit.GroupsController', { requires: [ 'Traccar.view.dialog.Group', 'Traccar.view.permissions.GroupGeofences', + 'Traccar.view.permissions.GroupAttributes', 'Traccar.view.BaseWindow', 'Traccar.model.Group' ], @@ -47,9 +48,27 @@ Ext.define('Traccar.view.edit.GroupsController', { }).show(); }, + onAttributesClick: function () { + var admin, group; + admin = Traccar.app.getUser().get('admin'); + group = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedComputedAttributes, + items: { + xtype: 'groupAttributesView', + baseObjectName: 'groupId', + linkObjectName: 'attributeId', + storeName: admin ? 'AllComputedAttributes' : 'ComputedAttributes', + urlApi: 'api/groups/attributes', + baseObject: group.getId() + } + }).show(); + }, + onSelectionChange: function (selected) { var disabled = selected.length > 0; this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); + this.lookupReference('toolbarAttributesButton').setDisabled(disabled); this.callParent(arguments); } }); diff --git a/web/app/view/edit/Users.js b/web/app/view/edit/Users.js index 312ebe2..4356b16 100644 --- a/web/app/view/edit/Users.js +++ b/web/app/view/edit/Users.js @@ -75,6 +75,13 @@ Ext.define('Traccar.view.edit.Users', { glyph: 'xf073@FontAwesome', tooltip: Strings.sharedCalendars, tooltipType: 'title' + }, { + disabled: true, + handler: 'onAttributesClick', + reference: 'userAttributesButton', + glyph: 'xf0ae@FontAwesome', + tooltip: Strings.sharedComputedAttributes, + tooltipType: 'title' }] }, diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index 88f39fb..f4ef401 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -27,6 +27,7 @@ Ext.define('Traccar.view.edit.UsersController', { 'Traccar.view.permissions.UserGeofences', 'Traccar.view.permissions.UserCalendars', 'Traccar.view.permissions.UserUsers', + 'Traccar.view.permissions.UserAttributes', 'Traccar.view.Notifications', 'Traccar.view.BaseWindow', 'Traccar.model.User' @@ -155,6 +156,23 @@ Ext.define('Traccar.view.edit.UsersController', { }).show(); }, + onAttributesClick: function () { + var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedCalendars, + items: { + xtype: 'userAttributesView', + baseObjectName: 'userId', + linkObjectName: 'attributeId', + storeName: 'AllComputedAttributes', + linkStoreName: 'ComputedAttributes', + urlApi: 'api/permissions/attributes', + baseObject: user.getId() + } + }).show(); + }, + + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; this.lookupReference('userDevicesButton').setDisabled(disabled); @@ -162,6 +180,7 @@ Ext.define('Traccar.view.edit.UsersController', { this.lookupReference('userGeofencesButton').setDisabled(disabled); this.lookupReference('userNotificationsButton').setDisabled(disabled); this.lookupReference('userCalendarsButton').setDisabled(disabled); + this.lookupReference('userAttributesButton').setDisabled(disabled); this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0); this.callParent(arguments); } diff --git a/web/app/view/permissions/DeviceAttributes.js b/web/app/view/permissions/DeviceAttributes.js new file mode 100644 index 0000000..43b3d25 --- /dev/null +++ b/web/app/view/permissions/DeviceAttributes.js @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.view.permissions.DeviceAttributes', { + extend: 'Traccar.view.permissions.Base', + xtype: 'deviceAttributesView', + + columns: { + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal + }] + } +}); diff --git a/web/app/view/permissions/GroupAttributes.js b/web/app/view/permissions/GroupAttributes.js new file mode 100644 index 0000000..10e894d --- /dev/null +++ b/web/app/view/permissions/GroupAttributes.js @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.view.permissions.GroupAttributes', { + extend: 'Traccar.view.permissions.Base', + xtype: 'groupAttributesView', + + columns: { + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal + }] + } +}); diff --git a/web/app/view/permissions/UserAttributes.js b/web/app/view/permissions/UserAttributes.js new file mode 100644 index 0000000..3129ad6 --- /dev/null +++ b/web/app/view/permissions/UserAttributes.js @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +Ext.define('Traccar.view.permissions.UserAttributes', { + extend: 'Traccar.view.permissions.Base', + xtype: 'userAttributesView', + + columns: { + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal + }] + } +}); -- cgit v1.2.3 From 54137d72265355c04c4b71836d524391ea144998 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 16 May 2017 16:53:31 +0500 Subject: - Added attribute column to permissions tables - Fixed string --- web/app/view/edit/UsersController.js | 2 +- web/app/view/permissions/DeviceAttributes.js | 5 +++++ web/app/view/permissions/GroupAttributes.js | 5 +++++ web/app/view/permissions/UserAttributes.js | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'web/app') diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index f4ef401..fe69d40 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -159,7 +159,7 @@ Ext.define('Traccar.view.edit.UsersController', { onAttributesClick: function () { var user = this.getView().getSelectionModel().getSelection()[0]; Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedCalendars, + title: Strings.sharedComputedAttributes, items: { xtype: 'userAttributesView', baseObjectName: 'userId', diff --git a/web/app/view/permissions/DeviceAttributes.js b/web/app/view/permissions/DeviceAttributes.js index 43b3d25..2f837c4 100644 --- a/web/app/view/permissions/DeviceAttributes.js +++ b/web/app/view/permissions/DeviceAttributes.js @@ -26,6 +26,11 @@ Ext.define('Traccar.view.permissions.DeviceAttributes', { dataIndex: 'description', flex: 1, minWidth: Traccar.Style.columnWidthNormal + }, { + text: Strings.sharedAttribute, + dataIndex: 'attribute', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal }] } }); diff --git a/web/app/view/permissions/GroupAttributes.js b/web/app/view/permissions/GroupAttributes.js index 10e894d..a08eb78 100644 --- a/web/app/view/permissions/GroupAttributes.js +++ b/web/app/view/permissions/GroupAttributes.js @@ -26,6 +26,11 @@ Ext.define('Traccar.view.permissions.GroupAttributes', { dataIndex: 'description', flex: 1, minWidth: Traccar.Style.columnWidthNormal + }, { + text: Strings.sharedAttribute, + dataIndex: 'attribute', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal }] } }); diff --git a/web/app/view/permissions/UserAttributes.js b/web/app/view/permissions/UserAttributes.js index 3129ad6..056c463 100644 --- a/web/app/view/permissions/UserAttributes.js +++ b/web/app/view/permissions/UserAttributes.js @@ -26,6 +26,11 @@ Ext.define('Traccar.view.permissions.UserAttributes', { dataIndex: 'description', flex: 1, minWidth: Traccar.Style.columnWidthNormal + }, { + text: Strings.sharedAttribute, + dataIndex: 'attribute', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal }] } }); -- cgit v1.2.3