aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Devices.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-10 13:42:47 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-10 13:42:47 +1200
commitf5a96bb1547dcfbddf26c05143874195b4a50d0f (patch)
treef7a6ada494a957e61cff83c82b81fa0dc6921285 /web/app/view/Devices.js
parente107563e0b4045c15321ad540983d614531bf6af (diff)
downloadtrackermap-server-f5a96bb1547dcfbddf26c05143874195b4a50d0f.tar.gz
trackermap-server-f5a96bb1547dcfbddf26c05143874195b4a50d0f.tar.bz2
trackermap-server-f5a96bb1547dcfbddf26c05143874195b4a50d0f.zip
Revert device panel back to grid
Diffstat (limited to 'web/app/view/Devices.js')
-rw-r--r--web/app/view/Devices.js40
1 files changed, 18 insertions, 22 deletions
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index 70e11aab5..eeaaf901b 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -15,7 +15,7 @@
*/
Ext.define('Traccar.view.Devices', {
- extend: 'Ext.tree.Panel',
+ extend: 'Ext.grid.Panel',
xtype: 'devicesView',
requires: [
@@ -26,7 +26,7 @@ Ext.define('Traccar.view.Devices', {
controller: 'devices',
rootVisible: false,
- store: 'DevicesTree',
+ store: 'Devices',
title: Strings.deviceTitle,
selType: 'rowmodel',
@@ -80,12 +80,10 @@ Ext.define('Traccar.view.Devices', {
}],*/
listeners: {
- selectionchange: 'onSelectionChange',
- beforeselect: 'onBeforeSelect'
+ selectionchange: 'onSelectionChange'
},
columns: [{
- xtype: 'treecolumn',
text: Strings.sharedName,
dataIndex: 'name',
flex: 1
@@ -94,23 +92,21 @@ Ext.define('Traccar.view.Devices', {
dataIndex: 'lastUpdate',
flex: 1,
renderer: function (value, metaData, record) {
- if (record.get('original') instanceof Traccar.model.Device) {
- switch (record.get('status')) {
- case 'online':
- metaData.tdCls = 'status-color-online';
- break;
- case 'offline':
- metaData.tdCls = 'status-color-offline';
- break;
- default:
- metaData.tdCls = 'status-color-unknown';
- break;
- }
- if (Traccar.app.getPreference('twelveHourFormat', false)) {
- return Ext.Date.format(value, Traccar.Style.dateTimeFormat12);
- } else {
- return Ext.Date.format(value, Traccar.Style.dateTimeFormat24);
- }
+ switch (record.get('status')) {
+ case 'online':
+ metaData.tdCls = 'status-color-online';
+ break;
+ case 'offline':
+ metaData.tdCls = 'status-color-offline';
+ break;
+ default:
+ metaData.tdCls = 'status-color-unknown';
+ break;
+ }
+ if (Traccar.app.getPreference('twelveHourFormat', false)) {
+ return Ext.Date.format(value, Traccar.Style.dateTimeFormat12);
+ } else {
+ return Ext.Date.format(value, Traccar.Style.dateTimeFormat24);
}
}
}]