refactoring node 24

This commit is contained in:
2025-11-10 11:01:18 +01:00
parent dff35b8218
commit 9870a55b02
2 changed files with 32 additions and 8 deletions

View File

@@ -1149,6 +1149,9 @@ function App() {
formatRangeLabel={formatRangeLabel} formatRangeLabel={formatRangeLabel}
onSaveConfig={saveConfig} onSaveConfig={saveConfig}
onResetConfig={() => fetchConfig()} onResetConfig={() => fetchConfig()}
onHideEntry={hideEntry}
onDeleteEntry={deleteEntry}
canDelete={Boolean(session?.isAdmin)}
/> />
); );

View File

@@ -25,7 +25,10 @@ const DashboardView = ({
onRangePickerRequest, onRangePickerRequest,
formatRangeLabel, formatRangeLabel,
onSaveConfig, onSaveConfig,
onResetConfig onResetConfig,
onHideEntry,
onDeleteEntry,
canDelete
}) => { }) => {
const { const {
error: notificationError, error: notificationError,
@@ -192,9 +195,10 @@ const DashboardView = ({
<th className="px-4 py-2">Aktiv</th> <th className="px-4 py-2">Aktiv</th>
<th className="px-4 py-2">Geschäft</th> <th className="px-4 py-2">Geschäft</th>
<th className="px-4 py-2">Profil prüfen</th> <th className="px-4 py-2">Profil prüfen</th>
<th className="px-4 py-2">Nur benachrichtigen</th> <th className="px-4 py-2">Nur benachrichtigen</th>
<th className="px-4 py-2">Wochentag</th> <th className="px-4 py-2">Wochentag</th>
<th className="px-4 py-2">Datum / Zeitraum</th> <th className="px-4 py-2">Datum / Zeitraum</th>
<th className="px-4 py-2 text-right">Aktionen</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -272,6 +276,27 @@ const DashboardView = ({
<span className="block text-xs text-gray-500">Klicke zum Auswählen</span> <span className="block text-xs text-gray-500">Klicke zum Auswählen</span>
</button> </button>
</td> </td>
<td className="px-4 py-2 text-right space-x-2">
<button
type="button"
onClick={() => onHideEntry(item.id)}
className="text-sm text-gray-600 hover:text-gray-900"
>
Ausblenden
</button>
{canDelete && (
<button
type="button"
onClick={() => onDeleteEntry(item.id)}
className="ml-2 text-red-600 hover:text-red-800"
title="Löschen"
>
<svg xmlns="http://www.w3.org/2000/svg" className="inline h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
</button>
)}
</td>
</tr> </tr>
); );
})} })}
@@ -288,10 +313,6 @@ const DashboardView = ({
</button> </button>
</div> </div>
<div className="mt-8 p-4 border rounded bg-gray-50">
<h2 className="text-lg font-bold mb-2">Aktuelle JSON-Konfiguration:</h2>
<pre className="bg-gray-100 p-4 rounded overflow-x-auto">{JSON.stringify(config, null, 2)}</pre>
</div>
</div> </div>
); );
}; };