From b392a4af78e01c8e0f50aad5468e9583675b24be Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 6 Apr 2024 09:17:52 -0700 Subject: Move to the legacy folder --- web/app/view/permissions/Base.js | 37 ------------ web/app/view/permissions/BaseController.js | 84 -------------------------- web/app/view/permissions/Calendars.js | 32 ---------- web/app/view/permissions/ComputedAttributes.js | 45 -------------- web/app/view/permissions/Devices.js | 82 ------------------------- web/app/view/permissions/Drivers.js | 38 ------------ web/app/view/permissions/Geofences.js | 43 ------------- web/app/view/permissions/Groups.js | 47 -------------- web/app/view/permissions/Maintenances.js | 65 -------------------- web/app/view/permissions/Notifications.js | 78 ------------------------ web/app/view/permissions/SavedCommands.js | 50 --------------- web/app/view/permissions/Users.js | 32 ---------- 12 files changed, 633 deletions(-) delete mode 100644 web/app/view/permissions/Base.js delete mode 100644 web/app/view/permissions/BaseController.js delete mode 100644 web/app/view/permissions/Calendars.js delete mode 100644 web/app/view/permissions/ComputedAttributes.js delete mode 100644 web/app/view/permissions/Devices.js delete mode 100644 web/app/view/permissions/Drivers.js delete mode 100644 web/app/view/permissions/Geofences.js delete mode 100644 web/app/view/permissions/Groups.js delete mode 100644 web/app/view/permissions/Maintenances.js delete mode 100644 web/app/view/permissions/Notifications.js delete mode 100644 web/app/view/permissions/SavedCommands.js delete mode 100644 web/app/view/permissions/Users.js (limited to 'web/app/view/permissions') diff --git a/web/app/view/permissions/Base.js b/web/app/view/permissions/Base.js deleted file mode 100644 index 57017531..00000000 --- a/web/app/view/permissions/Base.js +++ /dev/null @@ -1,37 +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.Base', { - extend: 'Traccar.view.GridPanel', - - requires: [ - 'Traccar.view.permissions.BaseController' - ], - - controller: 'base', - - selModel: { - selType: 'checkboxmodel', - checkOnly: true, - showHeaderCheckbox: false - }, - - listeners: { - beforedeselect: 'onBeforeDeselect', - beforeselect: 'onBeforeSelect' - } -}); diff --git a/web/app/view/permissions/BaseController.js b/web/app/view/permissions/BaseController.js deleted file mode 100644 index 5cb9c302..00000000 --- a/web/app/view/permissions/BaseController.js +++ /dev/null @@ -1,84 +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.BaseController', { - extend: 'Ext.app.ViewController', - alias: 'controller.base', - - init: function () { - var params = {}, linkStoreName, storeName; - params[this.getView().baseObjectName] = this.getView().baseObject; - linkStoreName = this.getView().linkStoreName; - storeName = this.getView().storeName; - linkStoreName = typeof linkStoreName === 'undefined' ? storeName : linkStoreName; - this.getView().setStore(Ext.getStore(storeName)); - this.getView().getStore().load({ - scope: this, - callback: function () { - var linkStore = Ext.create('Traccar.store.' + linkStoreName); - linkStore.load({ - params: params, - scope: this, - callback: function (records, operation, success) { - var i, index; - if (success) { - for (i = 0; i < records.length; i++) { - index = this.getView().getStore().getById(records[i].getId()); - this.getView().getSelectionModel().select(index, true, true); - } - } - } - }); - } - }); - }, - - onBeforeSelect: function (selection, record) { - var data = {}; - data[this.getView().baseObjectName] = this.getView().baseObject; - data[this.getView().linkObjectName] = record.getId(); - Ext.Ajax.request({ - scope: this, - url: 'api/permissions', - jsonData: Ext.util.JSON.encode(data), - callback: function (options, success, response) { - if (!success) { - selection.deselect(record, true); - Traccar.app.showError(response); - } - } - }); - }, - - onBeforeDeselect: function (selection, record) { - var data = {}; - data[this.getView().baseObjectName] = this.getView().baseObject; - data[this.getView().linkObjectName] = record.getId(); - Ext.Ajax.request({ - scope: this, - method: 'DELETE', - url: 'api/permissions', - jsonData: Ext.util.JSON.encode(data), - callback: function (options, success, response) { - if (!success) { - selection.select(record, true, true); - Traccar.app.showError(response); - } - } - }); - } -}); diff --git a/web/app/view/permissions/Calendars.js b/web/app/view/permissions/Calendars.js deleted file mode 100644 index 3d08efca..00000000 --- a/web/app/view/permissions/Calendars.js +++ /dev/null @@ -1,32 +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.Calendars', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkCalendarsView', - - 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 deleted file mode 100644 index 19af72ad..00000000 --- a/web/app/view/permissions/ComputedAttributes.js +++ /dev/null @@ -1,45 +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.ComputedAttributes', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkComputedAttributesView', - - 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/Devices.js b/web/app/view/permissions/Devices.js deleted file mode 100644 index 3180b107..00000000 --- a/web/app/view/permissions/Devices.js +++ /dev/null @@ -1,82 +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.Devices', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkDevicesView', - - requires: [ - 'Traccar.AttributeFormatter' - ], - - 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.sharedDisabled, - dataIndex: 'disabled', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - renderer: Traccar.AttributeFormatter.getFormatter('disabled'), - hidden: true, - filter: 'boolean' - }, { - 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 deleted file mode 100644 index 33cf2f76..00000000 --- a/web/app/view/permissions/Drivers.js +++ /dev/null @@ -1,38 +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.Drivers', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkDriversView', - - 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 deleted file mode 100644 index e2e85a36..00000000 --- a/web/app/view/permissions/Geofences.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2016 - 2018 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', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedCalendar, - dataIndex: 'calendarId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllCalendars' - }, - renderer: Traccar.AttributeFormatter.getFormatter('calendarId') - }] - } -}); diff --git a/web/app/view/permissions/Groups.js b/web/app/view/permissions/Groups.js deleted file mode 100644 index 91a639c0..00000000 --- a/web/app/view/permissions/Groups.js +++ /dev/null @@ -1,47 +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.Groups', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkGroupsView', - - requires: [ - 'Traccar.AttributeFormatter' - ], - - 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/Maintenances.js b/web/app/view/permissions/Maintenances.js deleted file mode 100644 index c5255769..00000000 --- a/web/app/view/permissions/Maintenances.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2018 Anton Tananaev (anton@traccar.org) - * Copyright 2018 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.Maintenances', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkMaintenancesView', - - columns: { - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedType, - dataIndex: 'type', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: { - type: 'list', - idField: 'key', - labelField: 'name', - store: 'MaintenanceTypes' - }, - renderer: function (value) { - var attribute = Ext.getStore('MaintenanceTypes').getById(value); - return attribute && attribute.get('name') || value; - } - }, { - text: Strings.maintenanceStart, - dataIndex: 'start', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - renderer: function (value, metaData, record) { - return Traccar.AttributeFormatter.renderAttribute( - value, Ext.getStore('MaintenanceTypes').getById(record.get('type'))); - } - }, { - text: Strings.maintenancePeriod, - dataIndex: 'period', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - renderer: function (value, metaData, record) { - return Traccar.AttributeFormatter.renderAttribute( - value, Ext.getStore('MaintenanceTypes').getById(record.get('type'))); - } - }] - } -}); diff --git a/web/app/view/permissions/Notifications.js b/web/app/view/permissions/Notifications.js deleted file mode 100644 index a8570fea..00000000 --- a/web/app/view/permissions/Notifications.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org) - * Copyright 2017 - 2018 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.Notifications', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkNotificationsView', - - columns: { - items: [{ - text: Strings.notificationType, - dataIndex: 'type', - flex: 2, - renderer: function (value) { - return Traccar.app.getEventString(value); - }, - filter: { - type: 'list', - idField: 'type', - labelField: 'name', - store: 'AllNotificationTypes' - } - }, { - text: Strings.notificationAlways, - dataIndex: 'always', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - renderer: Traccar.AttributeFormatter.getFormatter('always'), - filter: 'boolean' - }, { - text: Strings.notificationNotificators, - dataIndex: 'notificators', - flex: 2, - filter: { - type: 'arraylist', - idField: 'type', - labelField: 'name', - store: 'AllNotificators' - }, - renderer: function (value) { - var result = '', i, notificators; - if (value) { - notificators = value.split(/[ ,]+/).filter(Boolean); - for (i = 0; i < notificators.length; i++) { - result += Traccar.app.getNotificatorString(notificators[i]) + (i < notificators.length - 1 ? ', ' : ''); - } - } - return result; - } - }, { - text: Strings.sharedCalendar, - dataIndex: 'calendarId', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllCalendars' - }, - renderer: Traccar.AttributeFormatter.getFormatter('calendarId') - }] - } -}); diff --git a/web/app/view/permissions/SavedCommands.js b/web/app/view/permissions/SavedCommands.js deleted file mode 100644 index b57c07a0..00000000 --- a/web/app/view/permissions/SavedCommands.js +++ /dev/null @@ -1,50 +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.SavedCommands', { - extend: 'Traccar.view.permissions.Base', - xtype: 'linkSavedCommandsView', - - columns: { - items: [{ - text: Strings.sharedDescription, - dataIndex: 'description', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'string' - }, { - text: Strings.sharedType, - dataIndex: 'type', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: { - type: 'list', - idField: 'type', - labelField: 'name', - store: 'AllCommandTypes' - }, - renderer: Traccar.AttributeFormatter.getFormatter('commandType') - }, { - text: Strings.commandSendSms, - dataIndex: 'textChannel', - flex: 1, - minWidth: Traccar.Style.columnWidthNormal, - filter: 'boolean' - }] - } -}); diff --git a/web/app/view/permissions/Users.js b/web/app/view/permissions/Users.js deleted file mode 100644 index 66cf5d62..00000000 --- a/web/app/view/permissions/Users.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.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