Release v2.0.4 #140
@@ -296,6 +296,12 @@ const StationTab = ({ aircraft }: { aircraft: ConnectedAircraft & { Station: Sta
|
||||
{aircraft.posH145active ? "H145 Aktiv" : "H145 Inaktiv"}
|
||||
</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>
|
||||
);
|
||||
|
||||
@@ -21,9 +21,10 @@ export const PUT = async (req: Request) => {
|
||||
if (!session && !payload) return Response.json({ message: "Unauthorized" }, { status: 401 });
|
||||
|
||||
const userId = session?.user.id || payload.id;
|
||||
const { position, h145 } = (await req.json()) as {
|
||||
const { position, h145, xPlanePluginActive } = (await req.json()) as {
|
||||
position: PositionLog;
|
||||
h145: boolean;
|
||||
xPlanePluginActive: boolean;
|
||||
};
|
||||
if (!position) {
|
||||
return Response.json({ message: "Missing id or position" });
|
||||
@@ -61,6 +62,7 @@ export const PUT = async (req: Request) => {
|
||||
posHeading: position.heading,
|
||||
posSpeed: position.speed,
|
||||
posH145active: h145,
|
||||
posXplanePluginActive: xPlanePluginActive,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
model ConnectedAircraft {
|
||||
id Int @id @default(autoincrement())
|
||||
userId String
|
||||
publicUser Json
|
||||
lastHeartbeat DateTime @default(now())
|
||||
fmsStatus String @default("6")
|
||||
id Int @id @default(autoincrement())
|
||||
userId String
|
||||
publicUser Json
|
||||
lastHeartbeat DateTime @default(now())
|
||||
fmsStatus String @default("6")
|
||||
// position:
|
||||
posLat Float?
|
||||
posLng Float?
|
||||
posAlt Int?
|
||||
posSpeed Int?
|
||||
posHeading Int?
|
||||
simulator String?
|
||||
posH145active Boolean @default(false)
|
||||
stationId Int
|
||||
loginTime DateTime @default(now())
|
||||
esimatedLogoutTime DateTime?
|
||||
logoutTime DateTime?
|
||||
posLat Float?
|
||||
posLng Float?
|
||||
posAlt Int?
|
||||
posSpeed Int?
|
||||
posHeading Int?
|
||||
simulator String?
|
||||
posH145active Boolean @default(false)
|
||||
posXplanePluginActive Boolean @default(false)
|
||||
stationId Int
|
||||
loginTime DateTime @default(now())
|
||||
esimatedLogoutTime DateTime?
|
||||
logoutTime DateTime?
|
||||
|
||||
// relations:
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "ConnectedAircraft" ADD COLUMN "posXplanePluginActive" BOOLEAN NOT NULL DEFAULT false;
|
||||
Reference in New Issue
Block a user