[Web] Merge same notification types

master
andryyy 2020-05-20 20:37:52 +02:00
parent 8260fb5baf
commit ccc56c54a9
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
3 changed files with 10 additions and 2 deletions

View File

@ -182,3 +182,8 @@ nav .glyphicon {
padding: 15px 0px 15px 15px;
font-weight: bold;
}
.alert-hr {
margin:3px 0px;
border-bottom:1px solid #f5f5f5!important;
opacity: 0.3;
}

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;