aboutsummaryrefslogtreecommitdiff
path: root/web/app/store
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/store')
-rw-r--r--web/app/store/AllCommandTypes.js6
-rw-r--r--web/app/store/AllMaintenances.js30
-rw-r--r--web/app/store/AllNotificationTypes.js6
-rw-r--r--web/app/store/AllNotificators.js32
-rw-r--r--web/app/store/CommonDeviceAttributes.js10
-rw-r--r--web/app/store/CommonUserAttributes.js4
-rw-r--r--web/app/store/GeofenceAttributes.js14
-rw-r--r--web/app/store/HoursUnits.js43
-rw-r--r--web/app/store/MaintenanceTypes.js22
-rw-r--r--web/app/store/Maintenances.js30
-rw-r--r--web/app/store/MapTypes.js3
-rw-r--r--web/app/store/PositionAttributes.js3
-rw-r--r--web/app/store/ReportEvents.js1
-rw-r--r--web/app/store/ReportRoute.js1
-rw-r--r--web/app/store/ReportStops.js1
-rw-r--r--web/app/store/ReportSummary.js1
-rw-r--r--web/app/store/ReportTrips.js1
17 files changed, 189 insertions, 19 deletions
diff --git a/web/app/store/AllCommandTypes.js b/web/app/store/AllCommandTypes.js
index c86d0714..c35f50d9 100644
--- a/web/app/store/AllCommandTypes.js
+++ b/web/app/store/AllCommandTypes.js
@@ -1,6 +1,6 @@
/*
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
- * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org)
+ * 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
@@ -24,7 +24,7 @@ Ext.define('Traccar.store.AllCommandTypes', {
type: 'rest',
url: 'api/commands/types',
listeners: {
- 'exception': function (proxy, response) {
+ exception: function (proxy, response) {
Traccar.app.showError(response);
}
}
diff --git a/web/app/store/AllMaintenances.js b/web/app/store/AllMaintenances.js
new file mode 100644
index 00000000..745b5d64
--- /dev/null
+++ b/web/app/store/AllMaintenances.js
@@ -0,0 +1,30 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.store.AllMaintenances', {
+ extend: 'Ext.data.Store',
+ model: 'Traccar.model.Maintenance',
+
+ proxy: {
+ type: 'rest',
+ url: 'api/maintenances',
+ extraParams: {
+ all: true
+ }
+ }
+});
diff --git a/web/app/store/AllNotificationTypes.js b/web/app/store/AllNotificationTypes.js
index ded5ef98..63fec1bc 100644
--- a/web/app/store/AllNotificationTypes.js
+++ b/web/app/store/AllNotificationTypes.js
@@ -1,6 +1,6 @@
/*
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
- * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org)
+ * 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
@@ -24,7 +24,7 @@ Ext.define('Traccar.store.AllNotificationTypes', {
type: 'rest',
url: 'api/notifications/types',
listeners: {
- 'exception': function (proxy, response) {
+ exception: function (proxy, response) {
Traccar.app.showError(response);
}
}
diff --git a/web/app/store/AllNotificators.js b/web/app/store/AllNotificators.js
new file mode 100644
index 00000000..d81b02fd
--- /dev/null
+++ b/web/app/store/AllNotificators.js
@@ -0,0 +1,32 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.store.AllNotificators', {
+ extend: 'Ext.data.Store',
+ model: 'Traccar.model.KnownNotificator',
+
+ proxy: {
+ type: 'rest',
+ url: 'api/notifications/notificators',
+ listeners: {
+ exception: function (proxy, response) {
+ Traccar.app.showError(response);
+ }
+ }
+ }
+});
diff --git a/web/app/store/CommonDeviceAttributes.js b/web/app/store/CommonDeviceAttributes.js
index 83dd4114..e63daa6b 100644
--- a/web/app/store/CommonDeviceAttributes.js
+++ b/web/app/store/CommonDeviceAttributes.js
@@ -28,15 +28,5 @@ Ext.define('Traccar.store.CommonDeviceAttributes', {
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
index c2c29429..0ee9e163 100644
--- a/web/app/store/CommonUserAttributes.js
+++ b/web/app/store/CommonUserAttributes.js
@@ -63,6 +63,10 @@ Ext.define('Traccar.store.CommonUserAttributes', {
name: Strings.attributeUiDisableCalendars,
valueType: 'boolean'
}, {
+ key: 'ui.disableMaintenances',
+ name: Strings.attributeUiDisableMaintenances,
+ valueType: 'boolean'
+ }, {
key: 'ui.hidePositionAttributes',
name: Strings.attributeUiHidePositionAttributes,
valueType: 'string'
diff --git a/web/app/store/GeofenceAttributes.js b/web/app/store/GeofenceAttributes.js
index 2b8d2d89..b1d48c19 100644
--- a/web/app/store/GeofenceAttributes.js
+++ b/web/app/store/GeofenceAttributes.js
@@ -1,6 +1,6 @@
/*
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
- * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org)
+ * 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
@@ -24,5 +24,15 @@ Ext.define('Traccar.store.GeofenceAttributes', {
key: 'color',
name: Strings.attributeColor,
valueType: 'color'
+ }, {
+ key: 'speedLimit',
+ name: Strings.attributeSpeedLimit,
+ valueType: 'number',
+ dataType: 'speed'
+ }, {
+ key: 'polylineDistance',
+ name: Strings.attributePolylineDistance,
+ valueType: 'number',
+ dataType: 'distance'
}]
});
diff --git a/web/app/store/HoursUnits.js b/web/app/store/HoursUnits.js
new file mode 100644
index 00000000..02f62c65
--- /dev/null
+++ b/web/app/store/HoursUnits.js
@@ -0,0 +1,43 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+Ext.define('Traccar.store.HoursUnits', {
+ extend: 'Ext.data.Store',
+ fields: ['key', 'name', 'fullName'],
+
+ data: [{
+ key: 'h',
+ name: Strings.sharedHourAbbreviation,
+ fullName: Strings.sharedHour
+ }],
+
+ convertValue: function (value, unit, back) {
+ return back ? value * 3600000 : value / 3600000;
+ },
+
+ formatValue: function (value, unit, convert) {
+ var hours, minutes;
+ if (convert) {
+ hours = Math.floor(value / 3600000);
+ minutes = Math.floor(value % 3600000 / 60000);
+ } else {
+ hours = Math.floor(value);
+ minutes = Math.floor(value % 1 * 60);
+ }
+ return hours + ' ' + Strings.sharedHourAbbreviation + ' ' + minutes + ' ' + Strings.sharedMinuteAbbreviation;
+ }
+});
diff --git a/web/app/store/MaintenanceTypes.js b/web/app/store/MaintenanceTypes.js
new file mode 100644
index 00000000..468b67ea
--- /dev/null
+++ b/web/app/store/MaintenanceTypes.js
@@ -0,0 +1,22 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.store.MaintenanceTypes', {
+ extend: 'Ext.data.Store',
+ model: 'Traccar.model.KnownAttribute'
+});
diff --git a/web/app/store/Maintenances.js b/web/app/store/Maintenances.js
new file mode 100644
index 00000000..43d6ba5b
--- /dev/null
+++ b/web/app/store/Maintenances.js
@@ -0,0 +1,30 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.store.Maintenances', {
+ extend: 'Ext.data.Store',
+ model: 'Traccar.model.Maintenance',
+
+ proxy: {
+ type: 'rest',
+ url: 'api/maintenances',
+ writer: {
+ writeAllFields: true
+ }
+ }
+});
diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js
index 77c10ebd..3d322438 100644
--- a/web/app/store/MapTypes.js
+++ b/web/app/store/MapTypes.js
@@ -44,6 +44,9 @@ Ext.define('Traccar.store.MapTypes', {
key: 'yandexSat',
name: Strings.mapYandexSat
}, {
+ key: 'wikimedia',
+ name: Strings.mapWikimedia
+ }, {
key: 'custom',
name: Strings.mapCustom
}]
diff --git a/web/app/store/PositionAttributes.js b/web/app/store/PositionAttributes.js
index c8feb0a5..5b1206b7 100644
--- a/web/app/store/PositionAttributes.js
+++ b/web/app/store/PositionAttributes.js
@@ -90,7 +90,8 @@ Ext.define('Traccar.store.PositionAttributes', {
}, {
key: 'hours',
name: Strings.positionHours,
- valueType: 'string'
+ valueType: 'number',
+ dataType: 'hours'
}, {
key: 'steps',
name: Strings.positionSteps,
diff --git a/web/app/store/ReportEvents.js b/web/app/store/ReportEvents.js
index ca90693d..061aaa42 100644
--- a/web/app/store/ReportEvents.js
+++ b/web/app/store/ReportEvents.js
@@ -22,6 +22,7 @@ Ext.define('Traccar.store.ReportEvents', {
proxy: {
type: 'rest',
url: 'api/reports/events',
+ timeout: Traccar.Style.reportTimeout,
headers: {
'Accept': 'application/json'
},
diff --git a/web/app/store/ReportRoute.js b/web/app/store/ReportRoute.js
index 6ee4bbcd..7babe163 100644
--- a/web/app/store/ReportRoute.js
+++ b/web/app/store/ReportRoute.js
@@ -22,6 +22,7 @@ Ext.define('Traccar.store.ReportRoute', {
proxy: {
type: 'rest',
url: 'api/reports/route',
+ timeout: Traccar.Style.reportTimeout,
headers: {
'Accept': 'application/json'
},
diff --git a/web/app/store/ReportStops.js b/web/app/store/ReportStops.js
index 9e9ba13e..75c9fc18 100644
--- a/web/app/store/ReportStops.js
+++ b/web/app/store/ReportStops.js
@@ -23,6 +23,7 @@ Ext.define('Traccar.store.ReportStops', {
proxy: {
type: 'rest',
url: 'api/reports/stops',
+ timeout: Traccar.Style.reportTimeout,
headers: {
'Accept': 'application/json'
},
diff --git a/web/app/store/ReportSummary.js b/web/app/store/ReportSummary.js
index 4e53d948..f328da2d 100644
--- a/web/app/store/ReportSummary.js
+++ b/web/app/store/ReportSummary.js
@@ -23,6 +23,7 @@ Ext.define('Traccar.store.ReportSummary', {
proxy: {
type: 'rest',
url: 'api/reports/summary',
+ timeout: Traccar.Style.reportTimeout,
headers: {
'Accept': 'application/json'
},
diff --git a/web/app/store/ReportTrips.js b/web/app/store/ReportTrips.js
index d8aa9226..057cc7c0 100644
--- a/web/app/store/ReportTrips.js
+++ b/web/app/store/ReportTrips.js
@@ -23,6 +23,7 @@ Ext.define('Traccar.store.ReportTrips', {
proxy: {
type: 'rest',
url: 'api/reports/trips',
+ timeout: Traccar.Style.reportTimeout,
headers: {
'Accept': 'application/json'
},