From 62ee5e55ab010b55e6cc209eb1fbc58d2807a133 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Tue, 29 Jun 2021 16:57:48 +0200 Subject: [PATCH 1/2] Sort list of queries in web UI for display * Fix display of running and slow queries in web UI when there are multiple coordinators. Previously, the display order of queries was undefined, which could lead to queries from one coordinator being display on top once and then the queries from another. That made using this UI harder than necessary. --- CHANGELOG | 7 ++++++ .../frontend/js/views/queryManagementView.js | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 61570331007b..7dca52af457e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,13 @@ devel ----- +* Fix display of running and slow queries in web UI when there are multiple + coordinators. Previously, the display order of queries was undefined, which + could lead to queries from one coordinator being display on top once and + then the queries from another. That made using this UI harder than necessary. + + Now queries are sorted for display, according to their query IDs. + * Updated arangosync to 2.4.0. * Fixed DEVSUP-799: unique vertex getter may point to invalid memory after being diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js index ca204d96499f..63767370ddfd 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js @@ -233,6 +233,28 @@ '', '' ]); + } else { + // sort by query id, descending + rowsArray = rowsArray.sort(function(l, r) { + // normalize both inputs to strings (in case they are numbers) + l = l[0]; + if (typeof l !== "string") { + l = String(l); + } + r = r[0]; + if (typeof r !== "string") { + r = String(r); + } + + // pad strings to the same length, by prepending '0' chars + l = Array(20 - l.length).join("0") + l; + r = Array(20 - r.length).join("0") + r; + + if (l === r) { + return 0; + } + return l < r ? 1 : -1; + }); } self.tableDescription.rows = rowsArray; From d7c7a2bce299600b97d3b89fa2ea78870050ea27 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 30 Jun 2021 10:48:04 +0200 Subject: [PATCH 2/2] Update js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js Co-authored-by: Simran --- .../APP/frontend/js/views/queryManagementView.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js index 63767370ddfd..5a6c8e7d5498 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js @@ -237,18 +237,8 @@ // sort by query id, descending rowsArray = rowsArray.sort(function(l, r) { // normalize both inputs to strings (in case they are numbers) - l = l[0]; - if (typeof l !== "string") { - l = String(l); - } - r = r[0]; - if (typeof r !== "string") { - r = String(r); - } - - // pad strings to the same length, by prepending '0' chars - l = Array(20 - l.length).join("0") + l; - r = Array(20 - r.length).join("0") + r; + l = String(l[0]).padStart(20, "0"); + r = String(r[0]).padStart(20, "0"); if (l === r) { return 0;