Merge branch 'saas' of github.com:sourcefabric/Airtime into saas

This commit is contained in:
Albert Santoni 2015-06-19 14:23:46 -04:00
commit 74b403897d
3 changed files with 62 additions and 9 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

@ -8,18 +8,24 @@
$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">
@ -174,9 +180,27 @@
?>
</td>
</tr>
*/?>
<tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th>
</tr>
</tbody>
*/?>
<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>
</table>

View File

@ -0,0 +1,28 @@
<?php
class Router {
/**
* Parse the URL query string and store the key->val pairs
* into an array, then redirect
*/
public function reroute() {
$params = array();
parse_str($_SERVER['QUERY_STRING'], $params);
$this->_redirect($params);
}
/**
* Redirect to the URL passed in the 'state' parameter
* when we're redirected here from SoundCloud
*
* @param $params array array of URL query parameters
*/
private function _redirect($params) {
$url = urldecode($params['state']);
header("Location: $url?" . $_SERVER['QUERY_STRING']);
}
}
(new Router())->reroute();