package web import ( "strconv" "strings" "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" ) // PageRow is a status page in the list. type PageRow struct { ID string Title string Slug string Published bool URL string Domain string Suspended bool } // PagesView is the data of the status page list. type PagesView struct { Pages []PageRow CanWrite bool } templ StatusPagesPage(p Page, me Me, v PagesView) { @consoleShell(p, me) { @settingsHeading("pages.title", "pages.intro") if len(v.Pages) > 0 {
← { i18n.T(ctx, "pages.title") }
if e.Suspended {{ i18n.T(ctx, "pages.suspended_notice") } if e.SuspendedReason != "" { { " " + i18n.T(ctx, "console.suspended_reason", "Reason", e.SuspendedReason) } }
}{ i18n.T(ctx, "pages.own_servers") }
}{ i18n.T(ctx, "pages.feeds_hint") }
{ i18n.T(ctx, "pages.groups_intro") }
if len(e.Groups) > 0 {{ i18n.T(ctx, "pages.domain_intro") }
if e.Domain != "" {● switch e.VerifiedBy { case "cname": { i18n.T(ctx, "pages.domain_verified_by_cname") } case "txt": { i18n.T(ctx, "pages.domain_verified_by_txt") } default: { i18n.T(ctx, "pages.domain_step_verified") } }
if e.MissingSince != "" {{ i18n.T(ctx, "pages.domain_missing", "Since", e.MissingSince, "Date", e.SwitchOffAt) }
} else if e.VerifiedBy != "" {{ i18n.T(ctx, "pages.domain_keep") }
} } else if e.CNAMEValue != "" && !e.OwnServers {{ i18n.T(ctx, "pages.domain_cname_step") }
@dnsRecordList("CNAME", e.Domain, e.CNAMEValue+".") @verifyButton(e.ID, "pages.verify_now"){ i18n.T(ctx, "pages.domain_alt", "Target", e.CNAMEValue) }
@dnsRecordList("TXT", e.RecordName, e.RecordValue) @verifyButton(e.ID, "pages.verify"){ i18n.T(ctx, "pages.domain_step_verify") }
@dnsRecordList("TXT", e.RecordName, e.RecordValue) @verifyButton(e.ID, "pages.verify") if e.OwnServers {{ i18n.T(ctx, "pages.domain_step_cname_own") }
} else {{ i18n.T(ctx, "pages.domain_step_cname_unknown") }
}{ i18n.T(ctx, "pages.domain_apex") }
}{ i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay) }
{ i18n.T(ctx, "pages.subscribers_counts", "Confirmed", e.SubscribersConfirmed, "Pending", e.SubscribersPending) }
if e.SubscriberLimit > 0 {{ i18n.T(ctx, "pages.subscribers_limit", "Max", e.SubscriberLimit) }
} if len(e.Subscribers) == 0 {{ i18n.T(ctx, "pages.subscribers_none") }
} else {{ i18n.T(ctx, "pages.subscribers_more", "Count", len(e.Subscribers)) }
} }