aboutsummaryrefslogtreecommitdiff
path: root/web/app/store
diff options
context:
space:
mode:
authorGábor Somogyi <gabor.g.somogyi@gmail.com>2016-05-06 13:32:04 +0200
committerGábor Somogyi <gabor.g.somogyi@gmail.com>2016-05-06 13:32:04 +0200
commit37bc675580c640d4fa7968fee575544fb3a550e3 (patch)
tree91e804e75d9701f2581b2f5400e37226e8dcf2b1 /web/app/store
parentaac9a985e85859132d6e0619f6465dff7a548bf0 (diff)
downloadtrackermap-server-37bc675580c640d4fa7968fee575544fb3a550e3.tar.gz
trackermap-server-37bc675580c640d4fa7968fee575544fb3a550e3.tar.bz2
trackermap-server-37bc675580c640d4fa7968fee575544fb3a550e3.zip
I18N added
Diffstat (limited to 'web/app/store')
-rw-r--r--web/app/store/CommandTypes.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js
index d2f9b57e4..b8cb03668 100644
--- a/web/app/store/CommandTypes.js
+++ b/web/app/store/CommandTypes.js
@@ -16,10 +16,10 @@
Ext.define('Traccar.store.CommandTypes', {
extend: 'Ext.data.Store',
- fields: ['key'],
+ fields: ['key', 'name'],
listeners: {
- 'beforeload' : function(store, eOpts) {
+ 'beforeload' : function(store) {
var proxy;
proxy = store.getProxy();
proxy.setUrl('/api/commandtypes?deviceId' + proxy.extraParams.deviceId);
@@ -28,6 +28,22 @@ Ext.define('Traccar.store.CommandTypes', {
proxy: {
type: 'rest',
- url: ''
+ url: '',
+ reader: {
+ type: 'json',
+ getData: function(data) {
+ Ext.each(data, function(entry) {
+ entry.name = entry.key;
+ if (typeof entry.key !== "undefined") {
+ var key = 'command' + entry.key.charAt(0).toUpperCase() + entry.key.slice(1);
+ var name = Strings[key];
+ if (typeof name !== "undefined") {
+ entry.name = name;
+ }
+ }
+ });
+ return data;
+ }
+ },
}
});