2013-09-11 22:17:47 +08:00
|
|
|
<?php
|
|
|
|
$this->start('sidebar');
|
|
|
|
echo $this->Html->link( 'Add Monitor', array('controller' => 'monitors', 'action' => 'add'));
|
|
|
|
$this->end();
|
|
|
|
?>
|
2013-09-19 00:14:15 +08:00
|
|
|
|
|
|
|
<div class="row" id="monitors">
|
2013-09-11 22:17:47 +08:00
|
|
|
<?php foreach ($monitors as $monitor => $mon): ?>
|
2013-09-19 01:23:16 +08:00
|
|
|
<div class="col-sm-6 col-md-3" id="Monitor_<?= $mon['Monitor']['Id']; ?>">
|
2013-09-11 22:17:47 +08:00
|
|
|
<div class="thumbnail">
|
2013-09-16 18:00:27 +08:00
|
|
|
<?php
|
2013-09-19 01:23:16 +08:00
|
|
|
if($daemonStatus && $mon['Monitor']['Function'] != "None" && $mon['Monitor']['Enabled'])
|
2013-09-19 16:56:09 +08:00
|
|
|
echo $this->LiveStream->makeLiveStream($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $mon['Monitor']['Width']);
|
2013-09-19 01:23:16 +08:00
|
|
|
else
|
|
|
|
echo $this->LiveStream->showNoImage($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $width);
|
2013-09-16 18:00:27 +08:00
|
|
|
?>
|
2013-09-11 22:17:47 +08:00
|
|
|
<div class="caption">
|
2013-09-19 01:23:16 +08:00
|
|
|
<h4><?php echo $this->Html->link($mon['Monitor']['Name'],array('controller' => 'monitors', 'action' => 'view', $mon['Monitor']['Id'])); ?></h4>
|
2013-09-11 22:17:47 +08:00
|
|
|
<p><?php echo $this->Html->link($mon['Monitor']['Function'], array('action' => 'edit', $mon['Monitor']['Id'])); ?></p>
|
|
|
|
</div>
|
2013-05-25 08:13:14 +08:00
|
|
|
</div>
|
2013-09-11 22:17:47 +08:00
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php unset($monitor); ?>
|
|
|
|
</div>
|
2013-09-19 00:14:15 +08:00
|
|
|
|
|
|
|
<?php
|
|
|
|
$this->Js->get('#monitors');
|
|
|
|
$this->Js->sortable(array('complete' => '$.post("/monitors/reorder", $("#monitors").sortable("serialize"))',));
|
2013-09-19 16:56:09 +08:00
|
|
|
?>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(window).load(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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|