From 1599226f530118ac9b29716bdffc001e67d740e0 Mon Sep 17 00:00:00 2001 From: nocnico Date: Mon, 2 Jun 2025 21:36:02 +0200 Subject: [PATCH 1/2] Update Tracker Connections UI --- .../_components/ConnectedDispatcher.tsx | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/dispatch/app/tracker/_components/ConnectedDispatcher.tsx b/apps/dispatch/app/tracker/_components/ConnectedDispatcher.tsx index 2295dee2..d23a9f88 100644 --- a/apps/dispatch/app/tracker/_components/ConnectedDispatcher.tsx +++ b/apps/dispatch/app/tracker/_components/ConnectedDispatcher.tsx @@ -3,6 +3,7 @@ import { useQuery } from "@tanstack/react-query"; import { Badge } from "_components/Badge/Badge"; import { getConnectedAircraftsAPI } from "_querys/aircrafts"; import { getConnectedDispatcherAPI } from "_querys/connected-user"; +import { Plane, Workflow } from "lucide-react"; export const ConnectedDispatcher = () => { const { data: dispatcher } = useQuery({ @@ -21,18 +22,23 @@ export const ConnectedDispatcher = () => {
{/*
Kein Disponent Online
*/} -
- {(aircrafts?.length || 0) + (dispatcher?.length || 0)} Verbundene Mitglieder +
+ {(aircrafts?.length || 0) + (dispatcher?.length || 0)} Verbundene Mitglieder +
+
0 ? "badge-success" : "badge-error" + }`} + > + {dispatcher?.length || 0} +
+
+ {aircrafts?.length || 0} +
+
    -
  • - Disponenten: {dispatcher?.length || 0} -
  • -
  • - Piloten: {aircrafts?.length || 0} -
  • - {dispatcher?.map((d) => { return (
  • From 984eb093a0fc090d8e170a872319ddcd3370fb4b Mon Sep 17 00:00:00 2001 From: nocnico Date: Mon, 2 Jun 2025 22:01:45 +0200 Subject: [PATCH 2/2] Edit Navbar Connection, Fix Tracker Grammar, Auto Redirect on Dispatch Main Page, Adjust Toast Position --- .../dispatch/app/_components/map/BaseMaps.tsx | 2 +- .../navbar/_components/Connection.tsx | 37 ++++++++++--------- apps/dispatch/app/layout.tsx | 2 +- apps/dispatch/app/page.tsx | 23 ++++++------ .../navbar/_components/Connection.tsx | 10 ++--- .../_components/ConnectedDispatcher.tsx | 6 ++- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/apps/dispatch/app/_components/map/BaseMaps.tsx b/apps/dispatch/app/_components/map/BaseMaps.tsx index 13b95956..6c377602 100644 --- a/apps/dispatch/app/_components/map/BaseMaps.tsx +++ b/apps/dispatch/app/_components/map/BaseMaps.tsx @@ -314,7 +314,7 @@ export const BaseMaps = () => { return ( - + diff --git a/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx b/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx index 5023e6ab..c25f4581 100644 --- a/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx +++ b/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx @@ -2,6 +2,7 @@ import { useSession } from "next-auth/react"; import { useDispatchConnectionStore } from "../../../../_store/dispatch/connectionStore"; import { useRef, useState } from "react"; +import { toast } from "react-hot-toast"; export const ConnectionBtn = () => { const modalRef = useRef(null); @@ -10,6 +11,7 @@ export const ConnectionBtn = () => { logoffTime: "", selectedZone: "LST_01", }); + const [logoffDebounce, setLogoffDebounce] = useState(null); const session = useSession(); const uid = session.data?.user?.id; if (!uid) return null; @@ -22,14 +24,14 @@ export const ConnectionBtn = () => { {connection.status == "connected" ? ( ) : ( )} @@ -50,10 +50,7 @@ export const ConnectionBtn = () => {
    {connection.status == "connected" ? (

    - Verbunden als{" "} - - <{connection.selectedZone}> - + Verbunden als <{connection.selectedZone}>

    ) : (

    Als Disponent anmelden

    @@ -62,26 +59,30 @@ export const ConnectionBtn = () => { {connection.status == "disconnected" && ( -

    - Du kannst diese Zeit später noch anpassen. -

    +

    Du kannst diese Zeit später noch anpassen.

    )}
    - + {connection.status == "connected" ? ( ) : ( + {connection.status == "connected" ? ( ) : (