feat(web): fit the console and status pages to phones and tablets
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m4s
ci / test (pull_request) Successful in 11m52s
ci / build (pull_request) Successful in 17m48s
ci / image (pull_request) Successful in 5m28s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m4s
ci / test (pull_request) Successful in 11m52s
ci / build (pull_request) Successful in 17m48s
ci / image (pull_request) Successful in 5m28s
- The console header folds its navigation into a menu below 1024px. - Pages use narrower gutters on phones. - Monitor rows keep name and uptime in place on narrow screens. - Toolbars and the range switch wrap. - Tables scroll sideways instead of squeezing their columns. - Form fields keep 16px text on touch screens so iOS does not zoom in. - The status page footer wraps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
442b45b974
commit
670dde40b6
22 files changed
+1353
-1276
No files matched your search
+45
-31
@@ -43,41 +43,55 @@ type Org struct {
|
||||
templ consoleShell(p Page, me Me) {
|
||||
@Layout(p) {
|
||||
<header class="border-b border-rule">
|
||||
<div class="mx-auto flex max-w-5xl items-center gap-6 px-6 py-3 text-sm">
|
||||
<div class="mx-auto flex max-w-5xl flex-wrap items-center gap-x-4 gap-y-3 px-4 py-3 text-sm sm:gap-x-6 sm:px-6">
|
||||
@brandLockup("/")
|
||||
if len(me.Orgs) > 1 {
|
||||
<select data-switch-org class="border border-rule bg-transparent px-1.5 py-0.5 text-sm">
|
||||
for _, o := range me.Orgs {
|
||||
<option value={ o.ID } selected?={ o.ID == me.ActiveOrg }>{ o.Name }</option>
|
||||
<span class="flex min-w-0 items-center gap-2">
|
||||
if len(me.Orgs) > 1 {
|
||||
<select data-switch-org class="max-w-[10rem] min-w-0 border border-rule bg-transparent px-1.5 py-0.5 text-sm sm:max-w-none">
|
||||
for _, o := range me.Orgs {
|
||||
<option value={ o.ID } selected?={ o.ID == me.ActiveOrg }>{ o.Name }</option>
|
||||
}
|
||||
</select>
|
||||
} else if len(me.Orgs) == 1 {
|
||||
<span class="truncate text-muted">{ me.Orgs[0].Name }</span>
|
||||
}
|
||||
<a href="/orgs/new" class="px-1 text-muted hover:text-ink" title={ i18n.T(ctx, "orgs.new_title") } aria-label={ i18n.T(ctx, "orgs.new_title") }>+</a>
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
data-nav-toggle="console-nav"
|
||||
aria-controls="console-nav"
|
||||
aria-expanded="false"
|
||||
aria-label={ i18n.T(ctx, "console.nav.menu") }
|
||||
class="ml-auto -my-1 border border-rule px-2.5 py-1 text-muted hover:text-ink lg:hidden"
|
||||
>
|
||||
<span aria-hidden="true">☰</span> <span class="hidden sm:inline">{ i18n.T(ctx, "console.nav.menu") }</span>
|
||||
</button>
|
||||
<div id="console-nav" class="hidden w-full flex-col gap-4 border-t border-rule pt-3 lg:flex lg:w-auto lg:flex-1 lg:flex-row lg:items-center lg:gap-5 lg:border-0 lg:pt-0">
|
||||
<nav class="flex flex-col gap-3 lg:flex-row lg:items-center lg:gap-5 lg:whitespace-nowrap">
|
||||
<a href="/" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.monitors.title") }</a>
|
||||
if me.Can["statuspages.read"] {
|
||||
<a href="/statuspages" class="text-muted hover:text-ink">{ i18n.T(ctx, "pages.title") }</a>
|
||||
}
|
||||
</select>
|
||||
} else if len(me.Orgs) == 1 {
|
||||
<span class="text-muted">{ me.Orgs[0].Name }</span>
|
||||
}
|
||||
<a href="/orgs/new" class="-ml-4 text-muted hover:text-ink" title={ i18n.T(ctx, "orgs.new_title") } aria-label={ i18n.T(ctx, "orgs.new_title") }>+</a>
|
||||
<nav class="flex items-center gap-5 whitespace-nowrap">
|
||||
<a href="/" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.monitors.title") }</a>
|
||||
if me.Can["statuspages.read"] {
|
||||
<a href="/statuspages" class="text-muted hover:text-ink">{ i18n.T(ctx, "pages.title") }</a>
|
||||
}
|
||||
if me.Can["incidents.read"] {
|
||||
<a href="/incidents" class="text-muted hover:text-ink">{ i18n.T(ctx, "incidents.title") }</a>
|
||||
<a href="/maintenance" class="text-muted hover:text-ink">{ i18n.T(ctx, "maintenance.title") }</a>
|
||||
}
|
||||
</nav>
|
||||
<nav class="ml-auto flex items-center gap-5 whitespace-nowrap">
|
||||
<a href="/settings" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.settings") }</a>
|
||||
if me.IsAdmin {
|
||||
<a href="/admin" class="font-medium hover:underline">{ i18n.T(ctx, "console.nav.admin") }</a>
|
||||
}
|
||||
<button data-logout class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.logout") }</button>
|
||||
@languageSwitch(p.Languages)
|
||||
</nav>
|
||||
if me.Can["incidents.read"] {
|
||||
<a href="/incidents" class="text-muted hover:text-ink">{ i18n.T(ctx, "incidents.title") }</a>
|
||||
<a href="/maintenance" class="text-muted hover:text-ink">{ i18n.T(ctx, "maintenance.title") }</a>
|
||||
}
|
||||
</nav>
|
||||
<nav class="flex flex-col gap-3 border-t border-rule pt-3 lg:ml-auto lg:flex-row lg:items-center lg:gap-5 lg:whitespace-nowrap lg:border-0 lg:pt-0">
|
||||
<a href="/settings" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.settings") }</a>
|
||||
if me.IsAdmin {
|
||||
<a href="/admin" class="font-medium hover:underline">{ i18n.T(ctx, "console.nav.admin") }</a>
|
||||
}
|
||||
<button data-logout class="text-left text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.logout") }</button>
|
||||
@languageSwitch(p.Languages)
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
if me.OrgSuspended {
|
||||
<div class="border-b border-down bg-down/10" role="alert">
|
||||
<p class="mx-auto max-w-5xl px-6 py-3 text-sm">
|
||||
<p class="mx-auto max-w-5xl px-4 sm:px-6 py-3 text-sm">
|
||||
<strong>{ i18n.T(ctx, "console.org_suspended") }</strong>
|
||||
if me.SuspendedReason != "" {
|
||||
{ " " + i18n.T(ctx, "console.suspended_reason", "Reason", me.SuspendedReason) }
|
||||
@@ -91,7 +105,7 @@ templ consoleShell(p Page, me Me) {
|
||||
case "sso_required_by_org":
|
||||
@policyBanner("error.sso_required_by_org", "console.sso_required_action", "/sso/"+me.ActiveSlug)
|
||||
}
|
||||
<main class="mx-auto max-w-5xl px-6 py-10">
|
||||
<main class="mx-auto max-w-5xl px-4 py-6 sm:px-6 sm:py-10">
|
||||
@flash(p)
|
||||
{ children... }
|
||||
</main>
|
||||
@@ -226,7 +240,7 @@ templ recoveryOutput() {
|
||||
|
||||
templ policyBanner(msgID, actionID, href string) {
|
||||
<div class="border-b border-degraded/40 bg-degraded/10">
|
||||
<p class="mx-auto max-w-5xl px-6 py-2 text-sm">
|
||||
<p class="mx-auto max-w-5xl px-4 sm:px-6 py-2 text-sm">
|
||||
{ i18n.T(ctx, msgID) }
|
||||
<a href={ templ.SafeURL(href) } class="underline underline-offset-2">{ i18n.T(ctx, actionID) }</a>
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user