This commit is contained in:
PxlLoewe
2025-07-14 14:13:44 -07:00
2 changed files with 54 additions and 5 deletions

View File

@@ -70,7 +70,7 @@ export const SituationBoard = () => {
{situationTabOpen && ( {situationTabOpen && (
<div <div
tabIndex={0} tabIndex={0}
className="dropdown-content card bg-base-200 shadow-md z-[1100] ml-2 border-1 border-info" className="dropdown-content card bg-base-200 shadow-md z-[1100] ml-2 border-1 border-info min-w-[900px] max-h-[300px]"
> >
<div className="card-body flex flex-row gap-4"> <div className="card-body flex flex-row gap-4">
<div className="flex-1"> <div className="flex-1">
@@ -90,7 +90,7 @@ export const SituationBoard = () => {
</label> </label>
</div> </div>
</div> </div>
<div className="overflow-x-auto"> <div className="overflow-x-auto overflow-y-auto max-h-[170px] select-none">
<table className="table table-xs"> <table className="table table-xs">
{/* head */} {/* head */}
<thead> <thead>
@@ -106,6 +106,10 @@ export const SituationBoard = () => {
(mission) => (mission) =>
(dispatcherConnected || mission.state !== "draft") && ( (dispatcherConnected || mission.state !== "draft") && (
<tr <tr
className={cn(
"cursor-pointer",
mission.state === "draft" && "missionListItem",
)}
onDoubleClick={() => { onDoubleClick={() => {
setOpenMissionMarker({ setOpenMissionMarker({
open: [ open: [
@@ -125,9 +129,8 @@ export const SituationBoard = () => {
}); });
}} }}
key={mission.id} key={mission.id}
className={cn(mission.state === "draft" && "missionListItem")}
> >
<td>{mission.publicId}</td> <td>{mission.publicId.replace("ENr.: ", "")}</td>
<td>{mission.missionKeywordAbbreviation}</td> <td>{mission.missionKeywordAbbreviation}</td>
<td>{mission.addressCity}</td> <td>{mission.addressCity}</td>
<td> <td>
@@ -147,7 +150,7 @@ export const SituationBoard = () => {
<h2 className="inline-flex items-center gap-2 text-lg font-bold mb-2"> <h2 className="inline-flex items-center gap-2 text-lg font-bold mb-2">
<Plane /> Stationen <Plane /> Stationen
</h2> </h2>
<div className="overflow-x-auto"> <div className="overflow-x-auto overflow-y-auto max-h-[200px] select-none">
<table className="table table-xs"> <table className="table table-xs">
<thead> <thead>
<tr> <tr>
@@ -159,6 +162,7 @@ export const SituationBoard = () => {
<tbody> <tbody>
{connectedAircrafts?.map((station) => ( {connectedAircrafts?.map((station) => (
<tr <tr
className="cursor-pointer"
key={station.id} key={station.id}
onDoubleClick={() => { onDoubleClick={() => {
setOpenAircraftMarker({ setOpenAircraftMarker({

View File

@@ -0,0 +1,45 @@
"use client";
import { cn } from "@repo/shared-components";
import { ArrowLeftRight, Plane, Radar, Workflow } from "lucide-react";
import { useSession } from "next-auth/react";
import Link from "next/link";
import { usePathname } from "next/navigation";
export default function ModeSwitchDropdown({ className }: { className?: string }) {
const path = usePathname();
const session = useSession();
return (
<div className={cn("dropdown z-999999", className)}>
<div tabIndex={0} role="button" className="btn m-1">
<ArrowLeftRight size={22} /> {path.includes("pilot") && "Pilot"}
{path.includes("dispatch") && "Leitstelle"}
</div>
<ul
tabIndex={0}
className="menu dropdown-content bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm"
>
{session.data?.user.permissions?.includes("DISPO") && (
<li>
<Link href={"/dispatch"}>
<Workflow size={22} /> Leitstelle
</Link>
</li>
)}
{session.data?.user.permissions?.includes("PILOT") && (
<li>
<Link href={"/pilot"}>
<Plane size={22} /> Operations Center
</Link>
</li>
)}
<li>
<Link href={"/tracker"}>
<Radar size={22} /> Tracker
</Link>
</li>
</ul>
</div>
);
}