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 f4e81d7..f4f50fa 100644 --- a/main.go +++ b/main.go @@ -145,13 +145,16 @@ 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") } - if hideSleep { - b.WriteString("&hidesleep=on") + if !hideSleep { + b.WriteString("&hidesleep=off") } if filterUser != "" { b.WriteString("&filteruser=" + url.QueryEscape(filterUser)) @@ -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 { diff --git a/templates/partials/process_table.html b/templates/partials/process_table.html index 449336a..6891381 100644 --- a/templates/partials/process_table.html +++ b/templates/partials/process_table.html @@ -49,12 +49,14 @@ {{if and .Transaction (gt .Transaction.ActiveTime .Time)}}{{$t = .Transaction.ActiveTime}}{{end}} + {{if ne .Command "Binlog Dump"}} + {{end}} {{.ID}}