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
+117
-113
@@ -85,80 +85,82 @@ templ roleSelect(roles []Role, name string) {
|
||||
templ MembersPage(p Page, me Me, v MembersView) {
|
||||
@consoleShell(p, me) {
|
||||
@settingsHeading("members.title", "members.intro")
|
||||
<table class="mb-12 w-full text-left text-sm">
|
||||
<thead class="border-b border-rule text-xs uppercase tracking-wider text-muted">
|
||||
<tr>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "auth.field.email") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "members.roles") }</th>
|
||||
<th class="py-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-rule">
|
||||
for _, m := range v.Members {
|
||||
<tr class="align-top">
|
||||
<td class="py-2.5 pr-4">
|
||||
{ m.Email }
|
||||
if m.DisplayName != "" {
|
||||
<span class="block text-xs text-muted">{ m.DisplayName }</span>
|
||||
}
|
||||
</td>
|
||||
<td class="py-2.5 pr-4">
|
||||
if m.IsOwner {
|
||||
<span class="font-medium">{ i18n.T(ctx, "members.owner") }</span>
|
||||
}
|
||||
<ul class="flex flex-wrap gap-1.5">
|
||||
for _, a := range m.Assignments {
|
||||
<li class="inline-flex items-center gap-1.5 border border-rule px-1.5 py-0.5 text-xs">
|
||||
{ a.RoleName }
|
||||
if a.Scope != "" {
|
||||
<span class="text-muted">· { a.Scope }</span>
|
||||
}
|
||||
if v.CanManage {
|
||||
<div class="overflow-x-auto">
|
||||
<table class="mb-12 w-full text-left text-sm">
|
||||
<thead class="border-b border-rule text-xs uppercase tracking-wider text-muted">
|
||||
<tr>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "auth.field.email") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "members.roles") }</th>
|
||||
<th class="py-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-rule">
|
||||
for _, m := range v.Members {
|
||||
<tr class="align-top">
|
||||
<td class="py-2.5 pr-4">
|
||||
{ m.Email }
|
||||
if m.DisplayName != "" {
|
||||
<span class="block text-xs text-muted">{ m.DisplayName }</span>
|
||||
}
|
||||
</td>
|
||||
<td class="py-2.5 pr-4">
|
||||
if m.IsOwner {
|
||||
<span class="font-medium">{ i18n.T(ctx, "members.owner") }</span>
|
||||
}
|
||||
<ul class="flex flex-wrap gap-1.5">
|
||||
for _, a := range m.Assignments {
|
||||
<li class="inline-flex items-center gap-1.5 border border-rule px-1.5 py-0.5 text-xs">
|
||||
{ a.RoleName }
|
||||
if a.Scope != "" {
|
||||
<span class="text-muted">· { a.Scope }</span>
|
||||
}
|
||||
if v.CanManage {
|
||||
<button
|
||||
type="button"
|
||||
data-delete={ "/org/assignments/" + a.ID }
|
||||
class="text-muted hover:text-down"
|
||||
aria-label={ i18n.T(ctx, "members.unassign") }
|
||||
>×</button>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td class="py-2.5 text-right">
|
||||
@ownerAction(v, m)
|
||||
if v.CanManage && !m.IsOwner {
|
||||
<details class="inline-block text-left">
|
||||
<summary class="cursor-pointer text-muted hover:text-ink">{ i18n.T(ctx, "sso.action.edit") }</summary>
|
||||
<div class="mt-3 w-64">
|
||||
<form data-api={ "/org/members/" + m.UserID + "/roles" } data-next="/settings/members">
|
||||
@formError()
|
||||
@roleSelect(v.Roles, "role_id")
|
||||
<label class="mt-3 block">
|
||||
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "members.scope") }</span>
|
||||
<select name="scope" data-scope class="w-full border border-rule bg-transparent px-2 py-1.5 text-sm">
|
||||
<option value="">{ i18n.T(ctx, "members.scope_org") }</option>
|
||||
for _, sc := range v.Scopes {
|
||||
<option value={ sc.Value }>{ sc.Label }</option>
|
||||
}
|
||||
</select>
|
||||
</label>
|
||||
@submit(i18n.T(ctx, "members.assign"))
|
||||
</form>
|
||||
<button
|
||||
type="button"
|
||||
data-delete={ "/org/assignments/" + a.ID }
|
||||
class="text-muted hover:text-down"
|
||||
aria-label={ i18n.T(ctx, "members.unassign") }
|
||||
>×</button>
|
||||
}
|
||||
</li>
|
||||
data-delete={ "/org/members/" + m.UserID }
|
||||
data-confirm={ i18n.T(ctx, "members.remove_confirm") }
|
||||
class="mt-4 text-sm text-down hover:underline"
|
||||
>{ i18n.T(ctx, "members.remove") }</button>
|
||||
</div>
|
||||
</details>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td class="py-2.5 text-right">
|
||||
@ownerAction(v, m)
|
||||
if v.CanManage && !m.IsOwner {
|
||||
<details class="inline-block text-left">
|
||||
<summary class="cursor-pointer text-muted hover:text-ink">{ i18n.T(ctx, "sso.action.edit") }</summary>
|
||||
<div class="mt-3 w-64">
|
||||
<form data-api={ "/org/members/" + m.UserID + "/roles" } data-next="/settings/members">
|
||||
@formError()
|
||||
@roleSelect(v.Roles, "role_id")
|
||||
<label class="mt-3 block">
|
||||
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "members.scope") }</span>
|
||||
<select name="scope" data-scope class="w-full border border-rule bg-transparent px-2 py-1.5 text-sm">
|
||||
<option value="">{ i18n.T(ctx, "members.scope_org") }</option>
|
||||
for _, sc := range v.Scopes {
|
||||
<option value={ sc.Value }>{ sc.Label }</option>
|
||||
}
|
||||
</select>
|
||||
</label>
|
||||
@submit(i18n.T(ctx, "members.assign"))
|
||||
</form>
|
||||
<button
|
||||
type="button"
|
||||
data-delete={ "/org/members/" + m.UserID }
|
||||
data-confirm={ i18n.T(ctx, "members.remove_confirm") }
|
||||
class="mt-4 text-sm text-down hover:underline"
|
||||
>{ i18n.T(ctx, "members.remove") }</button>
|
||||
</div>
|
||||
</details>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@pager(v.Pager, "previous", "next")
|
||||
if v.CanManage {
|
||||
<div class="grid gap-12 md:grid-cols-2">
|
||||
@@ -313,49 +315,51 @@ templ TokensPage(p Page, me Me, v TokensView) {
|
||||
<p class="-mt-4 mb-8 text-sm">{ i18n.T(ctx, "tokens.policy", "Count", v.MaxDays) }</p>
|
||||
}
|
||||
if len(v.Tokens) > 0 {
|
||||
<table class="mb-12 w-full text-left text-sm">
|
||||
<thead class="border-b border-rule text-xs uppercase tracking-wider text-muted">
|
||||
<tr>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "sso.field.name") }</th>
|
||||
if v.ShowOwner {
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.owner") }</th>
|
||||
}
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.permissions") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.created") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.expires") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.last_used") }</th>
|
||||
<th class="py-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-rule">
|
||||
for _, t := range v.Tokens {
|
||||
<tr class="align-top">
|
||||
<td class="py-2.5 pr-4">{ t.Name } <span class="block font-mono text-xs text-muted">{ t.Prefix }…</span></td>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="mb-12 w-full text-left text-sm">
|
||||
<thead class="border-b border-rule text-xs uppercase tracking-wider text-muted">
|
||||
<tr>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "sso.field.name") }</th>
|
||||
if v.ShowOwner {
|
||||
<td class="py-2.5 pr-4">{ t.UserEmail }</td>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.owner") }</th>
|
||||
}
|
||||
<td class="py-2.5 pr-4">
|
||||
<ul class="flex max-w-xs flex-wrap gap-1 text-xs">
|
||||
for _, perm := range t.Permissions {
|
||||
<li class="border border-rule px-1 py-px">{ i18n.T(ctx, "perm."+perm) }</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td class="py-2.5 pr-4 whitespace-nowrap font-mono text-xs">{ t.CreatedAt }</td>
|
||||
<td class="py-2.5 pr-4 whitespace-nowrap font-mono text-xs">{ t.ExpiresAt }</td>
|
||||
<td class="py-2.5 pr-4 whitespace-nowrap font-mono text-xs">{ t.LastUsedAt }</td>
|
||||
<td class="py-2.5 text-right">
|
||||
<button
|
||||
type="button"
|
||||
data-delete={ "/org/tokens/" + t.ID }
|
||||
data-confirm={ i18n.T(ctx, "tokens.revoke_confirm") }
|
||||
class="text-muted hover:text-down"
|
||||
>{ i18n.T(ctx, "members.revoke") }</button>
|
||||
</td>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.permissions") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.created") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.expires") }</th>
|
||||
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "tokens.last_used") }</th>
|
||||
<th class="py-2"></th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-rule">
|
||||
for _, t := range v.Tokens {
|
||||
<tr class="align-top">
|
||||
<td class="py-2.5 pr-4">{ t.Name } <span class="block font-mono text-xs text-muted">{ t.Prefix }…</span></td>
|
||||
if v.ShowOwner {
|
||||
<td class="py-2.5 pr-4">{ t.UserEmail }</td>
|
||||
}
|
||||
<td class="py-2.5 pr-4">
|
||||
<ul class="flex max-w-xs flex-wrap gap-1 text-xs">
|
||||
for _, perm := range t.Permissions {
|
||||
<li class="border border-rule px-1 py-px">{ i18n.T(ctx, "perm."+perm) }</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td class="py-2.5 pr-4 whitespace-nowrap font-mono text-xs">{ t.CreatedAt }</td>
|
||||
<td class="py-2.5 pr-4 whitespace-nowrap font-mono text-xs">{ t.ExpiresAt }</td>
|
||||
<td class="py-2.5 pr-4 whitespace-nowrap font-mono text-xs">{ t.LastUsedAt }</td>
|
||||
<td class="py-2.5 text-right">
|
||||
<button
|
||||
type="button"
|
||||
data-delete={ "/org/tokens/" + t.ID }
|
||||
data-confirm={ i18n.T(ctx, "tokens.revoke_confirm") }
|
||||
class="text-muted hover:text-down"
|
||||
>{ i18n.T(ctx, "members.revoke") }</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
<section class="max-w-xl">
|
||||
@sectionHeading("tokens.create")
|
||||
@@ -454,7 +458,7 @@ templ InvitationPage(p Page, v Invitation) {
|
||||
} else {
|
||||
<p class="mb-6 text-sm">{ i18n.T(ctx, "invite.summary", "Org", v.OrgName, "Role", v.RoleName) }</p>
|
||||
<p class="mb-6 font-mono text-sm">{ v.Email }</p>
|
||||
switch {
|
||||
switch {
|
||||
case v.SignedInAs == v.Email:
|
||||
<form data-api={ "/invitations/" + v.Token + "/accept" } data-next="/">
|
||||
@formError()
|
||||
@@ -499,7 +503,7 @@ templ tokenUsage() {
|
||||
// own included, as long as another owner remains.
|
||||
templ ownerAction(v MembersView, m Member) {
|
||||
if v.IsOwner {
|
||||
switch {
|
||||
switch {
|
||||
case !m.IsOwner:
|
||||
@ownerForm(m.UserID, true, i18n.T(ctx, "members.make_owner"), i18n.T(ctx, "members.make_owner_confirm", "Email", m.Email))
|
||||
case v.Owners > 1 && m.UserID == v.Self:
|
||||
|
||||
Reference in new issue
Block a user