Sanitized mirror from private repository - 2026-04-08 03:19:28 UTC
Some checks failed
Documentation / Deploy to GitHub Pages (push) Has been cancelled
Documentation / Build Docusaurus (push) Has been cancelled

This commit is contained in:
Gitea Mirror Bot
2026-04-08 03:19:28 +00:00
commit cfecb0eed4
1416 changed files with 359738 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;
}