New Dashboard

This commit is contained in:
2025-03-01 20:00:46 +01:00
parent bccd5eb5a0
commit 86d90e3fd2
33 changed files with 2148 additions and 266 deletions

View File

@@ -27,6 +27,7 @@ import {z} from "zod";
import {fetchWithToken, tokenStore} from "@repo/repo.ts";
import {pageRepo} from "@repo/page.ts";
import {dataRepo} from "@repo/data.ts";
import {permsRepo} from "@repo/perms.ts";
export const schemTypes = cached<SchematicType[]>([], () =>
fetchWithToken(get(tokenStore), "/data/admin/schematicTypes")
@@ -37,6 +38,13 @@ export const players = cached<Player[]>([], async () => {
return z.array(PlayerSchema).parse(await res.json());
});
export const permissions = cached({
perms: [],
prefixes: {},
}, async () => {
return get(permsRepo).listPerms();
});
export const gamemodes = cached<string[]>([], async () => {
const res = await fetchWithToken(get(tokenStore), "/data/admin/gamemodes");
return z.array(z.string()).parse(await res.json());