diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-05 18:47:24 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-05 18:47:24 +1200 |
commit | c2afe93f1443181bc7bcce2df708a88c331b8800 (patch) | |
tree | 808dc50805ee76a882d299142ee0201bafc5a90c /web/app/view/device | |
parent | 35ae7fbd26180fa56072095ef47d6c54a4e22393 (diff) | |
download | trackermap-server-c2afe93f1443181bc7bcce2df708a88c331b8800.tar.gz trackermap-server-c2afe93f1443181bc7bcce2df708a88c331b8800.tar.bz2 trackermap-server-c2afe93f1443181bc7bcce2df708a88c331b8800.zip |
Implement server settings
Diffstat (limited to 'web/app/view/device')
-rw-r--r-- | web/app/view/device/Device.js | 18 | ||||
-rw-r--r-- | web/app/view/device/DeviceController.js | 18 |
2 files changed, 28 insertions, 8 deletions
diff --git a/web/app/view/device/Device.js b/web/app/view/device/Device.js index 64f53eeb2..bccb43e9e 100644 --- a/web/app/view/device/Device.js +++ b/web/app/view/device/Device.js @@ -15,7 +15,7 @@ */ Ext.define('Traccar.view.device.Device', { - extend: 'Ext.grid.Panel', + extend: 'Ext.grid.Panel', xtype: 'device-view', requires: [ @@ -29,25 +29,31 @@ Ext.define('Traccar.view.device.Device', { selType: 'rowmodel', tbar: [{ - text:'Add', + text: strings.device_add, handler: 'onAddClick', reference: 'deviceAddButton' }, { - text:'Edit', + text: strings.device_edit, disabled: true, handler: 'onEditClick', reference: 'deviceEditButton' }, { - text:'Remove', + text: strings.device_remove, disabled: true, handler: 'onRemoveClick', reference: 'deviceRemoveButton' }, { xtype: 'tbfill' }, { - text:'Settings' + text: strings.device_settings, + menu: [{ + text: strings.device_settings_server, + disabled: true, + handler: 'onServerClick', + reference: 'settingsServerButton' + }] }, { - text:'Logout', + text: strings.device_logout, handler: 'onLogoutClick' }], 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(); } }); |