From d25e8a163786c78098c57bb78cf44746c1fe2364 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Jul 2022 16:02:49 -0700 Subject: Geocoder enabled server flag --- src/main/java/org/traccar/api/resource/ServerResource.java | 1 + src/main/java/org/traccar/model/Server.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/org/traccar/api/resource/ServerResource.java b/src/main/java/org/traccar/api/resource/ServerResource.java index 071b7ae8e..3e6792f5b 100644 --- a/src/main/java/org/traccar/api/resource/ServerResource.java +++ b/src/main/java/org/traccar/api/resource/ServerResource.java @@ -63,6 +63,7 @@ public class ServerResource extends BaseResource { public Server get() throws StorageException { Server server = storage.getObject(Server.class, new Request(new Columns.All())); server.setEmailEnabled(mailManager.getEmailEnabled()); + server.setGeocoderEnabled(geocoder != null); User user = permissionsService.getUser(getUserId()); if (user != null && user.getAdministrator()) { server.setStorageSpace(Log.getStorageSpace()); diff --git a/src/main/java/org/traccar/model/Server.java b/src/main/java/org/traccar/model/Server.java index 648be2991..e39da1b16 100644 --- a/src/main/java/org/traccar/model/Server.java +++ b/src/main/java/org/traccar/model/Server.java @@ -214,6 +214,18 @@ public class Server extends ExtendedModel implements UserRestrictions { return emailEnabled; } + private boolean geocoderEnabled; + + @QueryIgnore + public void setGeocoderEnabled(boolean geocoderEnabled) { + this.geocoderEnabled = geocoderEnabled; + } + + @QueryIgnore + public boolean getGeocoderEnabled() { + return geocoderEnabled; + } + private long[] storageSpace; @QueryIgnore -- cgit v1.2.3