From bd2e0fdc6fe222316e9e740aa265b6d132d407b6 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 23 Jun 2016 16:17:25 +0500 Subject: Added possibility to disable event and geofence subsystems --- setup/windows/traccar.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'setup/windows') diff --git a/setup/windows/traccar.xml b/setup/windows/traccar.xml index 17f2ab4f3..7801912f9 100644 --- a/setup/windows/traccar.xml +++ b/setup/windows/traccar.xml @@ -17,6 +17,8 @@ all [LOG] + true + 60 true @@ -26,6 +28,8 @@ true + true> + org.h2.Driver -- cgit v1.2.3 From 52e7002ed39c333884529c3a0e8b4c6d23f0115e Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 24 Jun 2016 09:36:20 +0500 Subject: - Reverted changes in web-client - Removed duplicate flag --- debug.xml | 2 -- setup/unix/traccar.xml | 2 -- setup/windows/traccar.xml | 2 -- src/org/traccar/BasePipelineFactory.java | 8 +++----- src/org/traccar/Context.java | 2 +- src/org/traccar/web/WebServer.java | 11 ++--------- web/app/controller/Root.js | 7 +------ web/app/view/DevicesController.js | 2 +- web/app/view/GroupsController.js | 2 +- web/app/view/UsersController.js | 2 +- 10 files changed, 10 insertions(+), 30 deletions(-) (limited to 'setup/windows') diff --git a/debug.xml b/debug.xml index 674099c2f..d11cf99f4 100644 --- a/debug.xml +++ b/debug.xml @@ -52,8 +52,6 @@ true - true - diff --git a/setup/unix/traccar.xml b/setup/unix/traccar.xml index 747b30d52..b75376434 100644 --- a/setup/unix/traccar.xml +++ b/setup/unix/traccar.xml @@ -28,8 +28,6 @@ true - true - org.h2.Driver diff --git a/setup/windows/traccar.xml b/setup/windows/traccar.xml index 7801912f9..995b52c0d 100644 --- a/setup/windows/traccar.xml +++ b/setup/windows/traccar.xml @@ -28,8 +28,6 @@ true - true> - org.h2.Driver diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 9de9b3a52..44f1b0657 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -142,11 +142,9 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { if (Context.getConfig().getBoolean("event.motionHandler")) { motionEventHandler = new MotionEventHandler(); } - - if (Context.getConfig().getBoolean("geofence.enable") - && Context.getConfig().getBoolean("event.geofenceHandler")) { - geofenceEventHandler = new GeofenceEventHandler(); - } + } + if (Context.getConfig().getBoolean("event.geofenceHandler")) { + geofenceEventHandler = new GeofenceEventHandler(); } } diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 7d22ac681..b37e87331 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -193,7 +193,7 @@ public final class Context { connectionManager = new ConnectionManager(dataManager); - if (config.getBoolean("geofence.enable")) { + if (config.getBoolean("event.geofenceHandler")) { geofenceManager = new GeofenceManager(dataManager); } diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index 2fa5c1a80..c06ee5d35 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -29,7 +29,6 @@ import org.glassfish.jersey.jackson.JacksonFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; import org.traccar.Config; -import org.traccar.Context; import org.traccar.api.AsyncSocketServlet; import org.traccar.api.CorsResponseFilter; import org.traccar.api.ObjectMapperProvider; @@ -155,14 +154,8 @@ public class WebServer { resourceConfig.registerClasses(ServerResource.class, SessionResource.class, CommandResource.class, GroupPermissionResource.class, DevicePermissionResource.class, UserResource.class, GroupResource.class, DeviceResource.class, PositionResource.class, - CommandTypeResource.class); - if (Context.getConfig().getBoolean("event.enable")) { - resourceConfig.registerClasses(EventResource.class); - } - if (Context.getConfig().getBoolean("geofence.enable")) { - resourceConfig.registerClasses(GeofenceResource.class, DeviceGeofenceResource.class, - GeofencePermissionResource.class, GroupGeofenceResource.class); - } + CommandTypeResource.class, EventResource.class, GeofenceResource.class, + DeviceGeofenceResource.class, GeofencePermissionResource.class, GroupGeofenceResource.class); servletHandler.addServlet(new ServletHolder(new ServletContainer(resourceConfig)), "/*"); handlers.addHandler(servletHandler); diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 8ae348ca4..56a076edd 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -75,11 +75,6 @@ Ext.define('Traccar.controller.Root', { loadApp: function () { Ext.getStore('Groups').load(); Ext.getStore('Devices').load(); - Ext.getStore('Geofences').getProxy().on('exception', function(proxy, response, operation) { - if (operation && operation.error.status === 404) { - Traccar.app.withoutGeofences = true; - } - }); Ext.getStore('Geofences').load(); Ext.get('attribution').remove(); if (this.isPhone) { @@ -153,7 +148,7 @@ Ext.define('Traccar.controller.Root', { text = typeKey; } } - if (array[i].geofenceId !== 0 && !Traccar.app.withoutGeofences) { + if (array[i].geofenceId !== 0) { geofence = Ext.getStore('Geofences').getById(array[i].geofenceId); if (typeof geofence != "undefined") { text += ' \"' + geofence.getData().name + '"'; diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index 8b35fd859..cf31dd7bb 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -125,7 +125,7 @@ Ext.define('Traccar.view.DevicesController', { var empty = selected.getCount() === 0; this.lookupReference('toolbarEditButton').setDisabled(empty); this.lookupReference('toolbarRemoveButton').setDisabled(empty); - this.lookupReference('toolbarGeofencesButton').setDisabled(empty || Traccar.app.withoutGeofences); + this.lookupReference('toolbarGeofencesButton').setDisabled(empty); this.lookupReference('deviceCommandButton').setDisabled(empty || (selected.getLastSelected().get('status') !== 'online')); if (!empty) { this.fireEvent('selectDevice', selected.getLastSelected(), true); diff --git a/web/app/view/GroupsController.js b/web/app/view/GroupsController.js index ecacdb7f6..bc713bb6d 100644 --- a/web/app/view/GroupsController.js +++ b/web/app/view/GroupsController.js @@ -79,6 +79,6 @@ Ext.define('Traccar.view.GroupsController', { var disabled = selected.length > 0; this.lookupReference('toolbarEditButton').setDisabled(disabled); this.lookupReference('toolbarRemoveButton').setDisabled(disabled); - this.lookupReference('toolbarGeofencesButton').setDisabled(disabled || Traccar.app.withoutGeofences); + this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); } }); diff --git a/web/app/view/UsersController.js b/web/app/view/UsersController.js index d8e42570d..acba66b4d 100644 --- a/web/app/view/UsersController.js +++ b/web/app/view/UsersController.js @@ -120,6 +120,6 @@ Ext.define('Traccar.view.UsersController', { this.lookupReference('toolbarRemoveButton').setDisabled(disabled); this.lookupReference('userDevicesButton').setDisabled(disabled); this.lookupReference('userGroupsButton').setDisabled(disabled); - this.lookupReference('userGeofencesButton').setDisabled(disabled || Traccar.app.withoutGeofences); + this.lookupReference('userGeofencesButton').setDisabled(disabled); } }); -- cgit v1.2.3