mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 03:09:50 +08:00
fix(admin): persist provider settings and enforce quotas
This commit is contained in:
@@ -2896,8 +2896,21 @@ async function openAntigravityQuotaDialog(key: EndpointAPIKey) {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleKeyChanged() {
|
||||
function applyUpdatedKeySnapshot(updatedKey: EndpointAPIKey) {
|
||||
const index = providerKeys.value.findIndex(key => key.id === updatedKey.id)
|
||||
if (index >= 0) {
|
||||
providerKeys.value.splice(index, 1, updatedKey)
|
||||
}
|
||||
if (editingKey.value?.id === updatedKey.id) {
|
||||
editingKey.value = updatedKey
|
||||
}
|
||||
syncCurrentSelections(endpoints.value, providerKeys.value)
|
||||
}
|
||||
|
||||
async function handleKeyChanged(updatedKey?: EndpointAPIKey) {
|
||||
if (updatedKey) applyUpdatedKeySnapshot(updatedKey)
|
||||
await Promise.all([loadProvider(), loadEndpoints(), loadMappingPreview()])
|
||||
if (updatedKey) applyUpdatedKeySnapshot(updatedKey)
|
||||
emit('refresh')
|
||||
// 添加/修改 key 后自动获取已支持 provider 的配额(新 key 的 upstream_metadata 为空)
|
||||
void autoRefreshQuotaInBackground().then((changed) => {
|
||||
|
||||
Reference in New Issue
Block a user