From a946618d649cde478d8750bb6b84cb521b68c87c Mon Sep 17 00:00:00 2001 From: Leandro Silva Ferreira Date: Wed, 15 Aug 2012 08:58:26 -0400 Subject: Corrections of wrong "git fetch upstream" --- src/web/index.html | 60 +++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'src/web/index.html') diff --git a/src/web/index.html b/src/web/index.html index cde73f47b..dcc4771db 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -1,7 +1,9 @@ - - + + -Traccar Manager +Jornada Beta + + @@ -758,6 +760,7 @@ Ext.onReady(function() { ] }); + Ext.define('Position', { extend: 'Ext.data.Model', fields: [ @@ -768,7 +771,8 @@ Ext.onReady(function() { {name: 'longitude', type: 'float'}, {name: 'speed', type: 'float'}, {name: 'course', type: 'float'}, - {name: 'power', type: 'float'} + {name: 'power', type: 'float'}, + {name: 'mode', type: 'int'} ] }); @@ -806,7 +810,8 @@ Ext.onReady(function() { 'longitude', 'speed', 'course', - 'power' + 'power', + 'mode' ], proxy: { type: 'ajax', @@ -824,7 +829,7 @@ Ext.onReady(function() { }); var devicesPanel = Ext.create('Ext.grid.Panel', { - title: 'Devices', + title: 'Dispositivos', region: 'west', split: true, width: 300, @@ -837,16 +842,16 @@ Ext.onReady(function() { tbar: [ { id: 'device_update', - text: 'Update', + text: 'Atualizar', handler : function() { devices.load(); } }, { id: 'device_add', - text: 'Add', + text: 'Incluir', handler : function() { - Ext.Msg.prompt('Add', 'Device IMEI:', function(btn, text) { + Ext.Msg.prompt('Incluir', 'IMEI do Dispositivo:', function(btn, text) { if (btn == 'ok') { devices.add({imei: text}); } @@ -855,10 +860,10 @@ Ext.onReady(function() { }, { id: 'device_remove', - text: 'Remove', + text: 'Remover', disabled: true, handler : function() { - Ext.Msg.confirm('Remove', 'Are you sure to remove item?', function(btn) { + Ext.Msg.confirm('Remover', 'Confirma remoção do item?', function(btn) { if (btn == 'yes') { devices.remove(devicesPanel.getSelectionModel().getLastSelected()); } @@ -867,10 +872,10 @@ Ext.onReady(function() { }, { id: 'device_edit', - text: 'Edit', + text: 'Alterar', disabled: true, handler : function() { - Ext.Msg.prompt('Edit', 'Device IMEI:', function(btn, text) { + Ext.Msg.prompt('Alterar', 'IMEI do Dispositivo:', function(btn, text) { if (btn == 'ok') { devicesPanel.getSelectionModel().getLastSelected().set('imei', text); } @@ -888,11 +893,11 @@ Ext.onReady(function() { Ext.getCmp('device_remove').enable(); Ext.getCmp('device_edit').enable(); - positions.getProxy().url = positionsUrl + '?deviceId=' + - devicesPanel.getSelectionModel().getLastSelected().get('id'); + positions.getProxy().url = positionsUrl + '?deviceId=' + devicesPanel.getSelectionModel().getLastSelected().get('id'); positions.load(); Ext.getCmp('position_update').enable(); - } else { + } + else { Ext.getCmp('position_update').disable(); positions.getProxy().url = positionsUrl; positions.load(); @@ -905,7 +910,7 @@ Ext.onReady(function() { }); var positionsPanel = Ext.create('Ext.grid.Panel', { - title: 'Positions', + title: 'Posicionamentos', region: 'south', split: true, height: 300, @@ -918,7 +923,7 @@ Ext.onReady(function() { tbar: [ { id: 'position_update', - text: 'Update', + text: 'Atualizar', disabled: true, handler : function() { positions.load(); @@ -926,19 +931,18 @@ Ext.onReady(function() { } ], columns: [ - {header: 'Device Id', dataIndex: 'device_id'}, - { - header: 'Time', - dataIndex: 'time', + {header: 'Id Dispositivo', dataIndex: 'device_id'}, + {header: 'Data/Hora',dataIndex: 'time', flex: 1, - renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') + renderer: Ext.util.Format.dateRenderer('d/m/Y H:i:s') }, - {header: 'Valid', dataIndex: 'valid'}, + {header: 'Válido', dataIndex: 'valid'}, {header: 'Latitude', dataIndex: 'latitude'}, {header: 'Longitude', dataIndex: 'longitude'}, - {header: 'Speed', dataIndex: 'speed'}, - {header: 'Course', dataIndex: 'course'}, - {header: 'Power', dataIndex: 'power'} + {header: 'Velocidade', dataIndex: 'speed'}, + {header: 'Curso', dataIndex: 'course'}, + {header: 'Voltagem', dataIndex: 'power'}, + {header: 'Modo', dataIndex: 'mode'} ], listeners: { selectionchange: function(sender, selected, eOpts) { @@ -955,7 +959,7 @@ Ext.onReady(function() { }); var mapPanel = Ext.create('Ext.panel.Panel', { - title: 'Map', + title: 'Mapa', region: 'center', margins: {top: 5, bottom: 0, right: 5, left: 0}, -- cgit v1.2.3 From 3a78e641bacccaca181bbd292f0f2f0d579b5caf Mon Sep 17 00:00:00 2001 From: Leandro Silva Ferreira Date: Wed, 15 Aug 2012 11:04:16 -0400 Subject: Changes to save de address field from geocoding and show it on markers at the map and on position's grid --- setup/windows/windowsPG.cfg | 8 +++- src/org/traccar/Server.java | 2 +- src/org/traccar/TrackerEventHandler.java | 3 +- src/org/traccar/http/WebServer.java | 5 ++- src/org/traccar/model/DatabaseDataManager.java | 1 + src/web/index.html | 52 ++++++++++++++------------ test.sh | 0 7 files changed, 42 insertions(+), 29 deletions(-) mode change 100644 => 100755 test.sh (limited to 'src/web/index.html') diff --git a/setup/windows/windowsPG.cfg b/setup/windows/windowsPG.cfg index 28e29dbad..aaefc4b21 100644 --- a/setup/windows/windowsPG.cfg +++ b/setup/windows/windowsPG.cfg @@ -14,6 +14,7 @@ 300 + id - Long @@ -80,13 +82,15 @@ extended_info - String (XML) <--> - INSERT INTO positions (id, device_id, time, valid, latitude, longitude, speed, course, power, mode) - VALUES (nextval('positionsSQ'),:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power, :mode) + INSERT INTO positions (id, device_id, time, valid, latitude, longitude, speed, course, power, mode, address) + VALUES (nextval('positionsSQ'),:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power, :mode, :address) true 8082 + + true true diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java index 32a2888cc..15514bffc 100644 --- a/src/org/traccar/Server.java +++ b/src/org/traccar/Server.java @@ -193,7 +193,7 @@ public class Server { } private void initGeocoder(Properties properties) throws IOException { - if (Boolean.parseBoolean("geocoder.enable")) { + if (Boolean.parseBoolean(properties.getProperty("geocoder.enable"))) { geocoder = new GoogleReverseGeocoder(); } } diff --git a/src/org/traccar/TrackerEventHandler.java b/src/org/traccar/TrackerEventHandler.java index 2a66a084f..07ecf71de 100644 --- a/src/org/traccar/TrackerEventHandler.java +++ b/src/org/traccar/TrackerEventHandler.java @@ -57,7 +57,8 @@ public class TrackerEventHandler extends SimpleChannelHandler { ", speed: " + position.getSpeed() + ", course: " + position.getCourse() + ", power: " + position.getPower() + - ", mode: " + position.getMode()); + ", mode: " + position.getMode() + + ", address: " + position.getAddress()); } // Write position to database diff --git a/src/org/traccar/http/WebServer.java b/src/org/traccar/http/WebServer.java index e379a0a9a..5fac8ff65 100644 --- a/src/org/traccar/http/WebServer.java +++ b/src/org/traccar/http/WebServer.java @@ -146,7 +146,7 @@ public class WebServer { Iterator i = dataManager.getPositions(Long.valueOf(deviceId)).iterator(); while (i.hasNext()) { Position position = i.next(); - out.format("{'device_id':%d,'time':'%s','valid':%b,'latitude':%s,'longitude':%s,'speed':%s,'course':%s,'mode':%d}", + out.format("{'device_id':%d,'time':'%s','valid':%b,'latitude':%s,'longitude':%s,'speed':%s,'course':%s,'mode':%d,'address':'%s'}", position.getDeviceId(), position.getTimeFormated(), position.getValid(), @@ -154,7 +154,8 @@ public class WebServer { position.getLongitude().toString(), position.getSpeed().toString(), position.getCourse().toString(), - position.getMode()); + position.getMode(), + position.getAddress()); if (i.hasNext()) out.print(","); } } diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java index 2207d272b..3092744c0 100644 --- a/src/org/traccar/model/DatabaseDataManager.java +++ b/src/org/traccar/model/DatabaseDataManager.java @@ -211,6 +211,7 @@ public class DatabaseDataManager implements DataManager { position.setCourse(result.getDouble("course")); position.setPower(result.getDouble("power")); position.setMode(result.getInt("mode")); + position.setAddress(result.getString("address")); positionList.add(position); } diff --git a/src/web/index.html b/src/web/index.html index dcc4771db..6be205300 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -166,11 +166,12 @@ setCenter: { }, // or just specify lat/long +*/ setCenter: { - lat: 42.345573, - lng: -71.098326 -} - * + lat: '-15.618767', + lng: '-56.083214' +}, + /* * listeners */ /** * @cfg {Number} zoomLevel @@ -178,7 +179,7 @@ setCenter: { * Also used as the zoom level for panoramas, zero specifies no zoom at all. * Defaults to 3. */ - zoomLevel: 3, + zoomLevel: 10, /** * @cfg {Number} yaw * The Yaw, or rotational direction of the users perspective in degrees. Only applies to panoramas. @@ -291,7 +292,7 @@ markers: [{ Ext.defer(function(){ if (this.gmapType === 'map'){ - this.gmap = new google.maps.Map(this.getEl().dom, {zoom:this.zoomLevel,mapTypeId: google.maps.MapTypeId.ROADMAP}); + this.gmap = new google.maps.Map(this.getEl().dom, {zoom:this.zoomLevel,mapTypeId: google.maps.MapTypeId.HYBRID}); this.mapDefined = true; this.mapDefinedGMap = true; } @@ -302,7 +303,7 @@ markers: [{ } if (!this.mapDefined && this.gmapType){ - this.gmap = new google.maps.Map(this.getEl().dom, {zoom:this.zoomLevel,mapTypeId: google.maps.MapTypeId.ROADMAP}); + this.gmap = new google.maps.Map(this.getEl().dom, {zoom:this.zoomLevel,mapTypeId: google.maps.MapTypeId.HYBRID}); this.gmap.setMapTypeId(this.gmapType); this.mapDefined = true; this.mapDefinedGMap = true; @@ -317,7 +318,7 @@ markers: [{ this.geoCodeLookup(this.setCenter.geoCodeAddr, this.setCenter.marker, false, true, this.setCenter.listeners); }else{ if (this.gmapType === 'map'){ - var point = new google.maps.LatLng(this.setCenter.lat,this.setCenter.lng); + var point = new google.maps.LatLng(-15.618767,-56.083214); this.getMap().setCenter(point, this.zoomLevel); this.lastCenter = point; } @@ -473,9 +474,7 @@ markers: [{ this.lastCenter = point; } - var mark = new google.maps.Marker(Ext.apply(marker, { - position: point - })); + var mark = new google.maps.Marker(Ext.apply(marker, {position: point})); if (marker.infoWindow){ this.createInfoWindow(marker.infoWindow, point, mark); @@ -772,7 +771,8 @@ Ext.onReady(function() { {name: 'speed', type: 'float'}, {name: 'course', type: 'float'}, {name: 'power', type: 'float'}, - {name: 'mode', type: 'int'} + {name: 'mode', type: 'int'}, + {name: 'address', type: 'string'} ] }); @@ -811,7 +811,8 @@ Ext.onReady(function() { 'speed', 'course', 'power', - 'mode' + 'mode', + 'address' ], proxy: { type: 'ajax', @@ -932,25 +933,30 @@ Ext.onReady(function() { ], columns: [ {header: 'Id Dispositivo', dataIndex: 'device_id'}, - {header: 'Data/Hora',dataIndex: 'time', + {header: 'Data/Hora', + dataIndex: 'time', flex: 1, - renderer: Ext.util.Format.dateRenderer('d/m/Y H:i:s') + sortable: true, + renderer: Ext.util.Format.dateRenderer('d/m/Y H:i:s'), + width: 100 }, - {header: 'Válido', dataIndex: 'valid'}, - {header: 'Latitude', dataIndex: 'latitude'}, - {header: 'Longitude', dataIndex: 'longitude'}, - {header: 'Velocidade', dataIndex: 'speed'}, - {header: 'Curso', dataIndex: 'course'}, - {header: 'Voltagem', dataIndex: 'power'}, - {header: 'Modo', dataIndex: 'mode'} + {header: 'Endereço', dataIndex: 'address', width: 480}, + {header: 'Latitude', dataIndex: 'latitude', width: 70}, + {header: 'Longitude', dataIndex: 'longitude', width: 70}, + {header: 'Velocidade', dataIndex: 'speed', width: 70}, + {header: 'Curso', dataIndex: 'course', width: 70}, + {header: 'Voltagem', dataIndex: 'power', width: 70}, + {header: 'Modo', dataIndex: 'mode', width: 70}, + {header: 'Válido', dataIndex: 'valid', width: 70} ], listeners: { selectionchange: function(sender, selected, eOpts) { if (selected.length != 0) { var lat = positionsPanel.getSelectionModel().getLastSelected().get('latitude'); var lng = positionsPanel.getSelectionModel().getLastSelected().get('longitude'); + var title = positionsPanel.getSelectionModel().getLastSelected().get('address'); var point = new google.maps.LatLng(lat, lng); - map.addMarker(point, {lat: lat, lng: lng}, true, true); + map.addMarker(point, {lat: lat, lng: lng, title: title}, true, true); } else { map.clearMarkers(); // private? } diff --git a/test.sh b/test.sh old mode 100644 new mode 100755 -- cgit v1.2.3