From 47cea42e319176aa69decc43e8d8074374ff0c4b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 11 Jan 2013 19:48:19 +1300 Subject: Add logout button --- src/org/traccar/web/client/view/DeviceView.java | 13 +++++++++++++ src/org/traccar/web/client/view/DeviceView.ui.xml | 3 ++- src/org/traccar/web/client/view/MapView.java | 6 ------ 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/web/client/view') diff --git a/src/org/traccar/web/client/view/DeviceView.java b/src/org/traccar/web/client/view/DeviceView.java index 1213e5f0..76c773db 100644 --- a/src/org/traccar/web/client/view/DeviceView.java +++ b/src/org/traccar/web/client/view/DeviceView.java @@ -3,6 +3,8 @@ package org.traccar.web.client.view; import java.util.LinkedList; import java.util.List; +import org.traccar.web.client.Application; +import org.traccar.web.client.model.BaseAsyncCallback; import org.traccar.web.client.model.DeviceProperties; import org.traccar.web.shared.model.Device; @@ -10,6 +12,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Widget; import com.sencha.gxt.core.client.Style.SelectionMode; import com.sencha.gxt.data.shared.ListStore; @@ -106,4 +109,14 @@ public class DeviceView implements SelectionChangedEvent.SelectionChangedHandler deviceHandler.onRemove(grid.getSelectionModel().getSelectedItem()); } + @UiHandler("logoutButton") + public void onLogoutClicked(SelectEvent event) { + Application.getDataService().logout(new BaseAsyncCallback() { + @Override + public void onSuccess(Boolean result) { + Window.Location.reload(); + } + }); + } + } diff --git a/src/org/traccar/web/client/view/DeviceView.ui.xml b/src/org/traccar/web/client/view/DeviceView.ui.xml index af1b33cd..77de651e 100644 --- a/src/org/traccar/web/client/view/DeviceView.ui.xml +++ b/src/org/traccar/web/client/view/DeviceView.ui.xml @@ -33,7 +33,8 @@ - + + diff --git a/src/org/traccar/web/client/view/MapView.java b/src/org/traccar/web/client/view/MapView.java index a7d1dad2..70558b6e 100644 --- a/src/org/traccar/web/client/view/MapView.java +++ b/src/org/traccar/web/client/view/MapView.java @@ -23,8 +23,6 @@ import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.user.client.Command; import com.sencha.gxt.widget.core.client.ContentPanel; - - public class MapView { private ContentPanel contentPanel; @@ -68,8 +66,6 @@ public class MapView { MapOptions defaultMapOptions = new MapOptions(); defaultMapOptions.setNumZoomLevels(16); - defaultMapOptions.setProjection("EPSG:4326"); - defaultMapOptions.setDisplayProjection(new Projection("EPSG:4326")); mapWidget = new MapWidget("100%", "100%", defaultMapOptions); map = mapWidget.getMap(); @@ -78,11 +74,9 @@ public class MapView { mapLayer.setIsBaseLayer(true); VectorOptions vectorOptions = new VectorOptions(); - vectorOptions.setProjection("EPSG:4326"); vectorLayer = new Vector("Vector", vectorOptions); MarkersOptions markersOptions = new MarkersOptions(); - markersOptions.setProjection("EPSG:4326"); markerLayer = new Markers("Markers", markersOptions); map.addLayer(mapLayer); -- cgit v1.2.3