aboutsummaryrefslogtreecommitdiff
path: root/legacy/web/app/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-04-06 09:17:52 -0700
committerAnton Tananaev <anton@traccar.org>2024-04-06 09:17:52 -0700
commitb392a4af78e01c8e0f50aad5468e9583675b24be (patch)
tree0a4fd7c4ee020e0829817853469979d4e998a69a /legacy/web/app/model
parent94cadecda794358a53995c276697919eaf540466 (diff)
downloadtrackermap-web-b392a4af78e01c8e0f50aad5468e9583675b24be.tar.gz
trackermap-web-b392a4af78e01c8e0f50aad5468e9583675b24be.tar.bz2
trackermap-web-b392a4af78e01c8e0f50aad5468e9583675b24be.zip
Move to the legacy folder
Diffstat (limited to 'legacy/web/app/model')
-rw-r--r--legacy/web/app/model/Attribute.js33
-rw-r--r--legacy/web/app/model/Calendar.js34
-rw-r--r--legacy/web/app/model/Command.js40
-rw-r--r--legacy/web/app/model/ComputedAttribute.js39
-rw-r--r--legacy/web/app/model/Device.js64
-rw-r--r--legacy/web/app/model/Driver.js35
-rw-r--r--legacy/web/app/model/Event.js81
-rw-r--r--legacy/web/app/model/Geofence.js40
-rw-r--r--legacy/web/app/model/Group.js34
-rw-r--r--legacy/web/app/model/KnownAttribute.js35
-rw-r--r--legacy/web/app/model/KnownCommand.js34
-rw-r--r--legacy/web/app/model/KnownNotification.js32
-rw-r--r--legacy/web/app/model/KnownNotificator.js32
-rw-r--r--legacy/web/app/model/Maintenance.js41
-rw-r--r--legacy/web/app/model/Notification.js40
-rw-r--r--legacy/web/app/model/Position.js72
-rw-r--r--legacy/web/app/model/ReportStop.js58
-rw-r--r--legacy/web/app/model/ReportSummary.js61
-rw-r--r--legacy/web/app/model/ReportTrip.js77
-rw-r--r--legacy/web/app/model/Server.js88
-rw-r--r--legacy/web/app/model/Statistics.js59
-rw-r--r--legacy/web/app/model/User.js101
22 files changed, 1130 insertions, 0 deletions
diff --git a/legacy/web/app/model/Attribute.js b/legacy/web/app/model/Attribute.js
new file mode 100644
index 00000000..b1586a73
--- /dev/null
+++ b/legacy/web/app/model/Attribute.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2015 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Attribute', {
+ extend: 'Ext.data.Model',
+
+ fields: [{
+ name: 'priority',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'value'
+ }, {
+ name: 'attribute',
+ type: 'string'
+ }]
+});
diff --git a/legacy/web/app/model/Calendar.js b/legacy/web/app/model/Calendar.js
new file mode 100644
index 00000000..8c44d625
--- /dev/null
+++ b/legacy/web/app/model/Calendar.js
@@ -0,0 +1,34 @@
+/*
+ * 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.model.Calendar', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'data'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/Command.js b/legacy/web/app/model/Command.js
new file mode 100644
index 00000000..f64d2a4b
--- /dev/null
+++ b/legacy/web/app/model/Command.js
@@ -0,0 +1,40 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Command', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'description',
+ type: 'string'
+ }, {
+ name: 'deviceId',
+ type: 'int'
+ }, {
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'textChannel',
+ type: 'boolean'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/ComputedAttribute.js b/legacy/web/app/model/ComputedAttribute.js
new file mode 100644
index 00000000..16a78ef1
--- /dev/null
+++ b/legacy/web/app/model/ComputedAttribute.js
@@ -0,0 +1,39 @@
+/*
+ * 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.model.ComputedAttribute', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'description',
+ type: 'string'
+ }, {
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'attribute',
+ type: 'string'
+ }, {
+ name: 'expression',
+ type: 'string'
+ }]
+});
diff --git a/legacy/web/app/model/Device.js b/legacy/web/app/model/Device.js
new file mode 100644
index 00000000..ca1e07a6
--- /dev/null
+++ b/legacy/web/app/model/Device.js
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Device', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'uniqueId',
+ type: 'string'
+ }, {
+ name: 'phone',
+ type: 'string',
+ allowNull: true
+ }, {
+ name: 'model',
+ type: 'string',
+ allowNull: true
+ }, {
+ name: 'contact',
+ type: 'string',
+ allowNull: true
+ }, {
+ name: 'category',
+ type: 'string',
+ allowNull: true
+ }, {
+ name: 'status',
+ type: 'string',
+ allowNull: true
+ }, {
+ name: 'lastUpdate',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'groupId',
+ type: 'int'
+ }, {
+ name: 'disabled',
+ type: 'boolean'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/Driver.js b/legacy/web/app/model/Driver.js
new file mode 100644
index 00000000..3c3b30e5
--- /dev/null
+++ b/legacy/web/app/model/Driver.js
@@ -0,0 +1,35 @@
+/*
+ * 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.model.Driver', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'uniqueId',
+ type: 'string'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/Event.js b/legacy/web/app/model/Event.js
new file mode 100644
index 00000000..d1297dd7
--- /dev/null
+++ b/legacy/web/app/model/Event.js
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2015 - 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Event', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'eventTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'deviceId',
+ type: 'int'
+ }, {
+ name: 'positionId',
+ type: 'int'
+ }, {
+ name: 'geofenceId',
+ type: 'int'
+ }, {
+ name: 'maintenanceId',
+ type: 'int'
+ }, {
+ name: 'text',
+ convert: function (v, rec) {
+ var text, alarmKey, geofence, maintenance;
+ if (rec.get('type') === 'commandResult') {
+ text = Strings.eventCommandResult + ': ' + rec.get('attributes')['result'];
+ } else if (rec.get('type') === 'alarm') {
+ alarmKey = rec.get('attributes')['alarm'];
+ alarmKey = 'alarm' + alarmKey.charAt(0).toUpperCase() + alarmKey.slice(1);
+ text = Strings[alarmKey] || alarmKey;
+ } else if (rec.get('type') === 'textMessage') {
+ text = Strings.eventTextMessage + ': ' + rec.get('attributes')['message'];
+ } else if (rec.get('type') === 'driverChanged') {
+ text = Strings.eventDriverChanged + ': ' +
+ Traccar.AttributeFormatter.driverUniqueIdFormatter(rec.get('attributes')['driverUniqueId']);
+ } else {
+ text = Traccar.app.getEventString(rec.get('type'));
+ }
+ if (rec.get('geofenceId')) {
+ geofence = Ext.getStore('Geofences').getById(rec.get('geofenceId'));
+ if (geofence) {
+ text += ' "' + geofence.get('name') + '"';
+ }
+ }
+ if (rec.get('maintenanceId')) {
+ maintenance = Ext.getStore('Maintenances').getById(rec.get('maintenanceId'));
+ if (maintenance) {
+ text += ' "' + maintenance.get('name') + '"';
+ }
+ }
+ return text;
+ },
+ depends: ['type', 'attributes', 'geofenceId', 'maintenanceId']
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/Geofence.js b/legacy/web/app/model/Geofence.js
new file mode 100644
index 00000000..12a9f878
--- /dev/null
+++ b/legacy/web/app/model/Geofence.js
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2016 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Geofence', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'description',
+ type: 'string'
+ }, {
+ name: 'area',
+ type: 'string'
+ }, {
+ name: 'calendarId',
+ type: 'int'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/Group.js b/legacy/web/app/model/Group.js
new file mode 100644
index 00000000..8230fda1
--- /dev/null
+++ b/legacy/web/app/model/Group.js
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Group', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'groupId',
+ type: 'int'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/KnownAttribute.js b/legacy/web/app/model/KnownAttribute.js
new file mode 100644
index 00000000..f6f41a73
--- /dev/null
+++ b/legacy/web/app/model/KnownAttribute.js
@@ -0,0 +1,35 @@
+/*
+ * 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.model.KnownAttribute', {
+ extend: 'Ext.data.Model',
+ idProperty: 'key',
+
+ fields: [{
+ name: 'key',
+ type: 'string'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'valueType',
+ type: 'string'
+ }, {
+ name: 'dataType',
+ type: 'string'
+ }]
+});
diff --git a/legacy/web/app/model/KnownCommand.js b/legacy/web/app/model/KnownCommand.js
new file mode 100644
index 00000000..06610e32
--- /dev/null
+++ b/legacy/web/app/model/KnownCommand.js
@@ -0,0 +1,34 @@
+/*
+ * 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.model.KnownCommand', {
+ extend: 'Ext.data.Model',
+ idProperty: 'type',
+
+ fields: [{
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'name',
+ convert: function (v, rec) {
+ return Traccar.AttributeFormatter.getFormatter('commandType')(rec.get('type'));
+ },
+ depends: ['type']
+ }, {
+ name: 'parameters'
+ }]
+});
diff --git a/legacy/web/app/model/KnownNotification.js b/legacy/web/app/model/KnownNotification.js
new file mode 100644
index 00000000..f42ef972
--- /dev/null
+++ b/legacy/web/app/model/KnownNotification.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 <http://www.gnu.org/licenses/>.
+ */
+Ext.define('Traccar.model.KnownNotification', {
+ extend: 'Ext.data.Model',
+ idProperty: 'type',
+
+ fields: [{
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'name',
+ convert: function (v, rec) {
+ return Traccar.app.getEventString(rec.get('type'));
+ },
+ depends: ['type']
+ }]
+});
diff --git a/legacy/web/app/model/KnownNotificator.js b/legacy/web/app/model/KnownNotificator.js
new file mode 100644
index 00000000..7855a12b
--- /dev/null
+++ b/legacy/web/app/model/KnownNotificator.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.model.KnownNotificator', {
+ extend: 'Ext.data.Model',
+ idProperty: 'type',
+
+ fields: [{
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'name',
+ convert: function (v, rec) {
+ return Traccar.app.getNotificatorString(rec.get('type'));
+ },
+ depends: ['type']
+ }]
+});
diff --git a/legacy/web/app/model/Maintenance.js b/legacy/web/app/model/Maintenance.js
new file mode 100644
index 00000000..a0654275
--- /dev/null
+++ b/legacy/web/app/model/Maintenance.js
@@ -0,0 +1,41 @@
+/*
+ * 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.model.Maintenance', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'start',
+ type: 'float'
+ }, {
+ name: 'period',
+ type: 'float'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/Notification.js b/legacy/web/app/model/Notification.js
new file mode 100644
index 00000000..fc9d84d7
--- /dev/null
+++ b/legacy/web/app/model/Notification.js
@@ -0,0 +1,40 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Notification', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'type',
+ type: 'string'
+ }, {
+ name: 'always',
+ type: 'bool'
+ }, {
+ name: 'attributes'
+ }, {
+ name: 'notificators',
+ type: 'string'
+ }, {
+ name: 'calendarId',
+ type: 'int'
+ }]
+});
diff --git a/legacy/web/app/model/Position.js b/legacy/web/app/model/Position.js
new file mode 100644
index 00000000..6db54653
--- /dev/null
+++ b/legacy/web/app/model/Position.js
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2015 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Position', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'protocol',
+ type: 'string'
+ }, {
+ name: 'deviceId',
+ type: 'int'
+ }, {
+ name: 'serverTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'deviceTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'fixTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'valid',
+ type: 'boolean'
+ }, {
+ name: 'accuracy',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('accuracy')
+ }, {
+ name: 'latitude',
+ type: 'float'
+ }, {
+ name: 'longitude',
+ type: 'float'
+ }, {
+ name: 'altitude',
+ type: 'float'
+ }, {
+ name: 'speed',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('speed')
+ }, {
+ name: 'course',
+ type: 'float'
+ }, {
+ name: 'address',
+ type: 'string'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/ReportStop.js b/legacy/web/app/model/ReportStop.js
new file mode 100644
index 00000000..9aaa58b0
--- /dev/null
+++ b/legacy/web/app/model/ReportStop.js
@@ -0,0 +1,58 @@
+/*
+ * 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.model.ReportStop', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'deviceId',
+ type: 'int'
+ }, {
+ name: 'deviceName',
+ type: 'string'
+ }, {
+ name: 'duration',
+ type: 'int'
+ }, {
+ name: 'startTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'startOdometer',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'address',
+ type: 'string'
+ }, {
+ name: 'endTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'engineHours',
+ type: 'int'
+ }, {
+ name: 'positionId',
+ type: 'int'
+ }, {
+ name: 'spentFuel',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('spentFuel')
+ }]
+});
diff --git a/legacy/web/app/model/ReportSummary.js b/legacy/web/app/model/ReportSummary.js
new file mode 100644
index 00000000..559ffd41
--- /dev/null
+++ b/legacy/web/app/model/ReportSummary.js
@@ -0,0 +1,61 @@
+/*
+ * 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.model.ReportSummary', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'deviceId',
+ type: 'int'
+ }, {
+ name: 'deviceName',
+ type: 'string'
+ }, {
+ name: 'startTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'maxSpeed',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('speed')
+ }, {
+ name: 'averageSpeed',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('speed')
+ }, {
+ name: 'distance',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'startOdometer',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'endOdometer',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'engineHours',
+ type: 'int'
+ }, {
+ name: 'spentFuel',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('spentFuel')
+ }]
+});
diff --git a/legacy/web/app/model/ReportTrip.js b/legacy/web/app/model/ReportTrip.js
new file mode 100644
index 00000000..9d45fc87
--- /dev/null
+++ b/legacy/web/app/model/ReportTrip.js
@@ -0,0 +1,77 @@
+/*
+ * 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.model.ReportTrip', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'deviceId',
+ type: 'int'
+ }, {
+ name: 'deviceName',
+ type: 'string'
+ }, {
+ name: 'maxSpeed',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('speed')
+ }, {
+ name: 'averageSpeed',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('speed')
+ }, {
+ name: 'distance',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'startOdometer',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'endOdometer',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('distance')
+ }, {
+ name: 'duration',
+ type: 'int'
+ }, {
+ name: 'startTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'startAddress',
+ type: 'string'
+ }, {
+ name: 'endTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'endAddress',
+ type: 'string'
+ }, {
+ name: 'spentFuel',
+ type: 'float',
+ convert: Traccar.AttributeFormatter.getConverter('spentFuel')
+ }, {
+ name: 'driverUniqueId',
+ type: 'string'
+ }, {
+ name: 'driverName',
+ type: 'string'
+ }]
+});
diff --git a/legacy/web/app/model/Server.js b/legacy/web/app/model/Server.js
new file mode 100644
index 00000000..177b4fc4
--- /dev/null
+++ b/legacy/web/app/model/Server.js
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2015 - 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Server', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'registration',
+ type: 'boolean'
+ }, {
+ name: 'readonly',
+ type: 'boolean'
+ }, {
+ name: 'deviceReadonly',
+ type: 'boolean'
+ }, {
+ name: 'limitCommands',
+ type: 'boolean'
+ }, {
+ name: 'disableReports',
+ type: 'boolean'
+ }, {
+ name: 'map',
+ type: 'string'
+ }, {
+ name: 'bingKey',
+ type: 'string'
+ }, {
+ name: 'mapUrl',
+ type: 'string'
+ }, {
+ name: 'latitude',
+ type: 'float'
+ }, {
+ name: 'longitude',
+ type: 'float'
+ }, {
+ name: 'zoom',
+ type: 'int'
+ }, {
+ name: 'twelveHourFormat',
+ type: 'boolean'
+ }, {
+ name: 'forceSettings',
+ type: 'boolean'
+ }, {
+ name: 'coordinateFormat',
+ type: 'string'
+ }, {
+ name: 'poiLayer',
+ type: 'string'
+ }, {
+ name: 'announcement',
+ type: 'string'
+ }, {
+ name: 'attributes'
+ }],
+
+ proxy: {
+ type: 'ajax',
+ url: 'api/server',
+ actionMethods: {
+ update: 'PUT'
+ },
+ writer: {
+ type: 'json',
+ writeAllFields: true
+ }
+ }
+});
diff --git a/legacy/web/app/model/Statistics.js b/legacy/web/app/model/Statistics.js
new file mode 100644
index 00000000..95280ac4
--- /dev/null
+++ b/legacy/web/app/model/Statistics.js
@@ -0,0 +1,59 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.Statistics', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'captureTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'activeUsers',
+ type: 'int'
+ }, {
+ name: 'activeDevices',
+ type: 'int'
+ }, {
+ name: 'requests',
+ type: 'int'
+ }, {
+ name: 'messagesReceived',
+ type: 'int'
+ }, {
+ name: 'messagesStored',
+ type: 'int'
+ }, {
+ name: 'mailSent',
+ type: 'int'
+ }, {
+ name: 'smsSent',
+ type: 'int'
+ }, {
+ name: 'geocoderRequests',
+ type: 'int'
+ }, {
+ name: 'geolocationRequests',
+ type: 'int'
+ }, {
+ name: 'attributes'
+ }]
+});
diff --git a/legacy/web/app/model/User.js b/legacy/web/app/model/User.js
new file mode 100644
index 00000000..455bca64
--- /dev/null
+++ b/legacy/web/app/model/User.js
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2015 - 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.model.User', {
+ extend: 'Ext.data.Model',
+ identifier: 'negative',
+
+ fields: [{
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'login',
+ type: 'string'
+ }, {
+ name: 'email',
+ type: 'string'
+ }, {
+ name: 'password',
+ type: 'string'
+ }, {
+ name: 'phone',
+ type: 'string'
+ }, {
+ name: 'readonly',
+ type: 'boolean'
+ }, {
+ name: 'administrator',
+ type: 'boolean'
+ }, {
+ name: 'map',
+ type: 'string'
+ }, {
+ name: 'latitude',
+ type: 'float'
+ }, {
+ name: 'longitude',
+ type: 'float'
+ }, {
+ name: 'zoom',
+ type: 'int'
+ }, {
+ name: 'twelveHourFormat',
+ type: 'boolean'
+ }, {
+ name: 'coordinateFormat',
+ type: 'string'
+ }, {
+ name: 'disabled',
+ type: 'boolean'
+ }, {
+ name: 'expirationTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'deviceLimit',
+ type: 'int'
+ }, {
+ name: 'userLimit',
+ type: 'int'
+ }, {
+ name: 'deviceReadonly',
+ type: 'boolean'
+ }, {
+ name: 'limitCommands',
+ type: 'boolean'
+ }, {
+ name: 'disableReports',
+ type: 'boolean'
+ }, {
+ name: 'poiLayer',
+ type: 'string'
+ }, {
+ name: 'attributes'
+ }],
+
+ proxy: {
+ type: 'rest',
+ url: 'api/users',
+ writer: {
+ type: 'json',
+ writeAllFields: true
+ }
+ }
+});