[Web] Show XMPP status in /debug

master
andryyy 2021-02-11 09:34:08 +01:00
parent 77ceb5e8ad
commit e51479700b
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 50 additions and 8 deletions

View File

@ -6,6 +6,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
$solr_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_SOLR"])) ? false : solr_status();
$clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"])) ? false : true;
$xmpp_status = xmpp_control('status');
?>
<div class="container">
@ -48,7 +49,7 @@ $clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"])) ?
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<p>/var/vmail on <?=$vmail_df[0];?></p>
<p>Mail disk space via <?=$vmail_df[0];?></p>
<p><?=$vmail_df[2];?> / <?=$vmail_df[1];?> (<?=$vmail_df[4];?>)</p>
</div>
<div class="col-sm-9">
@ -78,11 +79,11 @@ $clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"])) ?
<p><?=$lang['debug']['jvm_memory_solr'];?>: <?=$solr_status['jvm']['memory']['total'] - $solr_status['jvm']['memory']['free'];?> / <?=$solr_status['jvm']['memory']['total'];?>
(<?=round($solr_status['jvm']['memory']['raw']['used%']);?>%)</p>
<hr>
<p><?=$lang['debug']['solr_uptime'];?>: ~<?=round($solr_status['status']['dovecot-fts']['uptime'] / 1000 / 60 / 60);?>h</p>
<p><?=$lang['debug']['solr_started_at'];?>: <?=$solr_status['status']['dovecot-fts']['startTime'];?></p>
<p><?=$lang['debug']['solr_last_modified'];?>: <?=$solr_status['status']['dovecot-fts']['index']['lastModified'];?></p>
<p><?=$lang['debug']['solr_size'];?>: <?=$solr_status['status']['dovecot-fts']['index']['size'];?></p>
<p><?=$lang['debug']['solr_docs'];?>: <?=$solr_status['status']['dovecot-fts']['index']['numDocs'];?></p>
<p><?=$lang['debug']['uptime'];?>: ~<?=round($solr_status['status']['dovecot-fts']['uptime'] / 1000 / 60 / 60);?>h</p>
<p><?=$lang['debug']['started_at'];?>: <span class="parse_date"><?=$solr_status['status']['dovecot-fts']['startTime'];?></span></p>
<p><?=$lang['debug']['last_modified'];?>: <span class="parse_date"><?=$solr_status['status']['dovecot-fts']['index']['lastModified'];?></span></p>
<p><?=$lang['debug']['size'];?>: <?=$solr_status['status']['dovecot-fts']['index']['size'];?></p>
<p><?=$lang['debug']['docs'];?>: <?=$solr_status['status']['dovecot-fts']['index']['numDocs'];?></p>
<?php
else:
?>
@ -94,6 +95,47 @@ $clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"])) ?
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?=$lang['debug']['xmpp_status'];?></h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<p><img class="img-responsive" alt="XMPP Logo" width="128px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAAlwSFlzAAAJcwAACXMB+Yg9ogAAAqNQTFRFR3BMEERaAAAAAAAAAAAAAAAAAAAAAAAAdIFfAAAABBEVAAAAAAAAAAAAAAAAFYSszZA8BxUkAAAAAAAAAAAAmsplAAAAn81nFYi7AAAAAAAAF3utAAAA52wfEpbK4mcg5WYgncxnD3OmAAAAnsxnAAAAAAAA5mwg520gEZbJAAAA0FYjoM5m6W0fEpfLAAAAR5VD3WkjEWGRE26fnctn6W0fE6ban85noc9o5mwhAAAAAAAAFHeq6m0fAAAAoM5nAAAAATtsATlqoc5mAjlrAjhqATdqATxt6W0eEp/SE6LXEmOUDmibE5DDzVokEmaXUZlIATVm6W0f52wg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QQJZxwThqv1yNTYpCZmoMUJ/lbI+CMIgaznO4JKLaR+gSUG9FjEEbumGQkD/igCIRrl8fFeCTgnCQbEHBO0avCBBwDlDQyD1UE3TEh4MxRr452eiYAEqZPIFRXB+O0/CQgfzEpEk9gEk5evFOHwLQwjNmJMeqNIgLR6pkpG5BNgu74SkQnE2MnoR/jGWbonsPQoQ3UIY1ABPG1Ep6ZqRKYQJ7uI+CBeP09Fc7rXVyhEIE4KItQ+NV5Doo/3pAAumCWSEBK5NXMMAinMjuTq41tpUZLhimKiTQmkGJIINodAUlNPiiEzBOwwczkxaorZqZkSADncqVIIDJNs9F9/0LEPZtXpw3HHSeFwHB5CTyBmAgVuEmFqQTy1BOhePXaPMYnEiQEUObT4martRjvYRnGGS3DcIP4eBlMc9KCJwSwtBKnqWr0QCDaqBM6UyRTyzCMJ0C3H+DDPYHwWCMCK93GN2pENqYBh8sigbRwCtFhIWQY3UWd2DBLvwlIM8VWjBkQAmQEQSfGy5CMWX4ZGgLHj0DjOj6NYkARiM3DZZKsJoDjh6pNOgclOyaHJYC3CTFxVhO4xUmNX3o8p+WwBGyhqBdYTCDuFgRKHnIKOjTBJuXAH3gORoHfeFsVD0+ApE0BP2Ybeo4KbnqDCCIII/wJlFbTu+je//0AAAAASUVORK5CYII=" /></p>
</div>
<div class="col-sm-9">
<?php
if ($xmpp_status !== false) {
?>
<p><?=$lang['debug']['online_users'];?>: <?=$xmpp_status['onlineusers'];?></p>
<p><?=$lang['debug']['started_at'];?>: <span class="parse_s_ago"><?=$xmpp_status['uptimeseconds'];?></span></p>
<?php
if (!empty($xmpp_status['muc_online_rooms'])) {
?>
<p>MUCs:</p>
<ol>
<?php
foreach ($xmpp_status['muc_online_rooms'] as $room) {
?>
<li><a href="xmpp:<?=$room;?>?message"><?=$room;?></a></li>
<?php
}
?>
</ol>
<?php
}
}
else {
?>
<p><?=$lang['debug']['xmpp_dead'];?></p>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?=$lang['debug']['containers_info'];?></h3>
@ -129,7 +171,7 @@ $clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"])) ?
$started = '?';
}
?>
<small>(<?=$lang['debug']['started_on'];?> <?=$started;?>),
<small>(<?=$lang['debug']['started_on'];?> <span class="parse_date"><?=$started;?></span>),
<a href data-toggle="modal" data-container="<?=$container;?>" data-target="#RestartContainer"><?=$lang['debug']['restart_container'];?></a></small>
<span class="pull-right status-indicator label label-<?=($container_info['State'] !== false && !empty($container_info['State'])) ? (($container_info['State']['Running'] == 1) ? 'success' : 'danger') : 'default'; ?>">&nbsp;</span>
</li>