2011-03-29 17:51:22 +00:00
|
|
|
<?php
|
|
|
|
|
2011-04-01 09:29:04 +00:00
|
|
|
require_once 'common.php';
|
2011-03-29 17:51:22 +00:00
|
|
|
|
2011-04-01 09:29:04 +00:00
|
|
|
$db = Db::getInstance();
|
2011-03-29 17:51:22 +00:00
|
|
|
|
2011-04-01 09:29:04 +00:00
|
|
|
$rows = $db->getRows($db->q("SELECT status, count(*) as cnt FROM beathaven.queue GROUP BY status"));
|
2011-03-29 17:51:22 +00:00
|
|
|
|
2011-04-01 12:07:09 +00:00
|
|
|
$info = array_fill(0, 3, 0);
|
2011-03-29 17:51:22 +00:00
|
|
|
|
2011-04-01 09:29:04 +00:00
|
|
|
foreach ($rows as $row) {
|
|
|
|
$info[$row['status']] = $row['cnt'];
|
2011-03-29 17:51:22 +00:00
|
|
|
}
|
|
|
|
|
2011-04-01 12:07:09 +00:00
|
|
|
$tmp = exec("ps aux | grep parse_queue");
|
|
|
|
$running = (strpos($tmp, '/opt/local/bin/php') !== false) ? 1 : 0;
|
|
|
|
|
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>BeatHaven</title>
|
|
|
|
<style>
|
|
|
|
body, td {padding:0;margin:0;}
|
|
|
|
body {background-color:#112;}
|
|
|
|
.status-1 {font: 10em Georgia; color: #FFF;}
|
|
|
|
.status-02 {font: 0.8em Georgia; color: #AAA;}
|
|
|
|
.running-1 {font: 0.8em Georgia; color: #8A8;}
|
|
|
|
.running-0 {font: 0.8em Georgia; color: #A88;}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table width="100%" height="100%"><tr><td align="center" valign="middle">
|
|
|
|
<span class="status-1"><?= $info[1] ?></span><span class="status-02"> / <?= $info[0] ?> / <?= $info[2] ?></span>
|
|
|
|
<span class="running-<?= $running ?>"><?= ($running ? 'running' : 'stopped') ?></span>
|
|
|
|
</td></tr></table>
|
|
|
|
</body>
|
|
|
|
</html>
|