diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-25 19:05:33 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-25 19:05:33 +1200 |
commit | 87156d38c250abd9a1cba9b9af289d5ff0acb075 (patch) | |
tree | d13f72cffc3c6b4ba06a43b68f91a536c58f8fc0 /web/app | |
parent | f449d805a01e709b06c4b06e6dcb35d1651f73ad (diff) | |
download | traccar-server-87156d38c250abd9a1cba9b9af289d5ff0acb075.tar.gz traccar-server-87156d38c250abd9a1cba9b9af289d5ff0acb075.tar.bz2 traccar-server-87156d38c250abd9a1cba9b9af289d5ff0acb075.zip |
Add server and user attributes
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/Application.js | 4 | ||||
-rw-r--r-- | web/app/store/DistanceUnits.js | 24 | ||||
-rw-r--r-- | web/app/store/MapTypes.js | 4 | ||||
-rw-r--r-- | web/app/store/SpeedUnits.js | 24 | ||||
-rw-r--r-- | web/app/view/admin/ServerDialog.js | 14 | ||||
-rw-r--r-- | web/app/view/user/UserDialog.js | 33 |
6 files changed, 100 insertions, 3 deletions
diff --git a/web/app/Application.js b/web/app/Application.js index f18c2768a..55b8f774c 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -37,7 +37,9 @@ Ext.define('Traccar.Application', { 'LiveData', 'Users', 'Parameters', - 'MapTypes' + 'MapTypes', + 'DistanceUnits', + 'SpeedUnits' ], controllers: [ diff --git a/web/app/store/DistanceUnits.js b/web/app/store/DistanceUnits.js new file mode 100644 index 000000000..b3d342fc6 --- /dev/null +++ b/web/app/store/DistanceUnits.js @@ -0,0 +1,24 @@ +/* + * 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.store.DistanceUnits', { + extend: 'Ext.data.Store', + fields: ['key', 'name'], + data : [ + {'key': 'km', 'name': strings.shared_km}, + {'key': 'mi', 'name': strings.shared_mi} + ] +}); diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js index 58e0a739c..09636e3a0 100644 --- a/web/app/store/MapTypes.js +++ b/web/app/store/MapTypes.js @@ -18,7 +18,7 @@ Ext.define('Traccar.store.MapTypes', { extend: 'Ext.data.Store', fields: ['key', 'name'], data : [ - {"key": "osm", "name": "OpenStreetMap"}, - {"key": "bing", "name": "Bing Maps"} + {'key': 'osm', 'name': strings.map_osm}, + {'key': 'bing', 'name': strings.map_bing} ] }); diff --git a/web/app/store/SpeedUnits.js b/web/app/store/SpeedUnits.js new file mode 100644 index 000000000..b658fc936 --- /dev/null +++ b/web/app/store/SpeedUnits.js @@ -0,0 +1,24 @@ +/* + * 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.store.SpeedUnits', { + extend: 'Ext.data.Store', + fields: ['key', 'name'], + data : [ + {'key': 'kph', 'name': strings.shared_kph}, + {'key': 'mph', 'name': strings.shared_mph} + ] +}); diff --git a/web/app/view/admin/ServerDialog.js b/web/app/view/admin/ServerDialog.js index 12170dc03..de3efd6fa 100644 --- a/web/app/view/admin/ServerDialog.js +++ b/web/app/view/admin/ServerDialog.js @@ -44,6 +44,20 @@ Ext.define('Traccar.view.admin.ServerDialog', { displayField: 'name', valueField: 'key' }, { + xtype: 'combobox', + name: 'distanceUnit', + fieldLabel: strings.settings_distance_unit, + store: 'DistanceUnits', + displayField: 'name', + valueField: 'key' + }, { + xtype: 'combobox', + name: 'speedUnit', + fieldLabel: strings.settings_speed_unit, + store: 'SpeedUnits', + displayField: 'name', + valueField: 'key' + }, { xtype: 'numberfield', name: 'latitude', fieldLabel: strings.position_latitude diff --git a/web/app/view/user/UserDialog.js b/web/app/view/user/UserDialog.js index 3db21de6c..67bf2ccf1 100644 --- a/web/app/view/user/UserDialog.js +++ b/web/app/view/user/UserDialog.js @@ -53,6 +53,39 @@ Ext.define('Traccar.view.user.UserDialog', { allowBlank: false, disabled: true, reference: 'adminField' + }, { + xtype: 'combobox', + name: 'map', + fieldLabel: strings.map_layer, + store: 'MapTypes', + displayField: 'name', + valueField: 'key' + }, { + xtype: 'combobox', + name: 'distanceUnit', + fieldLabel: strings.settings_distance_unit, + store: 'DistanceUnits', + displayField: 'name', + valueField: 'key' + }, { + xtype: 'combobox', + name: 'speedUnit', + fieldLabel: strings.settings_speed_unit, + store: 'SpeedUnits', + displayField: 'name', + valueField: 'key' + }, { + xtype: 'numberfield', + name: 'latitude', + fieldLabel: strings.position_latitude + }, { + xtype: 'numberfield', + name: 'longitude', + fieldLabel: strings.position_longitude + }, { + xtype: 'numberfield', + name: 'zoom', + fieldLabel: strings.server_zoom }] }, |