a lot of work, but i'd guess mostly api in the works

This commit is contained in:
2026-05-27 20:45:14 +02:00
parent 68458be71f
commit 50872d8951
22 changed files with 1425 additions and 1257 deletions
+29 -5
View File
@@ -1,10 +1,34 @@
import { db } from "$lib/server/db";
import { settings } from "$lib/server/db/schema";
import { eq } from "drizzle-orm";
import type { PageServerLoad } from "./$types";
import fsData from '$lib/assets/fs/fs.json';
import { db } from '$lib/server/db';
import { projects, settings } from '$lib/server/db/schema';
import { FileSystem } from '$lib/termos/filesystem/filesystem';
import { Sort, SortNodeBy } from '$lib/termos/util/sort';
import { eq } from 'drizzle-orm';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async () => {
FileSystem.Init(fsData as any);
const fs = FileSystem.instance;
const node = fs.getNodeByInode(13); //Gordonox home dir
let nodes = node.children.map((child) => fs.getNodeByInode(child));
nodes = Sort.nodeArraySort(nodes, false, SortNodeBy.NAME);
return {
settings: await db.select({setting: settings.state}).from(settings).where(eq(settings.var, 'maintenance')).limit(1)
settings: await db
.select({ setting: settings.state })
.from(settings)
.where(eq(settings.var, 'maintenance'))
.limit(1),
projects: await db
.select({
id: projects.id,
name: projects.name,
data: projects.data,
enabled: projects.enabled
})
.from(projects),
nodes: nodes
};
};