Merge branch 'main' of https://github.com/VAR-Virtual-Air-Rescue/var-monorepo
This commit is contained in:
@@ -40,9 +40,15 @@ export default function Navbar() {
|
||||
</div>
|
||||
<ThemeSwap isDark={isDark} toggleTheme={toggleTheme} />
|
||||
<div className="flex items-center">
|
||||
<Link
|
||||
href={process.env.NEXT_PUBLIC_HUB_URL || "#!"}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<button className="btn btn-ghost">
|
||||
<ExternalLinkIcon className="w-4 h-4" /> HUB
|
||||
</button>
|
||||
</Link>
|
||||
<Link href={"/logout"}>
|
||||
<button className="btn btn-ghost">
|
||||
<ExitIcon className="w-4 h-4" />
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
"use client";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<div>
|
||||
Hab das hier mal nach /dispatcher verschoben. Unter /pilot soll dann die
|
||||
Piloten UI sein
|
||||
</div>
|
||||
);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
// Replace this with actual permission-checking logic
|
||||
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";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,3 +11,4 @@ MOODLE_PW=var-api-user-P1
|
||||
MOODLE_TOKEN=ac346f0324647b68488d13fd52a9bbe8
|
||||
NEXT_PUBLIC_MOODLE_URL=http://localhost:8081
|
||||
NEXT_PUBLIC_HUB_SERVER_URL=http://localhost:3003
|
||||
NEXT_PUBLIC_DISPATCH_URL=http://localhost:3001
|
||||
@@ -75,7 +75,10 @@ export const HorizontalNav = () => (
|
||||
<div className="flex items-center ml-auto">
|
||||
<ul className="flex space-x-2 px-1">
|
||||
<li>
|
||||
<Link href="/">
|
||||
<Link
|
||||
href={process.env.NEXT_PUBLIC_DISPATCH_URL || "#!"}
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<button className="btn btn-sm btn-outline btn-primary">
|
||||
Zur Leitstelle
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user