diff --git a/src/lib/components/visuals/terminus/commands.ts b/src/lib/components/visuals/terminus/commands.ts index 1d091b2..2363886 100644 --- a/src/lib/components/visuals/terminus/commands.ts +++ b/src/lib/components/visuals/terminus/commands.ts @@ -154,6 +154,8 @@ new Command( .then((res) => res.json()) .then((data) => { const keys = Object.keys(data[0]); + console.log(keys); + const values = Object.values(data); const columnIsFinite = keys.map((k) => values.every((v) => isFinite(v[k]))); @@ -184,7 +186,7 @@ new Command( return true; }, { - short: 'achivementlytics', + short: 'Achivementlytics', long: ['Shows stats', 'Achivements, navigations, etc..'] } ); diff --git a/src/routes/api/stats/+server.ts b/src/routes/api/stats/+server.ts index da8b34b..64f7120 100644 --- a/src/routes/api/stats/+server.ts +++ b/src/routes/api/stats/+server.ts @@ -10,15 +10,17 @@ export async function GET() { await pb.collection('machine').authWithPassword('mallx', env.SECRET_MALLX); const res = await pb.collection('stats').getFullList(); - const stats = res.map(({ achivements, agent, navigations, os, platform, timeSpent, window }) => ({ - achivements, - agent, - navigations, - os, - platform, - timeSpent, - window - })); + const stats = res.map( + ({ achievements, agent, navigations, os, platform, timeSpent, window }) => ({ + agent, + os, + platform, + window, + navigations, + timeSpent, + achievements + }) + ); return json(stats); }