added the webui to the tarball

This commit is contained in:
SJ
2012-02-08 23:14:28 +01:00
parent 79cdeed1b6
commit 1211e9a39c
272 changed files with 26456 additions and 11 deletions

View File

@@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="hu" lang="hu">
<head>
<title>clapf web UI</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<meta name="keywords" content="clapf, webui, web ui, spam, anti-spam, email, e-mail, mail, unsolicited commercial bulk email, blacklist, software, filtering, service, Bayes, Bayesian" />
<meta name="description" content="clapf, webui, web ui, spam, anti-spam, antispam" />
<meta name="rating" content="general" />
<meta name="robots" content="all" />
</head>
<body>
<p>
<form action="index.php?route=health/worker" method="post">
<input type="hidden" name="confirmed" value="1" />
<input type="hidden" name="resetcounters" value="1" />
<input type="submit" name="submit" value="<?php print $text_confirm_to_reset_counters; ?>" />
</form>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
<span id="A1"><?php print $text_loading; ?> . . .</span>

View File

@@ -0,0 +1,125 @@
<div id="search">
<div id="health1">
<div class="row">
<div class="cellhealthleft"><?php print $text_refresh_period; ?>:</div>
<div class="cellhealthright"><?php print HEALTH_REFRESH; ?> sec</div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_server_name; ?>:</div>
<div class="cellhealthright"><?php print $sysinfo[0]; ?></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_server_operating_system; ?>:</div>
<div class="cellhealthright"><?php print $sysinfo[1]; ?></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_uptime; ?>:</div>
<div class="cellhealthright"><?php print $uptime; ?></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_archive_size; ?>:</div>
<div class="cellhealthright"><?php print $archive_size; ?> MB</div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_smtp_status; ?>:</div>
<div class="cellhealthright">
<?php foreach($health as $h) {
if(preg_match("/^220/", $h[1])) {
$status = 'OK'; $class = 'ok';
} else {
$status = 'ERROR'; $class = 'error';
}
?>
<div class="<?php print $class; ?>"><span onmouseover="Tip('<?php print preg_replace("/\'/", "\'", $h[1]); ?>, <?php print $h[2]; ?>', BALLOON, true, ABOVE, true)" onmouseout="UnTip()"><?php print $h[3]; ?>: <?php print $status; ?></span></div>
<?php } ?>
</div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_processed_emails; ?>:</div>
<div class="cellhealthright"><?php print $processed_emails[0]; ?> (<?= $text_24_hours; ?>)<br /><?php print $processed_emails[1]; ?> (<?= $text_1_week; ?>)<br /><?php print $processed_emails[2]; ?> (<?= $text_30_days; ?>)</div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_cpu_usage; ?>:</div>
<div class="cellhealthright"><span class="<?php if($cpuinfo < HEALTH_RATIO) { ?>ok<?php } else { ?>error<?php } ?>"><?php print $cpuinfo; ?>% <?php print $cpuload; ?></span></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_memory_usage; ?>:</div>
<div class="cellhealthright"><span class="<?php if($meminfo < HEALTH_RATIO) { ?>ok<?php } else { ?>error<?php } ?>"><?php print $meminfo; ?>% / <?php print $totalmem; ?> MB</span></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_swap_usage; ?></div>
<div class="cellhealthright"><span class="<?php if($swapinfo < HEALTH_RATIO) { ?>ok<?php } else { ?>error<?php } ?>"><?php print $swapinfo; ?>% / <?php print $totalswap; ?> MB</span></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_disk_usage; ?></div>
<div class="cellhealthright"><?php foreach($shortdiskinfo as $partition) { ?><span class="<?php if($partition['utilization'] < HEALTH_RATIO) { ?>ok<?php } else { ?>error<?php } ?>"><?php print $partition['partition']; ?> <?php print $partition['utilization']; ?>%</span> <?php } ?></div>
</div>
<div class="row">
<div class="cellhealthleft"><?php print $text_counters; ?></div>
<div class="cellhealthright">
<?php while(list($k, $v) = each($counters)) {
if(!is_numeric($k)) { ?>
<div class="row">
<div class="cellhealthright"><?php $a = preg_replace("/^_piler\:/", "", $k); if(isset($$a)) { print $$a; } else { print $k; } ?></div>
<div class="cellhealthright"><?php print $v; ?></div>
</div>
<?php } } ?>
</div>
</div>
<?php if(Registry::get('admin_user') == 1) { ?>
<div class="row">
<div class="cellhealthleft">&nbsp;</div>
<div class="cellhealthright">
<form action="index.php?route=health/worker" method="post">
<input type="hidden" name="resetcounters" value="1" />
<input type="submit" name="submit" value="<?php print $text_reset_counters; ?>" />
</form>
</div>
</div>
<?php } ?>
</div>
<div id="health2">
<?php if(isset($queues)) { ?>
<div class="row">
<div class="cellhealthleft"><?php print $text_queue_status; ?></div>
</div>
<?php foreach ($queues as $queue) {
if(isset($queue['desc'])) { ?>
<div class="row">
<div class="cellhealthleft"><?php print $queue['desc']; ?></div>
</div>
<div class="row">
<div class="cellhealthright"><pre><?php print $queue['lines']; ?></pre></div>
</div>
<?php }
} ?>
<?php } ?>
</div>
</div>

