mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
feat: 添加提供商格式转换优先级保持配置
- 新增 Provider.keep_priority_on_conversion 字段,控制格式转换时是否保持优先级 - 新增全局配置 KEEP_PRIORITY_ON_CONVERSION,可全局启用优先级保持 - 调度器根据配置决定是否降级需要格式转换的候选 - 前端 Provider 表单添加"保持优先级"开关 - 调整 HTTP 读写超时默认值为 3600 秒
This commit is contained in:
@@ -309,6 +309,7 @@ export interface ProviderWithEndpointsSummary {
|
||||
description?: string
|
||||
website?: string
|
||||
provider_priority: number
|
||||
keep_priority_on_conversion: boolean // 格式转换时是否保持优先级
|
||||
billing_type?: 'monthly_quota' | 'pay_as_you_go' | 'free_tier'
|
||||
monthly_quota_usd?: number
|
||||
monthly_used_usd?: number
|
||||
|
||||
@@ -171,6 +171,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 格式转换配置 -->
|
||||
<div class="space-y-3">
|
||||
<h3 class="text-sm font-medium border-b pb-2">
|
||||
格式转换
|
||||
</h3>
|
||||
<div class="flex items-center justify-between p-3 border rounded-lg bg-muted/50">
|
||||
<div class="space-y-0.5">
|
||||
<span class="text-sm font-medium">保持优先级</span>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
跨格式请求时保持原优先级排名,不降级到格式匹配的提供商之后
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
:model-value="form.keep_priority_on_conversion"
|
||||
@update:model-value="(v: boolean) => form.keep_priority_on_conversion = v"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 代理配置 -->
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -295,6 +314,7 @@ const form = ref({
|
||||
quota_last_reset_at: '', // 周期开始时间
|
||||
quota_expires_at: '',
|
||||
provider_priority: 999,
|
||||
keep_priority_on_conversion: false, // 格式转换时是否保持优先级
|
||||
// 状态配置
|
||||
is_active: true,
|
||||
rate_limit: undefined as number | undefined,
|
||||
@@ -323,6 +343,7 @@ function resetForm() {
|
||||
quota_last_reset_at: '',
|
||||
quota_expires_at: '',
|
||||
provider_priority: 999,
|
||||
keep_priority_on_conversion: false,
|
||||
is_active: true,
|
||||
rate_limit: undefined,
|
||||
concurrent_limit: undefined,
|
||||
@@ -356,6 +377,7 @@ function loadProviderData() {
|
||||
quota_expires_at: props.provider.quota_expires_at ?
|
||||
new Date(props.provider.quota_expires_at).toISOString().slice(0, 16) : '',
|
||||
provider_priority: props.provider.provider_priority || 999,
|
||||
keep_priority_on_conversion: props.provider.keep_priority_on_conversion ?? false,
|
||||
is_active: props.provider.is_active,
|
||||
rate_limit: undefined,
|
||||
concurrent_limit: undefined,
|
||||
@@ -416,6 +438,7 @@ const handleSubmit = async () => {
|
||||
quota_last_reset_at: form.value.quota_last_reset_at || undefined,
|
||||
quota_expires_at: form.value.quota_expires_at || undefined,
|
||||
provider_priority: form.value.provider_priority,
|
||||
keep_priority_on_conversion: form.value.keep_priority_on_conversion,
|
||||
is_active: form.value.is_active,
|
||||
// 请求配置
|
||||
max_retries: form.value.max_retries ?? undefined,
|
||||
|
||||
Reference in New Issue
Block a user