graphile_worker_admin_ui_client 0.1.3

Leptos WASM client for the embedded graphile_worker admin UI
Documentation
use leptos::prelude::*;

use super::super::types::AdminClientConfig;

#[component]
pub(super) fn Sidebar(config: AdminClientConfig) -> impl IntoView {
    view! {
    <aside class="gw-sidebar">
        <div class="flex items-center gap-3">
            <div class="flex h-10 w-10 items-center justify-center rounded-lg bg-cyan-600 text-white">
                <span class="i-lucide-workflow h-5 w-5"></span>
            </div>
            <div>
                <h1 class="text-base font-semibold">"Graphile Worker"</h1>
                <p class="gw-muted text-xs">"Admin UI"</p>
            </div>
        </div>

        <nav class="mt-6 grid gap-1">
            <a class="gw-tab" href="#jobs" aria-selected="true"><span class="i-lucide-list-checks h-4 w-4"></span>"Jobs"</a>
            <a class="gw-tab" href="#queues"><span class="i-lucide-git-branch h-4 w-4"></span>"Queues"</a>
            <a class="gw-tab" href="#workers"><span class="i-lucide-hard-drive h-4 w-4"></span>"Workers"</a>
            <a class="gw-tab" href="#maintenance"><span class="i-tabler-tool h-4 w-4"></span>"Maintenance"</a>
        </nav>

        <div class="mt-auto grid gap-3 rounded-lg border p-3 text-xs" style="border-color: rgb(var(--border));">
            <div class="flex items-center justify-between"><span class="gw-muted">"Schema"</span><span class="font-mono">{config.schema.clone()}</span></div>
            <div class="flex items-center justify-between"><span class="gw-muted">"Auth"</span><span class="gw-pill">{config.auth_mode.as_str()}</span></div>
            <div class="flex items-center justify-between"><span class="gw-muted">"Writes"</span><span class="gw-pill">{if config.read_only { "read only" } else { "enabled" }}</span></div>
        </div>
    </aside>
        }
}