mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix: logic reset quota by session
This commit is contained in:
@@ -36,8 +36,6 @@ function getQuotaTone(percentage) {
|
||||
return { bar: "bg-red-500", dot: "bg-red-500", text: "text-red-500" };
|
||||
}
|
||||
|
||||
const INACTIVE_SESSION_COUNTDOWN = "4h59m";
|
||||
|
||||
function TokenQuotaResetStatus({ quota }) {
|
||||
const [now, setNow] = useState(() => new Date());
|
||||
|
||||
@@ -51,7 +49,7 @@ function TokenQuotaResetStatus({ quota }) {
|
||||
const countdown = formatResetTime(quota.resetAt, now);
|
||||
const isSession = quota.windowType === USER_TOKEN_LIMIT_WINDOWS.SESSION;
|
||||
const text = countdown === "-"
|
||||
? (isSession ? INACTIVE_SESSION_COUNTDOWN : "Reset time unavailable")
|
||||
? (isSession ? "Session begins with the next request" : "Reset time unavailable")
|
||||
: (isSession ? `Next tokens restore in ${countdown}` : `Resets in ${countdown}`);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user