aboutsummaryrefslogtreecommitdiff
path: root/web/app/store
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/store')
-rw-r--r--web/app/store/AllCalendars.js30
-rw-r--r--web/app/store/Calendars.js30
-rw-r--r--web/app/store/GeofenceTypes.js3
-rw-r--r--web/app/store/Notifications.js4
-rw-r--r--web/app/store/Positions.js5
5 files changed, 70 insertions, 2 deletions
diff --git a/web/app/store/AllCalendars.js b/web/app/store/AllCalendars.js
new file mode 100644
index 00000000..26557287
--- /dev/null
+++ b/web/app/store/AllCalendars.js
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 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.AllCalendars', {
+ extend: 'Ext.data.Store',
+ model: 'Traccar.model.Calendar',
+
+ proxy: {
+ type: 'rest',
+ url: 'api/calendars',
+ extraParams: {
+ all: true
+ }
+ }
+});
diff --git a/web/app/store/Calendars.js b/web/app/store/Calendars.js
new file mode 100644
index 00000000..fa8e5c66
--- /dev/null
+++ b/web/app/store/Calendars.js
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 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.Calendars', {
+ extend: 'Ext.data.Store',
+ model: 'Traccar.model.Calendar',
+
+ proxy: {
+ type: 'rest',
+ url: 'api/calendars',
+ writer: {
+ writeAllFields: true
+ }
+ }
+});
diff --git a/web/app/store/GeofenceTypes.js b/web/app/store/GeofenceTypes.js
index c102de69..45b79897 100644
--- a/web/app/store/GeofenceTypes.js
+++ b/web/app/store/GeofenceTypes.js
@@ -25,5 +25,8 @@ Ext.define('Traccar.store.GeofenceTypes', {
}, {
key: 'Circle',
name: Strings.mapShapeCircle
+ }, {
+ key: 'LineString',
+ name: Strings.mapShapePolyline
}]
});
diff --git a/web/app/store/Notifications.js b/web/app/store/Notifications.js
index e4d2991a..d79702fc 100644
--- a/web/app/store/Notifications.js
+++ b/web/app/store/Notifications.js
@@ -22,5 +22,7 @@ Ext.define('Traccar.store.Notifications', {
proxy: {
type: 'rest',
url: 'api/users/notifications'
- }
+ },
+ sortOnLoad: true,
+ sorters: { property: 'type', direction : 'ASC' }
});
diff --git a/web/app/store/Positions.js b/web/app/store/Positions.js
index 8f185af1..388a3320 100644
--- a/web/app/store/Positions.js
+++ b/web/app/store/Positions.js
@@ -21,6 +21,9 @@ Ext.define('Traccar.store.Positions', {
proxy: {
type: 'rest',
- url: 'api/positions'
+ url: 'api/positions',
+ headers: {
+ 'Accept': 'application/json'
+ }
}
});