mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: extracted renderer from /stats
This commit is contained in:
1 parent
bcbc1e259f
commit
752f9b339b
21 files changed
+329
-273
No files matched your search
@@ -1,3 +1,3 @@
|
||||
export default function getPeriodNow() {
|
||||
return new Date().getTime() / 1000;
|
||||
return Date.now() / 1000;
|
||||
}
|
||||
@@ -7,6 +7,6 @@ export default function getPeriodStart(period: Exclude<Period, 'custom'>) {
|
||||
} else if (period === 'today') {
|
||||
return getTimeDaysAgo(0);
|
||||
} else {
|
||||
return getTimeDaysAgo(Number(period));
|
||||
return getTimeDaysAgo(parseInt(period));
|
||||
}
|
||||
}
|
||||
@@ -88,5 +88,5 @@ export default async function getPlayerHistories(
|
||||
}
|
||||
}
|
||||
|
||||
return [...latestNodes, ...filtered, ...previousNodes] satisfies Histories;
|
||||
return [...previousNodes, ...filtered, ...latestNodes] satisfies Histories;
|
||||
}
|
||||
@@ -109,5 +109,5 @@ export default async function getTankHistories(
|
||||
});
|
||||
}
|
||||
|
||||
return [...latestNodes, ...filtered, ...previousNodes] satisfies Histories;
|
||||
return [...previousNodes, ...filtered, ...latestNodes] satisfies Histories;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import getTankHistories, {
|
||||
TankHistoriesRaw,
|
||||
TankHistories,
|
||||
TankHistoryRaw,
|
||||
} from './getTankHistories.js';
|
||||
|
||||
@@ -45,7 +45,7 @@ export default async function getTankStatsOverTime(
|
||||
});
|
||||
|
||||
// sort them even though most won't be used
|
||||
const tankSortedHistory: Record<number, TankHistoriesRaw> = {};
|
||||
const tankSortedHistory: Record<number, TankHistories> = {};
|
||||
const tankIds: number[] = [];
|
||||
history.forEach((node) => {
|
||||
if (!tankSortedHistory[node.tank_id]) {
|
||||
|
||||
Reference in new issue
Block a user