From dc316b0aeede6a1f0bc43af8a1d77ada5e525208 Mon Sep 17 00:00:00 2001 From: Chris Wiggins Date: Mon, 16 Sep 2013 22:00:27 +1200 Subject: [PATCH] Add static image when the monitor/system is not enabled/running --- web/app/Controller/AppController.php | 6 ++++-- web/app/View/Helper/LiveStreamHelper.php | 7 ++++++- web/app/View/Layouts/default.ctp | 2 +- web/app/View/Monitors/index.ctp | 7 ++++++- web/app/View/Monitors/view.ctp | 7 ++++++- web/app/webroot/img/no-image.jpg | Bin 0 -> 921654 bytes 6 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 web/app/webroot/img/no-image.jpg diff --git a/web/app/Controller/AppController.php b/web/app/Controller/AppController.php index 673aaab7e..60066e2ee 100644 --- a/web/app/Controller/AppController.php +++ b/web/app/Controller/AppController.php @@ -66,10 +66,12 @@ class AppController extends Controller { } Configure::write('SCALE_BASE', 100); if ($this->AppModel->daemonStatus()) { - $this->set('daemonStatus', ('Running')); + $this->set('daemonStatusHtml', ('Running')); } else { - $this->set('daemonStatus', ('Stopped')); + $this->set('daemonStatusHtml', ('Stopped')); } + + $this->set('daemonStatus', $this->AppModel->daemonStatus()); if (Configure::read('ZM_DYN_LAST_VERSION') > Configure::read('ZM_VERSION')) { $zmVersion = '' . Configure::read('ZM_VERSION') . ''; diff --git a/web/app/View/Helper/LiveStreamHelper.php b/web/app/View/Helper/LiveStreamHelper.php index b32091245..2f41240db 100644 --- a/web/app/View/Helper/LiveStreamHelper.php +++ b/web/app/View/Helper/LiveStreamHelper.php @@ -2,9 +2,14 @@ App::uses('AppHelper', 'View/Helper'); class LiveStreamHelper extends AppHelper { - public function makeLiveStream($name, $src, $id, $width) { + public function makeLiveStream($name, $src, $id, $width=0) { $liveStream = "\"Live"; return $liveStream; } + + public function showNoImage($name, $src, $id, $width=0) { + $liveStream = "\"Live"; + return $liveStream; + } } ?> diff --git a/web/app/View/Layouts/default.ctp b/web/app/View/Layouts/default.ctp index af9d5929a..33fd5a1ec 100644 --- a/web/app/View/Layouts/default.ctp +++ b/web/app/View/Layouts/default.ctp @@ -45,7 +45,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework