aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/device/DeviceController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/device/DeviceController.js')
-rw-r--r--web/app/view/device/DeviceController.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/web/app/view/device/DeviceController.js b/web/app/view/device/DeviceController.js
index 82c17860f..6d88d8d3e 100644
--- a/web/app/view/device/DeviceController.js
+++ b/web/app/view/device/DeviceController.js
@@ -19,8 +19,15 @@ Ext.define('Traccar.view.device.DeviceController', {
alias: 'controller.device',
requires: [
- 'Traccar.view.device.DeviceDialog'
+ 'Traccar.view.device.DeviceDialog',
+ 'Traccar.view.admin.ServerDialog'
],
+
+ init: function() {
+ if (Traccar.getApplication().getUser().get('admin')) {
+ this.lookupReference('settingsServerButton').setDisabled(false);
+ }
+ },
onLogoutClick: function() {
Traccar.LoginManager.logout();
@@ -44,7 +51,7 @@ Ext.define('Traccar.view.device.DeviceController', {
var device = this.getView().getSelectionModel().getSelection()[0];
Ext.Msg.show({
title: strings.device_dialog,
- message: strings.device_remove,
+ message: strings.device_remove_confirm,
buttons: Ext.Msg.YESNO,
buttonText: {
yes: strings.dialog_delete,
@@ -64,6 +71,13 @@ Ext.define('Traccar.view.device.DeviceController', {
var disabled = selected.length > 0;
this.lookupReference('deviceEditButton').setDisabled(disabled);
this.lookupReference('deviceRemoveButton').setDisabled(disabled);
+ },
+
+ onServerClick: function() {
+ var server = Traccar.getApplication().getServer();
+ var dialog = Ext.create('Traccar.view.admin.ServerDialog');
+ dialog.down('form').loadRecord(server);
+ dialog.show();
}
});