37 lines
2.1 KiB
Svelte
37 lines
2.1 KiB
Svelte
<script lang="ts">
|
||
import { page } from '$app/state';
|
||
let { data, children } = $props();
|
||
const can = (permission: string) => data.permissions.includes('*') || data.permissions.includes(permission);
|
||
const dataSections = [
|
||
{ href: '/admin/stats', label: 'Stats & attributes', code: 'ATTR' },
|
||
{ href: '/admin/talents', label: 'Talents & triggers', code: 'TLNT' },
|
||
{ href: '/admin/brands', label: 'Brand sets', code: 'BRND' },
|
||
{ href: '/admin/gear', label: 'Gear', code: 'GEAR' },
|
||
{ href: '/admin/weapons', label: 'Weapons', code: 'WPN' }
|
||
];
|
||
const userSections = [{ href: '/admin/users', label: 'User operations', code: 'USER' }];
|
||
</script>
|
||
|
||
<main class="admin-page">
|
||
<header class="admin-command">
|
||
<div class="command-title"><p class="eyebrow"><span></span> INTELLIGENT SYSTEM ANALYTIC COMPUTER</p><h1>ISAC</h1><p>SHD.build operations and intelligence control surface</p></div>
|
||
<div class="command-status"><div><i></i><span>SYSTEM</span><strong>ONLINE</strong></div><div><span>ACCESS</span><strong>AUTHORIZED</strong></div><div><span>ENVIRONMENT</span><strong>LOCAL</strong></div></div>
|
||
</header>
|
||
<div class="admin-dashboard">
|
||
<aside class="admin-sidebar">
|
||
{#if can('users.view')}
|
||
<div class="sidebar-label"><span>USER OPERATIONS</span><b>01 MODULE</b></div>
|
||
<nav aria-label="User operations">{#each userSections as section}<a class:active={page.url.pathname.startsWith(section.href)} href={section.href}><small>{section.code}</small><span>{section.label}</span><b>›</b></a>{/each}</nav>
|
||
{/if}
|
||
{#if can('data.manage')}
|
||
<div class="sidebar-label section-label"><span>DATA MANAGEMENT</span><b>05 MODULES</b></div>
|
||
<nav aria-label="Data management">
|
||
{#each dataSections as section}<a class:active={page.url.pathname === section.href} href={section.href}><small>{section.code}</small><span>{section.label}</span><b>›</b></a>{/each}
|
||
</nav>
|
||
{/if}
|
||
<div class="sidebar-foot"><span>ISAC NODE</span><strong>NYC-01</strong><small>Access policy synchronized</small></div>
|
||
</aside>
|
||
<section class="admin-content">{@render children()}</section>
|
||
</div>
|
||
</main>
|