Sanitized mirror from private repository - 2026-04-18 11:19:59 UTC
Some checks failed
Documentation / Build Docusaurus (push) Failing after 5m14s
Documentation / Deploy to GitHub Pages (push) Has been skipped

This commit is contained in:
Gitea Mirror Bot
2026-04-18 11:19:59 +00:00
commit fb00a325d1
1418 changed files with 359990 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"use client";
import { useEffect } from "react";
import { useRouter } from "next/navigation";
export function KeyboardShortcuts() {
const router = useRouter();
useEffect(() => {
function handler(e: KeyboardEvent) {
// Don't trigger when typing in inputs
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
switch (e.key) {
case "1": router.push("/"); break;
case "2": router.push("/infrastructure"); break;
case "3": router.push("/media"); break;
case "4": router.push("/automations"); break;
case "5": router.push("/expenses"); break;
case "6": router.push("/network"); break;
case "7": router.push("/logs"); break;
case "r": window.location.reload(); break;
}
}
window.addEventListener("keydown", handler);
return () => window.removeEventListener("keydown", handler);
}, [router]);
return null;
}