mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-19 11:10:49 +08:00
feat: improve Settings page retry config UI and enhance excludedModels API support
- Reorganize retry settings into separate Card for better visual hierarchy - Move retry update button inline with input field via rightElement - Add excluded-models serialization in provider key configuration - Add excluded-models normalization support in API transformers with fallback parsing
This commit is contained in:
@@ -259,16 +259,21 @@ export function SettingsPage() {
|
|||||||
{t('basic_settings.proxy_update')}
|
{t('basic_settings.proxy_update')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card title={t('basic_settings.retry_title')}>
|
||||||
<Input
|
<Input
|
||||||
label={t('basic_settings.retry_count_label')}
|
label={t('basic_settings.retry_count_label')}
|
||||||
type="number"
|
type="number"
|
||||||
value={retryValue}
|
value={retryValue}
|
||||||
onChange={(e) => setRetryValue(Number(e.target.value))}
|
onChange={(e) => setRetryValue(Number(e.target.value))}
|
||||||
disabled={disableControls || loading}
|
disabled={disableControls || loading}
|
||||||
|
rightElement={
|
||||||
|
<Button onClick={handleRetryUpdate} loading={pending.retry} disabled={disableControls || loading}>
|
||||||
|
{t('basic_settings.retry_update')}
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Button onClick={handleRetryUpdate} loading={pending.retry} disabled={disableControls || loading} fullWidth>
|
|
||||||
{t('basic_settings.retry_update')}
|
|
||||||
</Button>
|
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card title={t('basic_settings.quota_title')}>
|
<Card title={t('basic_settings.quota_title')}>
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ const serializeProviderKey = (config: ProviderKeyConfig) => {
|
|||||||
if (headers) payload.headers = headers;
|
if (headers) payload.headers = headers;
|
||||||
const models = serializeModelAliases(config.models);
|
const models = serializeModelAliases(config.models);
|
||||||
if (models && models.length) payload.models = models;
|
if (models && models.length) payload.models = models;
|
||||||
|
if (config.excludedModels && config.excludedModels.length) {
|
||||||
|
payload['excluded-models'] = config.excludedModels;
|
||||||
|
}
|
||||||
return payload;
|
return payload;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ const normalizeProviderKeyConfig = (item: any): ProviderKeyConfig | null => {
|
|||||||
if (headers) config.headers = headers;
|
if (headers) config.headers = headers;
|
||||||
const models = normalizeModelAliases(item.models);
|
const models = normalizeModelAliases(item.models);
|
||||||
if (models.length) config.models = models;
|
if (models.length) config.models = models;
|
||||||
|
const excludedModels = normalizeExcludedModels(
|
||||||
|
item['excluded-models'] ?? item.excludedModels ?? item['excluded_models'] ?? item.excluded_models
|
||||||
|
);
|
||||||
|
if (excludedModels.length) config.excludedModels = excludedModels;
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user