diff options
-rw-r--r-- | src/org/traccar/ServerManager.java | 12 | ||||
-rw-r--r-- | src/org/traccar/api/resource/CommandTypeResource.java (renamed from src/org/traccar/api/resource/SupportedCommandResource.java) | 10 | ||||
-rw-r--r-- | src/org/traccar/model/CommandType.java (renamed from src/org/traccar/model/SupportedCommand.java) | 2 | ||||
-rw-r--r-- | src/org/traccar/web/WebServer.java | 4 | ||||
-rw-r--r-- | web/app/Application.js | 2 | ||||
-rw-r--r-- | web/app/store/CommandTypes.js (renamed from web/app/store/SupportedCommands.js) | 4 | ||||
-rw-r--r-- | web/app/view/CommandDialog.js | 2 |
7 files changed, 18 insertions, 18 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 5e59851f7..cf49b3e2c 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -15,7 +15,7 @@ */ package org.traccar; -import org.traccar.model.SupportedCommand; +import org.traccar.model.CommandType; import java.io.File; import java.net.URI; @@ -98,16 +98,16 @@ public class ServerManager { } } - public Collection<SupportedCommand> getProtocolSuppportedCommands(String protocol) { - List<SupportedCommand> result = new ArrayList<>(); + public Collection<CommandType> getProtocolCommandTypes(String protocol) { + List<CommandType> result = new ArrayList<>(); if (protocol != null) { BaseProtocol baseProtocol = protocols.get(protocol); if (baseProtocol != null) { for (String commandKey : baseProtocol.getSupportedCommands()) { - SupportedCommand supportedCommand = new SupportedCommand(); - supportedCommand.setKey(commandKey); - result.add(supportedCommand); + CommandType commandType = new CommandType(); + commandType.setKey(commandKey); + result.add(commandType); } } } diff --git a/src/org/traccar/api/resource/SupportedCommandResource.java b/src/org/traccar/api/resource/CommandTypeResource.java index 1d5ce8595..9f9ecf249 100644 --- a/src/org/traccar/api/resource/SupportedCommandResource.java +++ b/src/org/traccar/api/resource/CommandTypeResource.java @@ -18,7 +18,7 @@ package org.traccar.api.resource; import org.traccar.Context; import org.traccar.api.BaseResource; import org.traccar.model.Position; -import org.traccar.model.SupportedCommand; +import org.traccar.model.CommandType; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -30,17 +30,17 @@ import java.sql.SQLException; import java.util.Collection; import java.util.Collections; -@Path("supportedcommands") +@Path("commandtypes") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class SupportedCommandResource extends BaseResource { +public class CommandTypeResource extends BaseResource { @GET - public Collection<SupportedCommand> get(@QueryParam("deviceId") long deviceId) throws SQLException { + public Collection<CommandType> get(@QueryParam("deviceId") long deviceId) throws SQLException { Context.getPermissionsManager().checkDevice(getUserId(), deviceId); Position lastPosition = Context.getConnectionManager().getLastPosition(deviceId); if (lastPosition != null) { - return Context.getServerManager().getProtocolSuppportedCommands(lastPosition.getProtocol()); + return Context.getServerManager().getProtocolCommandTypes(lastPosition.getProtocol()); } else { return Collections.EMPTY_LIST; } diff --git a/src/org/traccar/model/SupportedCommand.java b/src/org/traccar/model/CommandType.java index 59a24d033..057dda4c5 100644 --- a/src/org/traccar/model/SupportedCommand.java +++ b/src/org/traccar/model/CommandType.java @@ -15,7 +15,7 @@ */ package org.traccar.model; -public class SupportedCommand { +public class CommandType { private String key; diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index bcb0442f6..8144af0b6 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -43,7 +43,7 @@ import org.traccar.api.resource.UserResource; import org.traccar.api.resource.GroupResource; import org.traccar.api.resource.DeviceResource; import org.traccar.api.resource.PositionResource; -import org.traccar.api.resource.SupportedCommandResource; +import org.traccar.api.resource.CommandTypeResource; import org.traccar.helper.Log; import javax.naming.InitialContext; @@ -148,7 +148,7 @@ public class WebServer { resourceConfig.register(CorsResponseFilter.class); resourceConfig.registerClasses(ServerResource.class, SessionResource.class, CommandResource.class, GroupPermissionResource.class, DevicePermissionResource.class, UserResource.class, - GroupResource.class, DeviceResource.class, PositionResource.class, SupportedCommandResource.class); + GroupResource.class, DeviceResource.class, PositionResource.class, CommandTypeResource.class); servletHandler.addServlet(new ServletHolder(new ServletContainer(resourceConfig)), "/*"); handlers.addHandler(servletHandler); diff --git a/web/app/Application.js b/web/app/Application.js index f68ef981e..69ce8f891 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -45,7 +45,7 @@ Ext.define('Traccar.Application', { 'MapTypes', 'DistanceUnits', 'SpeedUnits', - 'SupportedCommands', + 'CommandTypes', 'TimeUnits', 'Languages' ], diff --git a/web/app/store/SupportedCommands.js b/web/app/store/CommandTypes.js index 2bb73839b..d2f9b57e4 100644 --- a/web/app/store/SupportedCommands.js +++ b/web/app/store/CommandTypes.js @@ -14,7 +14,7 @@ * limitations under the License. */ -Ext.define('Traccar.store.SupportedCommands', { +Ext.define('Traccar.store.CommandTypes', { extend: 'Ext.data.Store', fields: ['key'], @@ -22,7 +22,7 @@ Ext.define('Traccar.store.SupportedCommands', { 'beforeload' : function(store, eOpts) { var proxy; proxy = store.getProxy(); - proxy.setUrl('/api/supportedcommands?deviceId' + proxy.extraParams.deviceId); + proxy.setUrl('/api/commandtypes?deviceId' + proxy.extraParams.deviceId); } }, diff --git a/web/app/view/CommandDialog.js b/web/app/view/CommandDialog.js index 05412f39c..f2c2f5541 100644 --- a/web/app/view/CommandDialog.js +++ b/web/app/view/CommandDialog.js @@ -30,7 +30,7 @@ Ext.define('Traccar.view.CommandDialog', { xtype: 'combobox', name: 'type', fieldLabel: Strings.commandType, - store: 'SupportedCommands', + store: 'CommandTypess', displayField: 'key', valueField: 'key', listeners: { |