From 2d26862b6c15a8b314b39de45923fa25bf3bdbe2 Mon Sep 17 00:00:00 2001 From: Davide Passoni Date: Wed, 19 Mar 2025 17:23:17 +0100 Subject: [PATCH] fix: Error in admin panel inputs fixed, plus improvements to modal panels --- frontend/react/src/ui/modals/adminmodal.tsx | 14 ++++---- .../react/src/ui/modals/components/modal.tsx | 23 +++++++------ .../react/src/ui/modals/importexportmodal.tsx | 2 ++ frontend/react/src/ui/modals/keybindmodal.tsx | 6 ++-- .../src/ui/modals/protectionpromptmodal.tsx | 1 + frontend/react/src/ui/modals/warningmodal.tsx | 30 +++++++---------- frontend/react/src/ui/panels/header.tsx | 32 +++++++++++-------- 7 files changed, 55 insertions(+), 53 deletions(-) diff --git a/frontend/react/src/ui/modals/adminmodal.tsx b/frontend/react/src/ui/modals/adminmodal.tsx index 1f6bf47c..969b4e66 100644 --- a/frontend/react/src/ui/modals/adminmodal.tsx +++ b/frontend/react/src/ui/modals/adminmodal.tsx @@ -76,11 +76,11 @@ export function AdminModal(props: { open: boolean }) { return ( - -
-
+ +
+
Groups:
-
+
{configs.groups && Object.keys(configs.groups).map((group: any) => { return ( @@ -142,7 +142,7 @@ export function AdminModal(props: { open: boolean }) { type="text" autoComplete="new-password" onChange={(ev) => { - setNewUserName(ev.currentTarget.value); + setNewGroupName(ev.currentTarget.value); }} className={` rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm @@ -173,9 +173,9 @@ export function AdminModal(props: { open: boolean }) {
-
+
Users:
-
+
{configs.users && Object.keys(configs.users).map((user: any) => { return ( diff --git a/frontend/react/src/ui/modals/components/modal.tsx b/frontend/react/src/ui/modals/components/modal.tsx index b8734b8f..2e5eb931 100644 --- a/frontend/react/src/ui/modals/components/modal.tsx +++ b/frontend/react/src/ui/modals/components/modal.tsx @@ -4,7 +4,7 @@ import { FaXmark } from "react-icons/fa6"; import { getApp, OlympusApp } from "../../../olympusapp"; import { OlympusState } from "../../../constants/constants"; -export function Modal(props: { open: boolean; children?: JSX.Element | JSX.Element[]; className?: string }) { +export function Modal(props: { open: boolean; children?: JSX.Element | JSX.Element[]; className?: string; size?: "sm" | "md" | "lg" | "full" }) { const [splash, setSplash] = useState(Math.ceil(Math.random() * 7)); useEffect(() => { @@ -18,19 +18,18 @@ export function Modal(props: { open: boolean; children?: JSX.Element | JSX.Eleme
- +
+
+
); } diff --git a/frontend/react/src/ui/modals/keybindmodal.tsx b/frontend/react/src/ui/modals/keybindmodal.tsx index f39da88b..fd98864d 100644 --- a/frontend/react/src/ui/modals/keybindmodal.tsx +++ b/frontend/react/src/ui/modals/keybindmodal.tsx @@ -61,7 +61,8 @@ export function KeybindModal(props: { open: boolean }) { } return ( - + +
)}
-
+
{shortcut && (
+
); } diff --git a/frontend/react/src/ui/modals/protectionpromptmodal.tsx b/frontend/react/src/ui/modals/protectionpromptmodal.tsx index 6017c8e8..a0a680f5 100644 --- a/frontend/react/src/ui/modals/protectionpromptmodal.tsx +++ b/frontend/react/src/ui/modals/protectionpromptmodal.tsx @@ -10,6 +10,7 @@ export function ProtectionPromptModal(props: { open: boolean }) { return (
diff --git a/frontend/react/src/ui/modals/warningmodal.tsx b/frontend/react/src/ui/modals/warningmodal.tsx index 2e3c349c..fee3b9d8 100644 --- a/frontend/react/src/ui/modals/warningmodal.tsx +++ b/frontend/react/src/ui/modals/warningmodal.tsx @@ -46,19 +46,12 @@ export function WarningModal(props: { open: boolean }) { ); break; case WarningSubstate.NOT_SECURE: - case WarningSubstate.NOT_CHROME: warningText = (
Your connection to DCS Olympus is not secure. To protect your personal data some advanced DCS Olympus features like the camera plugin or the audio backend have been disabled. - To solve this issue, DCS Olympus should be served using the{" "} - - https - {" "} - protocol. + To solve this issue, DCS Olympus should be served using the https protocol. To do so, we suggest using a dedicated server and a reverse proxy with SSL enabled.
@@ -73,27 +66,26 @@ export function WarningModal(props: { open: boolean }) {
); break; - case WarningSubstate.ERROR_UPLOADING_CONFIG: - warningText = ( -
- An error has occurred uploading the admin configuration. - - -
- ); - break; + case WarningSubstate.ERROR_UPLOADING_CONFIG: + warningText = ( +
+ An error has occurred uploading the admin configuration. + +
+ ); + break; default: break; } } return ( - +
Warning
-
{warningText}
+
{warningText}
- {savingSessionData ? ( -
- -
- ) : ( -
- - + +
+ ) : ( +
+ + - -
- )} + /> + +
+ )}