aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/dialog/BaseEditController.js2
-rw-r--r--web/app/view/dialog/SendCommand.js2
-rw-r--r--web/app/view/dialog/SendCommandController.js9
-rw-r--r--web/app/view/edit/DevicesController.js1
-rw-r--r--web/app/view/edit/SavedCommands.js7
-rw-r--r--web/app/view/permissions/SavedCommands.js7
6 files changed, 16 insertions, 12 deletions
diff --git a/web/app/view/dialog/BaseEditController.js b/web/app/view/dialog/BaseEditController.js
index f58b6cb..91379e2 100644
--- a/web/app/view/dialog/BaseEditController.js
+++ b/web/app/view/dialog/BaseEditController.js
@@ -43,7 +43,7 @@ Ext.define('Traccar.view.dialog.BaseEditController', {
} else {
record.save();
}
- button.up('window').close();
+ this.closeView();
},
showAttributesView: function (button) {
diff --git a/web/app/view/dialog/SendCommand.js b/web/app/view/dialog/SendCommand.js
index 0bb7d61..f4224be 100644
--- a/web/app/view/dialog/SendCommand.js
+++ b/web/app/view/dialog/SendCommand.js
@@ -29,7 +29,7 @@ Ext.define('Traccar.view.dialog.SendCommand', {
items: [{
xtype: 'combobox',
reference: 'commandsComboBox',
- fieldLabel: Strings.sharedSavedCommand,
+ fieldLabel: Strings.deviceCommand,
displayField: 'description',
valueField: 'id',
store: 'DeviceCommands',
diff --git a/web/app/view/dialog/SendCommandController.js b/web/app/view/dialog/SendCommandController.js
index 3bd2ad4..0e9442a 100644
--- a/web/app/view/dialog/SendCommandController.js
+++ b/web/app/view/dialog/SendCommandController.js
@@ -36,9 +36,7 @@ Ext.define('Traccar.view.dialog.SendCommandController', {
Ext.Ajax.request({
scope: this,
url: 'api/commands/send',
- jsonData: record.getData({
- persist: true
- }),
+ jsonData: record.getData(),
callback: this.onSendResult
});
},
@@ -89,5 +87,10 @@ Ext.define('Traccar.view.dialog.SendCommandController', {
} else {
Traccar.app.showError(response);
}
+ },
+
+ closeView: function () {
+ this.lookupReference('commandsComboBox').getStore().removeAll();
+ this.callParent(arguments);
}
});
diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js
index 43bab22..915f724 100644
--- a/web/app/view/edit/DevicesController.js
+++ b/web/app/view/edit/DevicesController.js
@@ -126,7 +126,6 @@ Ext.define('Traccar.view.edit.DevicesController', {
commandsStore = dialog.lookupReference('commandsComboBox').getStore();
commandsStore.getProxy().setExtraParam('deviceId', deviceId);
- commandsStore.removeAll();
if (!Traccar.app.getPreference('limitCommands', false)) {
commandsStore.add({
id: 0,
diff --git a/web/app/view/edit/SavedCommands.js b/web/app/view/edit/SavedCommands.js
index 8f1f6b3..869fbf9 100644
--- a/web/app/view/edit/SavedCommands.js
+++ b/web/app/view/edit/SavedCommands.js
@@ -50,13 +50,14 @@ Ext.define('Traccar.view.edit.SavedCommands', {
filter: 'string'
}, {
text: Strings.sharedType,
- dataIndex: 'name',
+ dataIndex: 'type',
filter: {
type: 'list',
- idField: 'name',
+ idField: 'type',
labelField: 'name',
store: 'AllCommandTypes'
- }
+ },
+ renderer: Traccar.AttributeFormatter.getFormatter('commandType')
}, {
text: Strings.notificationSms,
dataIndex: 'textChannel',
diff --git a/web/app/view/permissions/SavedCommands.js b/web/app/view/permissions/SavedCommands.js
index 1c7ab77..106fad5 100644
--- a/web/app/view/permissions/SavedCommands.js
+++ b/web/app/view/permissions/SavedCommands.js
@@ -35,15 +35,16 @@ Ext.define('Traccar.view.permissions.SavedCommands', {
filter: 'string'
}, {
text: Strings.sharedType,
- dataIndex: 'name',
+ dataIndex: 'type',
flex: 1,
minWidth: Traccar.Style.columnWidthNormal,
filter: {
type: 'list',
- idField: 'name',
+ idField: 'type',
labelField: 'name',
store: 'AllCommandTypes'
- }
+ },
+ renderer: Traccar.AttributeFormatter.getFormatter('commandType')
}, {
text: Strings.notificationSms,
dataIndex: 'textChannel',