From b247a05d4cc34cf587fc0b4299692d401124055a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 17 Nov 2015 15:52:39 +1300 Subject: Show last update in the status table --- web/l10n/en.json | 1 + 1 file changed, 1 insertion(+) (limited to 'web/l10n/en.json') diff --git a/web/l10n/en.json b/web/l10n/en.json index a3489fbe1..b18c85afd 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -31,6 +31,7 @@ "deviceTitle": "Devices", "deviceName": "Name", "deviceIdentifier": "Identifier", + "deviceLastUpdate": "Last Update", "deviceCommand": "Command", "settingsTitle": "Settings", "settingsUser": "Account", -- cgit v1.2.3 From 4550377ff48566c444ee96678b9da8107e21ef55 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 21 Nov 2015 12:21:03 +1300 Subject: Implement automatic device following --- web/app/view/Devices.js | 6 ++++++ web/app/view/MapController.js | 8 ++++++++ web/l10n/en.json | 1 + 3 files changed, 15 insertions(+) (limited to 'web/l10n/en.json') diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js index 128cd3be1..21bea6980 100644 --- a/web/app/view/Devices.js +++ b/web/app/view/Devices.js @@ -41,6 +41,12 @@ Ext.define('Traccar.view.Devices', { tooltipType: 'title' }, { xtype: 'tbfill' + }, { + id:'deviceFollowButton', + glyph: 'xf05b@FontAwesome', + tooltip: Strings.deviceFollow, + tooltipType: 'title', + enableToggle: true }, { xtype: 'settingsMenu' }] diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index a3412b796..e4ce53b57 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -97,6 +97,10 @@ Ext.define('Traccar.view.MapController', { } }, + followSelected: function () { + return Ext.getCmp('deviceFollowButton') && Ext.getCmp('deviceFollowButton').pressed; + }, + updateLatest: function (store, data) { var i, position, geometry, device, deviceId, marker, style; @@ -129,6 +133,10 @@ Ext.define('Traccar.view.MapController', { } marker.getStyle().getImage().setRotation(position.get('course') * Math.PI / 180); + + if (marker === this.selectedMarker && this.followSelected()) { + this.getView().getMapView().setCenter(marker.getGeometry().getCoordinates()); + } } }, diff --git a/web/l10n/en.json b/web/l10n/en.json index b18c85afd..d70e97a07 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -33,6 +33,7 @@ "deviceIdentifier": "Identifier", "deviceLastUpdate": "Last Update", "deviceCommand": "Command", + "deviceFollow": "Follow", "settingsTitle": "Settings", "settingsUser": "Account", "settingsServer": "Server", -- cgit v1.2.3