diff --git a/web/app/Controller/MonitorsController.php b/web/app/Controller/MonitorsController.php old mode 100644 new mode 100755 index 06c659d0d..e18c114d2 --- a/web/app/Controller/MonitorsController.php +++ b/web/app/Controller/MonitorsController.php @@ -5,7 +5,7 @@ public function index() { $zmBandwidth = $this->Cookie->read('zmBandwidth'); $this->set('width', Configure::read('ZM_WEB_LIST_THUMB_WIDTH')); - $monitoroptions = array('fields' => array('Name', 'Id', 'Function', 'Enabled', 'Sequence', 'Function'), 'order' => 'Sequence ASC', 'recursive' => -1); + $monitoroptions = array('fields' => array('Name', 'Id', 'Function', 'Enabled', 'Sequence', 'Function', 'Width'), 'order' => 'Sequence ASC', 'recursive' => -1); $this->set('monitors', $this->Monitor->find('all', $monitoroptions)); $monitors = $this->Monitor->find('all', array('recursive' => -1, 'fields' => array('Id', 'StreamReplayBuffer'))); foreach ($monitors as $monitor => $mon) { diff --git a/web/app/View/Helper/LiveStreamHelper.php b/web/app/View/Helper/LiveStreamHelper.php old mode 100644 new mode 100755 index b1204e6e5..ef8bf585d --- a/web/app/View/Helper/LiveStreamHelper.php +++ b/web/app/View/Helper/LiveStreamHelper.php @@ -3,12 +3,12 @@ App::uses('AppHelper', 'View/Helper'); class LiveStreamHelper extends AppHelper { public function makeLiveStream($name, $src, $id, $width=0) { - $liveStream = "\"Live"; + $liveStream = "\"Live"; return $liveStream; } public function showNoImage($name, $src, $id, $width=0) { - $liveStream = "\"Live"; + $liveStream = "\"No"; return $liveStream; } } diff --git a/web/app/View/Monitors/index.ctp b/web/app/View/Monitors/index.ctp old mode 100644 new mode 100755 index 322e7ca2f..e309444be --- a/web/app/View/Monitors/index.ctp +++ b/web/app/View/Monitors/index.ctp @@ -10,7 +10,7 @@
LiveStream->makeLiveStream($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $width); + echo $this->LiveStream->makeLiveStream($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $mon['Monitor']['Width']); else echo $this->LiveStream->showNoImage($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $width); ?> diff --git a/web/app/webroot/img/no-image.png b/web/app/webroot/img/no-image.png new file mode 100755 index 000000000..a41390c55 Binary files /dev/null and b/web/app/webroot/img/no-image.png differ diff --git a/web/app/webroot/js/main.js b/web/app/webroot/js/main.js old mode 100644 new mode 100755 index 42f935eb7..4860ce80a --- a/web/app/webroot/js/main.js +++ b/web/app/webroot/js/main.js @@ -199,6 +199,17 @@ $(document).ready(function() { } }); }); + + + $(".livestream_resize").each(function(index, element){ + if($(element).attr('src').indexOf('scale=') >= 0){ + var newScale = Math.ceil(($(element).width() / $(element).attr('width')) * 100); + var src = $(element).attr('src').replace('scale=100', 'scale='+newScale); + $(element).attr('src', src); + console.log("resized"); + } + }); + return false; // Monitors //