2

Refine requests log filter controls

This commit is contained in:
2026-03-12 18:52:21 +01:00
parent fef2237c49
commit 6b9330529c
3 changed files with 80 additions and 16 deletions

View File

@@ -169,6 +169,15 @@ func TestHandlerServesOverviewAndManualActions(t *testing.T) {
if !strings.Contains(queryLogBody, "Filters, sorting, and pagination") {
t.Fatalf("requests log page should expose the collapsible controls panel")
}
if !strings.Contains(queryLogBody, `<select id="source-filter">`) || !strings.Contains(queryLogBody, `<option value="main">main</option>`) {
t.Fatalf("requests log page should expose a source dropdown with configured sources")
}
if !strings.Contains(queryLogBody, `<select id="method-filter">`) || !strings.Contains(queryLogBody, `<option value="POST">POST</option>`) {
t.Fatalf("requests log page should expose a method dropdown")
}
if !strings.Contains(queryLogBody, `<select id="status-filter">`) || !strings.Contains(queryLogBody, `<option value="4xx">4xx</option>`) {
t.Fatalf("requests log page should expose a structured HTTP status dropdown")
}
if !strings.Contains(queryLogBody, "Rows per page") {
t.Fatalf("requests log page should expose pagination settings")
}
@@ -224,6 +233,10 @@ type stubApp struct {
lastEventOptions model.EventListOptions
}
func (s *stubApp) ListSourceNames() []string {
return []string{"gitea", "main"}
}
func (s *stubApp) GetOverview(_ context.Context, _ time.Time, _ int, options model.OverviewOptions) (model.Overview, error) {
s.lastOverviewOptions = options
now := time.Now().UTC()