mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 06:17:09 +00:00
fix(ui): hide local paths in remote CLIProxy mode
This commit is contained in:
@@ -31,6 +31,7 @@ export function ProviderEditor({
|
||||
authStatus,
|
||||
catalog,
|
||||
logoProvider,
|
||||
isRemoteMode,
|
||||
onAddAccount,
|
||||
onSetDefault,
|
||||
onRemoveAccount,
|
||||
@@ -124,6 +125,7 @@ export function ProviderEditor({
|
||||
hasChanges={hasChanges}
|
||||
isRawJsonValid={isRawJsonValid}
|
||||
isSaving={saveMutation.isPending}
|
||||
isRemoteMode={isRemoteMode}
|
||||
onRefetch={refetch}
|
||||
onSave={() => saveMutation.mutate()}
|
||||
/>
|
||||
|
||||
@@ -18,6 +18,7 @@ interface ProviderEditorHeaderProps {
|
||||
hasChanges: boolean;
|
||||
isRawJsonValid: boolean;
|
||||
isSaving: boolean;
|
||||
isRemoteMode?: boolean;
|
||||
onRefetch: () => void;
|
||||
onSave: () => void;
|
||||
}
|
||||
@@ -31,6 +32,7 @@ export function ProviderEditorHeader({
|
||||
hasChanges,
|
||||
isRawJsonValid,
|
||||
isSaving,
|
||||
isRemoteMode,
|
||||
onRefetch,
|
||||
onSave,
|
||||
}: ProviderEditorHeaderProps) {
|
||||
@@ -41,13 +43,13 @@ export function ProviderEditorHeader({
|
||||
<div>
|
||||
<div className="flex items-center gap-2">
|
||||
<h2 className="text-lg font-semibold">{displayName}</h2>
|
||||
{data?.path && (
|
||||
{!isRemoteMode && data?.path && (
|
||||
<Badge variant="outline" className="text-xs">
|
||||
{data.path.replace(/^.*\//, '')}
|
||||
{data.path.replace(/^.*[\\/]/, '')}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
{data && (
|
||||
{!isRemoteMode && data && (
|
||||
<p className="text-xs text-muted-foreground mt-0.5">
|
||||
Last modified: {new Date(data.mtime).toLocaleString()}
|
||||
</p>
|
||||
|
||||
@@ -21,6 +21,8 @@ export interface ProviderEditorProps {
|
||||
catalog?: ProviderCatalog;
|
||||
/** Provider type for logo display (defaults to provider) */
|
||||
logoProvider?: string;
|
||||
/** True if using remote CLIProxy mode (hides local paths) */
|
||||
isRemoteMode?: boolean;
|
||||
onAddAccount: () => void;
|
||||
onSetDefault: (accountId: string) => void;
|
||||
onRemoveAccount: (accountId: string) => void;
|
||||
|
||||
@@ -249,7 +249,8 @@ export const api = {
|
||||
},
|
||||
cliproxy: {
|
||||
list: () => request<{ variants: Variant[] }>('/cliproxy'),
|
||||
getAuthStatus: () => request<{ authStatus: AuthStatus[] }>('/cliproxy/auth'),
|
||||
getAuthStatus: () =>
|
||||
request<{ authStatus: AuthStatus[]; source?: 'remote' | 'local' }>('/cliproxy/auth'),
|
||||
create: (data: CreateVariant) =>
|
||||
request('/cliproxy', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -192,6 +192,7 @@ export function CliproxyPage() {
|
||||
} | null>(null);
|
||||
|
||||
const providers = useMemo(() => authData?.authStatus || [], [authData?.authStatus]);
|
||||
const isRemoteMode = authData?.source === 'remote';
|
||||
const variants = useMemo(() => variantsData?.variants || [], [variantsData?.variants]);
|
||||
|
||||
// Auto-select first provider if nothing selected
|
||||
@@ -338,6 +339,7 @@ export function CliproxyPage() {
|
||||
authStatus={parentAuthForVariant}
|
||||
catalog={MODEL_CATALOGS[selectedVariantData.provider]}
|
||||
logoProvider={selectedVariantData.provider}
|
||||
isRemoteMode={isRemoteMode}
|
||||
onAddAccount={() =>
|
||||
setAddAccountProvider({
|
||||
provider: selectedVariantData.provider,
|
||||
@@ -365,6 +367,7 @@ export function CliproxyPage() {
|
||||
displayName={selectedStatus.displayName}
|
||||
authStatus={selectedStatus}
|
||||
catalog={MODEL_CATALOGS[selectedStatus.provider]}
|
||||
isRemoteMode={isRemoteMode}
|
||||
onAddAccount={() =>
|
||||
setAddAccountProvider({
|
||||
provider: selectedStatus.provider,
|
||||
|
||||
Reference in New Issue
Block a user