aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorGabor Somogyi <Gabor_Somogyi@epam.com>2016-05-04 12:49:23 +0200
committerGabor Somogyi <Gabor_Somogyi@epam.com>2016-05-04 12:49:23 +0200
commit1cc86f7df5704aa19d1af643c5fbf852a301858b (patch)
tree28ffae07132f57c2cdd7fd065b2315f4fb7cd7fd /web/app
parent1a605980b1a120614ccaeb56faac37b05a81a4e9 (diff)
downloadtrackermap-server-1cc86f7df5704aa19d1af643c5fbf852a301858b.tar.gz
trackermap-server-1cc86f7df5704aa19d1af643c5fbf852a301858b.tar.bz2
trackermap-server-1cc86f7df5704aa19d1af643c5fbf852a301858b.zip
SupportedCommand model removed
Diffstat (limited to 'web/app')
-rw-r--r--web/app/Application.js3
-rw-r--r--web/app/model/SupportedCommand.js28
-rw-r--r--web/app/store/SupportedCommands.js16
-rw-r--r--web/app/view/CommandDialog.js2
-rw-r--r--web/app/view/CommandDialogController.js3
5 files changed, 8 insertions, 44 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index da3fdd505..f68ef981e 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -30,8 +30,7 @@ Ext.define('Traccar.Application', {
'Device',
'Position',
'Attribute',
- 'Command',
- 'SupportedCommand'
+ 'Command'
],
stores: [
diff --git a/web/app/model/SupportedCommand.js b/web/app/model/SupportedCommand.js
deleted file mode 100644
index 35c34c8cd..000000000
--- a/web/app/model/SupportedCommand.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2016 Gabor Somogyi (gabor.g.somogyi@gmail.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-Ext.define('Traccar.model.SupportedCommand', {
- extend: 'Ext.data.Model',
- identifier: 'negative',
-
- fields: [{
- name: 'key',
- type: 'string'
- }, {
- name: 'name',
- type: 'string'
- }]
-});
diff --git a/web/app/store/SupportedCommands.js b/web/app/store/SupportedCommands.js
index 64e4af88d..612909180 100644
--- a/web/app/store/SupportedCommands.js
+++ b/web/app/store/SupportedCommands.js
@@ -16,25 +16,15 @@
Ext.define('Traccar.store.SupportedCommands', {
extend: 'Ext.data.Store',
- model: 'Traccar.model.SupportedCommand',
+ fields: [
+ { type: 'string', name: 'key'}
+ ],
listeners: {
'beforeload' : function(store, eOpts) {
var proxy;
proxy = store.getProxy();
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);
- }
}
},
diff --git a/web/app/view/CommandDialog.js b/web/app/view/CommandDialog.js
index e24105699..05412f39c 100644
--- a/web/app/view/CommandDialog.js
+++ b/web/app/view/CommandDialog.js
@@ -31,7 +31,7 @@ Ext.define('Traccar.view.CommandDialog', {
name: 'type',
fieldLabel: Strings.commandType,
store: 'SupportedCommands',
- displayField: 'name',
+ displayField: 'key',
valueField: 'key',
listeners: {
select: 'onSelect'
diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js
index 93109a2d6..ec6b8b3b9 100644
--- a/web/app/view/CommandDialogController.js
+++ b/web/app/view/CommandDialogController.js
@@ -18,6 +18,9 @@ Ext.define('Traccar.view.CommandDialogController', {
extend: 'Ext.app.ViewController',
alias: 'controller.commandDialog',
+ onShow: function () {
+ },
+
onSelect: function (selected) {
this.lookupReference('paramPositionPeriodic').setHidden(
selected.getValue() !== 'positionPeriodic');