Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort list of queries in web UI for display #14428

Merged
merged 4 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
jsteemann marked this conversation as resolved.
Show resolved Hide resolved

if (l === r) {
return 0;
}
return l < r ? 1 : -1;
});
}

self.tableDescription.rows = rowsArray;
Expand Down