aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
Diffstat (limited to 'web/app')
-rw-r--r--web/app/store/SupportedCommands.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/web/app/store/SupportedCommands.js b/web/app/store/SupportedCommands.js
index 2b052b902..64e4af88d 100644
--- a/web/app/store/SupportedCommands.js
+++ b/web/app/store/SupportedCommands.js
@@ -19,10 +19,22 @@ Ext.define('Traccar.store.SupportedCommands', {
model: 'Traccar.model.SupportedCommand',
listeners: {
- 'beforeload' : function(store, options) {
+ 'beforeload' : function(store, eOpts) {
var proxy;
proxy = store.getProxy();
- proxy.setUrl('/api/devices/' + proxy.extraParams.deviceId + '/supportedcommands');
+ proxy.setUrl('/api/supportedcommands?deviceId' + proxy.extraParams.deviceId);
+ },
+ 'load' : function(store, records, successful, eOpts) {
+ if (typeof records !== "undefined") {
+ records.forEach(function(entry) {
+ if (typeof entry !== "undefined" && typeof entry.data.name !== "undefined") {
+ var translatedName = Strings[entry.data.name];
+ if (typeof translatedName !== "undefined") {
+ entry.data.name = translatedName;
+ }
+ }
+ }, this);
+ }
}
},