diff --git a/airtime_mvc/application/configs/navigation.php b/airtime_mvc/application/configs/navigation.php index 0851b0cf6..4619f4f9d 100644 --- a/airtime_mvc/application/configs/navigation.php +++ b/airtime_mvc/application/configs/navigation.php @@ -88,7 +88,14 @@ $pages[] = array( 'module' => 'default', 'controller' => 'preference', 'action' => 'stream-setting' - ) + ), + array( + 'label' => _('Status'), + 'module' => 'default', + 'controller' => 'systemstatus', + 'action' => 'index', + 'resource' => 'systemstatus' + ), ) ); $pages[] = array( diff --git a/airtime_mvc/application/controllers/SystemstatusController.php b/airtime_mvc/application/controllers/SystemstatusController.php new file mode 100644 index 000000000..b219c630b --- /dev/null +++ b/airtime_mvc/application/controllers/SystemstatusController.php @@ -0,0 +1,22 @@ +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; + } +} diff --git a/airtime_mvc/application/models/Systemstatus.php b/airtime_mvc/application/models/Systemstatus.php index b97ea491e..dcb5c1dac 100644 --- a/airtime_mvc/application/models/Systemstatus.php +++ b/airtime_mvc/application/models/Systemstatus.php @@ -214,27 +214,20 @@ class Application_Model_Systemstatus public static function GetDiskInfo() { $partitions = array(); - - //connect to DB and find how much total space user has allocated. - $totalSpace = Application_Model_Preference::GetDiskQuota(); - - $usedSpace = Application_Model_Preference::getDiskUsage(); - if (empty($usedSpace)) { - $usedSpace = 0; + /* First lets get all the watched directories. Then we can group them + * into the same partitions by comparing the partition sizes. */ + $musicDirs = Application_Model_MusicDir::getWatchedDirs(); + $musicDirs[] = Application_Model_MusicDir::getStorDir(); + foreach ($musicDirs as $md) { + $totalSpace = disk_total_space($md->getDirectory()); + if (!isset($partitions[$totalSpace])) { + $partitions[$totalSpace] = new StdClass; + $partitions[$totalSpace]->totalSpace = $totalSpace; + $partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory()); + $partitions[$totalSpace]->usedSpace = $totalSpace - $partitions[$totalSpace]->totalFreeSpace; + } + $partitions[$totalSpace]->dirs[] = $md->getDirectory(); } - /* $path = $_SERVER['AIRTIME_BASE']."etc/airtime/num_bytes.ini"; - $arr = parse_ini_file($path); - - $usedSpace = 0; - if ($arr !== false) { - $usedSpace = $arr['num_bytes']; - } */ - - $partitions[$totalSpace] = new stdClass(); - $partitions[$totalSpace]->totalSpace = $totalSpace; - $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; - //Logging::info($partitions[$totalSpace]->totalFreeSpace); - return array_values($partitions); } diff --git a/airtime_mvc/application/views/scripts/systemstatus/index.phtml b/airtime_mvc/application/views/scripts/systemstatus/index.phtml index 76321d8f2..9fa27d378 100644 --- a/airtime_mvc/application/views/scripts/systemstatus/index.phtml +++ b/airtime_mvc/application/views/scripts/systemstatus/index.phtml @@ -3,7 +3,6 @@ status->partitions[0]; - $used = $disk->totalSpace-$disk->totalFreeSpace; - $total = $disk->totalSpace; ?>
+ | version; ?> | +|||||||
@@ -37,13 +32,6 @@ | ||||||||
Postgres @@ -54,7 +42,7 @@ |
"
+ ?>">
Try running sudo apt-get install php5-pgsql
| - Database configuration for Airtime + Database configuration for LibreTime |
"
+ ?>">
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
- /etc/airtime.conf are correct and the Airtime database was installed correctly.
+ /etc/airtime.conf are correct and the LibreTime database was installed correctly.
@@ -85,12 +73,12 @@
RabbitMQ
|
- RabbitMQ configuration for Airtime + RabbitMQ configuration for LibreTime |
"
+ ?>">
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf
are correct. Try using sudo rabbitmqctl list_users and sudo rabbitmqctl list_vhosts
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
@@ -103,19 +91,19 @@
| |||
- Media Monitor + Media Analzyer | - Airtime media-monitor service + LibreTime media analyzer service | -+ |
"
- Check that the airtime-media-monitor service is installed correctly in /etc/init ,
+ ?>">
+ Check that the airtime_analyzer service is installed correctly in /etc/init ,
and ensure that it's running with
- initctl list | grep airtime-media-monitor - If not, try sudo service airtime-media-monitor start
+ initctl list | grep airtime_analyzer + If not, try sudo service airtime_analyzer start
@@ -126,12 +114,12 @@
Pypo
|
- Airtime playout service + LibreTime playout service |
"
+ ?>">
Check that the airtime-playout service is installed correctly in /etc/init ,
and ensure that it's running with
initctl list | grep airtime-playout @@ -146,12 +134,12 @@ Liquidsoap |
- Airtime liquidsoap service + LibreTime liquidsoap service | -+ |
"
+ ?>">
Check that the airtime-liquidsoap service is installed correctly in /etc/init ,
and ensure that it's running with
initctl list | grep airtime-liquidsoap @@ -162,26 +150,7 @@ |
-
|
- - - | -
-
-
-
- ;">
-
- |
-