restore /systemstatus page

All it needed was a new controller, and some small ui tweaks + re-adding to the menu. I put it in Settings » Status where I believe it belongs.
This commit is contained in:
Lucas Bickel 2017-03-08 14:46:33 +01:00
parent 0f8c3b7c92
commit 7315af0304
3 changed files with 53 additions and 31 deletions

View File

@ -88,7 +88,14 @@ $pages[] = array(
'module' => 'default', 'module' => 'default',
'controller' => 'preference', 'controller' => 'preference',
'action' => 'stream-setting' 'action' => 'stream-setting'
) ),
array(
'label' => _('Status'),
'module' => 'default',
'controller' => 'systemstatus',
'action' => 'index',
'resource' => 'systemstatus'
),
) )
); );
$pages[] = array( $pages[] = array(

View File

@ -0,0 +1,22 @@
<?php
class SystemstatusController extends Zend_Controller_Action
{
private $version;
public function init()
{
$config = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$config['airtime_version'],'text/javascript');
$this->version = $config['airtime_version'];
}
public function indexAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
$partitions = Application_Model_Systemstatus::GetDiskInfo();
$this->view->status = new StdClass;
$this->view->status->partitions = $partitions;
$this->view->version = $this->version;
}
}

View File

@ -3,7 +3,6 @@
</head> </head>
<?php <?php
/* Airtime Pro
$phpDependencies = checkPhpDependencies(); $phpDependencies = checkPhpDependencies();
$externalServices = checkExternalServices(); $externalServices = checkExternalServices();
$postgres = $phpDependencies["postgres"]; $postgres = $phpDependencies["postgres"];
@ -13,12 +12,11 @@
$pypo = $externalServices["pypo"]; $pypo = $externalServices["pypo"];
$liquidsoap = $externalServices["liquidsoap"]; $liquidsoap = $externalServices["liquidsoap"];
$mediamonitor = $externalServices["media-monitor"]; $analyzer = $externalServices["analyzer"];
$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 // Disk information. We only use the [0]th index
// because we don't have Watched/Media Folders // because we don't have Watched/Media Folders
@ -28,8 +26,11 @@
?> ?>
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable"> <table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
<?php /* Disabling most of the status page for Airtime Pro
<thead> <thead>
<tr>
<td class="strong"><?php echo sprintf(_("%s Version"), PRODUCT_NAME) ?></td>
<td colspan=2><?php echo $this->version; ?></td>
</tr>
<tr class="ui-state-default strong"> <tr class="ui-state-default strong">
<td><?php echo _("Service") ?></td> <td><?php echo _("Service") ?></td>
<td><?php echo _("Description") ?></td> <td><?php echo _("Description") ?></td>
@ -37,13 +38,6 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!--
<tr class="odd">
<td><?php echo sprintf(_("%s Version"), PRODUCT_NAME) ?></td>
<td>1.9.3</td>
<td>&nbsp;</td>
</tr>
-->
<tr> <tr>
<td class="component"> <td class="component">
Postgres Postgres
@ -54,7 +48,7 @@
<td class="solution <?php if ($postgres) {echo 'check';?>"> <td class="solution <?php if ($postgres) {echo 'check';?>">
<?php <?php
} else { } else {
?>" ?>">
Try running <code>sudo apt-get install php5-pgsql</code> Try running <code>sudo apt-get install php5-pgsql</code>
<?php <?php
} }
@ -66,15 +60,15 @@
Database Database
</td> </td>
<td class="description"> <td class="description">
Database configuration for Airtime Database configuration for LibreTime
</td> </td>
<td class="solution <?php if ($database) {echo 'check';?>"> <td class="solution <?php if ($database) {echo 'check';?>">
<?php <?php
} else { } else {
?>" ?>">
Make sure you aren't missing any of the Postgres dependencies in the table above. Make sure you aren't missing any of the Postgres dependencies in the table above.
If your dependencies check out, make sure your database configuration settings in If your dependencies check out, make sure your database configuration settings in
<code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly. <code>/etc/airtime.conf</code> are correct and the LibreTime database was installed correctly.
<?php <?php
} }
?> ?>
@ -85,12 +79,12 @@
RabbitMQ RabbitMQ
</td> </td>
<td class="description"> <td class="description">
RabbitMQ configuration for Airtime RabbitMQ configuration for LibreTime
</td> </td>
<td class="solution <?php if ($rabbitmq) {echo 'check';?>"> <td class="solution <?php if ($rabbitmq) {echo 'check';?>">
<?php <?php
} else { } else {
?>" ?>">
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code> are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
@ -103,19 +97,19 @@
</tr> </tr>
<tr> <tr>
<td class="component"> <td class="component">
Media Monitor Media Analzyer
</td> </td>
<td class="description"> <td class="description">
Airtime media-monitor service LibreTime media analyzer service
</td> </td>
<td class="solution <?php if ($mediamonitor) {echo 'check';?>"> <td class="solution <?php if ($analyzer) {echo 'check';?>">
<?php <?php
} else { } else {
?>" ?>">
Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>, Check that the airtime_analyzer service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with and ensure that it's running with
<br/><code>initctl list | grep airtime-media-monitor</code><br/> <br/><code>initctl list | grep airtime_analyzer</code><br/>
If not, try <br/><code>sudo service airtime-media-monitor start</code> If not, try <br/><code>sudo service airtime_analyzer start</code>
<?php <?php
} }
?> ?>
@ -126,12 +120,12 @@
Pypo Pypo
</td> </td>
<td class="description"> <td class="description">
Airtime playout service LibreTime playout service
</td> </td>
<td class="solution <?php if ($pypo) {echo 'check';?>"> <td class="solution <?php if ($pypo) {echo 'check';?>">
<?php <?php
} else { } else {
?>" ?>">
Check that the airtime-playout service is installed correctly in <code>/etc/init</code>, Check that the airtime-playout service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with and ensure that it's running with
<br/><code>initctl list | grep airtime-playout</code><br/> <br/><code>initctl list | grep airtime-playout</code><br/>
@ -146,12 +140,12 @@
Liquidsoap Liquidsoap
</td> </td>
<td class="description"> <td class="description">
Airtime liquidsoap service LibreTime liquidsoap service
</td> </td>
<td class="solution <?php if ($liquidsoap) {echo 'check';?>"> <td class="solution <?php if ($liquidsoap) {echo 'check';?>" >
<?php <?php
} else { } else {
?>" ?>">
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>, Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with and ensure that it's running with
<br/><code>initctl list | grep airtime-liquidsoap</code><br/> <br/><code>initctl list | grep airtime-liquidsoap</code><br/>
@ -162,7 +156,6 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
*/?>
<tr id="partitions" class="even"> <tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th> <th colspan="5"><?php echo _("Disk Space") ?></th>
</tr> </tr>