Skip to content

Commit

Permalink
fix typo and ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
mallsoft committed Aug 19, 2024
1 parent 5280f8b commit 797512f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/lib/components/visuals/terminus/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])));
Expand Down Expand Up @@ -184,7 +186,7 @@ new Command(
return true;
},
{
short: 'achivementlytics',
short: 'Achivementlytics',
long: ['Shows stats', 'Achivements, navigations, etc..']
}
);
20 changes: 11 additions & 9 deletions src/routes/api/stats/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 797512f

Please sign in to comment.