diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-26 17:34:47 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-26 17:34:47 +1200 |
commit | 71dad7d3240bb178701e5dd1e86ae31a6eaa8263 (patch) | |
tree | 38de4eb7b2f74329fa9b2cc8dc2e05e54ed2faad | |
parent | 8148beb00a82096b1d41f81bd5b3019fa75de2e9 (diff) | |
download | traccar-server-71dad7d3240bb178701e5dd1e86ae31a6eaa8263.tar.gz traccar-server-71dad7d3240bb178701e5dd1e86ae31a6eaa8263.tar.bz2 traccar-server-71dad7d3240bb178701e5dd1e86ae31a6eaa8263.zip |
Implement logout button
-rw-r--r-- | web/DeviceView.js | 40 | ||||
-rw-r--r-- | web/Styles.js | 3 |
2 files changed, 22 insertions, 21 deletions
diff --git a/web/DeviceView.js b/web/DeviceView.js index 09174467c..0e1312e5d 100644 --- a/web/DeviceView.js +++ b/web/DeviceView.js @@ -20,25 +20,27 @@ Ext.define('DeviceView', { title: Strings.device_title, - - initComponent: function() { - - this.tbar = [{ - text:'Add' - }, { - text:'Edit' - }, { - text:'Remove' - }, { - xtype: 'tbfill' - }, { - text:'Settings' - }, { - text:'Logout' - }]; - - this.callParent(); - }, + tbar: [{ + text:'Add' + }, { + text:'Edit' + }, { + text:'Remove' + }, { + xtype: 'tbfill' + }, { + text:'Settings' + }, { + text:'Logout', + handler: function() { + Ext.Ajax.request({ + url: '/api/logout', + success: function() { + window.location.reload(); + } + }); + } + }], store: { proxy: { diff --git a/web/Styles.js b/web/Styles.js index a77a0b0bf..5cf05adf1 100644 --- a/web/Styles.js +++ b/web/Styles.js @@ -19,10 +19,9 @@ Ext.define('Styles', { panel_padding: 10, - device_width: 400, + device_width: 350, map_center: [ -0.1275, 51.507222 ], map_zoom: 6, map_max_zoom: 16 - }); |