View File

@@ -0,0 +1,131 @@
<table border="0" cellpadding="10">
<tr valign="top">
<td>
<p><?php print $text_refresh_period; ?>: <?php print HEALTH_REFRESH; ?> sec</p>
<p><strong><?php print $text_server_name; ?>: </strong><?php print $sysinfo[0]; ?></p>
<p><strong><?php print $text_server_operating_system; ?>: </strong><?php print $sysinfo[1]; ?></p>
<p><strong><?php print $text_uptime; ?>: </strong><?php print $uptime; ?></p>
<p><strong><?php print $text_archive_size; ?>: </strong><?php print $archive_size; ?> MB</p>
<p><strong><?php print $text_processed_emails_in; ?>:</strong> <?php print $processed_emails[0]; ?>/<?php print $processed_emails[1]; ?>/<?php print $processed_emails[2]; ?></p>
<!--p><strong><?php print $text_smtp_status; ?>: </strong></p>
<p>
<table border="1">
<?php foreach($health as $h) {
$status = 'ERROR';
if(preg_match("/^220/", $h[1]) || preg_match("/^action=DUNNO/", $h[1])) { $status = 'OK'; }
?>
<tr>
<td><?php print $h[3]; ?></td>
<td class="<?php if($status == 'OK') { ?>health-ok<?php } else { ?>health-alert<?php } ?>"><span onmouseover="Tip('<?php print preg_replace("/\'/", "\'", $h[1]); ?>, <?php print $h[2]; ?>', BALLOON, true, ABOVE,
true)" onmouseout="UnTip()"><?php print $status; ?></span></td>
</tr>
<?php } ?>
</table>
</p>
<?php if(MAILLOG_PID_FILE) { ?><p><strong><?php print $text_maillog_status; ?>:</strong> <span class="health-<?php if($maillog_status == $text_running) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $maillog_status; ?></span><?php } ?>
<?php if(ENABLE_LDAP_IMPORT_FEATURE == 1) { ?><p><strong><?php print $text_ad_sync_status; ?>:</strong> <span class="health-<?php if($totalusers >= LDAP_IMPORT_MINIMUM_NUMBER_OF_USERS_TO_HEALTH_OK && $total_emails_in_database >= LDAP_IMPORT_MINIMUM_NUMBER_OF_USERS_TO_HEALTH_OK) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $adsyncinfo; ?> <?php print strtolower($text_email); ?></span></p><?php } ?>
<?php if(file_exists(DAILY_QUARANTINE_REPORT_STAT)) { ?><p><strong><?php print $text_daily_quarantine_report_status; ?>:</strong> <span class="health-<?php if(preg_match("/\/0$/", $quarantinereportinfo) && !preg_match("/ 0\//", $quarantinereportinfo) ) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $quarantinereportinfo; ?></span></p><?php } ?>
-->
<p><strong><?php print $text_cpu_usage; ?>:</strong> <span class="health-<?php if($cpuinfo < HEALTH_RATIO) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $cpuinfo; ?>%</span>, <strong><?php print $text_cpu_load; ?>:</strong> <span class="health-<?php if($cpuinfo < HEALTH_RATIO) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $cpuload; ?></span></p>
<p><strong><?php print $text_memory_usage; ?>: </strong> <span class="health-<?php if($meminfo < HEALTH_RATIO) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $meminfo; ?>%</span> / <?php print $totalmem; ?> MB, <strong><?php print $text_swap_usage; ?></strong>: <span class="health-<?php if($swapinfo < HEALTH_RATIO) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $swapinfo; ?>%</span> / <?php print $totalswap; ?> MB</p>
<p><strong><?php print $text_disk_usage; ?>: </strong> <?php foreach($shortdiskinfo as $partition) { ?><span class="health-<?php if($partition['utilization'] < HEALTH_RATIO) { ?>ok<?php } else { ?>alert<?php } ?>"><?php print $partition['partition']; ?> <?php print $partition['utilization']; ?>%</span> <?php } ?></p>
<p><strong><?php print $text_counters; ?>:</strong></p>
<p>
<table border="1">
<?php while(list($k, $v) = each($counters)) {
if(!is_numeric($k)) { ?>
<tr><td><?php $a = preg_replace("/^_piler\:/", "", $k); if(isset($$a)) { print $$a; } else { print $k; } ?></td><td><?php print $v; ?></td></tr>
<?php } } ?>
</table>
</p>
<?php if(Registry::get('admin_user') == 1) { ?>
<form action="index.php?route=health/worker" method="post">
<input type="hidden" name="resetcounters" value="1" />
<input type="submit" name="submit" value="<?php print $text_reset_counters; ?>" />
</form>
<?php } ?>
</td>
<td>
<h4><?php print $text_queue_status; ?>: </h4>
<?php foreach ($queues as $queue) { ?>
<p class="queue"><table class="queue" border="0">
<?php if(isset($queue['desc'])) { ?>
<tr><td colspan="12"><strong><?php print $queue['desc']; ?></strong></td></tr>
<?php
$i = 0;
while(list($k, $v) = each($queue['lines'])) {
$i++;
print "<tr class='queue'>";
$v = preg_replace("/^\*\<\/td\>/", "", $v);
if($i == 1) { print "<td>&nbsp;</td>"; }
print "$v</td></tr>\n";
if($i == count($queue['lines'])-1) { break; }
}
?>
<?php } ?>
</table></p>
<?php } ?>
<?php if(isset($queues_out)) { ?>
<h4><?php print $text_queue_out_status; ?>: </h4>
<?php foreach ($queues_out as $queue) { ?>
<p class="queue"><table class="queue" border="0">
<?php if(isset($queue['desc'])) { ?>
<tr><td colspan="12"><strong><?php print $queue['desc']; ?></strong></td></tr>
<?php
$i = 0;
while(list($k, $v) = each($queue['lines'])) {
$i++;
print "<tr class='queue'>";
$v = preg_replace("/^\*\<\/td\>/", "", $v);
if($i == 1) { print "<td>&nbsp;</td>"; }
print "$v</td></tr>\n";
if($i == count($queue['lines'])-1) { break; }
}
?>
<?php } ?>
</table></p>
<?php } ?>
<?php } ?>
</td>
</tr>
</table>