mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-19 11:10:49 +08:00
feat(ui): show AIStudio models for virtual auth files and adjust Gemini OAuth spacing
This commit is contained in:
@@ -719,9 +719,11 @@ export function AuthFilesPage() {
|
|||||||
const renderFileCard = (item: AuthFileItem) => {
|
const renderFileCard = (item: AuthFileItem) => {
|
||||||
const fileStats = resolveAuthFileStats(item, keyStats);
|
const fileStats = resolveAuthFileStats(item, keyStats);
|
||||||
const isRuntimeOnly = isRuntimeOnlyAuthFile(item);
|
const isRuntimeOnly = isRuntimeOnlyAuthFile(item);
|
||||||
|
const isAistudio = (item.type || '').toLowerCase() === 'aistudio';
|
||||||
|
const showModelsButton = !isRuntimeOnly || isAistudio;
|
||||||
const typeColor = getTypeColor(item.type || 'unknown');
|
const typeColor = getTypeColor(item.type || 'unknown');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={item.name} className={styles.fileCard}>
|
<div key={item.name} className={styles.fileCard}>
|
||||||
<div className={styles.cardHeader}>
|
<div className={styles.cardHeader}>
|
||||||
<span
|
<span
|
||||||
@@ -753,29 +755,29 @@ export function AuthFilesPage() {
|
|||||||
|
|
||||||
{/* 状态监测栏 */}
|
{/* 状态监测栏 */}
|
||||||
{renderStatusBar(item)}
|
{renderStatusBar(item)}
|
||||||
|
|
||||||
<div className={styles.cardActions}>
|
<div className={styles.cardActions}>
|
||||||
{isRuntimeOnly ? (
|
{showModelsButton && (
|
||||||
<div className={styles.virtualBadge}>{t('auth_files.type_virtual') || '虚拟认证文件'}</div>
|
<Button
|
||||||
) : (
|
variant="secondary"
|
||||||
<>
|
size="sm"
|
||||||
<Button
|
onClick={() => showModels(item)}
|
||||||
variant="secondary"
|
className={styles.iconButton}
|
||||||
size="sm"
|
title={t('auth_files.models_button', { defaultValue: '模型' })}
|
||||||
onClick={() => showModels(item)}
|
disabled={disableControls}
|
||||||
className={styles.iconButton}
|
>
|
||||||
title={t('auth_files.models_button', { defaultValue: '模型' })}
|
<IconBot className={styles.actionIcon} size={16} />
|
||||||
disabled={disableControls}
|
</Button>
|
||||||
>
|
)}
|
||||||
<IconBot className={styles.actionIcon} size={16} />
|
{!isRuntimeOnly && (
|
||||||
</Button>
|
<>
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => showDetails(item)}
|
onClick={() => showDetails(item)}
|
||||||
className={styles.iconButton}
|
className={styles.iconButton}
|
||||||
title={t('common.info', { defaultValue: '关于' })}
|
title={t('common.info', { defaultValue: '关于' })}
|
||||||
disabled={disableControls}
|
disabled={disableControls}
|
||||||
>
|
>
|
||||||
<IconInfo className={styles.actionIcon} size={16} />
|
<IconInfo className={styles.actionIcon} size={16} />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -799,13 +801,16 @@ export function AuthFilesPage() {
|
|||||||
>
|
>
|
||||||
{deleting === item.name ? (
|
{deleting === item.name ? (
|
||||||
<LoadingSpinner size={14} />
|
<LoadingSpinner size={14} />
|
||||||
) : (
|
) : (
|
||||||
<IconTrash2 className={styles.actionIcon} size={16} />
|
<IconTrash2 className={styles.actionIcon} size={16} />
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
{isRuntimeOnly && (
|
||||||
|
<div className={styles.virtualBadge}>{t('auth_files.type_virtual') || '虚拟认证文件'}</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -115,6 +115,13 @@
|
|||||||
margin-top: $spacing-sm;
|
margin-top: $spacing-sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.geminiProjectField {
|
||||||
|
:global(.form-group) {
|
||||||
|
margin-top: $spacing-sm;
|
||||||
|
gap: $spacing-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.filePicker {
|
.filePicker {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -327,19 +327,21 @@ export function OAuthPage() {
|
|||||||
>
|
>
|
||||||
<div className="hint">{t(provider.hintKey)}</div>
|
<div className="hint">{t(provider.hintKey)}</div>
|
||||||
{provider.id === 'gemini-cli' && (
|
{provider.id === 'gemini-cli' && (
|
||||||
<Input
|
<div className={styles.geminiProjectField}>
|
||||||
label={t('auth_login.gemini_cli_project_id_label')}
|
<Input
|
||||||
hint={t('auth_login.gemini_cli_project_id_hint')}
|
label={t('auth_login.gemini_cli_project_id_label')}
|
||||||
value={state.projectId || ''}
|
hint={t('auth_login.gemini_cli_project_id_hint')}
|
||||||
error={state.projectIdError}
|
value={state.projectId || ''}
|
||||||
onChange={(e) =>
|
error={state.projectIdError}
|
||||||
updateProviderState(provider.id, {
|
onChange={(e) =>
|
||||||
projectId: e.target.value,
|
updateProviderState(provider.id, {
|
||||||
projectIdError: undefined
|
projectId: e.target.value,
|
||||||
})
|
projectIdError: undefined
|
||||||
}
|
})
|
||||||
placeholder={t('auth_login.gemini_cli_project_id_placeholder')}
|
}
|
||||||
/>
|
placeholder={t('auth_login.gemini_cli_project_id_placeholder')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
{state.url && (
|
{state.url && (
|
||||||
<div className={`connection-box ${styles.authUrlBox}`}>
|
<div className={`connection-box ${styles.authUrlBox}`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user