"use client";
import { useEffect, useState } from "react";
import { BookOpen, Database, HardDrive, KeyRound, LogOut, Server, ShieldCheck, SlidersHorizontal, User, Workflow } from "lucide-react";
import { API_BASE, AUTH_MODE, formatBytes } from "@/app/lib/dashboard";
import { useDashboard } from "@/components/altdock/dashboard-provider";
import { Button } from "@/components/ui/button";
import type { Identity } from "@/packages/core/src/index";
function SettingRow({ icon: Icon, label, value, hint }: { icon: typeof User; label: string; value: React.ReactNode; hint?: string }) {
return
{label}{value}{hint && {hint}}
;
}
function Section({ title, description, children }: { title: string; description: string; children: React.ReactNode }) {
return ;
}
export default function SettingsPage() {
const { dashboard } = useDashboard();
const [identity, setIdentity] = useState(null);
useEffect(() => {
if (AUTH_MODE !== "oidc") return;
let cancelled = false;
fetch(`${API_BASE}/api/v1/me`, { credentials: "include" })
.then((response) => response.ok ? response.json() : null)
.then((body) => { if (!cancelled && body?.identity) setIdentity(body.identity as Identity); })
.catch(() => {});
return () => { cancelled = true; };
}, []);
const storagePercent = dashboard ? Math.min(100, (dashboard.usage.storageBytes / Math.max(1, dashboard.limits.maxStorageBytes)) * 100) : 0;
return <>
WORKSPACE SETTINGS
設定
Workspace・認証・配布上限の状態を確認できます。
{dashboard?.workspace.slug || "—"}} />
OIDC SSO : Demo mode} hint={AUTH_MODE === "oidc" ? "汎用OIDCプロバイダでログインしています" : "開発用の簡易認証です。本番ではOIDCを推奨します"} />
{AUTH_MODE === "oidc" && ログイン中 : セッション確認中…} />}
{formatBytes(dashboard?.usage.storageBytes || 0)} / {formatBytes(dashboard?.limits.maxStorageBytes || 0)}{storagePercent.toFixed(1)}%
ADP ZIP本体と公開済みアセットの合計サイズ
{API_BASE}} />
/healthz を開く} />
/version を開く} />
AltDock 管理画面Source・アプリ・リリースは左のナビゲーションから操作できます。
{AUTH_MODE === "oidc" && }
>;
}