diff options
Diffstat (limited to 'web/app/store')
-rw-r--r-- | web/app/store/AllNotifications.js | 5 | ||||
-rw-r--r-- | web/app/store/AllTimezones.js | 2 | ||||
-rw-r--r-- | web/app/store/CommandTypes.js | 2 | ||||
-rw-r--r-- | web/app/store/CommonDeviceAttributes.js | 42 | ||||
-rw-r--r-- | web/app/store/CommonUserAttributes.js | 55 | ||||
-rw-r--r-- | web/app/store/DeviceAttributes.js | 20 | ||||
-rw-r--r-- | web/app/store/GroupAttributes.js | 20 | ||||
-rw-r--r-- | web/app/store/Notifications.js | 5 | ||||
-rw-r--r-- | web/app/store/PositionAttributes.js | 12 | ||||
-rw-r--r-- | web/app/store/ServerAttributes.js | 34 | ||||
-rw-r--r-- | web/app/store/UserAttributes.js | 17 |
11 files changed, 113 insertions, 101 deletions
diff --git a/web/app/store/AllNotifications.js b/web/app/store/AllNotifications.js index f25aebc4..61aa75ab 100644 --- a/web/app/store/AllNotifications.js +++ b/web/app/store/AllNotifications.js @@ -27,5 +27,8 @@ Ext.define('Traccar.store.AllNotifications', { } }, sortOnLoad: true, - sorters: { property: 'type', direction : 'ASC' } + sorters: { + property: 'type', + direction: 'ASC' + } }); diff --git a/web/app/store/AllTimezones.js b/web/app/store/AllTimezones.js index e5a861b6..2a7fa371 100644 --- a/web/app/store/AllTimezones.js +++ b/web/app/store/AllTimezones.js @@ -21,7 +21,7 @@ Ext.define('Traccar.store.AllTimezones', { sorters: { property: 'key', - direction : 'ASC' + direction: 'ASC' }, data: [{ diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js index 445f937d..a14dd58e 100644 --- a/web/app/store/CommandTypes.js +++ b/web/app/store/CommandTypes.js @@ -41,7 +41,7 @@ Ext.define('Traccar.store.CommandTypes', { } }, listeners: { - 'exception' : function (proxy, response) { + 'exception': function (proxy, response) { Traccar.app.showError(response); } } diff --git a/web/app/store/CommonDeviceAttributes.js b/web/app/store/CommonDeviceAttributes.js new file mode 100644 index 00000000..83dd4114 --- /dev/null +++ b/web/app/store/CommonDeviceAttributes.js @@ -0,0 +1,42 @@ +/* + * 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 <http://www.gnu.org/licenses/>. + */ +Ext.define('Traccar.store.CommonDeviceAttributes', { + extend: 'Ext.data.Store', + model: 'Traccar.model.KnownAttribute', + + data: [{ + key: 'speedLimit', + name: Strings.attributeSpeedLimit, + valueType: 'number', + dataType: 'speed' + }, { + key: 'report.ignoreOdometer', + name: Strings.attributeReportIgnoreOdometer, + valueType: 'boolean' + }, { + key: 'maintenance.start', + name: Strings.attributeMaintenanceStart, + valueType: 'number', + dataType: 'distance' + }, { + key: 'maintenance.interval', + name: Strings.attributeMaintenanceInterval, + valueType: 'number', + dataType: 'distance' + }] +}); diff --git a/web/app/store/CommonUserAttributes.js b/web/app/store/CommonUserAttributes.js new file mode 100644 index 00000000..85d652df --- /dev/null +++ b/web/app/store/CommonUserAttributes.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 <http://www.gnu.org/licenses/>. + */ +Ext.define('Traccar.store.CommonUserAttributes', { + extend: 'Ext.data.Store', + model: 'Traccar.model.KnownAttribute', + + data: [{ + key: 'web.liveRouteLength', + name: Strings.attributeWebLiveRouteLength, + valueType: 'number', + allowDecimals: false + }, { + key: 'web.selectZoom', + name: Strings.attributeWebSelectZoom, + valueType: 'number', + allowDecimals: false, + minValue: Traccar.Style.mapDefaultZoom, + maxValue: Traccar.Style.mapMaxZoom + }, { + key: 'ui.disableReport', + name: Strings.attributeUiDisableReport, + valueType: 'boolean' + }, { + key: 'ui.disableVehicleFetures', + name: Strings.attributeUiDisableVehicleFetures, + valueType: 'boolean' + }, { + key: 'ui.disableDrivers', + name: Strings.attributeUiDisableDrivers, + valueType: 'boolean' + }, { + key: 'ui.disableComputedAttributes', + name: Strings.attributeUiDisableComputedAttributes, + valueType: 'boolean' + }, { + key: 'ui.disableCalendars', + name: Strings.attributeUiDisableCalendars, + valueType: 'boolean' + }] +}); diff --git a/web/app/store/DeviceAttributes.js b/web/app/store/DeviceAttributes.js index 220f9a5b..4b1d9204 100644 --- a/web/app/store/DeviceAttributes.js +++ b/web/app/store/DeviceAttributes.js @@ -18,28 +18,8 @@ Ext.define('Traccar.store.DeviceAttributes', { extend: 'Ext.data.Store', model: 'Traccar.model.KnownAttribute', - proxy: 'memory', data: [{ - key: 'speedLimit', - name: Strings.attributeSpeedLimit, - valueType: 'number', - dataType: 'speed' - }, { - key: 'report.ignoreOdometer', - name: Strings.attributeReportIgnoreOdometer, - valueType: 'boolean' - }, { - key: 'maintenance.start', - name: Strings.attributeMaintenanceStart, - valueType: 'number', - dataType: 'distance' - }, { - key: 'maintenance.interval', - name: Strings.attributeMaintenanceInterval, - valueType: 'number', - dataType: 'distance' - }, { key: 'web.reportColor', name: Strings.attributeWebReportColor, valueType: 'color' diff --git a/web/app/store/GroupAttributes.js b/web/app/store/GroupAttributes.js index 2a2765f5..9389db1c 100644 --- a/web/app/store/GroupAttributes.js +++ b/web/app/store/GroupAttributes.js @@ -18,28 +18,8 @@ Ext.define('Traccar.store.GroupAttributes', { extend: 'Ext.data.Store', model: 'Traccar.model.KnownAttribute', - proxy: 'memory', data: [{ - key: 'speedLimit', - name: Strings.attributeSpeedLimit, - valueType: 'number', - dataType: 'speed' - }, { - key: 'report.ignoreOdometer', - name: Strings.attributeReportIgnoreOdometer, - valueType: 'boolean' - }, { - key: 'maintenance.start', - name: Strings.attributeMaintenanceStart, - valueType: 'number', - dataType: 'distance' - }, { - key: 'maintenance.interval', - name: Strings.attributeMaintenanceInterval, - valueType: 'number', - dataType: 'distance' - }, { key: 'processing.copyAttributes', name: Strings.attributeProcessingCopyAttributes, valueType: 'string' diff --git a/web/app/store/Notifications.js b/web/app/store/Notifications.js index d79702fc..a672fd43 100644 --- a/web/app/store/Notifications.js +++ b/web/app/store/Notifications.js @@ -24,5 +24,8 @@ Ext.define('Traccar.store.Notifications', { url: 'api/users/notifications' }, sortOnLoad: true, - sorters: { property: 'type', direction : 'ASC' } + sorters: { + property: 'type', + direction: 'ASC' + } }); diff --git a/web/app/store/PositionAttributes.js b/web/app/store/PositionAttributes.js index c3d6d180..e457dafc 100644 --- a/web/app/store/PositionAttributes.js +++ b/web/app/store/PositionAttributes.js @@ -240,14 +240,12 @@ Ext.define('Traccar.store.PositionAttributes', { var model = this.getById(key); if (model) { return model.get('name'); + } else if (capitalize) { + return key.replace(/^./, function (match) { + return match.toUpperCase(); + }); } else { - if (capitalize) { - return key.replace(/^./, function (match) { - return match.toUpperCase(); - }); - } else { - return key; - } + return key; } }, diff --git a/web/app/store/ServerAttributes.js b/web/app/store/ServerAttributes.js index 89a0137b..204f885b 100644 --- a/web/app/store/ServerAttributes.js +++ b/web/app/store/ServerAttributes.js @@ -18,38 +18,6 @@ Ext.define('Traccar.store.ServerAttributes', { extend: 'Ext.data.Store', model: 'Traccar.model.KnownAttribute', - proxy: 'memory', - data: [{ - key: 'speedLimit', - name: Strings.attributeSpeedLimit, - valueType: 'number', - dataType: 'speed' - }, { - key: 'maintenance.start', - name: Strings.attributeMaintenanceStart, - valueType: 'number', - dataType: 'distance' - }, { - key: 'maintenance.interval', - name: Strings.attributeMaintenanceInterval, - valueType: 'number', - dataType: 'distance' - }, { - key: 'web.liveRouteLength', - name: Strings.attributeWebLiveRouteLength, - valueType: 'number', - allowDecimals: false - }, { - key: 'web.selectZoom', - name: Strings.attributeWebSelectZoom, - valueType: 'number', - allowDecimals: false, - minValue: Traccar.Style.mapDefaultZoom, - maxValue: Traccar.Style.mapMaxZoom - }, { - key: 'ui.disableReport', - name: Strings.attributeUiDisableReport, - valueType: 'boolean' - }] + data: [] }); diff --git a/web/app/store/UserAttributes.js b/web/app/store/UserAttributes.js index 6cf06fbb..dfe69421 100644 --- a/web/app/store/UserAttributes.js +++ b/web/app/store/UserAttributes.js @@ -18,7 +18,6 @@ Ext.define('Traccar.store.UserAttributes', { extend: 'Ext.data.Store', model: 'Traccar.model.KnownAttribute', - proxy: 'memory', data: [{ key: 'mail.smtp.host', @@ -67,21 +66,5 @@ Ext.define('Traccar.store.UserAttributes', { key: 'mail.smtp.password', name: Strings.attributeMailSmtpPassword, valueType: 'string' - }, { - key: 'web.liveRouteLength', - name: Strings.attributeWebLiveRouteLength, - valueType: 'number', - allowDecimals: false - }, { - key: 'web.selectZoom', - name: Strings.attributeWebSelectZoom, - valueType: 'number', - allowDecimals: false, - minValue: Traccar.Style.mapDefaultZoom, - maxValue: Traccar.Style.mapMaxZoom - }, { - key: 'ui.disableReport', - name: Strings.attributeUiDisableReport, - valueType: 'boolean' }] }); |