From 4bd199d7f874a7809d95eff90efca42071867780 Mon Sep 17 00:00:00 2001 From: Quake4 Date: Sat, 9 Nov 2024 19:26:05 +0300 Subject: [PATCH 1/4] add exec time of empty queries --- static/js/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/app.js b/static/js/app.js index 50e3fb51..d9f18173 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -430,7 +430,10 @@ function buildTable(results, sortColumn, sortOrder, options) { if (results.rows.length == 0) { $("#results_header").html(""); $("#results_body").html("No records found"); - $("#result-rows-count").html(""); + if (results.stats) + $("#result-rows-count").html(results.stats.query_duration_ms + " ms"); + else + $("#result-rows-count").html(""); $("#results").addClass("empty"); return; } From bb48cab87198d07762817e375b08629d3b06209f Mon Sep 17 00:00:00 2001 From: Quake4 Date: Mon, 11 Nov 2024 17:57:02 +0300 Subject: [PATCH 2/4] add { } --- static/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index d9f18173..de099188 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -430,10 +430,12 @@ function buildTable(results, sortColumn, sortOrder, options) { if (results.rows.length == 0) { $("#results_header").html(""); $("#results_body").html("No records found"); - if (results.stats) + if (results.stats) { $("#result-rows-count").html(results.stats.query_duration_ms + " ms"); - else + } + else { $("#result-rows-count").html(""); + } $("#results").addClass("empty"); return; } From 4e05bf2376b1fef1a3208c0eabfd08ee37c66b24 Mon Sep 17 00:00:00 2001 From: Quake4 Date: Mon, 11 Nov 2024 22:48:39 +0300 Subject: [PATCH 3/4] fix space --- static/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/app.js b/static/js/app.js index de099188..58e3a030 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -445,7 +445,7 @@ function buildTable(results, sortColumn, sortOrder, options) { results.columns.forEach(function(col) { if (col === sortColumn) { - cols += "" + col + " " + sortArrow(sortOrder) + ""; + cols += "" + col + " " + sortArrow(sortOrder) + ""; } else { cols += "" + col + ""; From fb3b57d9ea3ee34404b5a8ebf9637a42ff4e59e9 Mon Sep 17 00:00:00 2001 From: Quake4 Date: Mon, 11 Nov 2024 22:50:50 +0300 Subject: [PATCH 4/4] use proposed format --- static/js/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 58e3a030..e71dd533 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -432,8 +432,7 @@ function buildTable(results, sortColumn, sortOrder, options) { $("#results_body").html("No records found"); if (results.stats) { $("#result-rows-count").html(results.stats.query_duration_ms + " ms"); - } - else { + } else { $("#result-rows-count").html(""); } $("#results").addClass("empty"); @@ -446,8 +445,7 @@ function buildTable(results, sortColumn, sortOrder, options) { results.columns.forEach(function(col) { if (col === sortColumn) { cols += "" + col + " " + sortArrow(sortOrder) + ""; - } - else { + } else { cols += "" + col + ""; } });