From 449f7e2daa6dd32f61ee5f91cf1f402378a2a06d Mon Sep 17 00:00:00 2001 From: Meik Date: Mon, 10 Nov 2025 19:05:15 +0100 Subject: [PATCH] =?UTF-8?q?Link=20am=20Betrieb=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AdminSettingsPanel.js | 284 ++++++++++++++++----------- 1 file changed, 172 insertions(+), 112 deletions(-) diff --git a/src/components/AdminSettingsPanel.js b/src/components/AdminSettingsPanel.js index b7a56ae..39d75ba 100644 --- a/src/components/AdminSettingsPanel.js +++ b/src/components/AdminSettingsPanel.js @@ -1,5 +1,40 @@ +import { useState } from 'react'; import { Link } from 'react-router-dom'; +const SettingField = ({ label, description, children }) => { + const [showHelp, setShowHelp] = useState(false); + return ( +
+
+ + {description && ( + + )} +
+ {children} + {showHelp && description && ( +

{description}

+ )} +
+ ); +}; + +const SettingSection = ({ title, subtitle, children }) => ( +
+
+

{title}

+ {subtitle &&

{subtitle}

} +
+
{children}
+
+); + const AdminSettingsPanel = ({ adminSettings, adminSettingsLoading, @@ -18,7 +53,7 @@ const AdminSettingsPanel = ({

Admin-Einstellungen

-

Globale Abläufe und Verzögerungen für die Abhol-Automation verwalten.

+

Globale Abläufe und Benachrichtigungen feinjustieren.

{adminSettingsLoading &&

Lade Admin-Einstellungen...

} - {!adminSettingsLoading && !adminSettings &&

Keine Admin-Einstellungen verfügbar.

} + {!adminSettingsLoading && !adminSettings && ( +

Keine Admin-Einstellungen verfügbar.

+ )} {adminSettings && ( <> -
-
- + + onSettingChange('scheduleCron', event.target.value)} className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" - placeholder="z. B. 0 * * * *" + placeholder="z. B. */10 7-22 * * *" /> -
+ -
- +
-
+ -
- +
-
+ -
- + -
-
+ + -
-
- + + -

- Legt fest, wie häufig der Team-Status der überwachten Betriebe geprüft wird. -

-
-
- + + +
-

- Wird genutzt, um die ersten Prüfungen leicht zu verteilen. -

-
-
+ + -
-
-

Ignorierte Slots

- -
+ {(!adminSettings.ignoredSlots || adminSettings.ignoredSlots.length === 0) && (

Keine Regeln definiert.

)} {adminSettings.ignoredSlots?.map((slot, index) => ( -
+
))} -
+ +
-
-
-
-
-

ntfy

-

Konfiguration für Systembenachrichtigungen via ntfy.

+ +
+
+
+
+

ntfy

+

Push-Nachrichten via ntfy-Server.

+
+
-
-
- onNotificationChange('ntfy', 'serverUrl', event.target.value)} - className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" - placeholder="Server-URL" - /> - onNotificationChange('ntfy', 'topicPrefix', event.target.value)} - className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" - placeholder="Themenpräfix" - /> - onNotificationChange('ntfy', 'username', event.target.value)} - className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" - placeholder="Benutzername" - /> - onNotificationChange('ntfy', 'password', event.target.value)} - className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" - placeholder="Passwort" - /> + +
+
+
+

Telegram

+

Bot-Einstellungen für Telegram-Nachrichten.

+
+ +
+
+ onNotificationChange('telegram', 'botToken', event.target.value)} + className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" + placeholder="Bot-Token" + /> +
- -
-
-
-

Telegram

-

Bot-Konfiguration für Telegram-Benachrichtigungen.

-
- -
- onNotificationChange('telegram', 'botToken', event.target.value)} - className="border rounded p-2 w-full focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500" - placeholder="Bot-Token" - /> -
-
+