refactor: update MitmServerCard and MitmToolCard to use modalError instead of message for error handling
- Replaced message state with modalError in both components for better error management. - Removed unused message display logic and adjusted action handling to improve clarity. - Enhanced error handling in doAction and doDnsAction functions to ignore errors gracefully. - Updated API call responses to streamline user feedback on actions.
This commit is contained in:
@@ -43,7 +43,7 @@ export async function GET() {
|
||||
certExists: status.certExists || false,
|
||||
certTrusted: status.certTrusted || false,
|
||||
dnsStatus: status.dnsStatus || {},
|
||||
hasCachedPassword: !!getCachedPassword(),
|
||||
hasCachedPassword: !!getCachedPassword() || !!(await loadEncryptedPassword()),
|
||||
isAdmin: checkIsAdmin(),
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { enableTunnel } from "@/lib/tunnel/tunnelManager";
|
||||
|
||||
const DNS_WARMUP_DELAY_MS = 8000;
|
||||
|
||||
export async function POST() {
|
||||
try {
|
||||
const result = await enableTunnel();
|
||||
// Wait for DNS warmup to propagate at Cloudflare edge after tunnel registered
|
||||
await new Promise((r) => setTimeout(r, DNS_WARMUP_DELAY_MS));
|
||||
return NextResponse.json(result);
|
||||
} catch (error) {
|
||||
console.error("Tunnel enable error:", error);
|
||||
|
||||
Reference in New Issue
Block a user