SAAS-872 - Load disk information statically

This commit is contained in:
Duncan Sommerville 2015-06-17 13:44:14 -04:00
parent 61272cd42c
commit 4b3b3b5b93
2 changed files with 33 additions and 5 deletions

View File

@ -4,11 +4,12 @@ class SystemstatusController extends Zend_Controller_Action
{
public function init()
{
/* Disable this on Airtime pro since we're not using Media Monitor/Monit
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
*/
}
public function indexAction()

View File

@ -3,21 +3,30 @@
</head>
<?php
/* Disabling most of the status page for Airtime Pro
$phpDependencies = checkPhpDependencies();
$externalServices = checkExternalServices();
$zend = $phpDependencies["zend"];
$postgres = $phpDependencies["postgres"];
$database = $externalServices["database"];
$rabbitmq = $externalServices["rabbitmq"];
$pypo = $externalServices["pypo"];
$liquidsoap = $externalServices["liquidsoap"];
$mediamonitor = $externalServices["media-monitor"];
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
$r2 = array_reduce($externalServices, "booleanReduce", true);
$result = $r1 && $r2;
*/
// Disk information. We only use the [0]th index
// because we don't have Watched/Media Folders
$disk = $this->status->partitions[0];
$used = $disk->totalSpace-$disk->totalFreeSpace;
$total = $disk->totalSpace;
?>
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
@ -176,5 +185,23 @@
<tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th>
</tr>
<tr class="partition-info">
<td><span class="strong"><?php echo _("Disk") ?></span>
<ul id="watched-dir-list">
</ul>
</td>
<td>
<?php
echo sprintf("%01.1fGB of %01.1fGB", $used/pow(2, 30), $total/pow(2, 30))
?>
</td>
<td colspan="3">
<div class="big">
<div class="diskspace" style="width:<?php echo sprintf("%01.1f%%", $used/$total*100) ?>;">
</div>
</div>
<div><?php echo sprintf("%01.1f%% ", $used/$total*100) . _("in use") ?></div>
</td>
</tr>
</tbody>
</table>