autofill empty form

main
bel 2025-05-08 11:01:24 -06:00
parent 5470576b10
commit e8b6396760
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package handler
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"math/rand"
"net/http" "net/http"
"os" "os"
"path" "path"
@ -47,6 +48,11 @@ func (h Handler) uiIndex(w http.ResponseWriter, r *http.Request) error {
feeds.Entry `json:",inline"` feeds.Entry `json:",inline"`
feeds.Version `json:",inline"` feeds.Version `json:",inline"`
} }
editing.Version.Cron = fmt.Sprintf("%d */12 * * *", rand.Int()%60)
editing.Version.Pattern = ".*"
editing.Version.WebhookBody = "{{ .Item.Link }}"
editing.Version.WebhookMethod = "POST"
editing.Version.WebhookURL = "vpntor:///data/completed-rss/TITLE"
all := []feeds.Feed{} all := []feeds.Feed{}
if err := feeds.ForEach(ctx, func(f feeds.Feed) error { if err := feeds.ForEach(ctx, func(f feeds.Feed) error {
all = append(all, f) all = append(all, f)