🐛 Fixes regex and logs query param not working
This commit is contained in:
parent
e9065fb654
commit
30aae96185
@ -23,7 +23,7 @@ import (
|
||||
const TimeFormat = "2006-01-02 15:04:05"
|
||||
const DateFormat = "2006-01-02"
|
||||
|
||||
var LogRegex = regexp.MustCompile(`(?m)^.*/\d{4}-\d{2}-\d{2}_\d+\.txt$`)
|
||||
var LogRegex = regexp.MustCompile(`(?m)^\d{4}-\d{2}-\d{2}_.*\.txt$`)
|
||||
|
||||
type Client struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
@ -185,12 +185,12 @@ func main() {
|
||||
}))
|
||||
|
||||
app.GET("/admin/logs/:id", authed(idparam(func(c echo.Context, id uuid.UUID) error {
|
||||
date := c.Param("date")
|
||||
date := c.QueryParam("date")
|
||||
if date == "" {
|
||||
date = time.Now().Format(DateFormat)
|
||||
}
|
||||
|
||||
skipRaw := c.Param("skip")
|
||||
skipRaw := c.QueryParam("skip")
|
||||
skip := 0
|
||||
if skipRaw != "" {
|
||||
skip, err = strconv.Atoi(skipRaw)
|
||||
@ -199,7 +199,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
takeRaw := c.Param("take")
|
||||
takeRaw := c.QueryParam("take")
|
||||
take := 1024
|
||||
if takeRaw != "" {
|
||||
take, err = strconv.Atoi(takeRaw)
|
||||
|
Loading…
x
Reference in New Issue
Block a user