resolves #96
This commit is contained in:
@@ -54,7 +54,14 @@ export const SituationBoard = () => {
|
||||
queryKey: ["aircrafts"],
|
||||
queryFn: () => getConnectedAircraftsAPI(),
|
||||
});
|
||||
const { setOpenAircraftMarker, setOpenMissionMarker, setMap } = useMapStore((state) => state);
|
||||
const {
|
||||
setOpenAircraftMarker,
|
||||
setOpenMissionMarker,
|
||||
setMap,
|
||||
userSettings,
|
||||
openAircraftMarker,
|
||||
openMissionMarker,
|
||||
} = useMapStore((state) => state);
|
||||
|
||||
return (
|
||||
<div className={cn("dropdown dropdown-top", situationTabOpen && "dropdown-open")}>
|
||||
@@ -112,15 +119,27 @@ export const SituationBoard = () => {
|
||||
mission.state === "draft" && "missionListItem",
|
||||
)}
|
||||
onDoubleClick={() => {
|
||||
setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
if (userSettings.settingsAutoCloseMapPopup) {
|
||||
setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: openMissionMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
} else {
|
||||
setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
setMap({
|
||||
center: {
|
||||
lat: mission.addressLat,
|
||||
@@ -161,45 +180,57 @@ export const SituationBoard = () => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{connectedAircrafts?.map((station) => (
|
||||
{connectedAircrafts?.map((aircraft) => (
|
||||
<tr
|
||||
className="cursor-pointer"
|
||||
key={station.id}
|
||||
key={aircraft.id}
|
||||
onDoubleClick={() => {
|
||||
setOpenAircraftMarker({
|
||||
open: [
|
||||
{
|
||||
id: station.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
if (station.posLat === null || station.posLng === null) return;
|
||||
if (userSettings.settingsAutoCloseMapPopup) {
|
||||
setOpenAircraftMarker({
|
||||
open: [
|
||||
{
|
||||
id: aircraft.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: openAircraftMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
} else {
|
||||
setOpenAircraftMarker({
|
||||
open: [
|
||||
{
|
||||
id: aircraft.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
if (aircraft.posLat === null || aircraft.posLng === null) return;
|
||||
setMap({
|
||||
center: {
|
||||
lat: station.posLat,
|
||||
lng: station.posLng,
|
||||
lat: aircraft.posLat,
|
||||
lng: aircraft.posLng,
|
||||
},
|
||||
zoom: 14,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<td>{station.Station.bosCallsignShort}</td>
|
||||
<td>{aircraft.Station.bosCallsignShort}</td>
|
||||
<td
|
||||
className="font-lg text-center font-semibold"
|
||||
style={{
|
||||
color: FMS_STATUS_TEXT_COLORS[station.fmsStatus],
|
||||
backgroundColor: FMS_STATUS_COLORS[station.fmsStatus],
|
||||
color: FMS_STATUS_TEXT_COLORS[aircraft.fmsStatus],
|
||||
backgroundColor: FMS_STATUS_COLORS[aircraft.fmsStatus],
|
||||
}}
|
||||
>
|
||||
{station.fmsStatus}
|
||||
{aircraft.fmsStatus}
|
||||
</td>
|
||||
<td className="whitespace-nowrap">
|
||||
{station.posLng || !station.posLat ? (
|
||||
<>{findLeitstelleForPosition(station.posLng!, station.posLat!)}</>
|
||||
{aircraft.posLng || !aircraft.posLat ? (
|
||||
<>{findLeitstelleForPosition(aircraft.posLng!, aircraft.posLat!)}</>
|
||||
) : (
|
||||
station.Station.bosRadioArea
|
||||
aircraft.Station.bosRadioArea
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user