From a864343c058e63a7bd4379bbe0fd7d143284fa49 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 15 Dec 2019 13:29:03 +0000 Subject: [PATCH] get rid of senders and results columns, use ellipsis for very long search strings --- webui/src/main/js/search.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/webui/src/main/js/search.js b/webui/src/main/js/search.js index 389da368..9522e659 100644 --- a/webui/src/main/js/search.js +++ b/webui/src/main/js/search.js @@ -10,14 +10,15 @@ class SearchStatus { getMapping() { var mapping = new Map() - var queryLink = new Link(this.query, "refresh" + refreshType, [this.uuid]) + var trimmedQuery = this.query + if (this.query.length > 16) + trimmedQuery = this.query.slice(0, 16) + "..." + + var queryLink = new Link(trimmedQuery, "refresh" + refreshType, [this.uuid]) var stopLink = new Link("X", "stopSearch", [this.uuid]) - var queryHtml = "
" + queryLink.render() + "

[" + stopLink.render() + "]

" + var queryHtml = "
" + queryLink.render() + " ("+this.results+")" + "

[" + stopLink.render() + "]

" mapping.set("Query", queryHtml) - mapping.set("Senders", this.senders) - mapping.set("Results", this.results) - return mapping } } @@ -776,7 +777,7 @@ function refreshStatus() { newOrder = "ascending" else newOrder = "descending" - var table = new Table(["Query", "Senders", "Results"], "sortStatuses", statusKey, newOrder, null) + var table = new Table(["Query"], "sortStatuses", statusKey, newOrder, null) for (i = 0; i < statuses.length; i++) { var status = statuses[i] table.addRow(status.getMapping())