XPlane Plugin anzeige auf tracker

This commit is contained in:
PxlLoewe
2025-10-04 21:16:24 +02:00
parent 859b8519db
commit a2c320ddbe
4 changed files with 28 additions and 17 deletions

View File

@@ -296,6 +296,12 @@ const StationTab = ({ aircraft }: { aircraft: ConnectedAircraft & { Station: Sta
{aircraft.posH145active ? "H145 Aktiv" : "H145 Inaktiv"} {aircraft.posH145active ? "H145 Aktiv" : "H145 Inaktiv"}
</span> </span>
</span> </span>
<span className="flex items-center gap-2">
<Lollipop size={16} />{" "}
<span className={cn(aircraft.posXplanePluginActive && "text-green-500")}>
{aircraft.posXplanePluginActive ? "X-Plane Plugin Aktiv" : "X-Plane Plugin Inaktiv"}
</span>
</span>
</div> </div>
</div> </div>
); );

View File

@@ -21,9 +21,10 @@ export const PUT = async (req: Request) => {
if (!session && !payload) return Response.json({ message: "Unauthorized" }, { status: 401 }); if (!session && !payload) return Response.json({ message: "Unauthorized" }, { status: 401 });
const userId = session?.user.id || payload.id; const userId = session?.user.id || payload.id;
const { position, h145 } = (await req.json()) as { const { position, h145, xPlanePluginActive } = (await req.json()) as {
position: PositionLog; position: PositionLog;
h145: boolean; h145: boolean;
xPlanePluginActive: boolean;
}; };
if (!position) { if (!position) {
return Response.json({ message: "Missing id or position" }); return Response.json({ message: "Missing id or position" });
@@ -61,6 +62,7 @@ export const PUT = async (req: Request) => {
posHeading: position.heading, posHeading: position.heading,
posSpeed: position.speed, posSpeed: position.speed,
posH145active: h145, posH145active: h145,
posXplanePluginActive: xPlanePluginActive,
}, },
}); });

View File

@@ -1,21 +1,22 @@
model ConnectedAircraft { model ConnectedAircraft {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
userId String userId String
publicUser Json publicUser Json
lastHeartbeat DateTime @default(now()) lastHeartbeat DateTime @default(now())
fmsStatus String @default("6") fmsStatus String @default("6")
// position: // position:
posLat Float? posLat Float?
posLng Float? posLng Float?
posAlt Int? posAlt Int?
posSpeed Int? posSpeed Int?
posHeading Int? posHeading Int?
simulator String? simulator String?
posH145active Boolean @default(false) posH145active Boolean @default(false)
stationId Int posXplanePluginActive Boolean @default(false)
loginTime DateTime @default(now()) stationId Int
esimatedLogoutTime DateTime? loginTime DateTime @default(now())
logoutTime DateTime? esimatedLogoutTime DateTime?
logoutTime DateTime?
// relations: // relations:
User User @relation(fields: [userId], references: [id], onDelete: Cascade) User User @relation(fields: [userId], references: [id], onDelete: Cascade)

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "ConnectedAircraft" ADD COLUMN "posXplanePluginActive" BOOLEAN NOT NULL DEFAULT false;