Skip to content

Commit c1289dc

Browse files
committed
feat: reorganize admin settings dashboard
1 parent e04d863 commit c1289dc

4 files changed

Lines changed: 211 additions & 31 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A local-first emergency board for bed occupancy and patient flow.
77

88
<p align="center">
9-
<img alt="Release Channel" src="https://img.shields.io/badge/Release%20Channel-beta--1.0.1-8FAADC?style=flat-square" />
9+
<img alt="Release Channel" src="https://img.shields.io/badge/Release%20Channel-beta--1.0.3-8FAADC?style=flat-square" />
1010
<img alt="Legacy Tags" src="https://img.shields.io/badge/Legacy%20Tags-alpha--v*-B5C7A4?style=flat-square" />
1111
<img alt="Backend Coverage" src="https://img.shields.io/badge/Backend%20Coverage-26.8%25-7AB893?style=flat-square" />
1212
<img alt="Frontend Coverage" src="https://img.shields.io/badge/Frontend%20Coverage-32.82%25-6FA7C7?style=flat-square" />

frontend/src/App.jsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,32 @@ function App() {
545545
showSuccess(tr(locale, 'Notification accusee.', 'Notification acknowledged.', 'تم تأكيد الإشعار.'));
546546
};
547547

548+
const acknowledgeAllAlertNotifications = async () => {
549+
if (!isAdmin) return;
550+
const pending = (Array.isArray(alertNotifications) ? alertNotifications : [])
551+
.filter((entry) => String(entry.status || '').toLowerCase() !== 'acknowledged');
552+
if (!pending.length) {
553+
showSuccess(tr(locale, 'Aucune notification en attente.', 'No pending notifications.', 'لا توجد إشعارات معلقة.'));
554+
return;
555+
}
556+
let failed = 0;
557+
for (const entry of pending) {
558+
const response = await api('/api/admin/integrations/alerts/notifications/ack', {
559+
method: 'POST',
560+
body: JSON.stringify({ id: Number(entry.id) }),
561+
});
562+
if (!response.ok) {
563+
failed += 1;
564+
}
565+
}
566+
await refreshAlertNotifications({ announce: false });
567+
if (failed > 0) {
568+
showError(tr(locale, `${failed} accusés ont échoué.`, `${failed} acknowledgments failed.`, `فشل ${failed} من عمليات التأكيد.`));
569+
return;
570+
}
571+
showSuccess(tr(locale, `${pending.length} notifications accusées.`, `${pending.length} notifications acknowledged.`, `تم تأكيد ${pending.length} إشعارًا.`));
572+
};
573+
548574
const refreshSecurityConfig = async () => {
549575
if (!isAdmin) return;
550576
const response = await api('/api/admin/security/config', { method: 'GET' });
@@ -1617,26 +1643,33 @@ function App() {
16171643
newUser={newUser}
16181644
setNewUser={setNewUser}
16191645
createUser={createUser}
1646+
refreshUsers={refreshUsers}
16201647
resetPasswordForm={resetPasswordForm}
16211648
setResetPasswordForm={setResetPasswordForm}
16221649
resetUserPassword={resetUserPassword}
1650+
usersCount={users.length}
16231651
createBackup={createBackup}
16241652
restoreLatestBackup={restoreLatestBackup}
16251653
lastBackupFile={lastBackupFile}
1654+
refreshAuditLogs={() => refreshAudit(true)}
16261655
gotifyForm={gotifyForm}
16271656
setGotifyForm={setGotifyForm}
16281657
saveGotifySettings={saveGotifySettings}
16291658
testGotifySettings={testGotifySettings}
1659+
refreshGotifySettings={refreshGotifySettings}
16301660
alertChannelsForm={alertChannelsForm}
16311661
setAlertChannelsForm={setAlertChannelsForm}
16321662
saveAlertChannelsSettings={saveAlertChannelsSettings}
16331663
testAlertChannelsSettings={testAlertChannelsSettings}
1664+
refreshAlertChannelsSettings={refreshAlertChannelsSettings}
16341665
alertNotifications={alertNotifications}
16351666
refreshAlertNotifications={refreshAlertNotifications}
16361667
acknowledgeAlertNotification={acknowledgeAlertNotification}
1668+
acknowledgeAllAlertNotifications={acknowledgeAllAlertNotifications}
16371669
securityConfigForm={securityConfigForm}
16381670
setSecurityConfigForm={setSecurityConfigForm}
16391671
saveSecurityConfig={saveSecurityConfig}
1672+
refreshSecurityConfig={refreshSecurityConfig}
16401673
securityHealth={securityHealth}
16411674
refreshSecurityHealth={refreshSecurityHealth}
16421675
exportAuditCsv={exportAuditCsv}
@@ -1646,6 +1679,7 @@ function App() {
16461679
uiConfigForm={uiConfigForm}
16471680
setUiConfigForm={setUiConfigForm}
16481681
saveUiConfig={saveUiConfig}
1682+
refreshUIConfig={refreshUIConfig}
16491683
locale={locale}
16501684
renderUsers={renderUsers}
16511685
auditLogs={auditLogs}

0 commit comments

Comments
 (0)