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 {
// IsOwner refers to the active organization.
IsOwner bool
ActiveSlug string
Email string
DisplayName string
TOTP bool
ActiveOrg string
Orgs []Org
// Can holds the permissions in the active organization.
Can map[string]bool
// Policy is the error code of an unmet sign-in policy of the active
// organization, or empty.
Policy string
// RecoveryCodesLeft counts unused TOTP recovery codes.
RecoveryCodesLeft int
}
// 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) {
{ i18n.T(ctx, "console.monitors.empty") }
} } // Identity is an SSO sign-in linked to the user in the active organization. type Identity struct { Provider string Email string } templ Security(p Page, me Me, identities []Identity, canLink bool) { @consoleShell(p, me) {● { i18n.T(ctx, "security.totp.active") }
= 3) }> { i18n.T(ctx, "security.recovery.left", "Count", me.RecoveryCodesLeft) }
● { i18n.T(ctx, "security.totp.inactive") }
{ i18n.T(ctx, "security.sso.none") }
} else {{ i18n.T(ctx, msgID) } { i18n.T(ctx, actionID) }