Dispatch Router-Struktur; AddPenalty Layout gefixed
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
import { toast } from "react-hot-toast";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { ReactNode, useEffect, useState } from "react";
|
||||
import { dispatchSocket } from "dispatch/socket";
|
||||
import { dispatchSocket } from "(app)/dispatch/socket";
|
||||
import { Mission, NotificationPayload } from "@repo/db";
|
||||
import { HPGnotificationToast } from "_components/customToasts/HPGnotification";
|
||||
import { useMapStore } from "_store/mapStore";
|
||||
import { AdminMessageToast } from "_components/customToasts/AdminMessage";
|
||||
import { pilotSocket } from "pilot/socket";
|
||||
import { pilotSocket } from "(app)/pilot/socket";
|
||||
|
||||
export function QueryProvider({ children }: { children: ReactNode }) {
|
||||
const mapStore = useMapStore((s) => s);
|
||||
|
||||
@@ -150,21 +150,29 @@ export default function AdminPanel() {
|
||||
</td>
|
||||
<td className="flex gap-2">
|
||||
<PenaltyDropdown
|
||||
btnName="Verbindung trennen"
|
||||
btnClassName="btn-warning"
|
||||
btnTip="Kick"
|
||||
btnTip="Die Verbindung zur Leitstelle wird für diesesn Nutzer unterbrochen"
|
||||
Icon={<RedoDot size={15} />}
|
||||
onClick={({ reason }) =>
|
||||
kickPilotMutation.mutate({ id: p.id, reason })
|
||||
}
|
||||
/>
|
||||
<PenaltyDropdown
|
||||
btnName="Kick + Berechtigungen entfernen"
|
||||
btnClassName="btn-error tooltip-error"
|
||||
btnTip="Kick + Berechtigungen entfernen"
|
||||
btnTip="Dadurch wird sich der Pilot nicht mehr mit dem VAR verbinden können."
|
||||
showDatePicker
|
||||
Icon={<LockKeyhole size={15} />}
|
||||
onClick={({ reason, until }) =>
|
||||
kickPilotMutation.mutate({ id: p.id, reason, bann: true, until })
|
||||
}
|
||||
onClick={({ reason, until }) => {
|
||||
if (!until) {
|
||||
toast.error(
|
||||
"Bitte wähle ein Datum aus. Ein permanenter Bann ist nur vom HUB aus möglich.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
kickPilotMutation.mutate({ id: p.id, reason, bann: true, until });
|
||||
}}
|
||||
/>
|
||||
<a
|
||||
href={`${process.env.NEXT_PUBLIC_HUB_URL}/admin/user/${p.userId}`}
|
||||
@@ -203,16 +211,18 @@ export default function AdminPanel() {
|
||||
</td>
|
||||
<td className="flex gap-2">
|
||||
<PenaltyDropdown
|
||||
btnName="Verbindung trennen"
|
||||
btnClassName="btn-warning"
|
||||
btnTip="Kick"
|
||||
btnTip="Die Verbindung zur Leitstelle wird für diesesn Nutzer unterbrochen"
|
||||
Icon={<RedoDot size={15} />}
|
||||
onClick={({ reason }) =>
|
||||
kickDispatchMutation.mutate({ id: d.id, reason })
|
||||
}
|
||||
/>
|
||||
<PenaltyDropdown
|
||||
btnName="Kick + Berechtigungen entfernen"
|
||||
btnClassName="btn-error tooltip-error"
|
||||
btnTip="Kick + Berechtigungen entfernen"
|
||||
btnTip="Dadurch wird sich der Pilot nicht mehr mit dem VAR verbinden können."
|
||||
showDatePicker
|
||||
Icon={<LockKeyhole size={15} />}
|
||||
onClick={({ reason, until }) =>
|
||||
@@ -264,12 +274,6 @@ export default function AdminPanel() {
|
||||
>
|
||||
<RedoDot size={15} />
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-xs btn-square btn-error btn-soft tooltip tooltip-bottom tooltip-error"
|
||||
data-tip="Kick + Berechtigungen entfernen"
|
||||
>
|
||||
<LockKeyhole size={15} />
|
||||
</button>
|
||||
<a
|
||||
href={`${process.env.NEXT_PUBLIC_HUB_URL}/admin/user/${p.participant.attributes.userId}`}
|
||||
target="_blank"
|
||||
|
||||
Reference in New Issue
Block a user