Merge branch 'saas' of github.com:sourcefabric/Airtime into saas
This commit is contained in:
commit
74b403897d
|
@ -4,11 +4,12 @@ class SystemstatusController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
/* Disable this on Airtime pro since we're not using Media Monitor/Monit
|
||||||
|
|
||||||
$CC_CONFIG = Config::getConfig();
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
|
|
|
@ -8,18 +8,24 @@
|
||||||
$externalServices = checkExternalServices();
|
$externalServices = checkExternalServices();
|
||||||
$zend = $phpDependencies["zend"];
|
$zend = $phpDependencies["zend"];
|
||||||
$postgres = $phpDependencies["postgres"];
|
$postgres = $phpDependencies["postgres"];
|
||||||
|
|
||||||
$database = $externalServices["database"];
|
$database = $externalServices["database"];
|
||||||
$rabbitmq = $externalServices["rabbitmq"];
|
$rabbitmq = $externalServices["rabbitmq"];
|
||||||
|
|
||||||
$pypo = $externalServices["pypo"];
|
$pypo = $externalServices["pypo"];
|
||||||
$liquidsoap = $externalServices["liquidsoap"];
|
$liquidsoap = $externalServices["liquidsoap"];
|
||||||
$mediamonitor = $externalServices["media-monitor"];
|
$mediamonitor = $externalServices["media-monitor"];
|
||||||
|
|
||||||
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
||||||
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
||||||
$result = $r1 && $r2;
|
$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">
|
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
|
||||||
|
@ -174,9 +180,27 @@
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
*/?>
|
|
||||||
<tr id="partitions" class="even">
|
|
||||||
<th colspan="5"><?php echo _("Disk Space") ?></th>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</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>
|
</table>
|
||||||
|
|
|
@ -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();
|
Loading…
Reference in New Issue