refactor(ui): replace remaining hardcoded port defaults

- use shared cliproxy default in control panel embed

- use shared cursor default port in cursor page fallbacks
This commit is contained in:
Tam Nhu Tran
2026-02-18 03:10:10 +07:00
parent 5788ddc3b7
commit 70116cb3a1
2 changed files with 4 additions and 6 deletions
@@ -11,9 +11,7 @@ import { RefreshCw, AlertCircle, Key, X, Gauge, Globe, Settings } from 'lucide-r
import { useQuery } from '@tanstack/react-query';
import { api } from '@/lib/api-client';
import type { CliproxyServerConfig } from '@/lib/api-client';
/** CLIProxyAPI default port */
const CLIPROXY_DEFAULT_PORT = 8317;
import { CLIPROXY_DEFAULT_PORT } from '@/lib/preset-utils';
interface AuthTokensResponse {
apiKey: { value: string; isCustom: boolean };
+3 -3
View File
@@ -23,7 +23,7 @@ import {
XCircle,
} from 'lucide-react';
import { cn } from '@/lib/utils';
import { useCursor } from '@/hooks/use-cursor';
import { DEFAULT_CURSOR_PORT, useCursor } from '@/hooks/use-cursor';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
@@ -77,7 +77,7 @@ function buildConfigDraft(config?: {
haiku_model?: string;
}): CursorConfigDraft {
return {
port: String(config?.port ?? 20129),
port: String(config?.port ?? DEFAULT_CURSOR_PORT),
auto_start: config?.auto_start ?? false,
ghost_mode: config?.ghost_mode ?? true,
model: config?.model?.trim() || 'gpt-5.3-codex',
@@ -767,7 +767,7 @@ export function CursorPage() {
<div className="p-3 border-t bg-background text-xs text-muted-foreground">
<div className="flex items-center justify-between">
<span>Port</span>
<span>{status?.port ?? config?.port ?? 20129}</span>
<span>{status?.port ?? config?.port ?? DEFAULT_CURSOR_PORT}</span>
</div>
</div>
</div>