[Web] Add rspamd-stats route to API

This commit is contained in:
andryyy 2020-09-06 08:54:09 +02:00
parent 003499200e
commit f3c72832f2
No known key found for this signature in database
GPG key ID: 8EC34FF2794E25EF
2 changed files with 18 additions and 0 deletions

View file

@ -707,6 +707,10 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
}
echo (isset($logs) && !empty($logs)) ? json_encode($logs, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) : '{}';
break;
case "rspamd-stats":
$logs = get_logs('rspamd-stats');
echo (isset($logs) && !empty($logs)) ? json_encode($logs, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) : '{}';
break;
// return no route found if no case is matched
default:
http_response_code(404);