mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-05 18:23:45 +00:00
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:
@@ -11,9 +11,7 @@ import { RefreshCw, AlertCircle, Key, X, Gauge, Globe, Settings } from 'lucide-r
|
|||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { api } from '@/lib/api-client';
|
import { api } from '@/lib/api-client';
|
||||||
import type { CliproxyServerConfig } from '@/lib/api-client';
|
import type { CliproxyServerConfig } from '@/lib/api-client';
|
||||||
|
import { CLIPROXY_DEFAULT_PORT } from '@/lib/preset-utils';
|
||||||
/** CLIProxyAPI default port */
|
|
||||||
const CLIPROXY_DEFAULT_PORT = 8317;
|
|
||||||
|
|
||||||
interface AuthTokensResponse {
|
interface AuthTokensResponse {
|
||||||
apiKey: { value: string; isCustom: boolean };
|
apiKey: { value: string; isCustom: boolean };
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
XCircle,
|
XCircle,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
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 { Button } from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
@@ -77,7 +77,7 @@ function buildConfigDraft(config?: {
|
|||||||
haiku_model?: string;
|
haiku_model?: string;
|
||||||
}): CursorConfigDraft {
|
}): CursorConfigDraft {
|
||||||
return {
|
return {
|
||||||
port: String(config?.port ?? 20129),
|
port: String(config?.port ?? DEFAULT_CURSOR_PORT),
|
||||||
auto_start: config?.auto_start ?? false,
|
auto_start: config?.auto_start ?? false,
|
||||||
ghost_mode: config?.ghost_mode ?? true,
|
ghost_mode: config?.ghost_mode ?? true,
|
||||||
model: config?.model?.trim() || 'gpt-5.3-codex',
|
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="p-3 border-t bg-background text-xs text-muted-foreground">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span>Port</span>
|
<span>Port</span>
|
||||||
<span>{status?.port ?? config?.port ?? 20129}</span>
|
<span>{status?.port ?? config?.port ?? DEFAULT_CURSOR_PORT}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user