aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Devices.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/Devices.js')
-rw-r--r--web/app/view/Devices.js94
1 files changed, 47 insertions, 47 deletions
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index 19739768..1789a119 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -153,52 +153,52 @@ Ext.define('Traccar.view.Devices', {
selectionchange: 'onSelectionChange'
},
- columns: [{
- text: Strings.sharedName,
- dataIndex: 'name',
- flex: 1
- }, {
- text: Strings.deviceIdentifier,
- dataIndex: 'uniqueId',
- hidden: true,
- flex: 1
- }, {
- text: Strings.devicePhone,
- dataIndex: 'phone',
- hidden: true,
- flex: 1
- }, {
- text: Strings.deviceModel,
- dataIndex: 'model',
- hidden: true,
- flex: 1
- }, {
- text: Strings.deviceContact,
- dataIndex: 'contact',
- hidden: true,
- flex: 1
- }, {
- text: Strings.deviceLastUpdate,
- dataIndex: 'lastUpdate',
- flex: 1,
- renderer: function (value, metaData, record) {
- switch (record.get('status')) {
- case 'online':
- metaData.tdCls = 'view-color-green';
- break;
- case 'offline':
- metaData.tdCls = 'view-color-red';
- break;
- default:
- metaData.tdCls = 'view-color-yellow';
- break;
- }
- if (Traccar.app.getPreference('twelveHourFormat', false)) {
- return Ext.Date.format(value, Traccar.Style.dateTimeFormat12);
- } else {
- return Ext.Date.format(value, Traccar.Style.dateTimeFormat24);
- }
- }
- }]
+ forceFit: true,
+ columns: {
+ defaults: {
+ minWidth: Traccar.Style.columnWidthNormal
+ },
+ items: [{
+ text: Strings.sharedName,
+ dataIndex: 'name'
+ }, {
+ text: Strings.deviceIdentifier,
+ dataIndex: 'uniqueId',
+ hidden: true
+ }, {
+ text: Strings.devicePhone,
+ dataIndex: 'phone',
+ hidden: true
+ }, {
+ text: Strings.deviceModel,
+ dataIndex: 'model',
+ hidden: true
+ }, {
+ text: Strings.deviceContact,
+ dataIndex: 'contact',
+ hidden: true
+ }, {
+ text: Strings.deviceLastUpdate,
+ dataIndex: 'lastUpdate',
+ renderer: function (value, metaData, record) {
+ switch (record.get('status')) {
+ case 'online':
+ metaData.tdCls = 'view-color-green';
+ break;
+ case 'offline':
+ metaData.tdCls = 'view-color-red';
+ break;
+ default:
+ metaData.tdCls = 'view-color-yellow';
+ break;
+ }
+ if (Traccar.app.getPreference('twelveHourFormat', false)) {
+ return Ext.Date.format(value, Traccar.Style.dateTimeFormat12);
+ } else {
+ return Ext.Date.format(value, Traccar.Style.dateTimeFormat24);
+ }
+ }
+ }]
+ }
});