diff options
Diffstat (limited to 'web/app/model')
-rw-r--r-- | web/app/model/Attribute.js | 30 | ||||
-rw-r--r-- | web/app/model/Command.js | 30 | ||||
-rw-r--r-- | web/app/model/Device.js | 45 | ||||
-rw-r--r-- | web/app/model/Event.js | 43 | ||||
-rw-r--r-- | web/app/model/Geofence.js | 36 | ||||
-rw-r--r-- | web/app/model/Group.js | 33 | ||||
-rw-r--r-- | web/app/model/Notification.js | 33 | ||||
-rw-r--r-- | web/app/model/Position.js | 66 | ||||
-rw-r--r-- | web/app/model/ReportSummary.js | 41 | ||||
-rw-r--r-- | web/app/model/ReportTrip.js | 55 | ||||
-rw-r--r-- | web/app/model/Server.js | 72 | ||||
-rw-r--r-- | web/app/model/User.js | 69 |
12 files changed, 553 insertions, 0 deletions
diff --git a/web/app/model/Attribute.js b/web/app/model/Attribute.js new file mode 100644 index 00000000..78acdb1d --- /dev/null +++ b/web/app/model/Attribute.js @@ -0,0 +1,30 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.Attribute', { + extend: 'Ext.data.Model', + + fields: [{ + name: 'priority', + type: 'int' + }, { + name: 'name', + type: 'string' + }, { + name: 'value', + type: 'string' + }] +}); diff --git a/web/app/model/Command.js b/web/app/model/Command.js new file mode 100644 index 00000000..3e848b57 --- /dev/null +++ b/web/app/model/Command.js @@ -0,0 +1,30 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.Command', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'deviceId', + type: 'int' + }, { + name: 'type', + type: 'string' + }, { + name: 'attributes' + }] +}); diff --git a/web/app/model/Device.js b/web/app/model/Device.js new file mode 100644 index 00000000..100f50f5 --- /dev/null +++ b/web/app/model/Device.js @@ -0,0 +1,45 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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: 'status', + type: 'string' + }, { + name: 'lastUpdate', + type: 'date', + dateFormat: 'c' + }, { + name: 'groupId', + type: 'int' + }, { + name: 'geofenceIds' + }, { + name: 'attributes' + }] +}); diff --git a/web/app/model/Event.js b/web/app/model/Event.js new file mode 100644 index 00000000..698ebb53 --- /dev/null +++ b/web/app/model/Event.js @@ -0,0 +1,43 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.Event', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'id', + type: 'int' + }, { + name: 'type', + type: 'string' + }, { + name: 'serverTime', + type: 'date', + dateFormat: 'c' + }, { + name: 'deviceId', + type: 'int' + }, { + name: 'positionId', + type: 'int' + }, { + name: 'geofenceId', + type: 'int' + }, { + name: 'attributes' + }] +}); diff --git a/web/app/model/Geofence.js b/web/app/model/Geofence.js new file mode 100644 index 00000000..a832455a --- /dev/null +++ b/web/app/model/Geofence.js @@ -0,0 +1,36 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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: 'attributes' + }] +}); diff --git a/web/app/model/Group.js b/web/app/model/Group.js new file mode 100644 index 00000000..bb18b5b3 --- /dev/null +++ b/web/app/model/Group.js @@ -0,0 +1,33 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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/web/app/model/Notification.js b/web/app/model/Notification.js new file mode 100644 index 00000000..9b4d61eb --- /dev/null +++ b/web/app/model/Notification.js @@ -0,0 +1,33 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.Notification', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'id', + type: 'int' + }, { + name: 'type', + type: 'string' + }, { + name: 'userId', + type: 'int' + }, { + name: 'attributes' + }] +}); diff --git a/web/app/model/Position.js b/web/app/model/Position.js new file mode 100644 index 00000000..e559a7ea --- /dev/null +++ b/web/app/model/Position.js @@ -0,0 +1,66 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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: 'latitude', + type: 'float' + }, { + name: 'longitude', + type: 'float' + }, { + name: 'altitude', + type: 'float' + }, { + name: 'speed', + type: 'float' + }, { + name: 'course', + type: 'float' + }, { + name: 'address', + type: 'string' + }, { + name: 'attributes' + }] +}); diff --git a/web/app/model/ReportSummary.js b/web/app/model/ReportSummary.js new file mode 100644 index 00000000..430d00b9 --- /dev/null +++ b/web/app/model/ReportSummary.js @@ -0,0 +1,41 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.ReportSummary', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'deviceId', + type: 'int' + }, { + name: 'deviceName', + type: 'string' + }, { + name: 'maxSpeed', + type: 'float' + }, { + name: 'averageSpeed', + type: 'float' + }, { + name: 'distance', + type: 'float' + }, { + name: 'engineHours', + type: 'int' + }] +}); diff --git a/web/app/model/ReportTrip.js b/web/app/model/ReportTrip.js new file mode 100644 index 00000000..cbd03d77 --- /dev/null +++ b/web/app/model/ReportTrip.js @@ -0,0 +1,55 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.ReportTrip', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'deviceId', + type: 'int' + }, { + name: 'deviceName', + type: 'string' + }, { + name: 'maxSpeed', + type: 'float' + }, { + name: 'averageSpeed', + type: 'float' + }, { + name: 'distance', + type: 'float' + }, { + name: 'duration', + type: 'int' + }, { + name: 'startTime', + type: 'date', + dateFormat: 'c' + }, { + name: 'startAddress', + type: 'string' + }, { + name: 'endTime', + type: 'date', + dateFormat: 'c' + }, { + name: 'endAddress', + type: 'string' + }] +}); diff --git a/web/app/model/Server.js b/web/app/model/Server.js new file mode 100644 index 00000000..2ed8f12f --- /dev/null +++ b/web/app/model/Server.js @@ -0,0 +1,72 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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: 'map', + type: 'string' + }, { + name: 'bingKey', + type: 'string' + }, { + name: 'mapUrl', + type: 'string' + }, { + name: 'distanceUnit', + type: 'string' + }, { + name: 'speedUnit', + type: 'string' + }, { + name: 'latitude', + type: 'float' + }, { + name: 'longitude', + type: 'float' + }, { + name: 'zoom', + type: 'int' + }, { + name: 'twelveHourFormat', + type: 'boolean' + }, { + name: 'attributes' + }], + + proxy: { + type: 'ajax', + url: 'api/server', + actionMethods: { + update: 'PUT' + }, + writer: { + type: 'json', + writeAllFields: true + } + } +}); diff --git a/web/app/model/User.js b/web/app/model/User.js new file mode 100644 index 00000000..b162bada --- /dev/null +++ b/web/app/model/User.js @@ -0,0 +1,69 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.model.User', { + extend: 'Ext.data.Model', + identifier: 'negative', + + fields: [{ + name: 'id', + type: 'int' + }, { + name: 'name', + type: 'string' + }, { + name: 'email', + type: 'string' + }, { + name: 'password', + type: 'string' + }, { + name: 'admin', + type: 'boolean' + }, { + name: 'map', + type: 'string' + }, { + name: 'distanceUnit', + type: 'string' + }, { + name: 'speedUnit', + type: 'string' + }, { + name: 'latitude', + type: 'float' + }, { + name: 'longitude', + type: 'float' + }, { + name: 'zoom', + type: 'int' + }, { + name: 'twelveHourFormat', + type: 'boolean' + }, { + name: 'attributes' + }], + + proxy: { + type: 'rest', + url: 'api/users', + writer: { + type: 'json', + writeAllFields: true + } + } +}); |