From 47736367db8bb47247a1cb5a1b99d1a5495ae28d Mon Sep 17 00:00:00 2001 From: lejo Date: Sat, 28 Feb 2026 17:51:29 +0100 Subject: [PATCH 1/4] Fix hidesleep param being URL-encoded into dir value in href links baseParams returned a plain string, so Go's html/template URL-encoded the leading & to %26 when interpolated inside an href attribute, making &hidesleep=on land as part of the dir value instead of its own param. Returning template.URL marks the fragment as already safe. Co-Authored-By: Claude Sonnet 4.6 --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f4e81d7..aaa98ac 100644 --- a/main.go +++ b/main.go @@ -145,7 +145,10 @@ func formatNumber(num int64) string { // baseParams returns the persistent query-string tail (starting with &) for all // params that should survive sort/navigation changes: refresh, hidesleep, // filteruser, filterdb. Append directly to ?sort=X&dir=Y in hx-get URLs. -func baseParams(autoRefresh, hideSleep bool, filterUser, filterDB string) string { +// +// Returns template.URL so Go's html/template does not re-encode the & separators +// when the value is interpolated inside an href attribute. +func baseParams(autoRefresh, hideSleep bool, filterUser, filterDB string) template.URL { var b strings.Builder if autoRefresh { b.WriteString("&refresh=on") @@ -159,7 +162,7 @@ func baseParams(autoRefresh, hideSleep bool, filterUser, filterDB string) string if filterDB != "" { b.WriteString("&filterdb=" + url.QueryEscape(filterDB)) } - return b.String() + return template.URL(b.String()) } func nextDir(currentCol, currentDir, col string) string { From 8ce689d6fd19997700975e08b111fdfdd3b8c931 Mon Sep 17 00:00:00 2001 From: lejo Date: Sat, 28 Feb 2026 17:51:45 +0100 Subject: [PATCH 2/4] Do not highlight Binlog Dump rows as long-running MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Binlog Dump is a persistent replication connection that runs indefinitely by design — coloring it red based on elapsed time is misleading. Co-Authored-By: Claude Sonnet 4.6 --- templates/partials/process_table.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/partials/process_table.html b/templates/partials/process_table.html index 449336a..6fc99da 100644 --- a/templates/partials/process_table.html +++ b/templates/partials/process_table.html @@ -49,6 +49,7 @@ {{if and .Transaction (gt .Transaction.ActiveTime .Time)}}{{$t = .Transaction.ActiveTime}}{{end}} Date: Sat, 28 Feb 2026 17:52:09 +0100 Subject: [PATCH 3/4] Hide Kill button for Binlog Dump processes Binlog Dump connections are replication threads that should not be killed from the admin UI. Co-Authored-By: Claude Sonnet 4.6 --- templates/partials/process_table.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/partials/process_table.html b/templates/partials/process_table.html index 6fc99da..6891381 100644 --- a/templates/partials/process_table.html +++ b/templates/partials/process_table.html @@ -56,6 +56,7 @@ {{else}}hover:bg-gray-50{{end}}"> + {{if ne .Command "Binlog Dump"}} + {{end}} {{.ID}} From 9deaace4255ff18e444b8e700f0a43268876c68c Mon Sep 17 00:00:00 2001 From: lejo Date: Sat, 28 Feb 2026 17:53:56 +0100 Subject: [PATCH 4/4] Hide idle (Sleep) processes by default Previously idle processes were shown unless ?hidesleep=on was set. Now they are hidden by default and shown only when ?hidesleep=off is explicitly present in the URL. Co-Authored-By: Claude Sonnet 4.6 --- internal/handler/instance.go | 2 +- main.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/handler/instance.go b/internal/handler/instance.go index b9570be..9ffeb58 100644 --- a/internal/handler/instance.go +++ b/internal/handler/instance.go @@ -46,7 +46,7 @@ func buildInstanceData(name string, processes []model.ProcessWithTransaction, r sortCol := r.URL.Query().Get("sort") sortDir := r.URL.Query().Get("dir") autoRefresh := r.URL.Query().Get("refresh") == "on" - hideSleep := r.URL.Query().Get("hidesleep") == "on" + hideSleep := r.URL.Query().Get("hidesleep") != "off" filterUser := r.URL.Query().Get("filteruser") filterDB := r.URL.Query().Get("filterdb") diff --git a/main.go b/main.go index aaa98ac..f4f50fa 100644 --- a/main.go +++ b/main.go @@ -153,8 +153,8 @@ func baseParams(autoRefresh, hideSleep bool, filterUser, filterDB string) templa if autoRefresh { b.WriteString("&refresh=on") } - if hideSleep { - b.WriteString("&hidesleep=on") + if !hideSleep { + b.WriteString("&hidesleep=off") } if filterUser != "" { b.WriteString("&filteruser=" + url.QueryEscape(filterUser))