package web import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" // Me is the signed-in user as the console templates see it. type Me struct { Email string DisplayName string TOTP bool ActiveOrg string Orgs []Org TOTPMissing bool } // Org is one entry of the organization switcher. type Org struct { ID string Name string Slug string IsOwner bool } templ consoleShell(p Page, me Me) { @Layout(p) {
uptimesebi if len(me.Orgs) > 1 { } else if len(me.Orgs) == 1 { { me.Orgs[0].Name } }
if me.TOTPMissing {

{ i18n.T(ctx, "console.totp_missing") } { i18n.T(ctx, "console.totp_missing_action") }

}
{ children... }
} } templ Dashboard(p Page, me Me) { @consoleShell(p, me) {

{ i18n.T(ctx, "console.monitors.title") }

{ i18n.T(ctx, "console.monitors.empty") }

} } templ Security(p Page, me Me) { @consoleShell(p, me) {

{ i18n.T(ctx, "security.title") }

{ i18n.T(ctx, "security.totp.heading") }

if me.TOTP {

● { i18n.T(ctx, "security.totp.active") }

@formError() @field(i18n.T(ctx, "auth.field.password"), "password", "password", "current-password", true) @field(i18n.T(ctx, "security.totp.current_code"), "code", "text", "one-time-code", true) @submit(i18n.T(ctx, "security.totp.disable"))
} else {

● { i18n.T(ctx, "security.totp.inactive") }

}
} }