@@ -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