[Web] Merge same notification types

This commit is contained in:
andryyy
2020-05-20 20:37:52 +02:00
parent 8260fb5baf
commit ccc56c54a9
3 changed files with 10 additions and 2 deletions

View File

@@ -42,8 +42,11 @@ $(document).ready(function() {
$alertbox_log_parser = alertbox_log_parser($_SESSION);
if (is_array($alertbox_log_parser)) {
foreach($alertbox_log_parser as $log) {
$alerts[$log['type']][] = $log['msg'];
}
foreach($alerts as $alert_type => $alert_msg) {
?>
mailcow_alert_box(<?=$log['msg'];?>, <?=$log['type'];?>);
mailcow_alert_box(<?=json_encode(implode('<hr class="alert-hr">', $alert_msg));?>, <?=$alert_type;?>);
<?php
}
unset($_SESSION['return']);

View File

@@ -436,7 +436,7 @@ function alertbox_log_parser($_data){
else {
$msg = $return['msg'];
}
$log_array[] = array('msg' => json_encode($msg), 'type' => json_encode($type));
$log_array[] = array('msg' => $msg, 'type' => json_encode($type));
}
if (!empty($log_array)) {
return $log_array;