From 4d3108350b40e6968ed805ba97f839dbbbbef955 Mon Sep 17 00:00:00 2001 From: Markus Stenberg Date: Fri, 3 May 2024 14:23:25 +0300 Subject: [PATCH] Add back index handling to log rule list (it was accidentally removed) --- log_rule_list.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/log_rule_list.go b/log_rule_list.go index db8e0fc..24a94b6 100644 --- a/log_rule_list.go +++ b/log_rule_list.go @@ -16,6 +16,8 @@ import ( "github.com/fingon/lixie/data" ) +const indexKey = "i" + // This struct represents external configuration - what we can get as query/form parameters type LogRuleListConfig struct { // Global configuration (cookie) @@ -26,6 +28,10 @@ type LogRuleListConfig struct { } func (self *LogRuleListConfig) Init(r *http.Request, w http.ResponseWriter) error { + _, err := cm.IntFromForm(r, indexKey, &self.Index) + if err != nil { + return err + } return cm.Run(r, w, &self.Global) } @@ -79,8 +85,6 @@ func (self *LogRuleListModel) NextLinkString() string { return next.ToLinkString() } -const indexKey = "i" - func logRuleListHandler(db *data.Database) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { config := LogRuleListConfig{}