aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/view
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-01-11 19:48:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-01-11 19:48:19 +1300
commit47cea42e319176aa69decc43e8d8074374ff0c4b (patch)
tree604850f3300e00bdd3a33735338949f2a9d39dfe /src/org/traccar/web/client/view
parent3defcd30d7ef7c10c82561b955c9e4e4fba789bf (diff)
downloadtrackermap-web-47cea42e319176aa69decc43e8d8074374ff0c4b.tar.gz
trackermap-web-47cea42e319176aa69decc43e8d8074374ff0c4b.tar.bz2
trackermap-web-47cea42e319176aa69decc43e8d8074374ff0c4b.zip
Add logout button
Diffstat (limited to 'src/org/traccar/web/client/view')
-rw-r--r--src/org/traccar/web/client/view/DeviceView.java13
-rw-r--r--src/org/traccar/web/client/view/DeviceView.ui.xml3
-rw-r--r--src/org/traccar/web/client/view/MapView.java6
3 files changed, 15 insertions, 7 deletions
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<Boolean>() {
+ @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 @@
<toolbar:FillToolItem />
<toolbar:SeparatorToolItem />
<button:TextButton ui:field="settingsButton" text="Settings" enabled="false" />
- </toolbar:ToolBar>
+ <button:TextButton ui:field="logoutButton" text="Logout" />
+ </toolbar:ToolBar>
</container:child>
<container:child layoutData="{layoutData}">
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);