This commit is contained in:
PxlLoewe
2025-06-03 13:45:44 -07:00
17 changed files with 7025 additions and 115 deletions

View File

@@ -1,13 +1,12 @@
"use client";
import { useLeftMenuStore } from "_store/leftMenuStore";
import { useSession } from "next-auth/react";
import { cn } from "_helpers/cn";
import { ListCollapse, Plane } from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { getMissionsAPI } from "_querys/missions";
import { MissionsOnStations, Station } from "@repo/db";
import { Station } from "@repo/db";
import { getConnectedAircraftsAPI } from "_querys/aircrafts";
import { FMS_STATUS_COLORS, FMS_STATUS_TEXT_COLORS } from "_components/map/AircraftMarker";
import { FMS_STATUS_COLORS, FMS_STATUS_TEXT_COLORS } from "_helpers/fmsStatusColors";
import { useMapStore } from "_store/mapStore";
import { useDispatchConnectionStore } from "_store/dispatch/connectionStore";
@@ -68,7 +67,7 @@ export const SituationBoard = () => {
{/* head */}
<thead>
<tr>
<th>ID</th>
<th>E-Nr.</th>
<th>Stichwort</th>
<th>Stadt</th>
<th>Stationen</th>
@@ -76,39 +75,42 @@ export const SituationBoard = () => {
</thead>
<tbody>
{/* row 1 */}
{missions?.map((mission) => (
<tr
onDoubleClick={() => {
setOpenMissionMarker({
open: [
{
id: mission.id,
tab: "home",
},
],
close: [],
});
setMap({
center: {
lat: mission.addressLat,
lng: mission.addressLng,
},
zoom: 14,
});
}}
key={mission.id}
className={cn(mission.state === "draft" && "bg-base-300")}
>
<td>{mission.publicId}</td>
<td>{mission.missionKeywordAbbreviation}</td>
<td>{mission.addressCity}</td>
<td>
{(mission as any).MissionsOnStations?.map(
(mos: { Station: Station }) => mos.Station?.bosCallsignShort,
).join(", ")}
</td>
</tr>
))}
{missions?.map(
(mission) =>
(dispatcherConnected || mission.state !== "draft") && (
<tr
onDoubleClick={() => {
setOpenMissionMarker({
open: [
{
id: mission.id,
tab: "home",
},
],
close: [],
});
setMap({
center: {
lat: mission.addressLat,
lng: mission.addressLng,
},
zoom: 14,
});
}}
key={mission.id}
className={cn(mission.state === "draft" && "missionListItem")}
>
<td>{mission.publicId}</td>
<td>{mission.missionKeywordAbbreviation}</td>
<td>{mission.addressCity}</td>
<td>
{(mission as any).MissionsOnStations?.map(
(mos: { Station: Station }) => mos.Station?.bosCallsignShort,
).join(", ")}
</td>
</tr>
),
)}
</tbody>
</table>
</div>