forked from baron/baron-sso
fix: ensure all manageable tenants are visible for tenant admin and refine overview UI
This commit is contained in:
@@ -20,41 +20,6 @@ import { t } from "../../lib/i18n";
|
||||
import { RoleGuard } from "../../components/auth/RoleGuard";
|
||||
import PermissionChecker from "./components/PermissionChecker";
|
||||
|
||||
const summaryCards = [
|
||||
{
|
||||
labelKey: "ui.admin.overview.summary.total_tenants",
|
||||
labelFallback: "Total Tenants",
|
||||
value: "-",
|
||||
hintKey: "msg.admin.overview.summary.total_tenants",
|
||||
hintFallback: "Tenant-aware core",
|
||||
icon: Users,
|
||||
},
|
||||
{
|
||||
labelKey: "ui.admin.overview.summary.oidc_clients",
|
||||
labelFallback: "OIDC Clients",
|
||||
value: "-",
|
||||
hintKey: "msg.admin.overview.summary.oidc_clients",
|
||||
hintFallback: "Hydra registry",
|
||||
icon: ShieldCheck,
|
||||
},
|
||||
{
|
||||
labelKey: "ui.admin.overview.summary.audit_events_24h",
|
||||
labelFallback: "Audit Events (24h)",
|
||||
value: "-",
|
||||
hintKey: "msg.admin.overview.summary.audit_events_24h",
|
||||
hintFallback: "ClickHouse stream",
|
||||
icon: Activity,
|
||||
},
|
||||
{
|
||||
labelKey: "ui.admin.overview.summary.policy_gate",
|
||||
labelFallback: "Policy Gate",
|
||||
value: "Planned",
|
||||
hintKey: "msg.admin.overview.summary.policy_gate",
|
||||
hintFallback: "Keto + Admin checks",
|
||||
icon: Database,
|
||||
},
|
||||
];
|
||||
|
||||
function GlobalOverviewPage() {
|
||||
return (
|
||||
<div className="space-y-10">
|
||||
@@ -73,42 +38,79 @@ function GlobalOverviewPage() {
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant="muted">
|
||||
{t("msg.admin.overview.idp_primary", "IDP: Ory primary")}
|
||||
</Badge>
|
||||
<Badge variant="muted">
|
||||
{t("msg.admin.overview.idp_fallback", "Fallback: Descope")}
|
||||
</Badge>
|
||||
</div>
|
||||
<RoleGuard roles={["super_admin"]}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant="muted">
|
||||
{t("msg.admin.overview.idp_primary", "IDP: Ory primary")}
|
||||
</Badge>
|
||||
<Badge variant="muted">
|
||||
{t("msg.admin.overview.idp_fallback", "Fallback: Descope")}
|
||||
</Badge>
|
||||
</div>
|
||||
</RoleGuard>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
||||
{summaryCards.map(
|
||||
({
|
||||
labelKey,
|
||||
labelFallback,
|
||||
value,
|
||||
hintKey,
|
||||
hintFallback,
|
||||
icon: Icon,
|
||||
}) => (
|
||||
<Card key={labelKey} className="bg-[var(--color-panel)]">
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardDescription>{t(labelKey, labelFallback)}</CardDescription>
|
||||
<div className="rounded-full border border-[var(--color-border)] p-2 text-[var(--color-muted)]">
|
||||
<Icon size={16} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-semibold">{value}</div>
|
||||
<p className="mt-1 text-xs text-[var(--color-muted)]">
|
||||
{t(hintKey, hintFallback)}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
),
|
||||
)}
|
||||
<RoleGuard roles={["super_admin"]}>
|
||||
<Card className="bg-[var(--color-panel)]">
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardDescription>{t("ui.admin.overview.summary.total_tenants", "Total Tenants")}</CardDescription>
|
||||
<div className="rounded-full border border-[var(--color-border)] p-2 text-[var(--color-muted)]">
|
||||
<Users size={16} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-semibold">-</div>
|
||||
<p className="mt-1 text-xs text-[var(--color-muted)]">
|
||||
{t("msg.admin.overview.summary.total_tenants", "Tenant-aware core")}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card className="bg-[var(--color-panel)]">
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardDescription>{t("ui.admin.overview.summary.oidc_clients", "OIDC Clients")}</CardDescription>
|
||||
<div className="rounded-full border border-[var(--color-border)] p-2 text-[var(--color-muted)]">
|
||||
<ShieldCheck size={16} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-semibold">-</div>
|
||||
<p className="mt-1 text-xs text-[var(--color-muted)]">
|
||||
{t("msg.admin.overview.summary.oidc_clients", "Hydra registry")}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</RoleGuard>
|
||||
|
||||
<Card className="bg-[var(--color-panel)]">
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardDescription>{t("ui.admin.overview.summary.audit_events_24h", "Audit Events (24h)")}</CardDescription>
|
||||
<div className="rounded-full border border-[var(--color-border)] p-2 text-[var(--color-muted)]">
|
||||
<Activity size={16} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-semibold">-</div>
|
||||
<p className="mt-1 text-xs text-[var(--color-muted)]">
|
||||
{t("msg.admin.overview.summary.audit_events_24h", "ClickHouse stream")}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card className="bg-[var(--color-panel)]">
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardDescription>{t("ui.admin.overview.summary.policy_gate", "Policy Gate")}</CardDescription>
|
||||
<div className="rounded-full border border-[var(--color-border)] p-2 text-[var(--color-muted)]">
|
||||
<Database size={16} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-semibold">Planned</div>
|
||||
<p className="mt-1 text-xs text-[var(--color-muted)]">
|
||||
{t("msg.admin.overview.summary.policy_gate", "Keto + Admin checks")}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-6 lg:grid-cols-[1.4fr,1fr]">
|
||||
|
||||
Reference in New Issue
Block a user