aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-22 07:22:14 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-22 07:22:14 -0700
commitcc9eca495f93b8ffaee0fe5b10b62f1f3dfbf945 (patch)
tree397de1f1bb572138cf6f60f2c618c6a71e71c95d /src/main/java/org/traccar/api
parentf5a9207393463879cfe85e94259ee70d6d5b9980 (diff)
downloadtrackermap-server-cc9eca495f93b8ffaee0fe5b10b62f1f3dfbf945.tar.gz
trackermap-server-cc9eca495f93b8ffaee0fe5b10b62f1f3dfbf945.tar.bz2
trackermap-server-cc9eca495f93b8ffaee0fe5b10b62f1f3dfbf945.zip
Return storage info
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/ServerResource.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/api/resource/ServerResource.java b/src/main/java/org/traccar/api/resource/ServerResource.java
index b66f5a931..2ef99c578 100644
--- a/src/main/java/org/traccar/api/resource/ServerResource.java
+++ b/src/main/java/org/traccar/api/resource/ServerResource.java
@@ -18,8 +18,10 @@ package org.traccar.api.resource;
import org.traccar.api.BaseResource;
import org.traccar.database.MailManager;
import org.traccar.geocoder.Geocoder;
+import org.traccar.helper.Log;
import org.traccar.helper.LogAction;
import org.traccar.model.Server;
+import org.traccar.model.User;
import org.traccar.storage.Storage;
import org.traccar.storage.StorageException;
import org.traccar.storage.query.Columns;
@@ -60,6 +62,10 @@ 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());
+ User user = permissionsService.getUser(getUserId());
+ if (user != null && user.getAdministrator()) {
+ server.setStorageSpace(Log.getStorageSpace());
+ }
return server;
}