feat(web): show monitors as a group tree and limit roles to groups
The dashboard nests groups with an aggregated status, the monitor editor offers the groups one may write to, a page manages groups, and members can be assigned roles limited to a group or a status page. Settings move to their own page to keep the navigation short. Closes #57 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
11482ec6d5
commit
b3f19e20ad
12 files changed
+2727
-1627
No files matched your search
+38
-17
@@ -45,29 +45,17 @@ templ consoleShell(p Page, me Me) {
|
||||
} else if len(me.Orgs) == 1 {
|
||||
<span class="text-muted">{ me.Orgs[0].Name }</span>
|
||||
}
|
||||
<nav class="ml-auto flex items-center gap-5">
|
||||
<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>
|
||||
}
|
||||
if me.Can["notifications.read"] {
|
||||
<a href="/settings/channels" class="text-muted hover:text-ink">{ i18n.T(ctx, "channels.title") }</a>
|
||||
}
|
||||
if me.Can["members.read"] {
|
||||
<a href="/settings/members" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.members") }</a>
|
||||
<a href="/settings/roles" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.roles") }</a>
|
||||
}
|
||||
if len(me.Orgs) > 0 {
|
||||
<a href="/settings/tokens" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.tokens") }</a>
|
||||
}
|
||||
if me.Can["org.manage"] {
|
||||
<a href="/settings/regions" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.regions") }</a>
|
||||
<a href="/settings/org" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.org") }</a>
|
||||
<a href="/settings/sso" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.sso") }</a>
|
||||
}
|
||||
<a href="/settings/security" class="text-muted hover:text-ink">{ i18n.T(ctx, "console.nav.security") }</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>
|
||||
}
|
||||
@@ -177,3 +165,36 @@ templ policyBanner(msgID, actionID, href string) {
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ settingsLink(href, titleID, hintID string) {
|
||||
<a href={ templ.SafeURL(href) } class="block border border-rule p-4 hover:border-ink">
|
||||
<span class="block font-medium">{ i18n.T(ctx, titleID) }</span>
|
||||
<span class="mt-1 block text-sm text-muted">{ i18n.T(ctx, hintID) }</span>
|
||||
</a>
|
||||
}
|
||||
|
||||
// SettingsIndex lists the settings the user may open.
|
||||
templ SettingsIndex(p Page, me Me) {
|
||||
@consoleShell(p, me) {
|
||||
@settingsHeading("console.nav.settings", "")
|
||||
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
if me.Can["notifications.read"] {
|
||||
@settingsLink("/settings/channels", "channels.title", "settings.channels")
|
||||
}
|
||||
@settingsLink("/groups", "groups.title", "settings.groups")
|
||||
if me.Can["members.read"] {
|
||||
@settingsLink("/settings/members", "console.nav.members", "settings.members")
|
||||
@settingsLink("/settings/roles", "console.nav.roles", "settings.roles")
|
||||
}
|
||||
if len(me.Orgs) > 0 {
|
||||
@settingsLink("/settings/tokens", "console.nav.tokens", "settings.tokens")
|
||||
}
|
||||
if me.Can["org.manage"] {
|
||||
@settingsLink("/settings/regions", "console.nav.regions", "settings.regions")
|
||||
@settingsLink("/settings/org", "console.nav.org", "settings.org")
|
||||
@settingsLink("/settings/sso", "console.nav.sso", "settings.sso")
|
||||
}
|
||||
@settingsLink("/settings/security", "console.nav.security", "settings.security")
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user