Skip to content

Conversation

@pmenzel
Copy link
Contributor

@pmenzel pmenzel commented Jul 20, 2026

Currently the column tables on the Web pages cannot be sorted or filtered.

section groups

Clicking on the column header, the request is sent to the cgi, querying the data base and creating the HTML page.

Screenshot 2026-07-20 at 13-55-42

section servers

As always all cluster nodes are shown on the page, sorting is implemented via JavaScript (example below sorts via max. time ):

image

You have to click on the column head. There is no indicator that it’s sortable.

pmenzel and others added 2 commits July 20, 2026 13:57
The no-JavaScript groups page now has server-side sortable column headers
(clickable links carrying whitelisted sort parameters, so an attacker-supplied
sort key can never reach the query) and a filter form for user name, group
name substring and the finished-groups day window.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The servers page lists every server in a single table, so sorting needs no
server round-trip. Clicking a column header now reorders the rows via a small
vanilla-JS click-to-sort (no dependencies): data rows live in <tbody>, the
totals stay in <tfoot>, and the human-readable memory columns carry a raw
"data-sort" value so e.g. "2.0 GiB" sorts above "512.0 MiB".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pmenzel pmenzel force-pushed the sortable-static-tables branch from a1724ea to 8a40b16 Compare July 20, 2026 11:58
@pmenzel
Copy link
Contributor Author

pmenzel commented Jul 20, 2026

Feel free to test on http://afk.molgen.mpg.de/mxq/mxq4/.

@donald
Copy link
Contributor

donald commented Jul 20, 2026

I don't understand the PR text.

"The group tables are rendered on the server. The server table is rendered client side. You have to click on the column head. There is no indicator that it’s sortable."

Can't make head and tail of this.

What does the PR do?

@pmenzel
Copy link
Contributor Author

pmenzel commented Jul 22, 2026

I don't understand the PR text.

"The group tables are rendered on the server. The server table is rendered client side. You have to click on the column head. There is no indicator that it’s sortable."

Can't make head and tail of this.

I guess server was ambiguous with the server running the cgi script, and server meaning cluster node.

What does the PR do?

Sorry about this. I mostly ignore merge/pull request descriptions, as they are not copied to the merge commit. Hopefully, I fixed it, and the commit messages itself are more informative.

@@ -678,11 +735,23 @@ sub group_table {
unknown
);

my $sth=$dbh->prepare('SELECT '.join(',',@cols).' FROM mxq_group WHERE '.$sql_clause.' AND (group_jobs_running>0 OR group_jobs_inq>0) ORDER BY group_id DESC');
my %active_allowed=map {$_=>$_} qw(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my %active_allowed = map {$_ => 1} @cols; ?

  • avoid duplication of @cols

  • use more sensible whitespace (I confess, I set the bad example in the surrounding code)

  • %active_allowed is only evaluated with exists so the value doesn't matter. We can use an optimized constant instead of a string which needs allocation for the value.

  • unested! (I'm on mobile)

  • same next line

@donald
Copy link
Contributor

donald commented Jul 24, 2026

It's to much to review on a small screen. However, if it works, I'm okay with that. Nothing prevents us from improving the code in future changes, so I don't want to send other minor comments. Thanks, good idea. If you want, just merge and copy the produced cgi script to the afk server without going through releases.

Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants