Refactor error handling and localDb structure, and fix usage tracking bug.
This commit is contained in:
parent
3badf1cbb6
commit
75ad0bef8e
13 changed files with 162 additions and 109 deletions
|
|
@ -120,6 +120,7 @@ export async function POST(request) {
|
|||
// Merge new env with existing settings
|
||||
const newSettings = {
|
||||
...currentSettings,
|
||||
hasCompletedOnboarding: true,
|
||||
env: {
|
||||
...(currentSettings.env || {}),
|
||||
...env,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { getTunnelStatus, getTailscaleStatus } from "@/lib/tunnel/tunnelManager";
|
||||
import { getDownloadStatus } from "@/lib/tunnel/cloudflared";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const [tunnel, tailscale] = await Promise.all([getTunnelStatus(), getTailscaleStatus()]);
|
||||
return NextResponse.json({ tunnel, tailscale });
|
||||
const download = getDownloadStatus();
|
||||
return NextResponse.json({ tunnel, tailscale, download });
|
||||
} catch (error) {
|
||||
console.error("Tunnel status error:", error);
|
||||
return NextResponse.json({ error: error.message }, { status: 500 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue