From c593ded864fa23b44d0f2517166151607c44d7ed Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 30 Aug 2022 23:58:58 +0200 Subject: [PATCH] Grey out inactive search results --- backend/src/api/explorer/channels.api.ts | 2 +- backend/src/api/explorer/nodes.api.ts | 2 +- .../search-form/search-results/search-results.component.html | 4 ++-- .../search-form/search-results/search-results.component.scss | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/src/api/explorer/channels.api.ts b/backend/src/api/explorer/channels.api.ts index b5eac7499..147767d95 100644 --- a/backend/src/api/explorer/channels.api.ts +++ b/backend/src/api/explorer/channels.api.ts @@ -80,7 +80,7 @@ class ChannelsApi { public async $searchChannelsById(search: string): Promise { try { const searchStripped = search.replace('%', '') + '%'; - const query = `SELECT id, short_id, capacity FROM channels WHERE id LIKE ? OR short_id LIKE ? LIMIT 10`; + const query = `SELECT id, short_id, capacity, status FROM channels WHERE id LIKE ? OR short_id LIKE ? LIMIT 10`; const [rows]: any = await DB.query(query, [searchStripped, searchStripped]); return rows; } catch (e) { diff --git a/backend/src/api/explorer/nodes.api.ts b/backend/src/api/explorer/nodes.api.ts index fcd5b8815..128405ffd 100644 --- a/backend/src/api/explorer/nodes.api.ts +++ b/backend/src/api/explorer/nodes.api.ts @@ -249,7 +249,7 @@ class NodesApi { try { const publicKeySearch = search.replace('%', '') + '%'; const aliasSearch = search.replace(/[-_.]/g, ' ').replace(/[^a-zA-Z0-9 ]/g, '').split(' ').map((search) => '+' + search + '*').join(' '); - const query = `SELECT public_key, alias, capacity, channels FROM nodes WHERE public_key LIKE ? OR MATCH alias_search AGAINST (? IN BOOLEAN MODE) ORDER BY capacity DESC LIMIT 10`; + const query = `SELECT public_key, alias, capacity, channels, status FROM nodes WHERE public_key LIKE ? OR MATCH alias_search AGAINST (? IN BOOLEAN MODE) ORDER BY capacity DESC LIMIT 10`; const [rows]: any = await DB.query(query, [publicKeySearch, aliasSearch]); return rows; } catch (e) { diff --git a/frontend/src/app/components/search-form/search-results/search-results.component.html b/frontend/src/app/components/search-form/search-results/search-results.component.html index f7193f261..cc289ddac 100644 --- a/frontend/src/app/components/search-form/search-results/search-results.component.html +++ b/frontend/src/app/components/search-form/search-results/search-results.component.html @@ -10,7 +10,7 @@
Lightning Nodes
- @@ -18,7 +18,7 @@
Lightning Channels
- diff --git a/frontend/src/app/components/search-form/search-results/search-results.component.scss b/frontend/src/app/components/search-form/search-results/search-results.component.scss index 094865bb6..7cf9fe3c2 100644 --- a/frontend/src/app/components/search-form/search-results/search-results.component.scss +++ b/frontend/src/app/components/search-form/search-results/search-results.component.scss @@ -14,3 +14,7 @@ box-shadow: 0.125rem 0.125rem 0.25rem rgba(0,0,0,0.075); width: 100%; } + +.inactive { + opacity: 0.2; +}