This commit is contained in:
PxlLoewe
2025-04-25 17:37:35 -07:00
4 changed files with 39 additions and 11 deletions

View File

@@ -40,9 +40,15 @@ export default function Navbar() {
</div> </div>
<ThemeSwap isDark={isDark} toggleTheme={toggleTheme} /> <ThemeSwap isDark={isDark} toggleTheme={toggleTheme} />
<div className="flex items-center"> <div className="flex items-center">
<button className="btn btn-ghost"> <Link
<ExternalLinkIcon className="w-4 h-4" /> HUB href={process.env.NEXT_PUBLIC_HUB_URL || "#!"}
</button> target="_blank"
rel="noopener noreferrer"
>
<button className="btn btn-ghost">
<ExternalLinkIcon className="w-4 h-4" /> HUB
</button>
</Link>
<Link href={"/logout"}> <Link href={"/logout"}>
<button className="btn btn-ghost"> <button className="btn btn-ghost">
<ExitIcon className="w-4 h-4" /> <ExitIcon className="w-4 h-4" />

View File

@@ -1,8 +1,26 @@
"use client";
import { useEffect } from "react";
import { useRouter } from "next/navigation";
export default () => { export default () => {
return ( const router = useRouter();
<div>
Hab das hier mal nach /dispatcher verschoben. Unter /pilot soll dann die useEffect(() => {
Piloten UI sein // Replace this with actual permission-checking logic
</div> const hasDispoPermission = checkUserPermission("DISPO");
);
if (hasDispoPermission) {
router.replace("/dispatch");
} else {
router.replace("/pilot");
}
}, [router]);
return null;
// Mock function for permission checking
function checkUserPermission(permission: string): boolean {
// Replace with real permission logic
return permission === "DISPO";
}
}; };

View File

@@ -11,3 +11,4 @@ MOODLE_PW=var-api-user-P1
MOODLE_TOKEN=ac346f0324647b68488d13fd52a9bbe8 MOODLE_TOKEN=ac346f0324647b68488d13fd52a9bbe8
NEXT_PUBLIC_MOODLE_URL=http://localhost:8081 NEXT_PUBLIC_MOODLE_URL=http://localhost:8081
NEXT_PUBLIC_HUB_SERVER_URL=http://localhost:3003 NEXT_PUBLIC_HUB_SERVER_URL=http://localhost:3003
NEXT_PUBLIC_DISPATCH_URL=http://localhost:3001

View File

@@ -75,7 +75,10 @@ export const HorizontalNav = () => (
<div className="flex items-center ml-auto"> <div className="flex items-center ml-auto">
<ul className="flex space-x-2 px-1"> <ul className="flex space-x-2 px-1">
<li> <li>
<Link href="/"> <Link
href={process.env.NEXT_PUBLIC_DISPATCH_URL || "#!"}
rel="noopener noreferrer"
>
<button className="btn btn-sm btn-outline btn-primary"> <button className="btn btn-sm btn-outline btn-primary">
Zur Leitstelle Zur Leitstelle
</button> </button>