mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 18:15:48 +00:00
fix(cliproxy): show clear message for paused accounts in Live Monitor
- Check isAccountPaused() before readAuthData() in fetchAccountQuota() - Return "Account is paused" instead of confusing "Auth file not found" - Improves UX by explaining why quota fetch fails for paused accounts
This commit is contained in:
1 parent
4d31128b63
commit
a931bc9745
1 file changed
+13
@@ -11,6 +11,7 @@ import { getAuthDir } from './config-generator';
|
|||||||
import { CLIProxyProvider } from './types';
|
import { CLIProxyProvider } from './types';
|
||||||
import {
|
import {
|
||||||
getProviderAccounts,
|
getProviderAccounts,
|
||||||
|
isAccountPaused,
|
||||||
setAccountTier,
|
setAccountTier,
|
||||||
type AccountInfo,
|
type AccountInfo,
|
||||||
type AccountTier,
|
type AccountTier,
|
||||||
@@ -553,6 +554,18 @@ export async function fetchAccountQuota(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if account is paused (token moved to auth-paused/ directory)
|
||||||
|
if (isAccountPaused(provider, accountId)) {
|
||||||
|
const error = 'Account is paused';
|
||||||
|
if (verbose) console.error(`[i] ${error}`);
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
models: [],
|
||||||
|
lastUpdated: Date.now(),
|
||||||
|
error,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Read auth data from auth file
|
// Read auth data from auth file
|
||||||
const authData = readAuthData(provider, accountId);
|
const authData = readAuthData(provider, accountId);
|
||||||
if (!authData) {
|
if (!authData) {
|
||||||
|
|||||||
Reference in new issue
Block a user