diff options
author | Abyss777 <abyss@fox5.ru> | 2017-06-19 11:34:01 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-06-19 16:09:43 +0500 |
commit | b2b9e4cb213023697566885340d2ff7b5a44db8b (patch) | |
tree | acd73e2c5ccd3eda062b0228873d2239e2d988fd | |
parent | f3ce72afbd49ccde94178158147de7b378128a55 (diff) | |
download | trackermap-web-b2b9e4cb213023697566885340d2ff7b5a44db8b.tar.gz trackermap-web-b2b9e4cb213023697566885340d2ff7b5a44db8b.tar.bz2 trackermap-web-b2b9e4cb213023697566885340d2ff7b5a44db8b.zip |
- Added columns filters to most windows
- Added more columns to UserDevices and UserGroups
- Change openlayers version to 4.2.0
-rw-r--r-- | web/app/AttributeFormatter.js | 14 | ||||
-rw-r--r-- | web/app/view/edit/Attributes.js | 4 | ||||
-rw-r--r-- | web/app/view/edit/Calendars.js | 6 | ||||
-rw-r--r-- | web/app/view/edit/ComputedAttributes.js | 16 | ||||
-rw-r--r-- | web/app/view/edit/Devices.js | 8 | ||||
-rw-r--r-- | web/app/view/edit/Geofences.js | 9 | ||||
-rw-r--r-- | web/app/view/edit/Groups.js | 17 | ||||
-rw-r--r-- | web/app/view/edit/Users.js | 18 | ||||
-rw-r--r-- | web/app/view/edit/UsersController.js | 1 | ||||
-rw-r--r-- | web/app/view/permissions/DeviceAttributes.js | 14 | ||||
-rw-r--r-- | web/app/view/permissions/DeviceGeofences.js | 9 | ||||
-rw-r--r-- | web/app/view/permissions/GroupAttributes.js | 12 | ||||
-rw-r--r-- | web/app/view/permissions/GroupGeofences.js | 9 | ||||
-rw-r--r-- | web/app/view/permissions/UserAttributes.js | 14 | ||||
-rw-r--r-- | web/app/view/permissions/UserCalendars.js | 9 | ||||
-rw-r--r-- | web/app/view/permissions/UserDevices.js | 46 | ||||
-rw-r--r-- | web/app/view/permissions/UserGeofences.js | 9 | ||||
-rw-r--r-- | web/app/view/permissions/UserGroups.js | 22 | ||||
-rw-r--r-- | web/app/view/permissions/UserUsers.js | 3 | ||||
-rw-r--r-- | web/load.js | 2 |
20 files changed, 212 insertions, 30 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index aecbd8a2..f8bce1b1 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -62,6 +62,18 @@ Ext.define('Traccar.AttributeFormatter', { return Ext.getStore('Devices').getById(value).get('name'); }, + groupIdFormatter: function (value) { + var group; + if (value !== 0) { + if (Ext.getStore('AllGroups').getTotalCount() === 0) { + group = Ext.getStore('Groups').getById(value); + } else { + group = Ext.getStore('AllGroups').getById(value); + } + return group ? group.get('name') : value; + } + }, + lastUpdateFormatter: function (value) { var seconds, interval; @@ -113,6 +125,8 @@ Ext.define('Traccar.AttributeFormatter', { return this.durationFormatter; } else if (key === 'deviceId') { return this.deviceIdFormatter; + } else if (key === 'groupId') { + return this.groupIdFormatter; } else if (key === 'lastUpdate') { return this.lastUpdateFormatter; } else { diff --git a/web/app/view/edit/Attributes.js b/web/app/view/edit/Attributes.js index 66d8bb12..84cadea5 100644 --- a/web/app/view/edit/Attributes.js +++ b/web/app/view/edit/Attributes.js @@ -20,10 +20,13 @@ Ext.define('Traccar.view.edit.Attributes', { xtype: 'attributesView', requires: [ + 'Ext.grid.filters.Filters', 'Traccar.view.edit.AttributesController', 'Traccar.view.edit.Toolbar' ], + plugins: 'gridfilters', + controller: 'attributes', tbar: { @@ -42,6 +45,7 @@ Ext.define('Traccar.view.edit.Attributes', { items: [{ text: Strings.sharedName, dataIndex: 'name', + filter: 'string', renderer: function (value, metaData) { var attribute; if (this.attributesStore) { diff --git a/web/app/view/edit/Calendars.js b/web/app/view/edit/Calendars.js index 92ffa06d..1c4a2ece 100644 --- a/web/app/view/edit/Calendars.js +++ b/web/app/view/edit/Calendars.js @@ -21,10 +21,13 @@ Ext.define('Traccar.view.edit.Calendars', { xtype: 'calendarsView', requires: [ + 'Ext.grid.filters.Filters', 'Traccar.view.edit.CalendarsController', 'Traccar.view.edit.Toolbar' ], + plugins: 'gridfilters', + controller: 'calendars', store: 'Calendars', @@ -43,7 +46,8 @@ Ext.define('Traccar.view.edit.Calendars', { }, items: [{ text: Strings.sharedName, - dataIndex: 'name' + dataIndex: 'name', + filter: 'string' }] } }); diff --git a/web/app/view/edit/ComputedAttributes.js b/web/app/view/edit/ComputedAttributes.js index b4699e84..5d344988 100644 --- a/web/app/view/edit/ComputedAttributes.js +++ b/web/app/view/edit/ComputedAttributes.js @@ -21,10 +21,13 @@ Ext.define('Traccar.view.edit.ComputedAttributes', { xtype: 'computedAttributesView', requires: [ + 'Ext.grid.filters.Filters', 'Traccar.view.edit.ComputedAttributesController', 'Traccar.view.edit.Toolbar' ], + plugins: 'gridfilters', + controller: 'computedAttributes', store: 'ComputedAttributes', @@ -43,10 +46,16 @@ Ext.define('Traccar.view.edit.ComputedAttributes', { }, items: [{ text: Strings.sharedDescription, - dataIndex: 'description' + dataIndex: 'description', + filter: 'string' }, { text: Strings.sharedAttribute, dataIndex: 'attribute', + filter: { + type: 'list', + labelField: 'name', + store: 'PositionAttributes' + }, renderer: function (value) { return Ext.getStore('PositionAttributes').getAttributeName(value); } @@ -56,6 +65,11 @@ Ext.define('Traccar.view.edit.ComputedAttributes', { }, { text: Strings.sharedType, dataIndex: 'type', + filter: { + type: 'list', + labelField: 'name', + store: 'AttributeValueTypes' + }, renderer: function (value) { var type = Ext.getStore('AttributeValueTypes').getById(value); if (type) { diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index 196df733..267a38be 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -139,13 +139,7 @@ Ext.define('Traccar.view.edit.Devices', { labelField: 'name', store: 'Groups' }, - renderer: function (value) { - var group; - if (value !== 0) { - group = Ext.getStore('Groups').getById(value); - return group ? group.get('name') : value; - } - } + renderer: Traccar.AttributeFormatter.getFormatter('groupId') }, { text: Strings.deviceStatus, dataIndex: 'status', diff --git a/web/app/view/edit/Geofences.js b/web/app/view/edit/Geofences.js index 8ca9c31c..51fa7686 100644 --- a/web/app/view/edit/Geofences.js +++ b/web/app/view/edit/Geofences.js @@ -20,10 +20,13 @@ Ext.define('Traccar.view.edit.Geofences', { xtype: 'geofencesView', requires: [ + 'Ext.grid.filters.Filters', 'Traccar.view.edit.GeofencesController', 'Traccar.view.edit.Toolbar' ], + plugins: 'gridfilters', + controller: 'geofences', store: 'Geofences', @@ -42,10 +45,12 @@ Ext.define('Traccar.view.edit.Geofences', { }, items: [{ text: Strings.sharedName, - dataIndex: 'name' + dataIndex: 'name', + filter: 'string' }, { text: Strings.sharedDescription, - dataIndex: 'description' + dataIndex: 'description', + filter: 'string' }] } }); diff --git a/web/app/view/edit/Groups.js b/web/app/view/edit/Groups.js index 88bbd7ba..d4d08305 100644 --- a/web/app/view/edit/Groups.js +++ b/web/app/view/edit/Groups.js @@ -20,10 +20,14 @@ Ext.define('Traccar.view.edit.Groups', { xtype: 'groupsView', requires: [ + 'Ext.grid.filters.Filters', + 'Traccar.AttributeFormatter', 'Traccar.view.edit.GroupsController', 'Traccar.view.edit.Toolbar' ], + plugins: 'gridfilters', + controller: 'groups', store: 'Groups', @@ -59,7 +63,18 @@ Ext.define('Traccar.view.edit.Groups', { }, items: [{ text: Strings.sharedName, - dataIndex: 'name' + dataIndex: 'name', + filter: 'string' + }, { + text: Strings.groupDialog, + dataIndex: 'groupId', + hidden: true, + filter: { + type: 'list', + labelField: 'name', + store: 'AllGroups' + }, + renderer: Traccar.AttributeFormatter.getFormatter('groupId') }] } }); diff --git a/web/app/view/edit/Users.js b/web/app/view/edit/Users.js index 4356b166..0aafb3dd 100644 --- a/web/app/view/edit/Users.js +++ b/web/app/view/edit/Users.js @@ -96,30 +96,36 @@ Ext.define('Traccar.view.edit.Users', { }, items: [{ text: Strings.sharedName, - dataIndex: 'name' + dataIndex: 'name', + filter: 'string' }, { text: Strings.userEmail, dataIndex: 'email', filter: 'string' }, { text: Strings.userAdmin, - dataIndex: 'admin' + dataIndex: 'admin', + filter: 'boolean' }, { text: Strings.serverReadonly, dataIndex: 'readonly', - hidden: true + hidden: true, + filter: 'boolean' }, { text: Strings.userDeviceReadonly, dataIndex: 'deviceReadonly', - hidden: true + hidden: true, + filter: 'boolean' }, { text: Strings.userDisabled, - dataIndex: 'disabled' + dataIndex: 'disabled', + filter: 'boolean' }, { text: Strings.userExpirationTime, dataIndex: 'expirationTime', hidden: true, - renderer: Traccar.AttributeFormatter.getFormatter('expirationTime') + renderer: Traccar.AttributeFormatter.getFormatter('expirationTime'), + filter: 'date' }] } }); diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index fe69d40c..c0644035 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -67,6 +67,7 @@ Ext.define('Traccar.view.edit.UsersController', { onDevicesClick: function () { var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.getStore('AllGroups').load(); Ext.create('Traccar.view.BaseWindow', { title: Strings.deviceTitle, items: { diff --git a/web/app/view/permissions/DeviceAttributes.js b/web/app/view/permissions/DeviceAttributes.js index 2ce07633..c7755f09 100644 --- a/web/app/view/permissions/DeviceAttributes.js +++ b/web/app/view/permissions/DeviceAttributes.js @@ -20,17 +20,29 @@ Ext.define('Traccar.view.permissions.DeviceAttributes', { extend: 'Traccar.view.permissions.Base', xtype: 'deviceAttributesView', + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedDescription, dataIndex: 'description', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }, { text: Strings.sharedAttribute, dataIndex: 'attribute', flex: 1, minWidth: Traccar.Style.columnWidthNormal, + filter: { + type: 'list', + labelField: 'name', + store: 'PositionAttributes' + }, renderer: function (value) { return Ext.getStore('PositionAttributes').getAttributeName(value); } diff --git a/web/app/view/permissions/DeviceGeofences.js b/web/app/view/permissions/DeviceGeofences.js index 7905b49e..c16bceda 100644 --- a/web/app/view/permissions/DeviceGeofences.js +++ b/web/app/view/permissions/DeviceGeofences.js @@ -19,12 +19,19 @@ Ext.define('Traccar.view.permissions.DeviceGeofences', { extend: 'Traccar.view.permissions.Base', xtype: 'deviceGeofencesView', + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }] } }); diff --git a/web/app/view/permissions/GroupAttributes.js b/web/app/view/permissions/GroupAttributes.js index 44089daf..4db8b244 100644 --- a/web/app/view/permissions/GroupAttributes.js +++ b/web/app/view/permissions/GroupAttributes.js @@ -20,17 +20,27 @@ Ext.define('Traccar.view.permissions.GroupAttributes', { extend: 'Traccar.view.permissions.Base', xtype: 'groupAttributesView', + requires: [ + 'Ext.grid.filters.Filters' + ], + columns: { items: [{ text: Strings.sharedDescription, dataIndex: 'description', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }, { text: Strings.sharedAttribute, dataIndex: 'attribute', flex: 1, minWidth: Traccar.Style.columnWidthNormal, + filter: { + type: 'list', + labelField: 'name', + store: 'PositionAttributes' + }, renderer: function (value) { return Ext.getStore('PositionAttributes').getAttributeName(value); } diff --git a/web/app/view/permissions/GroupGeofences.js b/web/app/view/permissions/GroupGeofences.js index 84cec3ca..f365e356 100644 --- a/web/app/view/permissions/GroupGeofences.js +++ b/web/app/view/permissions/GroupGeofences.js @@ -19,12 +19,19 @@ Ext.define('Traccar.view.permissions.GroupGeofences', { extend: 'Traccar.view.permissions.Base', xtype: 'groupGeofencesView', + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }] } }); diff --git a/web/app/view/permissions/UserAttributes.js b/web/app/view/permissions/UserAttributes.js index 7bca6223..a0a385ee 100644 --- a/web/app/view/permissions/UserAttributes.js +++ b/web/app/view/permissions/UserAttributes.js @@ -20,17 +20,29 @@ Ext.define('Traccar.view.permissions.UserAttributes', { extend: 'Traccar.view.permissions.Base', xtype: 'userAttributesView', + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedDescription, dataIndex: 'description', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }, { text: Strings.sharedAttribute, dataIndex: 'attribute', flex: 1, minWidth: Traccar.Style.columnWidthNormal, + filter: { + type: 'list', + labelField: 'name', + store: 'PositionAttributes' + }, renderer: function (value) { return Ext.getStore('PositionAttributes').getAttributeName(value); } diff --git a/web/app/view/permissions/UserCalendars.js b/web/app/view/permissions/UserCalendars.js index f45f7772..54ecfc22 100644 --- a/web/app/view/permissions/UserCalendars.js +++ b/web/app/view/permissions/UserCalendars.js @@ -20,12 +20,19 @@ Ext.define('Traccar.view.permissions.UserCalendars', { extend: 'Traccar.view.permissions.Base', xtype: 'userCalendarsView', + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }] } }); diff --git a/web/app/view/permissions/UserDevices.js b/web/app/view/permissions/UserDevices.js index dd6f43d2..a9bb65b7 100644 --- a/web/app/view/permissions/UserDevices.js +++ b/web/app/view/permissions/UserDevices.js @@ -19,17 +19,59 @@ Ext.define('Traccar.view.permissions.UserDevices', { extend: 'Traccar.view.permissions.Base', xtype: 'userDevicesView', + requires: [ + 'Ext.grid.filters.Filters', + 'Traccar.AttributeFormatter' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }, { text: Strings.deviceIdentifier, dataIndex: 'uniqueId', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.sharedPhone, + dataIndex: 'phone', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: 'string' + }, { + text: Strings.deviceModel, + dataIndex: 'model', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: 'string' + }, { + text: Strings.deviceContact, + dataIndex: 'contact', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: 'string' + }, { + text: Strings.groupDialog, + dataIndex: 'groupId', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: { + type: 'list', + labelField: 'name', + store: 'AllGroups' + }, + renderer: Traccar.AttributeFormatter.getFormatter('groupId') }] } }); diff --git a/web/app/view/permissions/UserGeofences.js b/web/app/view/permissions/UserGeofences.js index 49b94ff9..436a2a6a 100644 --- a/web/app/view/permissions/UserGeofences.js +++ b/web/app/view/permissions/UserGeofences.js @@ -19,12 +19,19 @@ Ext.define('Traccar.view.permissions.UserGeofences', { extend: 'Traccar.view.permissions.Base', xtype: 'userGeofencesView', + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }] } }); diff --git a/web/app/view/permissions/UserGroups.js b/web/app/view/permissions/UserGroups.js index 0c23713b..bc24201c 100644 --- a/web/app/view/permissions/UserGroups.js +++ b/web/app/view/permissions/UserGroups.js @@ -19,12 +19,32 @@ Ext.define('Traccar.view.permissions.UserGroups', { extend: 'Traccar.view.permissions.Base', xtype: 'userGroupsView', + requires: [ + 'Ext.grid.filters.Filters', + 'Traccar.AttributeFormatter' + ], + + plugins: 'gridfilters', + columns: { items: [{ text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' + }, { + text: Strings.groupDialog, + dataIndex: 'groupId', + flex: 1, + minWidth: Traccar.Style.columnWidthNormal, + hidden: true, + filter: { + type: 'list', + labelField: 'name', + store: 'AllGroups' + }, + renderer: Traccar.AttributeFormatter.getFormatter('groupId') }] } }); diff --git a/web/app/view/permissions/UserUsers.js b/web/app/view/permissions/UserUsers.js index abef700a..c5980c2f 100644 --- a/web/app/view/permissions/UserUsers.js +++ b/web/app/view/permissions/UserUsers.js @@ -25,7 +25,8 @@ Ext.define('Traccar.view.permissions.UserUsers', { text: Strings.sharedName, dataIndex: 'name', flex: 1, - minWidth: Traccar.Style.columnWidthNormal + minWidth: Traccar.Style.columnWidthNormal, + filter: 'string' }] } }); diff --git a/web/load.js b/web/load.js index f6da4e62..82a01d8b 100644 --- a/web/load.js +++ b/web/load.js @@ -122,7 +122,7 @@ extjsVersion = '6.2.0'; fontAwesomeVersion = '4.7.0'; - olVersion = '4.0.1'; + olVersion = '4.2.0'; proj4jsVersion = '2.4.3'; if (debugMode) { |