Skip to content

Commit

Permalink
Add back index handling to log rule list (it was accidentally removed)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingon committed May 3, 2024
1 parent a460daf commit 4d31083
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions log_rule_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}

Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit 4d31083

Please sign in to comment.