qwenproxy-cli 1.5.3 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -846,12 +846,29 @@ export class StatusView implements TuiView {
846
846
  const poolPct = accounts.length > 0 ? Math.round((availableCount / accounts.length) * 100) : 0;
847
847
  const poolColor = poolPct >= 70 ? theme.green : poolPct >= 40 ? theme.yellow : theme.red;
848
848
  const poolBar = renderProgressBar(poolPct, 8, poolColor);
849
+ const poolDailyUsage = data?.dailyUsage;
850
+ const poolUsagePct = poolDailyUsage?.poolUsagePercent ?? 0;
851
+ const poolUsageColor = poolUsagePct >= 80 ? theme.red : poolUsagePct >= 40 ? theme.yellow : theme.cyan;
852
+ const poolUsageBar = renderProgressBar(poolUsagePct, 8, poolUsageColor);
849
853
  const innerRightW = Math.max(30, rightW - 2);
850
- const emailWidth = Math.max(16, Math.min(20, innerRightW - 27));
854
+ const showUsageCol = innerRightW >= 52;
855
+ const emailWidth = showUsageCol
856
+ ? Math.max(14, Math.min(18, innerRightW - 33))
857
+ : Math.max(16, Math.min(20, innerRightW - 27));
858
+
851
859
  const rightContent: string[] = [
852
860
  ` ${theme.bold("Disponibilidade:")} [${poolBar}] ${poolColor(`${availableCount}/${accounts.length} (${poolPct}%)`)}`,
861
+ ...(poolDailyUsage
862
+ ? [
863
+ ` ${theme.bold("Cota Pool Hoje:")} [${poolUsageBar}] ${poolUsageColor(
864
+ `${poolUsagePct}%`,
865
+ )} ${theme.dim(
866
+ `(~${Math.round(poolDailyUsage.totalTokens / 1000)}k tok)`,
867
+ )}`,
868
+ ]
869
+ : []),
853
870
  ` ${theme.dim("─".repeat(Math.max(32, innerRightW - 2)))}`,
854
- ` ${theme.dim(`# ${pad("Conta", emailWidth)} Carga Status`)}`,
871
+ ` ${theme.dim(`# ${pad("Conta", emailWidth)} Carga ${showUsageCol ? "Uso% " : ""}Status`)}`,
855
872
  ` ${theme.dim("─".repeat(Math.max(32, innerRightW - 2)))}`,
856
873
  ];
857
874
 
@@ -864,7 +881,23 @@ export class StatusView implements TuiView {
864
881
  const name = pad(truncate(acc.emailOrName, emailWidth - 1), emailWidth);
865
882
  const active = acc.activeStreams || 0;
866
883
  const limit = acc.streamLimit || 1;
867
- const loadBadge = active > 0 ? theme.yellow(`[${active}/${limit}]`) : theme.dim(`[0/${limit}]`);
884
+ const usagePct = acc.dailyUsagePercent ?? 0;
885
+
886
+ let loadBadge: string;
887
+ if (active > 0) {
888
+ loadBadge = theme.yellow(`[${active}/${limit}]`);
889
+ } else if (!showUsageCol && usagePct > 0) {
890
+ const pctColor = usagePct >= 80 ? theme.red : usagePct >= 40 ? theme.yellow : theme.cyan;
891
+ loadBadge = pctColor(pad(`[${usagePct}%]`, 5));
892
+ } else {
893
+ loadBadge = theme.dim(`[0/${limit}]`);
894
+ }
895
+
896
+ const usageCol = showUsageCol
897
+ ? (usagePct > 0
898
+ ? (usagePct >= 80 ? theme.red(pad(`${usagePct}%`, 5)) : usagePct >= 40 ? theme.yellow(pad(`${usagePct}%`, 5)) : theme.cyan(pad(`${usagePct}%`, 5)))
899
+ : theme.dim(pad("0%", 5))) + " "
900
+ : "";
868
901
 
869
902
  let status = theme.green(`${glyphs.bullet} Pronto`);
870
903
  if (active > 0 && !acc.onCooldown && acc.headersReady) {
@@ -888,7 +921,7 @@ export class StatusView implements TuiView {
888
921
  ? theme.yellow(`◐ Aquecendo...`)
889
922
  : theme.muted(`○ Standby`);
890
923
  }
891
- rightContent.push(` ${num}${name} ${loadBadge} ${status}`);
924
+ rightContent.push(` ${num}${name} ${loadBadge} ${usageCol}${status}`);
892
925
  });
893
926
  }
894
927