mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
feat(db): migrate from lowdb to SQLite with repos pattern
- Add modular DB layer (adapters, migrations, repos, helpers) - Replace localDb/usageDb/requestDetailsDb monoliths with repos - Add Tailscale tunnel integration & status check API - Add /api/cli-tools/all-statuses aggregated endpoint - Add settingsStore (Zustand) and mitm/dbReader - Add DB unit tests (benchmark, concurrent, migration, vs-lowdb)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"use server";
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { GET as claudeGet } from "../claude-settings/route";
|
||||
import { GET as codexGet } from "../codex-settings/route";
|
||||
import { GET as opencodeGet } from "../opencode-settings/route";
|
||||
import { GET as droidGet } from "../droid-settings/route";
|
||||
import { GET as openclawGet } from "../openclaw-settings/route";
|
||||
import { GET as hermesGet } from "../hermes-settings/route";
|
||||
import { GET as coworkGet } from "../cowork-settings/route";
|
||||
import { GET as copilotGet } from "../copilot-settings/route";
|
||||
|
||||
const STATUS_GETTERS = {
|
||||
claude: claudeGet,
|
||||
codex: codexGet,
|
||||
opencode: opencodeGet,
|
||||
droid: droidGet,
|
||||
openclaw: openclawGet,
|
||||
hermes: hermesGet,
|
||||
cowork: coworkGet,
|
||||
copilot: copilotGet,
|
||||
};
|
||||
|
||||
// Batch endpoint: gather all CLI tool statuses in one round-trip
|
||||
export async function GET() {
|
||||
const entries = await Promise.all(
|
||||
Object.entries(STATUS_GETTERS).map(async ([toolId, getter]) => {
|
||||
try {
|
||||
const res = await getter();
|
||||
const data = await res.json();
|
||||
return [toolId, data];
|
||||
} catch {
|
||||
return [toolId, null];
|
||||
}
|
||||
})
|
||||
);
|
||||
return NextResponse.json(Object.fromEntries(entries));
|
||||
}
|
||||
Reference in New Issue
Block a user