mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 00:16:38 +00:00
feat(cliproxy): pool visibility in quota output and dashboard routing card
- ccs cliproxy quota: per-provider Pool context section with routing mode (pool on/off, strategy, affinity, effective retry cap), drain order resolved exactly as the selector picks (incl. residual on-disk priorities reordering display + drift warning), and per-account state named distinctly: available / cooling-until-<time> / paused - these produce different client errors so they read differently - cooling visibility degrades honestly when pool cooling is disabled (no cooldown data exists; renderer says so) - dashboard routing card: pool badge + retry cap + drain-order hint in compact and full variants via additive poolRouting state block - no Bar summary fields, no per-session pin introspection (cut per plan); policy_quota_unsupported semantics untouched Part of #1464 account pools (phase 6).
This commit is contained in:
1 parent
a33e12619e
commit
74894f61da
15 files changed
+1254
-48
No files matched your search
@@ -46,6 +46,8 @@ export function RoutingGuidanceCard({
|
||||
}: RoutingGuidanceCardProps) {
|
||||
const { t } = useTranslation();
|
||||
const currentStrategy = state?.strategy ?? 'round-robin';
|
||||
const poolEnabled = state?.poolRouting?.enabled ?? false;
|
||||
const poolMaxRetry = state?.poolRouting?.maxRetryCredentials;
|
||||
const currentAffinityEnabled = sessionAffinityState?.enabled ?? false;
|
||||
const currentAffinityTtl = sessionAffinityState?.ttl ?? '1h';
|
||||
const sessionAffinityManageable = sessionAffinityState?.manageable ?? true;
|
||||
@@ -172,6 +174,29 @@ export function RoutingGuidanceCard({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5">
|
||||
<div className="min-w-0">
|
||||
<div className="text-[10px] font-medium text-foreground">
|
||||
{t('routingGuidance.poolRouting')}
|
||||
</div>
|
||||
<div className="text-[10px] text-muted-foreground">
|
||||
{poolEnabled && poolMaxRetry !== undefined
|
||||
? t('routingGuidance.poolMaxRetry', { count: poolMaxRetry })
|
||||
: t('routingGuidance.drainOrderHint')}
|
||||
</div>
|
||||
</div>
|
||||
<Badge
|
||||
variant={poolEnabled ? 'secondary' : 'outline'}
|
||||
title={
|
||||
poolEnabled
|
||||
? t('routingGuidance.poolRoutingManaged')
|
||||
: t('routingGuidance.poolRoutingOffHint')
|
||||
}
|
||||
>
|
||||
{poolEnabled ? t('routingGuidance.poolRoutingOn') : t('routingGuidance.poolRoutingOff')}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5">
|
||||
<div className="min-w-0">
|
||||
<div className="text-[10px] font-medium text-foreground">
|
||||
@@ -240,11 +265,32 @@ export function RoutingGuidanceCard({
|
||||
<Badge variant="secondary">{currentStrategy}</Badge>
|
||||
{state ? <Badge variant="outline">{sourceLabel}</Badge> : null}
|
||||
{state ? <Badge variant="outline">{state.target}</Badge> : null}
|
||||
{state ? (
|
||||
<Badge
|
||||
variant={poolEnabled ? 'secondary' : 'outline'}
|
||||
title={
|
||||
poolEnabled
|
||||
? t('routingGuidance.poolRoutingManaged')
|
||||
: t('routingGuidance.poolRoutingOffHint')
|
||||
}
|
||||
>
|
||||
{t('routingGuidance.poolRouting')}:{' '}
|
||||
{poolEnabled
|
||||
? t('routingGuidance.poolRoutingOn')
|
||||
: t('routingGuidance.poolRoutingOff')}
|
||||
{poolEnabled && poolMaxRetry !== undefined
|
||||
? ` · ${t('routingGuidance.poolMaxRetry', { count: poolMaxRetry })}`
|
||||
: ''}
|
||||
</Badge>
|
||||
) : null}
|
||||
</div>
|
||||
<p className="max-w-3xl text-xs leading-5 text-muted-foreground">
|
||||
Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly
|
||||
change it.
|
||||
</p>
|
||||
<p className="max-w-3xl text-[11px] leading-5 text-muted-foreground">
|
||||
{t('routingGuidance.drainOrderHint')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-2 xl:items-end">
|
||||
|
||||
Reference in new issue
Block a user