mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 08:27:46 +08:00
merge(main): sync latest main into security branch
This commit is contained in:
@@ -1153,6 +1153,7 @@ import {
|
||||
getCodexResetCreditAvailableCount,
|
||||
getCodexResetCreditReservationIdempotencyKey,
|
||||
getVisibleCodexResetCreditItems,
|
||||
mergeCodexQuotaDisplays,
|
||||
readPendingCodexResetCreditIdempotencyKey,
|
||||
rememberPendingCodexResetCreditIdempotencyKey,
|
||||
} from '@/features/providers/components/codex-reset-credit-display'
|
||||
@@ -2235,9 +2236,17 @@ function applyQuotaRefreshResultToCurrentPage(result: Awaited<ReturnType<typeof
|
||||
}
|
||||
|
||||
function getCodexResetCredits(key: PoolKeyDetail) {
|
||||
return getQuotaSnapshotProviderType(key) === 'codex'
|
||||
? key.status_snapshot?.quota?.reset_credits ?? null
|
||||
if (getQuotaSnapshotProviderType(key) !== 'codex') return null
|
||||
|
||||
const snapshot = key.status_snapshot?.quota?.reset_credits
|
||||
const snapshotUpdatedAt = key.status_snapshot?.quota?.updated_at
|
||||
const snapshotDisplay = snapshot
|
||||
? {
|
||||
...(typeof snapshotUpdatedAt === 'number' ? { updated_at: snapshotUpdatedAt } : {}),
|
||||
reset_credits: snapshot,
|
||||
}
|
||||
: null
|
||||
return mergeCodexQuotaDisplays(snapshotDisplay, key.upstream_metadata?.codex)?.reset_credits ?? null
|
||||
}
|
||||
|
||||
function getCodexCredentialGeneration(key: PoolKeyDetail): string | null | undefined {
|
||||
|
||||
@@ -745,6 +745,7 @@
|
||||
<RoutingPriorityPolicyEditor
|
||||
:config="activeConfigForReading"
|
||||
:model="activePerModelPolicy.model"
|
||||
:model-id="globalModelIdFor(activePerModelPolicy.model)"
|
||||
:priority-mode="modelPriorityMode(activePerModelPolicy.model)"
|
||||
:scheduling-mode="modelSchedulingMode(activePerModelPolicy.model)"
|
||||
:show-priority-mode="false"
|
||||
@@ -1458,6 +1459,11 @@ function globalModelLabel(modelName: string): string {
|
||||
return `${model.display_name} (${model.name})`
|
||||
}
|
||||
|
||||
function globalModelIdFor(modelName: string): string | undefined {
|
||||
const normalizedName = modelName.trim()
|
||||
return globalModels.value.find(item => item.name.trim() === normalizedName)?.id
|
||||
}
|
||||
|
||||
function replaceGroup(group: RoutingGroupRecord, select = true): void {
|
||||
const normalized = normalizeRecord(group)
|
||||
const index = groups.value.findIndex(item => item.id === normalized.id)
|
||||
|
||||
Reference in New Issue
Block a user