Add tabbed settings and system shell

This commit is contained in:
2026-07-31 21:30:51 +02:00
parent d663979ebb
commit c36e5e811f
20 changed files with 698 additions and 29 deletions
+15
View File
@@ -0,0 +1,15 @@
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import { z } from "zod";
const execFileAsync = promisify(execFile);
export const systemPowerActionSchema = z.enum(["reboot", "poweroff"]);
export type SystemPowerAction = z.infer<typeof systemPowerActionSchema>;
export async function triggerSystemPower(action: SystemPowerAction): Promise<void> {
await execFileAsync("/usr/bin/sudo", ["-n", "/usr/local/sbin/pi-car-companion-power", action], {
timeout: 10_000,
maxBuffer: 16 * 1024
});
}