diff --git a/README.md b/README.md index 7f82271..8b3dd7d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + # uptimesebi [![ci](https://git.zb-server.de/ZB-Server/uptimesebi/actions/workflows/ci.yaml/badge.svg?branch=main)](https://git.zb-server.de/ZB-Server/uptimesebi/actions?workflow=ci.yaml) · License: AGPL-3.0-only diff --git a/docs/images/logo.svg b/docs/images/logo.svg new file mode 100644 index 0000000..0985176 --- /dev/null +++ b/docs/images/logo.svg @@ -0,0 +1,9 @@ + + + + + uptimesebi + diff --git a/internal/api/openapi_test.go b/internal/api/openapi_test.go index 2c8f621..2faac4e 100644 --- a/internal/api/openapi_test.go +++ b/internal/api/openapi_test.go @@ -13,6 +13,7 @@ import ( "git.zb-server.de/ZB-Server/uptimesebi/internal/api" "git.zb-server.de/ZB-Server/uptimesebi/internal/config" + "git.zb-server.de/ZB-Server/uptimesebi/internal/web" ) func TestEveryRouteIsDocumented(t *testing.T) { @@ -115,6 +116,18 @@ func TestAPIDocsServed(t *testing.T) { if st, _, page := e.browser(t).page("/api/docs"); st != http.StatusOK || !strings.Contains(page, "swagger-ui-bundle.js") { t.Errorf("/api/docs = %d", st) } + // Every page carries the favicons, which ship in the embedded /static. + for _, path := range []string{"/brand/favicon.svg", "/brand/favicon-32.png", "/brand/apple-touch-icon.png", "/brand/site.webmanifest"} { + f, err := web.Static().Open(path) + if err != nil { + t.Errorf("static %s: %v", path, err) + continue + } + _ = f.Close() + } + if _, _, login := e.browser(t).page("/login"); !strings.Contains(login, `href="/static/brand/favicon.svg"`) { + t.Error("the login page lacks the favicon") + } // Linked from every console page and where tokens are created. if _, _, login := e.browser(t).page("/login"); !strings.Contains(login, `href="/api/docs"`) { t.Error("the footer does not link the API documentation") diff --git a/internal/web/apidocs.templ b/internal/web/apidocs.templ index 8d2f010..ac042a4 100644 --- a/internal/web/apidocs.templ +++ b/internal/web/apidocs.templ @@ -14,13 +14,14 @@ templ APIDocsPage(p Page) { } { i18n.T(ctx, p.TitleID) } · uptimesebi + @faviconLinks()
- uptimesebi + @brandLockup("/") { i18n.T(ctx, "apidocs.hint") }
diff --git a/internal/web/apidocs_templ.go b/internal/web/apidocs_templ.go index b57789f..0db1a22 100644 --- a/internal/web/apidocs_templ.go +++ b/internal/web/apidocs_templ.go @@ -79,20 +79,36 @@ func APIDocsPage(p Page) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " · uptimesebi
uptimesebi ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " · uptimesebi") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = faviconLinks().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = brandLockup("/").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "apidocs.hint")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/apidocs.templ`, Line: 24, Col: 67} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/apidocs.templ`, Line: 25, Col: 67} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/web/brand.templ b/internal/web/brand.templ new file mode 100644 index 0000000..1b290c8 --- /dev/null +++ b/internal/web/brand.templ @@ -0,0 +1,26 @@ +package web + +// brandMark is the logo: a pulse that ends in the status dot. The line takes +// the text color, so it works on light and dark backgrounds. +templ brandMark(size string) { + +} + +// brandLockup is the logo with the wordmark, linking home. +templ brandLockup(href string) { + + @brandMark("h-6 w-6") + uptimesebi + +} + +// faviconLinks belong in every page's head. +templ faviconLinks() { + + + + +} diff --git a/internal/web/brand_templ.go b/internal/web/brand_templ.go new file mode 100644 index 0000000..960bea0 --- /dev/null +++ b/internal/web/brand_templ.go @@ -0,0 +1,148 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.1118 + +package web + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +// brandMark is the logo: a pulse that ends in the status dot. The line takes +// the text color, so it works on light and dark backgrounds. +func brandMark(size string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + ctx = templ.ClearChildren(ctx) + { + templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer + templ_7745c5c3_Buffer := templ.GetBuffer() + var templ_7745c5c3_ElementScripts []templ.ComponentScript + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +// brandLockup is the logo with the wordmark, linking home. +func brandLockup(href string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = brandMark("h-6 w-6").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "uptimesebi") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +// faviconLinks belong in every page's head. +func faviconLinks() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/web/console.templ b/internal/web/console.templ index c8bac86..5542147 100644 --- a/internal/web/console.templ +++ b/internal/web/console.templ @@ -37,7 +37,7 @@ templ consoleShell(p Page, me Me) { @Layout(p) {
- uptimesebi + @brandLockup("/") if len(me.Orgs) > 1 { ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -428,20 +440,20 @@ func submit(label string) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -467,39 +479,39 @@ func flash(p Page) templ.Component { ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) if p.ErrorID != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var23 string templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.ErrorID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 97, Col: 88} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 98, Col: 88} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if p.NoticeID != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var24 string templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.NoticeID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 100, Col: 77} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 101, Col: 77} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -525,7 +537,7 @@ func formError() templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/web/legal.templ b/internal/web/legal.templ index 7aef0cf..9b19caf 100644 --- a/internal/web/legal.templ +++ b/internal/web/legal.templ @@ -43,7 +43,7 @@ templ LegalPage(p Page, me *Me, html string) { @Layout(p) {
- uptimesebi + @brandLockup("/")
{ i18n.T(ctx, "auth.login.title") } @languageSwitch(p.Languages) @@ -65,6 +65,7 @@ templ PublicLegalPage(s agentapi.PageSnapshot, a PublicAssets, kind, html, back { i18n.T(ctx, LegalTitleID(kind)) } · { s.Title } + @faviconLinks() diff --git a/internal/web/legal_templ.go b/internal/web/legal_templ.go index d95e2ca..994bb17 100644 --- a/internal/web/legal_templ.go +++ b/internal/web/legal_templ.go @@ -238,7 +238,15 @@ func LegalPage(p Page, me *Me, html string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "
uptimesebi
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -267,7 +275,7 @@ func LegalPage(p Page, me *Me, html string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -300,7 +308,7 @@ func PublicLegalPage(s agentapi.PageSnapshot, a PublicAssets, kind, html, back s } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -326,7 +334,7 @@ func PublicLegalPage(s agentapi.PageSnapshot, a PublicAssets, kind, html, back s if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, " · ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, " · ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -339,46 +347,54 @@ func PublicLegalPage(s agentapi.PageSnapshot, a PublicAssets, kind, html, back s if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = faviconLinks().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\" class=\"text-sm text-muted hover:text-ink\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs("← " + s.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 72, Col: 113} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 73, Col: 113} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -386,7 +402,7 @@ func PublicLegalPage(s agentapi.PageSnapshot, a PublicAssets, kind, html, back s if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -437,7 +453,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do return templ_7745c5c3_Err } for _, d := range docs { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -445,33 +461,33 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -479,46 +495,46 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/web/public.templ b/internal/web/public.templ index 8094802..7d4e1a0 100644 --- a/internal/web/public.templ +++ b/internal/web/public.templ @@ -16,6 +16,9 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) { { s.Title } + if a.InlineCSS == "" { + @faviconLinks() + } if a.InlineCSS != "" { @templ.Raw("") } else { @@ -114,7 +117,10 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) { for _, l := range PageLegalLinks(s, a.LegalBase) { @legalLink(l) } - uptimesebi + + @brandMark("h-3.5 w-3.5") + uptimesebi + diff --git a/internal/web/public_templ.go b/internal/web/public_templ.go index 3719b37..97b2dc6 100644 --- a/internal/web/public_templ.go +++ b/internal/web/public_templ.go @@ -64,6 +64,12 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + if a.InlineCSS == "" { + templ_7745c5c3_Err = faviconLinks().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } if a.InlineCSS != "" { templ_7745c5c3_Err = templ.Raw("").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { @@ -77,7 +83,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(a.CSSHref).ResolveURL(ctx) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 22, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 25, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4) if templ_7745c5c3_Err != nil { @@ -112,7 +118,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(s.Theme.LogoURL).ResolveURL(ctx) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 35, Col: 32} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 38, Col: 32} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5) if templ_7745c5c3_Err != nil { @@ -125,7 +131,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(s.Title).Resolve(ctx) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 35, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 38, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6) if templ_7745c5c3_Err != nil { @@ -143,7 +149,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(s.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 37, Col: 90} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 40, Col: 90} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -179,7 +185,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.stale", "Time", a.StaleSince.UTC().Format("2006-01-02 15:04")+" UTC")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 46, Col: 95} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 49, Col: 95} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -238,7 +244,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.status."+s.Status)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 57, Col: 74} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 60, Col: 74} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -265,7 +271,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(sec.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 63, Col: 90} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 66, Col: 90} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { @@ -296,7 +302,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(comp.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 70, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 73, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -309,7 +315,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.component."+comp.Status)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 71, Col: 95} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 74, Col: 95} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -330,7 +336,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.days_ago", "Count", len(comp.Days))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 75, Col: 71} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 78, Col: 71} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -343,7 +349,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(UptimeText(comp.Uptime)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 76, Col: 41} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 79, Col: 41} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -356,7 +362,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.today")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 77, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 80, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -383,7 +389,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.incidents")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 86, Col: 109} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 89, Col: 109} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -401,7 +407,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.no_incidents")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 88, Col: 70} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 91, Col: 70} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { @@ -429,7 +435,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var20 string templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.ongoing")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 94, Col: 80} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 97, Col: 80} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { @@ -447,7 +453,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var21 string templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.resolved")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 96, Col: 67} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 99, Col: 67} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { @@ -465,7 +471,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var22 string templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(inc.Component) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 98, Col: 30} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 101, Col: 30} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { @@ -478,7 +484,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var23 string templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(inc.StartedAt.UTC().Format("2006-01-02 15:04")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 100, Col: 58} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 103, Col: 58} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { @@ -496,7 +502,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var24 string templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(inc.ResolvedAt.UTC().Format("15:04")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 102, Col: 53} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 105, Col: 53} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) if templ_7745c5c3_Err != nil { @@ -524,7 +530,7 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { var templ_7745c5c3_Var25 string templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "page.updated", "Time", s.GeneratedAt.UTC().Format(time.DateTime)+" UTC")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 112, Col: 98} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 115, Col: 98} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) if templ_7745c5c3_Err != nil { @@ -540,7 +546,15 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "uptimesebi") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = brandMark("h-3.5 w-3.5").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, " uptimesebi") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -566,25 +580,25 @@ func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Com ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) if len(items) > 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var27 string templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(heading) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 128, Col: 85} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 134, Col: 85} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "

    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "

    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, m := range items { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "
  • ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "
  • ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -592,51 +606,51 @@ func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Com if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var28 string templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 135, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 141, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var29 string templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(m.Start.UTC().Format("2006-01-02 15:04") + " – " + m.End.UTC().Format("15:04") + " UTC") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 138, Col: 99} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 144, Col: 99} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "

    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var30 string templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(m.Components, ", ")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 141, Col: 80} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 147, Col: 80} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if m.Description != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -644,17 +658,17 @@ func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Com if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/web/static/brand/apple-touch-icon.png b/internal/web/static/brand/apple-touch-icon.png new file mode 100644 index 0000000..be054d6 Binary files /dev/null and b/internal/web/static/brand/apple-touch-icon.png differ diff --git a/internal/web/static/brand/favicon-32.png b/internal/web/static/brand/favicon-32.png new file mode 100644 index 0000000..f32d4d0 Binary files /dev/null and b/internal/web/static/brand/favicon-32.png differ diff --git a/internal/web/static/brand/favicon.svg b/internal/web/static/brand/favicon.svg new file mode 100644 index 0000000..725703e --- /dev/null +++ b/internal/web/static/brand/favicon.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/internal/web/static/brand/icon-512.png b/internal/web/static/brand/icon-512.png new file mode 100644 index 0000000..56af6d1 Binary files /dev/null and b/internal/web/static/brand/icon-512.png differ diff --git a/internal/web/static/brand/logo.svg b/internal/web/static/brand/logo.svg new file mode 100644 index 0000000..0887e57 --- /dev/null +++ b/internal/web/static/brand/logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/internal/web/static/brand/site.webmanifest b/internal/web/static/brand/site.webmanifest new file mode 100644 index 0000000..2380f1c --- /dev/null +++ b/internal/web/static/brand/site.webmanifest @@ -0,0 +1,8 @@ +{ + "name": "uptimesebi", + "short_name": "uptimesebi", + "icons": [{ "src": "/static/brand/icon-512.png", "sizes": "512x512", "type": "image/png" }], + "theme_color": "#f4f2ee", + "background_color": "#f4f2ee", + "display": "browser" +}