code stable. terminal initializes, database successfully connects, reads and writes. css on maintenance page needs tweaking. terminal still displays before initialization.

This commit is contained in:
2026-03-08 09:52:49 +01:00
parent 55787fe3c5
commit b40fa704c6
21 changed files with 990 additions and 31 deletions
+10
View File
@@ -0,0 +1,10 @@
import { db } from "$lib/server/db";
import { settings } from "$lib/server/db/schema";
import { eq } from "drizzle-orm";
import type { PageServerLoad } from "./$types";
export const load: PageServerLoad = async () => {
return {
settings: await db.select({setting: settings.state}).from(settings).where(eq(settings.var, 'maintenance')).limit(1)
};
};
+30 -1
View File
@@ -1,7 +1,36 @@
<script lang="ts">
import { Construction } from '@lucide/svelte';
import ProjectModule from '../../../modules/panel/ProjectModule.svelte';
import { setMaintenanceState } from '../settings.remote';
let { data }: { data: any } = $props();
let maintenance = $state(Boolean(data.settings[0].setting));
console.log(maintenance);
function handleToggle() {
console.log(maintenance);
maintenance = !maintenance;
console.log(maintenance);
let result = setMaintenanceState(Number(maintenance) as 1 | 0);
console.log(result);
}
</script>
<div class=" m-10">
<ProjectModule projectName="ProjectName" />
<ProjectModule projectName="ProjectName" checked={false} />
</div>
<div class=" mt-4">
<Construction strokeWidth={1} />
<label
for='maintenence'
class="relative m-2 ml-auto block h-5 w-10 cursor-pointer rounded-full bg-bg-lighter-dark shadow-subtle"
>
<input type="checkbox" checked={maintenance} onclick={async () => await setMaintenanceState(Number(!maintenance))} id='maintenence' class=" peer sr-only" />
<span
class=" absolute top-0.5 left-0.5 h-4/5 w-2/5 rounded-full bg-bg-dark peer-checked:left-5.5 peer-checked:bg-primary-dark"
>
</span>
</label>
</div>