a lot of work, but i'd guess mostly api in the works
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user