mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
fix: 修复模型权限正则匹配逻辑及相关缓存清除
- 修复 model_mappings 正则匹配不再受 candidate_models 限制 - Provider 启用/禁用/删除时清除 GlobalModel 解析缓存 - 优先级管理对话框中启用的 Provider 排在禁用的前面 - 修复请求时间线 skipped 状态颜色适配主题
This commit is contained in:
@@ -567,10 +567,20 @@ const availableFormats = computed(() => {
|
||||
return Object.keys(keysByFormat.value).sort()
|
||||
})
|
||||
|
||||
// 排序 providers:启用的在前,停用的在后,各自按优先级排序
|
||||
function sortProvidersByActiveAndPriority(providers: ProviderWithEndpointsSummary[]) {
|
||||
return [...providers].sort((a, b) => {
|
||||
if (a.is_active !== b.is_active) {
|
||||
return a.is_active ? -1 : 1
|
||||
}
|
||||
return a.provider_priority - b.provider_priority
|
||||
})
|
||||
}
|
||||
|
||||
// 监听 props.providers 变化
|
||||
watch(() => props.providers, (newProviders) => {
|
||||
if (newProviders) {
|
||||
sortedProviders.value = [...newProviders].sort((a, b) => a.provider_priority - b.provider_priority)
|
||||
sortedProviders.value = sortProvidersByActiveAndPriority(newProviders)
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
@@ -691,8 +701,8 @@ function finishEditProviderPriority(provider: ProviderWithEndpointsSummary, even
|
||||
provider_priority: newPriority
|
||||
}
|
||||
}
|
||||
// 按 provider_priority 重新排序
|
||||
sortedProviders.value = [...sortedProviders.value].sort((a, b) => a.provider_priority - b.provider_priority)
|
||||
// 重新排序
|
||||
sortedProviders.value = sortProvidersByActiveAndPriority(sortedProviders.value)
|
||||
}
|
||||
|
||||
editingProviderPriority.value = null
|
||||
@@ -777,7 +787,7 @@ function handleProviderDrop(dropIndex: number) {
|
||||
})
|
||||
|
||||
// 重新排序
|
||||
sortedProviders.value = [...items].sort((a, b) => a.provider_priority - b.provider_priority)
|
||||
sortedProviders.value = sortProvidersByActiveAndPriority(items)
|
||||
draggedProvider.value = null
|
||||
dragOverProvider.value = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user