-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.go
41 lines (35 loc) · 805 Bytes
/
page.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"html/template"
"net/http"
"github.com/gin-gonic/gin"
)
type StatusUpdate struct {
HTML template.HTML
SentBy string
TimeStamp string
BackgroundClass string
IconFilename string
}
type CSPPage struct {
updates []StatusUpdate
pinnedUpdates []StatusUpdate
}
func (page *CSPPage) statusPage(c *gin.Context) {
c.HTML(
http.StatusOK,
"index.html",
gin.H{
"HelpMessage": template.HTML(config.HelpMessage),
"PinnedStatuses": page.pinnedUpdates,
"StatusUpdates": page.updates,
"Org": config.OrgName,
"Logo": config.LogoURL,
"Favicon": config.FaviconURL,
"NominalMessage": config.NominalMessage,
},
)
}
func health(c *gin.Context) {
c.JSON(http.StatusOK, "cursed-status-page")
}