You've already forked caddy-opnsense-blocker
Refine requests log filter controls
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user