fix: health chart labels and get logs for 12h instead of 24h

This commit is contained in:
charles-gauthereau
2026-03-25 20:45:20 +01:00
parent fb97963cc3
commit a9d6481193
2 changed files with 66 additions and 68 deletions
+3 -3
View File
@@ -57,14 +57,14 @@ export const getAgentAction = userAction.schema(z.string()).action(async ({parse
return {
data: agent,
health: agent ? await getLast24hLogs({ id: agent.id }) : []
health: agent ? await getLast12hLogs({ id: agent.id }) : []
};
});
export async function getLast24hLogs({id}: { id: string }) {
export async function getLast12hLogs({id}: { id: string }) {
const now = new Date()
const since = new Date(now.getTime() - 24 * 60 * 60 * 1000)
const since = new Date(now.getTime() - 12 * 60 * 60 * 1000)
return db
.select()