aboutsummaryrefslogtreecommitdiff
path: root/modern/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-08-11 09:28:57 -0700
committerAnton Tananaev <anton@traccar.org>2022-08-11 09:28:57 -0700
commit88eeb5ca27cd50160ef5bce24539b612afea57d5 (patch)
tree68cea70b7555e07c2bdd680a0e01eb6aad9a482f /modern/src/main
parent026655404d0997a0cb637a6ef03349194e021d52 (diff)
downloadtrackermap-web-88eeb5ca27cd50160ef5bce24539b612afea57d5.tar.gz
trackermap-web-88eeb5ca27cd50160ef5bce24539b612afea57d5.tar.bz2
trackermap-web-88eeb5ca27cd50160ef5bce24539b612afea57d5.zip
Search by more device fields (fix #1011)
Diffstat (limited to 'modern/src/main')
-rw-r--r--modern/src/main/MainPage.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/main/MainPage.js b/modern/src/main/MainPage.js
index 91b6768e..283c61a6 100644
--- a/modern/src/main/MainPage.js
+++ b/modern/src/main/MainPage.js
@@ -195,7 +195,10 @@ const MainPage = () => {
const filtered = Object.values(devices)
.filter((device) => !filterStatuses.length || filterStatuses.includes(device.status))
.filter((device) => !filterGroups.length || filterGroups.includes(device.groupId))
- .filter((device) => `${device.name} ${device.uniqueId}`.toLowerCase().includes(filterKeyword.toLowerCase()));
+ .filter((device) => {
+ const keyword = filterKeyword.toLowerCase();
+ return [device.name, device.uniqueId, device.phone, device.model, device.contact].some((s) => s && s.toLowerCase().includes(keyword));
+ });
if (filterSort === 'lastUpdate') {
filtered.sort((device1, device2) => {
const time1 = device1.lastUpdate ? moment(device1.lastUpdate).valueOf() : 0;