mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 03:10:50 +08:00
fix(status-bar): extend health monitor window to 200 minutes
This commit is contained in:
@@ -903,11 +903,11 @@ export function calculateStatusBarData(
|
|||||||
authIndexFilter?: number
|
authIndexFilter?: number
|
||||||
): StatusBarData {
|
): StatusBarData {
|
||||||
const BLOCK_COUNT = 20;
|
const BLOCK_COUNT = 20;
|
||||||
const BLOCK_DURATION_MS = 5 * 60 * 1000; // 5 minutes
|
const BLOCK_DURATION_MS = 10 * 60 * 1000; // 10 minutes
|
||||||
const HOUR_MS = 60 * 60 * 1000;
|
const WINDOW_MS = 200 * 60 * 1000; // 200 minutes
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const hourAgo = now - HOUR_MS;
|
const windowStart = now - WINDOW_MS;
|
||||||
|
|
||||||
// Initialize blocks
|
// Initialize blocks
|
||||||
const blockStats: Array<{ success: number; failure: number }> = Array.from(
|
const blockStats: Array<{ success: number; failure: number }> = Array.from(
|
||||||
@@ -921,7 +921,7 @@ export function calculateStatusBarData(
|
|||||||
// Filter and bucket the usage details
|
// Filter and bucket the usage details
|
||||||
usageDetails.forEach((detail) => {
|
usageDetails.forEach((detail) => {
|
||||||
const timestamp = Date.parse(detail.timestamp);
|
const timestamp = Date.parse(detail.timestamp);
|
||||||
if (Number.isNaN(timestamp) || timestamp < hourAgo || timestamp > now) {
|
if (Number.isNaN(timestamp) || timestamp < windowStart || timestamp > now) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user