"use client"; import { useState, useEffect } from "react"; import { Card, Button, Badge, Toggle } from "@/shared/components"; import { useTheme } from "@/shared/hooks/useTheme"; import { APP_CONFIG } from "@/shared/constants/config"; export default function ProfilePage() { const { theme, setTheme, isDark } = useTheme(); const [settings, setSettings] = useState({ fallbackStrategy: "fill-first" }); const [loading, setLoading] = useState(true); useEffect(() => { fetch("/api/settings") .then((res) => res.json()) .then((data) => { setSettings(data); setLoading(false); }) .catch((err) => { console.error("Failed to fetch settings:", err); setLoading(false); }); }, []); const updateFallbackStrategy = async (strategy) => { try { const res = await fetch("/api/settings", { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ fallbackStrategy: strategy }), }); if (res.ok) { setSettings(prev => ({ ...prev, fallbackStrategy: strategy })); } } catch (err) { console.error("Failed to update settings:", err); } }; return (
Running on your machine
All data is stored locally in the data/db.json file.
Round Robin
Cycle through accounts to distribute load
{settings.fallbackStrategy === "round-robin" ? "Currently distributing requests across all available accounts." : "Currently using accounts in priority order (Fill First)."}
Dark Mode
Switch between light and dark themes
Database Location
~/9router/data/db.json
{APP_CONFIG.name} v{APP_CONFIG.version}
Local Mode - All data stored on your machine