Merge pull request #2571 from sherlockwhite/fix/openai-account-email-and-usage-refresh

fix(accounts): show email and fix usage refresh for OpenAI OAuth accounts
This commit is contained in:
Wesley Liddick authored and GitHub committed 2026-05-19 16:56:26 +08:00
commit 21ae52c01f
6 files changed
+50 -17

No files matched your search

@@ -126,6 +126,30 @@
:show-now-when-idle="true"
color="emerald"
/>
<div class="flex items-center gap-1.5 mt-0.5">
<button
type="button"
class="inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[9px] font-medium text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-900/30 transition-colors"
:disabled="activeQueryLoading"
@click="loadActiveUsage"
>
<svg
class="h-2.5 w-2.5"
:class="{ 'animate-spin': activeQueryLoading }"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
/>
</svg>
{{ t('admin.accounts.usageWindow.activeQuery') }}
</button>
</div>
</div>
<div v-else-if="loading" class="space-y-1.5">
<div class="flex items-center gap-1">
@@ -1070,7 +1094,7 @@ const attachVisibilityObserver = () => {
const loadActiveUsage = async () => {
activeQueryLoading.value = true
try {
usageInfo.value = await adminAPI.accounts.getUsage(props.account.id, 'active')
usageInfo.value = await adminAPI.accounts.getUsage(props.account.id, 'active', true)
} catch (e: any) {
console.error('Failed to load active usage:', e)
} finally {