aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 19:05:33 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 19:05:33 +1200
commit87156d38c250abd9a1cba9b9af289d5ff0acb075 (patch)
treed13f72cffc3c6b4ba06a43b68f91a536c58f8fc0
parentf449d805a01e709b06c4b06e6dcb35d1651f73ad (diff)
downloadtrackermap-server-87156d38c250abd9a1cba9b9af289d5ff0acb075.tar.gz
trackermap-server-87156d38c250abd9a1cba9b9af289d5ff0acb075.tar.bz2
trackermap-server-87156d38c250abd9a1cba9b9af289d5ff0acb075.zip
Add server and user attributes
-rw-r--r--debug.xml23
-rw-r--r--web/app/Application.js4
-rw-r--r--web/app/store/DistanceUnits.js24
-rw-r--r--web/app/store/MapTypes.js4
-rw-r--r--web/app/store/SpeedUnits.js24
-rw-r--r--web/app/view/admin/ServerDialog.js14
-rw-r--r--web/app/view/user/UserDialog.js33
-rw-r--r--web/l10n/en.js8
8 files changed, 129 insertions, 5 deletions
diff --git a/debug.xml b/debug.xml
index 1f54b6f42..88f9a859e 100644
--- a/debug.xml
+++ b/debug.xml
@@ -138,7 +138,16 @@
</entry>
<entry key='database.updateServer'>
- UPDATE server SET registration = :registration WHERE id = :id;
+ UPDATE server SET
+ registration = :registration,
+ map = :map,
+ language = :language,
+ distanceUnit = :distanceUnit,
+ speedUnit = :speedUnit,
+ latitude = :latitude,
+ longitude = :longitude,
+ zoom = :zoom
+ WHERE id = :id;
</entry>
<entry key='database.loginUser'>
@@ -156,7 +165,17 @@
</entry>
<entry key='database.updateUser'>
- UPDATE "user" SET name = :name, email = :email, admin = :admin
+ UPDATE "user" SET
+ name = :name,
+ email = :email,
+ admin = :admin,
+ map = :map,
+ language = :language,
+ distanceUnit = :distanceUnit,
+ speedUnit = :speedUnit,
+ latitude = :latitude,
+ longitude = :longitude,
+ zoom = :zoom
WHERE id = :id;
</entry>
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
}]
},
diff --git a/web/l10n/en.js b/web/l10n/en.js
index 7f169cf81..2fedbb754 100644
--- a/web/l10n/en.js
+++ b/web/l10n/en.js
@@ -6,6 +6,10 @@ var strings = {
shared_edit: 'Edit',
shared_remove: 'Remove',
shared_remove_confirm: 'Remove item?',
+ shared_km: 'km',
+ shared_mi: 'mi',
+ shared_kph: 'km/h',
+ shared_mph: 'mph',
error_title: 'Error',
error_unknown: 'Unknown error',
@@ -31,6 +35,8 @@ var strings = {
settings_user: 'Account',
settings_server: 'Server',
settings_users: 'Users',
+ settings_distance_unit: 'Distance',
+ settings_speed_unit: 'Speed',
report_title: 'Reports',
report_device: 'Device',
@@ -55,6 +61,8 @@ var strings = {
map_title: 'Map',
map_layer: 'Map Layer',
+ map_osm: 'OpenStreetMap',
+ map_bing: 'Bing Maps',
state_title: 'State',
state_name: 'Parameter',