From a5d36c62facad98c409b9fcd4f8b92c3d47601ab Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 12 Sep 2017 17:39:43 +0500 Subject: Implement Saved Commands --- web/app/view/SettingsMenu.js | 6 ++ web/app/view/SettingsMenuController.js | 11 +++ web/app/view/dialog/Command.js | 69 ---------------- web/app/view/dialog/CommandController.js | 110 ------------------------- web/app/view/dialog/SavedCommand.js | 82 ++++++++++++++++++ web/app/view/dialog/SavedCommandController.js | 99 ++++++++++++++++++++++ web/app/view/dialog/SendCommand.js | 104 +++++++++++++++++++++++ web/app/view/dialog/SendCommandController.js | 93 +++++++++++++++++++++ web/app/view/dialog/Server.js | 6 ++ web/app/view/dialog/User.js | 8 ++ web/app/view/dialog/UserController.js | 1 + web/app/view/edit/Devices.js | 41 ++++----- web/app/view/edit/DevicesController.js | 46 +++++++---- web/app/view/edit/Groups.js | 8 ++ web/app/view/edit/GroupsController.js | 31 +++++-- web/app/view/edit/SavedCommands.js | 66 +++++++++++++++ web/app/view/edit/SavedCommandsController.js | 32 +++++++ web/app/view/edit/Users.js | 8 ++ web/app/view/edit/UsersController.js | 45 ++++++---- web/app/view/permissions/Calendars.js | 38 +++++++++ web/app/view/permissions/ComputedAttributes.js | 51 ++++++++++++ web/app/view/permissions/DeviceAttributes.js | 51 ------------ web/app/view/permissions/DeviceDrivers.js | 44 ---------- web/app/view/permissions/DeviceGeofences.js | 37 --------- web/app/view/permissions/Devices.js | 77 +++++++++++++++++ web/app/view/permissions/Drivers.js | 44 ++++++++++ web/app/view/permissions/Geofences.js | 37 +++++++++ web/app/view/permissions/GroupAttributes.js | 49 ----------- web/app/view/permissions/GroupDrivers.js | 44 ---------- web/app/view/permissions/GroupGeofences.js | 37 --------- web/app/view/permissions/Groups.js | 50 +++++++++++ web/app/view/permissions/SavedCommands.js | 55 +++++++++++++ web/app/view/permissions/UserAttributes.js | 51 ------------ web/app/view/permissions/UserCalendars.js | 38 --------- web/app/view/permissions/UserDevices.js | 77 ----------------- web/app/view/permissions/UserDrivers.js | 44 ---------- web/app/view/permissions/UserGeofences.js | 37 --------- web/app/view/permissions/UserGroups.js | 50 ----------- web/app/view/permissions/UserUsers.js | 32 ------- web/app/view/permissions/Users.js | 32 +++++++ 40 files changed, 1006 insertions(+), 835 deletions(-) delete mode 100644 web/app/view/dialog/Command.js delete mode 100644 web/app/view/dialog/CommandController.js create mode 100644 web/app/view/dialog/SavedCommand.js create mode 100644 web/app/view/dialog/SavedCommandController.js create mode 100644 web/app/view/dialog/SendCommand.js create mode 100644 web/app/view/dialog/SendCommandController.js create mode 100644 web/app/view/edit/SavedCommands.js create mode 100644 web/app/view/edit/SavedCommandsController.js create mode 100644 web/app/view/permissions/Calendars.js create mode 100644 web/app/view/permissions/ComputedAttributes.js delete mode 100644 web/app/view/permissions/DeviceAttributes.js delete mode 100644 web/app/view/permissions/DeviceDrivers.js delete mode 100644 web/app/view/permissions/DeviceGeofences.js create mode 100644 web/app/view/permissions/Devices.js create mode 100644 web/app/view/permissions/Drivers.js create mode 100644 web/app/view/permissions/Geofences.js delete mode 100644 web/app/view/permissions/GroupAttributes.js delete mode 100644 web/app/view/permissions/GroupDrivers.js delete mode 100644 web/app/view/permissions/GroupGeofences.js create mode 100644 web/app/view/permissions/Groups.js create mode 100644 web/app/view/permissions/SavedCommands.js delete mode 100644 web/app/view/permissions/UserAttributes.js delete mode 100644 web/app/view/permissions/UserCalendars.js delete mode 100644 web/app/view/permissions/UserDevices.js delete mode 100644 web/app/view/permissions/UserDrivers.js delete mode 100644 web/app/view/permissions/UserGeofences.js delete mode 100644 web/app/view/permissions/UserGroups.js delete mode 100644 web/app/view/permissions/UserUsers.js create mode 100644 web/app/view/permissions/Users.js (limited to 'web/app/view') diff --git a/web/app/view/SettingsMenu.js b/web/app/view/SettingsMenu.js index 7fb7636..9ef12a3 100644 --- a/web/app/view/SettingsMenu.js +++ b/web/app/view/SettingsMenu.js @@ -96,6 +96,12 @@ Ext.define('Traccar.view.SettingsMenu', { glyph: 'xf073@FontAwesome', handler: 'onCalendarsClick', reference: 'settingsCalendarsButton' + }, { + hidden: true, + text: Strings.sharedSavedCommands, + glyph: 'xf093@FontAwesome', + handler: 'onCommandsClick', + reference: 'settingsCommandsButton' }, { text: Strings.loginLogout, glyph: 'xf08b@FontAwesome', diff --git a/web/app/view/SettingsMenuController.js b/web/app/view/SettingsMenuController.js index 5968a53..caa57a6 100644 --- a/web/app/view/SettingsMenuController.js +++ b/web/app/view/SettingsMenuController.js @@ -32,6 +32,7 @@ Ext.define('Traccar.view.SettingsMenuController', { 'Traccar.view.Statistics', 'Traccar.view.dialog.DeviceDistance', 'Traccar.view.edit.Calendars', + 'Traccar.view.edit.SavedCommands', 'Traccar.view.BaseWindow' ], @@ -58,6 +59,7 @@ Ext.define('Traccar.view.SettingsMenuController', { Traccar.app.getBooleanAttributePreference('ui.disableCalendars')); this.lookupReference('settingsDriversButton').setHidden( Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); + this.lookupReference('settingsCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); } if (admin || !deviceReadonly && !readonly) { this.lookupReference('settingsComputedAttributesButton').setHidden( @@ -159,6 +161,15 @@ Ext.define('Traccar.view.SettingsMenuController', { }).show(); }, + onCommandsClick: function () { + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedSavedCommands, + items: { + xtype: 'savedCommandsView' + } + }).show(); + }, + onLogoutClick: function () { Ext.create('Traccar.view.dialog.LoginController').logout(); } diff --git a/web/app/view/dialog/Command.js b/web/app/view/dialog/Command.js deleted file mode 100644 index ce5b75b..0000000 --- a/web/app/view/dialog/Command.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@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.Command', { - extend: 'Traccar.view.dialog.Base', - - requires: [ - 'Traccar.view.dialog.CommandController' - ], - - controller: 'command', - title: Strings.commandTitle, - - items: { - xtype: 'form', - listeners: { - validitychange: 'onValidityChange' - }, - items: [{ - xtype: 'checkboxfield', - name: 'textChannel', - reference: 'textChannelCheckBox', - inputValue: true, - uncheckedValue: false, - fieldLabel: Strings.notificationSms, - listeners: { - change: 'onTextChannelChange' - } - }, { - xtype: 'combobox', - name: 'type', - reference: 'commandType', - fieldLabel: Strings.sharedType, - store: 'CommandTypes', - displayField: 'name', - valueField: 'type', - editable: false, - listeners: { - select: 'onSelect' - } - }, { - xtype: 'fieldcontainer', - reference: 'parameters' - }] - }, - - buttons: [{ - text: Strings.commandSend, - reference: 'sendButton', - handler: 'onSendClick' - }, { - text: Strings.sharedCancel, - handler: 'closeView' - }] -}); diff --git a/web/app/view/dialog/CommandController.js b/web/app/view/dialog/CommandController.js deleted file mode 100644 index 0687f67..0000000 --- a/web/app/view/dialog/CommandController.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@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.CommandController', { - extend: 'Ext.app.ViewController', - alias: 'controller.command', - - defaultFieldConfig: { - allowBlank: false - }, - - onSelect: function (selected) { - var i, config, command, parameters, parameter; - this.lookupReference('parameters').removeAll(); - command = Ext.getStore('KnownCommands').getById(selected.getValue()); - if (command && command.get('parameters')) { - parameters = command.get('parameters'); - for (i = 0; i < parameters.length; i++) { - parameter = new Traccar.model.KnownAttribute(parameters[i]); - config = Ext.clone(this.defaultFieldConfig); - config.key = parameter.get('key'); - config.fieldLabel = parameter.get('name'); - switch (parameter.get('valueType')) { - case 'number': - config.xtype = 'customNumberField'; - if (parameter.get('allowDecimals') !== undefined) { - config.allowDecimals = parameter.get('allowDecimals'); - } else { - config.allowDecimals = true; - } - config.dataType = parameter.get('dataType'); - config.maxValue = parameter.get('maxValue'); - config.minValue = parameter.get('minValue'); - break; - case 'boolean': - config.xtype = 'checkboxfield'; - config.inputValue = true; - config.uncheckedValue = false; - break; - default: - if (parameter.get('dataType') === 'timezone') { - config.xtype = 'combobox'; - config.queryMode = 'local'; - config.displayField = 'key'; - config.editable = false; - config.store = 'AllTimezones'; - } else { - config.xtype = 'textfield'; - } - } - this.lookupReference('parameters').add(config); - } - } - }, - - onSendClick: function (button) { - var i, record, form, parameters, attributes = {}; - - form = button.up('window').down('form'); - form.updateRecord(); - record = form.getRecord(); - parameters = this.lookupReference('parameters').items.items; - - for (i = 0; i < parameters.length; i++) { - attributes[parameters[i].key] = parameters[i].getValue(); - } - - record.set('attributes', attributes); - - Ext.Ajax.request({ - scope: this, - url: 'api/commands', - jsonData: record.getData(), - callback: this.onSendResult - }); - }, - - onValidityChange: function (form, valid) { - this.lookupReference('sendButton').setDisabled(!valid); - }, - - onTextChannelChange: function (checkbox, newValue) { - var typesStore = this.lookupReference('commandType').getStore(); - typesStore.getProxy().setExtraParam('textChannel', newValue); - typesStore.reload(); - }, - - onSendResult: function (options, success, response) { - if (success) { - this.closeView(); - Traccar.app.showToast(Strings.commandSent); - } else { - Traccar.app.showError(response); - } - } -}); diff --git a/web/app/view/dialog/SavedCommand.js b/web/app/view/dialog/SavedCommand.js new file mode 100644 index 0000000..4759143 --- /dev/null +++ b/web/app/view/dialog/SavedCommand.js @@ -0,0 +1,82 @@ +/* + * Copyright 2015 - 2017 Anton Tananaev (anton@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.SavedCommand', { + extend: 'Traccar.view.dialog.BaseEdit', + + requires: [ + 'Traccar.view.dialog.SavedCommandController' + ], + + controller: 'savedCommand', + title: Strings.sharedSavedCommand, + + items: [{ + xtype: 'form', + listeners: { + validitychange: 'onValidityChange' + }, + items: [{ + xtype: 'fieldset', + title: Strings.sharedRequired, + items: [{ + xtype: 'textfield', + name: 'description', + fieldLabel: Strings.sharedDescription + }, { + xtype: 'checkboxfield', + name: 'textChannel', + inputValue: true, + uncheckedValue: false, + fieldLabel: Strings.notificationSms + }, { + xtype: 'combobox', + name: 'type', + reference: 'commandType', + fieldLabel: Strings.sharedType, + store: 'AllCommandTypes', + queryMode: 'local', + displayField: 'name', + valueField: 'type', + editable: false, + allowBlank: false, + listeners: { + change: 'onTypeChange' + } + }, { + xtype: 'fieldcontainer', + reference: 'parameters' + }] + }] + }], + + buttons: [{ + glyph: 'xf00c@FontAwesome', + reference: 'saveButton', + tooltip: Strings.sharedSave, + tooltipType: 'title', + minWidth: 0, + disabled: true, + handler: 'onSaveClick' + }, { + glyph: 'xf00d@FontAwesome', + tooltip: Strings.sharedCancel, + tooltipType: 'title', + minWidth: 0, + handler: 'closeView' + }] +}); diff --git a/web/app/view/dialog/SavedCommandController.js b/web/app/view/dialog/SavedCommandController.js new file mode 100644 index 0000000..37c5660 --- /dev/null +++ b/web/app/view/dialog/SavedCommandController.js @@ -0,0 +1,99 @@ +/* + * Copyright 2015 - 2017 Anton Tananaev (anton@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.SavedCommandController', { + extend: 'Traccar.view.dialog.BaseEditController', + alias: 'controller.savedCommand', + + defaultFieldConfig: { + allowBlank: false + }, + + onTypeChange: function (combo, newValue) { + var i, config, command, parameters, parameter, record; + record = combo.up('window').down('form').getRecord(); + this.lookupReference('parameters').removeAll(); + command = Ext.getStore('KnownCommands').getById(newValue); + if (command && command.get('parameters')) { + parameters = command.get('parameters'); + for (i = 0; i < parameters.length; i++) { + parameter = new Traccar.model.KnownAttribute(parameters[i]); + config = Ext.clone(this.defaultFieldConfig); + config.key = parameter.get('key'); + config.fieldLabel = parameter.get('name'); + if (record.get('attributes')) { + config.value = record.get('attributes')[parameter.get('key')]; + } + config.disabled = combo.isDisabled(); + switch (parameter.get('valueType')) { + case 'number': + config.xtype = 'customNumberField'; + if (parameter.get('allowDecimals') !== undefined) { + config.allowDecimals = parameter.get('allowDecimals'); + } else { + config.allowDecimals = true; + } + config.dataType = parameter.get('dataType'); + config.maxValue = parameter.get('maxValue'); + config.minValue = parameter.get('minValue'); + break; + case 'boolean': + config.xtype = 'checkboxfield'; + config.inputValue = true; + config.uncheckedValue = false; + break; + default: + if (parameter.get('dataType') === 'timezone') { + config.xtype = 'combobox'; + config.queryMode = 'local'; + config.displayField = 'key'; + config.editable = false; + config.store = 'AllTimezones'; + } else { + config.xtype = 'textfield'; + } + } + this.lookupReference('parameters').add(config); + } + } + }, + + fillAttributes: function (button) { + var i, form, record, parameters, attributes = {}; + + form = button.up('window').down('form'); + form.updateRecord(); + record = form.getRecord(); + parameters = this.lookupReference('parameters').items.items; + + for (i = 0; i < parameters.length; i++) { + attributes[parameters[i].key] = parameters[i].getValue(); + } + + record.set('attributes', attributes); + }, + + onSaveClick: function (button) { + this.fillAttributes(button); + this.callParent(arguments); + }, + + onValidityChange: function (form, valid) { + this.lookupReference('saveButton').setDisabled(!valid); + } + +}); diff --git a/web/app/view/dialog/SendCommand.js b/web/app/view/dialog/SendCommand.js new file mode 100644 index 0000000..0bb7d61 --- /dev/null +++ b/web/app/view/dialog/SendCommand.js @@ -0,0 +1,104 @@ +/* + * 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.SendCommand', { + extend: 'Traccar.view.dialog.Base', + + requires: [ + 'Traccar.view.dialog.SendCommandController' + ], + + controller: 'sendCommand', + title: Strings.commandTitle, + + items: [{ + xtype: 'combobox', + reference: 'commandsComboBox', + fieldLabel: Strings.sharedSavedCommand, + displayField: 'description', + valueField: 'id', + store: 'DeviceCommands', + queryMode: 'local', + editable: false, + allowBlank: false, + listeners: { + select: 'onCommandSelect' + } + }, { + xtype: 'form', + listeners: { + validitychange: 'onValidityChange' + }, + items: [{ + xtype: 'fieldset', + reference: 'newCommandFields', + disabled: true, + items: [{ + xtype: 'checkboxfield', + name: 'textChannel', + reference: 'textChannelCheckBox', + inputValue: true, + uncheckedValue: false, + fieldLabel: Strings.notificationSms, + listeners: { + change: 'onTextChannelChange' + } + }, { + xtype: 'combobox', + name: 'type', + reference: 'commandType', + fieldLabel: Strings.sharedType, + store: 'CommandTypes', + displayField: 'name', + valueField: 'type', + editable: false, + allowBlank: false, + listeners: { + change: 'onTypeChange' + } + }, { + xtype: 'fieldcontainer', + reference: 'parameters' + }] + }] + }], + + buttons: [{ + glyph: 'xf093@FontAwesome', + text: Strings.sharedSavedCommands, + reference: 'linkButton', + handler: 'onLinkCommands', + hidden: true + }, { + xtype: 'tbfill' + }, { + glyph: 'xf093@FontAwesome', + tooltip: Strings.sharedSend, + tooltipType: 'title', + minWidth: 0, + disabled: true, + reference: 'sendButton', + handler: 'onSendClick' + }, { + glyph: 'xf00d@FontAwesome', + tooltip: Strings.sharedCancel, + tooltipType: 'title', + minWidth: 0, + handler: 'closeView' + }] +}); diff --git a/web/app/view/dialog/SendCommandController.js b/web/app/view/dialog/SendCommandController.js new file mode 100644 index 0000000..3bd2ad4 --- /dev/null +++ b/web/app/view/dialog/SendCommandController.js @@ -0,0 +1,93 @@ +/* + * 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.SendCommandController', { + extend: 'Traccar.view.dialog.SavedCommandController', + alias: 'controller.sendCommand', + + requires: [ + 'Traccar.view.permissions.SavedCommands' + ], + + init: function () { + this.lookupReference('linkButton').setHidden(Traccar.app.getPreference('limitCommands', false)); + }, + + onSendClick: function (button) { + var record; + this.fillAttributes(button); + record = button.up('window').down('form').getRecord(); + + Ext.Ajax.request({ + scope: this, + url: 'api/commands/send', + jsonData: record.getData({ + persist: true + }), + callback: this.onSendResult + }); + }, + + onValidityChange: function (form, valid) { + this.lookupReference('sendButton').setDisabled(!valid || + this.lookupReference('commandsComboBox').getValue() === null); + }, + + onTextChannelChange: function (checkbox, newValue) { + var typesStore = this.lookupReference('commandType').getStore(); + typesStore.getProxy().setExtraParam('textChannel', newValue); + typesStore.reload(); + }, + + onCommandSelect: function (selected) { + var record, form, command = selected.getStore().getById(selected.getValue()); + command.set('deviceId', this.getView().deviceId); + form = selected.up('window').down('form'); + record = form.getRecord(); + form.loadRecord(command); + if (record && command.get('type') === record.get('type')) { + this.onTypeChange(this.lookupReference('commandType'), command.get('type')); + } + + this.lookupReference('newCommandFields').setDisabled(command.getId() !== 0); + this.lookupReference('textChannelCheckBox').setDisabled(command.getId() !== 0 || !this.getView().online); + this.lookupReference('sendButton').setDisabled(command.getId() === 0); + }, + + onLinkCommands: function () { + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedSavedCommands, + items: { + xtype: 'linkSavedCommandsView', + baseObjectName: 'deviceId', + linkObjectName: 'commandId', + storeName: 'Commands', + baseObject: this.getView().deviceId + } + }).show(); + }, + + onSendResult: function (options, success, response) { + if (success) { + this.closeView(); + Traccar.app.showToast(Strings.commandSent); + } else { + Traccar.app.showError(response); + } + } +}); diff --git a/web/app/view/dialog/Server.js b/web/app/view/dialog/Server.js index b6343f3..1fe2184 100644 --- a/web/app/view/dialog/Server.js +++ b/web/app/view/dialog/Server.js @@ -107,6 +107,12 @@ Ext.define('Traccar.view.dialog.Server', { uncheckedValue: false, name: 'deviceReadonly', fieldLabel: Strings.userDeviceReadonly + }, { + xtype: 'checkboxfield', + inputValue: true, + uncheckedValue: false, + name: 'limitCommands', + fieldLabel: Strings.userLimitCommands }] }] }, diff --git a/web/app/view/dialog/User.js b/web/app/view/dialog/User.js index 43990a5..36bccfe 100644 --- a/web/app/view/dialog/User.js +++ b/web/app/view/dialog/User.js @@ -132,6 +132,14 @@ Ext.define('Traccar.view.dialog.User', { fieldLabel: Strings.userDeviceReadonly, disabled: true, reference: 'deviceReadonlyField' + }, { + xtype: 'checkboxfield', + inputValue: true, + uncheckedValue: false, + name: 'limitCommands', + fieldLabel: Strings.userLimitCommands, + disabled: true, + reference: 'limitCommandsField' }, { xtype: 'datefield', name: 'expirationTime', diff --git a/web/app/view/dialog/UserController.js b/web/app/view/dialog/UserController.js index 89b0bc8..6f2c03a 100644 --- a/web/app/view/dialog/UserController.js +++ b/web/app/view/dialog/UserController.js @@ -30,6 +30,7 @@ Ext.define('Traccar.view.dialog.UserController', { this.lookupReference('disabledField').setDisabled(false); this.lookupReference('expirationTimeField').setDisabled(false); this.lookupReference('deviceReadonlyField').setDisabled(false); + this.lookupReference('limitCommandsField').setDisabled(false); } }, diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index 4fdcab0..5ec452b 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -37,67 +37,54 @@ Ext.define('Traccar.view.edit.Devices', { tbar: { componentCls: 'toolbar-header-style', + defaults: { + xtype: 'button', + disabled: true, + tooltipType: 'title' + }, items: [{ xtype: 'tbtext', html: Strings.deviceTitle, baseCls: 'x-panel-header-title-default' }, { - xtype: 'tbfill' + xtype: 'tbfill', + disabled: false }, { - xtype: 'button', - disabled: true, handler: 'onAddClick', reference: 'toolbarAddButton', glyph: 'xf067@FontAwesome', - tooltip: Strings.sharedAdd, - tooltipType: 'title' + tooltip: Strings.sharedAdd }, { - xtype: 'button', - disabled: true, handler: 'onEditClick', reference: 'toolbarEditButton', glyph: 'xf040@FontAwesome', - tooltip: Strings.sharedEdit, - tooltipType: 'title' + tooltip: Strings.sharedEdit }, { - xtype: 'button', - disabled: true, handler: 'onRemoveClick', reference: 'toolbarRemoveButton', glyph: 'xf00d@FontAwesome', - tooltip: Strings.sharedRemove, - tooltipType: 'title' + tooltip: Strings.sharedRemove }, { - xtype: 'button', - disabled: true, handler: 'onGeofencesClick', reference: 'toolbarGeofencesButton', glyph: 'xf21d@FontAwesome', - tooltip: Strings.sharedGeofences, - tooltipType: 'title' + tooltip: Strings.sharedGeofences }, { - xtype: 'button', - disabled: true, handler: 'onAttributesClick', reference: 'toolbarAttributesButton', glyph: 'xf0ae@FontAwesome', - tooltip: Strings.sharedComputedAttributes, - tooltipType: 'title' + tooltip: Strings.sharedComputedAttributes }, { xtype: 'button', - disabled: true, handler: 'onDriversClick', reference: 'toolbarDriversButton', glyph: 'xf2c2@FontAwesome', - tooltip: Strings.sharedDrivers, - tooltipType: 'title' + tooltip: Strings.sharedDrivers }, { - disabled: true, handler: 'onCommandClick', reference: 'deviceCommandButton', glyph: 'xf093@FontAwesome', - tooltip: Strings.deviceCommand, - tooltipType: 'title' + tooltip: Strings.deviceCommand }] }, diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js index df75b1d..43bab22 100644 --- a/web/app/view/edit/DevicesController.js +++ b/web/app/view/edit/DevicesController.js @@ -20,11 +20,12 @@ Ext.define('Traccar.view.edit.DevicesController', { alias: 'controller.devices', requires: [ - 'Traccar.view.dialog.Command', + 'Traccar.view.dialog.SendCommand', 'Traccar.view.dialog.Device', - 'Traccar.view.permissions.DeviceGeofences', - 'Traccar.view.permissions.DeviceAttributes', - 'Traccar.view.permissions.DeviceDrivers', + 'Traccar.view.permissions.Geofences', + 'Traccar.view.permissions.ComputedAttributes', + 'Traccar.view.permissions.Drivers', + 'Traccar.view.permissions.SavedCommands', 'Traccar.view.BaseWindow', 'Traccar.model.Device', 'Traccar.model.Command' @@ -76,7 +77,7 @@ Ext.define('Traccar.view.edit.DevicesController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedGeofences, items: { - xtype: 'deviceGeofencesView', + xtype: 'linkGeofencesView', baseObjectName: 'deviceId', linkObjectName: 'geofenceId', storeName: 'Geofences', @@ -90,7 +91,7 @@ Ext.define('Traccar.view.edit.DevicesController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedComputedAttributes, items: { - xtype: 'deviceAttributesView', + xtype: 'linkComputedAttributesView', baseObjectName: 'deviceId', linkObjectName: 'attributeId', storeName: 'ComputedAttributes', @@ -104,7 +105,7 @@ Ext.define('Traccar.view.edit.DevicesController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedDrivers, items: { - xtype: 'deviceDriversView', + xtype: 'linkDriversView', baseObjectName: 'deviceId', linkObjectName: 'driverId', storeName: 'Drivers', @@ -114,22 +115,31 @@ Ext.define('Traccar.view.edit.DevicesController', { }, onCommandClick: function () { - var device, deviceId, command, dialog, typesStore, online; + var device, deviceId, dialog, typesStore, online, commandsStore; device = this.getView().getSelectionModel().getSelection()[0]; online = device.get('status') === 'online'; deviceId = device.get('id'); - command = Ext.create('Traccar.model.Command'); - command.set('deviceId', deviceId); - command.set('textChannel', !online); - - dialog = Ext.create('Traccar.view.dialog.Command'); - - typesStore = dialog.lookupReference('commandType').getStore(); - typesStore.getProxy().setExtraParam('deviceId', deviceId); + dialog = Ext.create('Traccar.view.dialog.SendCommand'); + dialog.deviceId = deviceId; + dialog.online = online; + + commandsStore = dialog.lookupReference('commandsComboBox').getStore(); + commandsStore.getProxy().setExtraParam('deviceId', deviceId); + commandsStore.removeAll(); + if (!Traccar.app.getPreference('limitCommands', false)) { + commandsStore.add({ + id: 0, + description: Strings.sharedNew, + textChannel: !online + }); + typesStore = dialog.lookupReference('commandType').getStore(); + typesStore.getProxy().setExtraParam('deviceId', deviceId); + } + commandsStore.load({ + addRecords: true + }); - dialog.down('form').loadRecord(command); - dialog.lookupReference('textChannelCheckBox').setDisabled(!online); dialog.show(); }, diff --git a/web/app/view/edit/Groups.js b/web/app/view/edit/Groups.js index deb797f..05c5723 100644 --- a/web/app/view/edit/Groups.js +++ b/web/app/view/edit/Groups.js @@ -57,6 +57,14 @@ Ext.define('Traccar.view.edit.Groups', { glyph: 'xf2c2@FontAwesome', tooltip: Strings.sharedDrivers, tooltipType: 'title' + }, { + xtype: 'button', + disabled: true, + handler: 'onCommandsClick', + reference: 'toolbarCommandsButton', + glyph: 'xf093@FontAwesome', + tooltip: Strings.sharedSavedCommands, + tooltipType: 'title' }] }, diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index be26cc9..872fea4 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -21,9 +21,10 @@ Ext.define('Traccar.view.edit.GroupsController', { requires: [ 'Traccar.view.dialog.Group', - 'Traccar.view.permissions.GroupGeofences', - 'Traccar.view.permissions.GroupAttributes', - 'Traccar.view.permissions.GroupDrivers', + 'Traccar.view.permissions.Geofences', + 'Traccar.view.permissions.ComputedAttributes', + 'Traccar.view.permissions.Drivers', + 'Traccar.view.permissions.SavedCommands', 'Traccar.view.BaseWindow', 'Traccar.model.Group' ], @@ -37,6 +38,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); this.lookupReference('toolbarAttributesButton').setHidden( Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); + this.lookupReference('toolbarCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); }, onGeofencesClick: function () { @@ -46,7 +48,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedGeofences, items: { - xtype: 'groupGeofencesView', + xtype: 'linkGeofencesView', baseObjectName: 'groupId', linkObjectName: 'geofenceId', storeName: admin ? 'AllGeofences' : 'Geofences', @@ -62,7 +64,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedComputedAttributes, items: { - xtype: 'groupAttributesView', + xtype: 'linkComputedAttributesView', baseObjectName: 'groupId', linkObjectName: 'attributeId', storeName: admin ? 'AllComputedAttributes' : 'ComputedAttributes', @@ -78,7 +80,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedDrivers, items: { - xtype: 'groupDriversView', + xtype: 'linkDriversView', baseObjectName: 'groupId', linkObjectName: 'driverId', storeName: admin ? 'AllDrivers' : 'Drivers', @@ -87,11 +89,28 @@ Ext.define('Traccar.view.edit.GroupsController', { }).show(); }, + onCommandsClick: function () { + var admin, group; + admin = Traccar.app.getUser().get('admin'); + group = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedSavedCommands, + items: { + xtype: 'linkSavedCommandsView', + baseObjectName: 'groupId', + linkObjectName: 'commandId', + storeName: admin ? 'AllCommands' : 'Commands', + baseObject: group.getId() + } + }).show(); + }, + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); this.lookupReference('toolbarAttributesButton').setDisabled(disabled); this.lookupReference('toolbarDriversButton').setDisabled(disabled); + this.lookupReference('toolbarCommandsButton').setDisabled(disabled); this.callParent(arguments); } }); diff --git a/web/app/view/edit/SavedCommands.js b/web/app/view/edit/SavedCommands.js new file mode 100644 index 0000000..8f1f6b3 --- /dev/null +++ b/web/app/view/edit/SavedCommands.js @@ -0,0 +1,66 @@ +/* + * 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.SavedCommands', { + extend: 'Ext.grid.Panel', + xtype: 'savedCommandsView', + + requires: [ + 'Ext.grid.filters.Filters', + 'Traccar.view.edit.SavedCommandsController', + 'Traccar.view.edit.Toolbar' + ], + + plugins: 'gridfilters', + + controller: 'savedCommands', + store: 'Commands', + + tbar: { + xtype: 'editToolbar' + }, + + listeners: { + selectionchange: 'onSelectionChange' + }, + + columns: { + defaults: { + flex: 1, + minWidth: Traccar.Style.columnWidthNormal + }, + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description', + filter: 'string' + }, { + text: Strings.sharedType, + dataIndex: 'name', + filter: { + type: 'list', + idField: 'name', + labelField: 'name', + store: 'AllCommandTypes' + } + }, { + text: Strings.notificationSms, + dataIndex: 'textChannel', + filter: 'boolean' + }] + } +}); diff --git a/web/app/view/edit/SavedCommandsController.js b/web/app/view/edit/SavedCommandsController.js new file mode 100644 index 0000000..989aeab --- /dev/null +++ b/web/app/view/edit/SavedCommandsController.js @@ -0,0 +1,32 @@ +/* + * 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.SavedCommandsController', { + extend: 'Traccar.view.edit.ToolbarController', + alias: 'controller.savedCommands', + + requires: [ + 'Traccar.view.dialog.SavedCommand', + 'Traccar.model.Command' + ], + + objectModel: 'Traccar.model.Command', + objectDialog: 'Traccar.view.dialog.SavedCommand', + removeTitle: Strings.sharedSavedCommand + +}); diff --git a/web/app/view/edit/Users.js b/web/app/view/edit/Users.js index bb121be..c77ba49 100644 --- a/web/app/view/edit/Users.js +++ b/web/app/view/edit/Users.js @@ -90,6 +90,14 @@ Ext.define('Traccar.view.edit.Users', { glyph: 'xf2c2@FontAwesome', tooltip: Strings.sharedDrivers, tooltipType: 'title' + }, { + xtype: 'button', + disabled: true, + handler: 'onCommandsClick', + reference: 'userCommandsButton', + glyph: 'xf093@FontAwesome', + tooltip: Strings.sharedSavedCommands, + tooltipType: 'title' }] }, diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index 3bc7d1c..f710ed2 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -22,13 +22,14 @@ Ext.define('Traccar.view.edit.UsersController', { requires: [ 'Traccar.view.dialog.User', - 'Traccar.view.permissions.UserDevices', - 'Traccar.view.permissions.UserGroups', - 'Traccar.view.permissions.UserGeofences', - 'Traccar.view.permissions.UserCalendars', - 'Traccar.view.permissions.UserUsers', - 'Traccar.view.permissions.UserAttributes', - 'Traccar.view.permissions.UserDrivers', + 'Traccar.view.permissions.Devices', + 'Traccar.view.permissions.Groups', + 'Traccar.view.permissions.Geofences', + 'Traccar.view.permissions.Calendars', + 'Traccar.view.permissions.Users', + 'Traccar.view.permissions.ComputedAttributes', + 'Traccar.view.permissions.Drivers', + 'Traccar.view.permissions.SavedCommands', 'Traccar.view.Notifications', 'Traccar.view.BaseWindow', 'Traccar.model.User' @@ -47,6 +48,7 @@ Ext.define('Traccar.view.edit.UsersController', { Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); this.lookupReference('userCalendarsButton').setHidden( Traccar.app.getBooleanAttributePreference('ui.disableCalendars')); + this.lookupReference('userCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); }, onEditClick: function () { @@ -78,7 +80,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.deviceTitle, items: { - xtype: 'userDevicesView', + xtype: 'linkDevicesView', baseObjectName: 'userId', linkObjectName: 'deviceId', storeName: 'AllDevices', @@ -93,7 +95,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.settingsGroups, items: { - xtype: 'userGroupsView', + xtype: 'linkGroupsView', baseObjectName: 'userId', linkObjectName: 'groupId', storeName: 'AllGroups', @@ -108,7 +110,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedGeofences, items: { - xtype: 'userGeofencesView', + xtype: 'linkGeofencesView', baseObjectName: 'userId', linkObjectName: 'geofenceId', storeName: 'AllGeofences', @@ -134,7 +136,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedCalendars, items: { - xtype: 'userCalendarsView', + xtype: 'linkCalendarsView', baseObjectName: 'userId', linkObjectName: 'calendarId', storeName: 'AllCalendars', @@ -149,7 +151,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.settingsUsers, items: { - xtype: 'userUsersView', + xtype: 'linkUsersView', baseObjectName: 'userId', linkObjectName: 'managedUserId', storeName: 'Users', @@ -163,7 +165,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedComputedAttributes, items: { - xtype: 'userAttributesView', + xtype: 'linkComputedAttributesView', baseObjectName: 'userId', linkObjectName: 'attributeId', storeName: 'AllComputedAttributes', @@ -178,7 +180,7 @@ Ext.define('Traccar.view.edit.UsersController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedDrivers, items: { - xtype: 'userDriversView', + xtype: 'linkDriversView', baseObjectName: 'userId', linkObjectName: 'driverId', storeName: 'AllDrivers', @@ -188,6 +190,20 @@ Ext.define('Traccar.view.edit.UsersController', { }).show(); }, + onCommandsClick: function () { + var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedSavedCommands, + items: { + xtype: 'linkSavedCommandsView', + baseObjectName: 'userId', + linkObjectName: 'commandId', + storeName: 'AllCommands', + linkStoreName: 'Commands', + baseObject: user.getId() + } + }).show(); + }, onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; @@ -198,6 +214,7 @@ Ext.define('Traccar.view.edit.UsersController', { this.lookupReference('userCalendarsButton').setDisabled(disabled); this.lookupReference('userAttributesButton').setDisabled(disabled); this.lookupReference('userDriversButton').setDisabled(disabled); + this.lookupReference('userCommandsButton').setDisabled(disabled); this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0); this.callParent(arguments); } diff --git a/web/app/view/permissions/Calendars.js b/web/app/view/permissions/Calendars.js new file mode 100644 index 0000000..ff2796b --- /dev/null +++ b/web/app/view/permissions/Calendars.js @@ -0,0 +1,38 @@ +/* + * 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.permissions.Calendars', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkCalendarsView', + + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedName, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }] + } +}); diff --git a/web/app/view/permissions/ComputedAttributes.js b/web/app/view/permissions/ComputedAttributes.js new file mode 100644 index 0000000..800717c --- /dev/null +++ b/web/app/view/permissions/ComputedAttributes.js @@ -0,0 +1,51 @@ +/* + * 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.ComputedAttributes', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkComputedAttributesView', + + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.sharedAttribute, + dataIndex: 'attribute', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: { + type: 'list', + labelField: 'name', + store: 'PositionAttributes' + }, + renderer: function (value) { + return Ext.getStore('PositionAttributes').getAttributeName(value); + } + }] + } +}); diff --git a/web/app/view/permissions/DeviceAttributes.js b/web/app/view/permissions/DeviceAttributes.js deleted file mode 100644 index c7755f0..0000000 --- a/web/app/view/permissions/DeviceAttributes.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedDescription, - dataIndex: 'description', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedAttribute, - dataIndex: 'attribute', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: { - type: 'list', - labelField: 'name', - store: 'PositionAttributes' - }, - renderer: function (value) { - return Ext.getStore('PositionAttributes').getAttributeName(value); - } - }] - } -}); diff --git a/web/app/view/permissions/DeviceDrivers.js b/web/app/view/permissions/DeviceDrivers.js deleted file mode 100644 index d3aa20b..0000000 --- a/web/app/view/permissions/DeviceDrivers.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.DeviceDrivers', { - extend: 'Traccar.view.permissions.Base', - xtype: 'deviceDriversView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.deviceIdentifier, - dataIndex: 'uniqueId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/DeviceGeofences.js b/web/app/view/permissions/DeviceGeofences.js deleted file mode 100644 index c16bced..0000000 --- a/web/app/view/permissions/DeviceGeofences.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@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.DeviceGeofences', { - extend: 'Traccar.view.permissions.Base', - xtype: 'deviceGeofencesView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/Devices.js b/web/app/view/permissions/Devices.js new file mode 100644 index 0000000..4cadafe --- /dev/null +++ b/web/app/view/permissions/Devices.js @@ -0,0 +1,77 @@ +/* + * Copyright 2015 - 2017 Anton Tananaev (anton@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.Devices', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkDevicesView', + + requires: [ + 'Ext.grid.filters.Filters', + 'Traccar.AttributeFormatter' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedName, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.deviceIdentifier, + dataIndex: 'uniqueId', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.sharedPhone, + dataIndex: 'phone', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: 'string' + }, { + text: Strings.deviceModel, + dataIndex: 'model', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: 'string' + }, { + text: Strings.deviceContact, + dataIndex: 'contact', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: 'string' + }, { + text: Strings.groupDialog, + dataIndex: 'groupId', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: { + type: 'list', + labelField: 'name', + store: 'AllGroups' + }, + renderer: Traccar.AttributeFormatter.getFormatter('groupId') + }] + } +}); diff --git a/web/app/view/permissions/Drivers.js b/web/app/view/permissions/Drivers.js new file mode 100644 index 0000000..f0ea289 --- /dev/null +++ b/web/app/view/permissions/Drivers.js @@ -0,0 +1,44 @@ +/* + * 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.Drivers', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkDriversView', + + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedName, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.deviceIdentifier, + dataIndex: 'uniqueId', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }] + } +}); diff --git a/web/app/view/permissions/Geofences.js b/web/app/view/permissions/Geofences.js new file mode 100644 index 0000000..84135d3 --- /dev/null +++ b/web/app/view/permissions/Geofences.js @@ -0,0 +1,37 @@ +/* + * Copyright 2016 - 2017 Anton Tananaev (anton@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.Geofences', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkGeofencesView', + + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedName, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }] + } +}); diff --git a/web/app/view/permissions/GroupAttributes.js b/web/app/view/permissions/GroupAttributes.js deleted file mode 100644 index 4db8b24..0000000 --- a/web/app/view/permissions/GroupAttributes.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - columns: { - items: [{ - text: Strings.sharedDescription, - dataIndex: 'description', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedAttribute, - dataIndex: 'attribute', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: { - type: 'list', - labelField: 'name', - store: 'PositionAttributes' - }, - renderer: function (value) { - return Ext.getStore('PositionAttributes').getAttributeName(value); - } - }] - } -}); diff --git a/web/app/view/permissions/GroupDrivers.js b/web/app/view/permissions/GroupDrivers.js deleted file mode 100644 index 61aa10a..0000000 --- a/web/app/view/permissions/GroupDrivers.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.GroupDrivers', { - extend: 'Traccar.view.permissions.Base', - xtype: 'groupDriversView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.deviceIdentifier, - dataIndex: 'uniqueId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/GroupGeofences.js b/web/app/view/permissions/GroupGeofences.js deleted file mode 100644 index f365e35..0000000 --- a/web/app/view/permissions/GroupGeofences.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@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.GroupGeofences', { - extend: 'Traccar.view.permissions.Base', - xtype: 'groupGeofencesView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/Groups.js b/web/app/view/permissions/Groups.js new file mode 100644 index 0000000..d3cad98 --- /dev/null +++ b/web/app/view/permissions/Groups.js @@ -0,0 +1,50 @@ +/* + * Copyright 2016 - 2017 Anton Tananaev (anton@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.Groups', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkGroupsView', + + requires: [ + 'Ext.grid.filters.Filters', + 'Traccar.AttributeFormatter' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedName, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.groupDialog, + dataIndex: 'groupId', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: { + type: 'list', + labelField: 'name', + store: 'AllGroups' + }, + renderer: Traccar.AttributeFormatter.getFormatter('groupId') + }] + } +}); diff --git a/web/app/view/permissions/SavedCommands.js b/web/app/view/permissions/SavedCommands.js new file mode 100644 index 0000000..1c7ab77 --- /dev/null +++ b/web/app/view/permissions/SavedCommands.js @@ -0,0 +1,55 @@ +/* + * 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.SavedCommands', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkSavedCommandsView', + + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + + columns: { + items: [{ + text: Strings.sharedDescription, + dataIndex: 'description', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.sharedType, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: { + type: 'list', + idField: 'name', + labelField: 'name', + store: 'AllCommandTypes' + } + }, { + text: Strings.notificationSms, + dataIndex: 'textChannel', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'boolean' + }] + } +}); diff --git a/web/app/view/permissions/UserAttributes.js b/web/app/view/permissions/UserAttributes.js deleted file mode 100644 index a0a385e..0000000 --- a/web/app/view/permissions/UserAttributes.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedDescription, - dataIndex: 'description', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedAttribute, - dataIndex: 'attribute', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: { - type: 'list', - labelField: 'name', - store: 'PositionAttributes' - }, - renderer: function (value) { - return Ext.getStore('PositionAttributes').getAttributeName(value); - } - }] - } -}); diff --git a/web/app/view/permissions/UserCalendars.js b/web/app/view/permissions/UserCalendars.js deleted file mode 100644 index 54ecfc2..0000000 --- a/web/app/view/permissions/UserCalendars.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.permissions.UserCalendars', { - extend: 'Traccar.view.permissions.Base', - xtype: 'userCalendarsView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/UserDevices.js b/web/app/view/permissions/UserDevices.js deleted file mode 100644 index a9bb65b..0000000 --- a/web/app/view/permissions/UserDevices.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@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.UserDevices', { - extend: 'Traccar.view.permissions.Base', - xtype: 'userDevicesView', - - requires: [ - 'Ext.grid.filters.Filters', - 'Traccar.AttributeFormatter' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.deviceIdentifier, - dataIndex: 'uniqueId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedPhone, - dataIndex: 'phone', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: 'string' - }, { - text: Strings.deviceModel, - dataIndex: 'model', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: 'string' - }, { - text: Strings.deviceContact, - dataIndex: 'contact', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: 'string' - }, { - text: Strings.groupDialog, - dataIndex: 'groupId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllGroups' - }, - renderer: Traccar.AttributeFormatter.getFormatter('groupId') - }] - } -}); diff --git a/web/app/view/permissions/UserDrivers.js b/web/app/view/permissions/UserDrivers.js deleted file mode 100644 index 8f88ddd..0000000 --- a/web/app/view/permissions/UserDrivers.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.UserDrivers', { - extend: 'Traccar.view.permissions.Base', - xtype: 'userDriversView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.deviceIdentifier, - dataIndex: 'uniqueId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/UserGeofences.js b/web/app/view/permissions/UserGeofences.js deleted file mode 100644 index 436a2a6..0000000 --- a/web/app/view/permissions/UserGeofences.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@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.UserGeofences', { - extend: 'Traccar.view.permissions.Base', - xtype: 'userGeofencesView', - - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/UserGroups.js b/web/app/view/permissions/UserGroups.js deleted file mode 100644 index bc24201..0000000 --- a/web/app/view/permissions/UserGroups.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@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.UserGroups', { - extend: 'Traccar.view.permissions.Base', - xtype: 'userGroupsView', - - requires: [ - 'Ext.grid.filters.Filters', - 'Traccar.AttributeFormatter' - ], - - plugins: 'gridfilters', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.groupDialog, - dataIndex: 'groupId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllGroups' - }, - renderer: Traccar.AttributeFormatter.getFormatter('groupId') - }] - } -}); diff --git a/web/app/view/permissions/UserUsers.js b/web/app/view/permissions/UserUsers.js deleted file mode 100644 index c5980c2..0000000 --- a/web/app/view/permissions/UserUsers.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.UserUsers', { - extend: 'Traccar.view.permissions.Base', - xtype: 'userUsersView', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }] - } -}); diff --git a/web/app/view/permissions/Users.js b/web/app/view/permissions/Users.js new file mode 100644 index 0000000..66cf5d6 --- /dev/null +++ b/web/app/view/permissions/Users.js @@ -0,0 +1,32 @@ +/* + * 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.Users', { + extend: 'Traccar.view.permissions.Base', + xtype: 'linkUsersView', + + columns: { + items: [{ + text: Strings.sharedName, + dataIndex: 'name', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }] + } +}); -- cgit v1.2.3