diff --git a/handler/sponsor_handler.go b/handler/sponsor_handler.go index 732c574..b3b215a 100644 --- a/handler/sponsor_handler.go +++ b/handler/sponsor_handler.go @@ -1,13 +1,20 @@ package handler import ( - "encoding/json" "html/template" "net/http" "uptimemonitor" "uptimemonitor/html" ) +var sponsors = []uptimemonitor.Sponsor{ + { + Name: "AIR Labs", + Url: "https://airlabs.pl", + Image: "/static/img/airlabs.svg", + }, +} + func (*Handler) ListSponsors() http.HandlerFunc { layout := template.Must(template.ParseFS(html.FS, "layout.html")) sponsor := template.Must(template.ParseFS(html.FS, "sponsor.html")) @@ -23,36 +30,9 @@ func (*Handler) ListSponsors() http.HandlerFunc { } d := data{ - Sponsors: []uptimemonitor.Sponsor{ - { - Name: "AIR Labs", - Url: "https://airlabs.pl", - Image: "/static/img/airlabs.svg", - }, - }, - } - - req, err := http.NewRequest(http.MethodGet, "https://sponsors.uptimemonitor.dev", nil) - if err != nil { - sponsor.Execute(w, d) - return - } - - res, err := http.DefaultClient.Do(req) - if err != nil { - sponsor.Execute(w, d) - return - } - - var sponsors []uptimemonitor.Sponsor - err = json.NewDecoder(res.Body).Decode(&sponsors) - if err != nil { - sponsor.Execute(w, d) - return - } - - sponsor.Execute(w, data{ Sponsors: sponsors, - }) + } + + sponsor.Execute(w, d) } } diff --git a/html/incident.html b/html/incident.html index ab148f2..722e3c9 100644 --- a/html/incident.html +++ b/html/incident.html @@ -124,25 +124,25 @@