Merge branch 'modern' into feature-h264-videostorage
This commit is contained in:
commit
a1a407d543
|
@ -1,6 +1,9 @@
|
|||
language: cpp
|
||||
notifications:
|
||||
irc: "chat.freenode.net#zoneminder-dev"
|
||||
branches:
|
||||
except:
|
||||
- modern
|
||||
env:
|
||||
global:
|
||||
- LD_LIBRARY_PATH="/usr/local/lib:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH"
|
||||
|
@ -11,8 +14,8 @@ compiler:
|
|||
- gcc
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get upgrade -y
|
||||
- sudo apt-get install -y apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev
|
||||
- sudo apt-get upgrade -y -qq
|
||||
- sudo apt-get install -y -qq apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev
|
||||
install:
|
||||
- git clone git://source.ffmpeg.org/ffmpeg.git
|
||||
- cd ffmpeg
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
class MonitorsController extends AppController {
|
||||
public $helpers = array('LiveStream', 'Js'=>array('Jquery'));
|
||||
public $helpers = array('Js'=>array('Jquery'));
|
||||
|
||||
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', '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) {
|
||||
$streamSrc[$mon['Monitor']['Id']] = $this->Monitor->getStreamSrc($mon['Monitor']['Id'], $zmBandwidth, $monitor['Monitor']['StreamReplayBuffer']);
|
||||
$monitoroptions = array('fields' => array('Name', 'Id', 'Function', 'Enabled', 'Sequence', 'Function', 'Width', 'StreamReplayBuffer'), 'order' => 'Sequence ASC', 'recursive' => -1);
|
||||
$monitors = $this->Monitor->find('all', $monitoroptions);
|
||||
|
||||
|
||||
foreach ($monitors as $key => $value) {
|
||||
$monitors[$key]['img'] = $this->Monitor->getStreamSrc($value['Monitor']['Id'], $zmBandwidth, $value['Monitor']['StreamReplayBuffer'], $value['Monitor']['Function'], $value['Monitor']['Enabled'], $value['Monitor']['Name'], $value['Monitor']['Width']);
|
||||
}
|
||||
$this->set('streamSrc', $streamSrc);
|
||||
$this->set('monitors', $monitors);
|
||||
}
|
||||
|
||||
public function view($id = null) {
|
||||
|
@ -28,8 +28,7 @@
|
|||
|
||||
$zmBandwidth = $this->Cookie->read('zmBandwidth');
|
||||
$buffer = $monitor['Monitor']['StreamReplayBuffer'];
|
||||
$this->set('streamSrc', $this->Monitor->getStreamSrc($id, $zmBandwidth, $buffer));
|
||||
|
||||
$this->set('streamSrc', $this->Monitor->getStreamSrc($id, $zmBandwidth, $buffer, $monitor['Monitor']['Function'], $monitor['Monitor']['Enabled'], $monitor['Monitor']['Name'], $monitor['Monitor']['Width'], false));
|
||||
}
|
||||
|
||||
public function edit($id = null) {
|
||||
|
@ -42,108 +41,6 @@
|
|||
throw new NotFoundException(__('Invalid monitor'));
|
||||
}
|
||||
$this->set('monitor', $monitor['Monitor']);
|
||||
|
||||
$typeoptions = array(
|
||||
'Local' => 'Local',
|
||||
'Remote' => 'Remote',
|
||||
'File' => 'File',
|
||||
'Ffmpeg' => 'Ffmpeg'
|
||||
);
|
||||
$this->set('typeoptions', $typeoptions);
|
||||
|
||||
$functionoptions = array(
|
||||
'Modect' => 'Modect',
|
||||
'Monitor' => 'Monitor',
|
||||
'Record' => 'Record',
|
||||
'None' => 'None',
|
||||
'Nodect' => 'Nodect',
|
||||
'Mocord' => 'Mocord'
|
||||
);
|
||||
$this->set('functionoptions', $functionoptions);
|
||||
|
||||
$protocoloptions = array(
|
||||
'rtsp' => 'RTSP',
|
||||
'http' => 'HTTP'
|
||||
);
|
||||
$this->set('protocoloptions', $protocoloptions);
|
||||
|
||||
$methodoptions = array(
|
||||
'simple' => 'Simple',
|
||||
'regexp' => 'Regexp'
|
||||
);
|
||||
$this->set('methodoptions', $methodoptions);
|
||||
|
||||
$optionsColours = array(
|
||||
1 => '8 bit grayscale',
|
||||
3 => '24 bit color',
|
||||
4 => '32 bit color'
|
||||
);
|
||||
$this->set('optionsColours', $optionsColours);
|
||||
|
||||
$channeloptions = array();
|
||||
for ($i=1; $i<32; $i++) {
|
||||
array_push($channeloptions, $i);
|
||||
}
|
||||
$this->set('channeloptions', $channeloptions);
|
||||
|
||||
$formatoptions = array(
|
||||
255 => "PAL",
|
||||
45056 => "NTSC",
|
||||
1 => "PAL B",
|
||||
2 => "PAL B1",
|
||||
4 => "PAL G",
|
||||
8 => "PAL H",
|
||||
16 => "PAL I",
|
||||
32 => "PAL D",
|
||||
64 => "PAL D1",
|
||||
128 => "PAL K",
|
||||
256 => "PAL M",
|
||||
512 => "PAL N",
|
||||
1024 => "PAL Nc",
|
||||
2048 => "PAL 60",
|
||||
4096 => "NTSC M",
|
||||
8192 => "NTSC M JP",
|
||||
16384 => "NTSC 443",
|
||||
32768 => "NTSC M KR",
|
||||
65536 => "SECAM B",
|
||||
131072 => "SECAM D",
|
||||
262144 => "SECAM G",
|
||||
524288 => "SECAM H",
|
||||
1048576 => "SECAM K",
|
||||
2097152 => "SECAM K1",
|
||||
4194304 => "SECAM L",
|
||||
8388608 => "SECAM LC",
|
||||
16777216 => "ATSC 8 VSB",
|
||||
33554432 => "ATSC 16 VSB"
|
||||
);
|
||||
$this->set('formatoptions', $formatoptions);
|
||||
|
||||
$optionsPalette = array(
|
||||
0 => 'Auto',
|
||||
1497715271 => 'Gray',
|
||||
877807426 => 'BGR32',
|
||||
876758866 => 'RGB32',
|
||||
861030210 => 'BGR24',
|
||||
859981650 => 'RGB24',
|
||||
1448695129 => '*YUYV',
|
||||
1195724874 => '*JPEG',
|
||||
1196444237 => '*MJPEG',
|
||||
875836498 => '*RGB444',
|
||||
1329743698 => '*RGB555',
|
||||
1346520914 => '*RGB565',
|
||||
1345466932 => '*YUV422P',
|
||||
1345401140 => '*YUV411P',
|
||||
875836505 => '*YUV444',
|
||||
961959257 => '*YUV410',
|
||||
842093913 => '*YUV420'
|
||||
);
|
||||
$this->set('optionsPalette', $optionsPalette);
|
||||
|
||||
$optionsMethod = array(
|
||||
'v4l2' => 'Video For Linux 2'
|
||||
);
|
||||
$this->set('optionsMethod', $optionsMethod);
|
||||
|
||||
$this->set('linkedMonitors', $this->Monitor->find('list', array('fields' => array('Id', 'Name'))));
|
||||
|
||||
if ($this->request->is('put') || $this->request->is('post')) {
|
||||
|
@ -162,6 +59,7 @@
|
|||
}
|
||||
|
||||
public function add() {
|
||||
$this->set('linkedMonitors', $this->Monitor->find('list', array('fields' => array('Id', 'Name'))));
|
||||
if ($this->request->is('post')) {
|
||||
$this->Monitor->create();
|
||||
if ($this->Monitor->save($this->request->data)) {
|
||||
|
|
|
@ -37,6 +37,7 @@ class AppModel extends Model {
|
|||
$zm_path_bin = Configure::read('ZM_PATH_BIN');
|
||||
$string = $zm_path_bin."/zmdc.pl status";
|
||||
$daemon_status = shell_exec ( $string );
|
||||
Configure::write('daemonStatus', $daemon_status);
|
||||
return !strstr($daemon_status, "Unable to connect to server");
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
)
|
||||
);
|
||||
|
||||
public function getStreamSrc($id = null, $zmBandwidth, $buffer) {
|
||||
public function getStreamSrc($id = null, $zmBandwidth, $buffer, $function, $enabled, $name, $width, $scale = true) {
|
||||
$img['id'] = "livestream_$id";
|
||||
$img['width'] = $width;
|
||||
|
||||
$ZM_MPEG_LIVE_FORMAT = Configure::read('ZM_MPEG_LIVE_FORMAT');
|
||||
$ZM_WEB_STREAM_METHOD = ClassRegistry::init('Config')->getWebOption('ZM_WEB_STREAM_METHOD', $zmBandwidth);
|
||||
|
@ -23,12 +25,22 @@
|
|||
$ZM_WEB_VIDEO_MAXFPS = ClassRegistry::init('Config')->getWebOption('ZM_WEB_VIDEO_MAXFPS', $zmBandwidth);
|
||||
$ZM_MPEG_LIVE_FORMAT = $ZM_MPEG_LIVE_FORMAT;
|
||||
|
||||
if (Configure::read('daemonStatus') && $function != "None" && $enabled) {
|
||||
$img['alt'] = "Live stream of $name";
|
||||
if ($ZM_WEB_STREAM_METHOD == 'mpeg' && $ZM_MPEG_LIVE_FORMAT) {
|
||||
return "/cgi-bin/nph-zms?mode=mpeg&scale=100&maxfps=$ZM_WEB_VIDEO_MAXFPS&bitrate=$ZM_WEB_VIDEO_BITRATE&format=$ZM_MPEG_LIVE_FORMAT&monitor=$id";
|
||||
$img['src'] = "/cgi-bin/nph-zms?mode=mpeg&maxfps=$ZM_WEB_VIDEO_MAXFPS&bitrate=$ZM_WEB_VIDEO_BITRATE&format=$ZM_MPEG_LIVE_FORMAT&monitor=$id";
|
||||
} else {
|
||||
return "/cgi-bin/nph-zms?mode=jpeg&scale=100&maxfps=$ZM_WEB_VIDEO_MAXFPS&buffer=$buffer&monitor=$id";
|
||||
$img['src'] = "/cgi-bin/nph-zms?mode=jpeg&maxfps=$ZM_WEB_VIDEO_MAXFPS&buffer=$buffer&monitor=$id";
|
||||
}
|
||||
|
||||
if ($scale) {
|
||||
$scale = (Configure::read('ZM_WEB_LIST_THUMB_WIDTH') / $width) * 100;
|
||||
$img['src'] .= '&scale=' . $scale;
|
||||
}
|
||||
} else {
|
||||
$img['src'] = "/img/no-image.png";
|
||||
$img['alt'] = "No live stream available for $name";
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<div class="tab-pane" id="buffers">
|
||||
<?php
|
||||
echo $this->Form->inputs(array(
|
||||
'ImageBufferCount',
|
||||
'WarmupCount',
|
||||
'PreEventCount',
|
||||
'PostEventCount',
|
||||
'StreamReplayBuffer',
|
||||
'AlarmFrameCount',
|
||||
'ImageBufferCount' => array('after' => '<span class="help-block">This option determines how many frames are held in the ring buffer at any one time</span>'),
|
||||
'WarmupCount' => array('after' => '<span class="help-block">How many frames the analysis daemon should process but not examine when it starts. This allows it to generate an accurate reference image from a series of images before looking too carefully for any changes</span>'),
|
||||
'PreEventCount' => array('after' => '<span class="help-block">How many frames from before the event to include in the event.</span>'),
|
||||
'PostEventCount' => array('after' => '<span class="help-block">How many frames from after the event to include in the event.</span>'),
|
||||
'StreamReplayBuffer' => array('after' => '<span class="help-block"></span>'),
|
||||
'AlarmFrameCount' => array('after' => '<span class="help-block">How many consecutive alarm frames must occur before an alarm event is generated</span>'),
|
||||
'legend' => false
|
||||
));
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?php echo $this->Form->create('Monitor', array(
|
||||
'inputDefaults' => array(
|
||||
'legend' => false,
|
||||
'fieldset' => false,
|
||||
'label' => array('class' => array('control-label')),
|
||||
'div' => array('class' => array('form-group')),
|
||||
'class' => 'form-control'
|
||||
)
|
||||
)); ?>
|
||||
<?php echo $this->Form->input('Id', array('type' => 'hidden')); ?>
|
|
@ -0,0 +1,7 @@
|
|||
<div class="form-group">
|
||||
<?php echo $this->Form->end(array(
|
||||
'label' => 'Save Monitor',
|
||||
'class' => array('btn', 'btn-default'),
|
||||
'div' => false
|
||||
)); ?>
|
||||
</div>
|
|
@ -1,11 +1,37 @@
|
|||
<?php
|
||||
$typeoptions = array(
|
||||
'Local' => 'Local',
|
||||
'Remote' => 'Remote',
|
||||
'File' => 'File',
|
||||
'Ffmpeg' => 'Ffmpeg'
|
||||
);
|
||||
$this->set('typeoptions', $typeoptions);
|
||||
|
||||
$functionoptions = array(
|
||||
'Modect' => 'Modect',
|
||||
'Monitor' => 'Monitor',
|
||||
'Record' => 'Record',
|
||||
'None' => 'None',
|
||||
'Nodect' => 'Nodect',
|
||||
'Mocord' => 'Mocord'
|
||||
);
|
||||
$this->set('functionoptions', $functionoptions);
|
||||
?>
|
||||
|
||||
<div id="general" class="tab-pane active">
|
||||
<?php
|
||||
echo $this->Form->input('Name');
|
||||
echo $this->Form->input('Type', array( 'type' => 'select', 'options' => $typeoptions));
|
||||
echo $this->Form->input('Function', array('type' => 'select', 'options' => $functionoptions));
|
||||
echo $this->Form->input('Enabled', array('type' => 'checkbox'));
|
||||
echo $this->Form->input('MaxFPS');
|
||||
echo $this->Form->input('AlarmMaxFPS');
|
||||
echo $this->Form->input('RefBlendPerc');
|
||||
echo $this->Form->input('Enabled', array('type' => 'checkbox', 'div' => false, 'class' => false));
|
||||
echo $this->Form->input('MaxFPS', array(
|
||||
'after' => '<span class="help-block">Limit the maximum capture rate to the specified value. Do not use with IP / Network cameras, instead limit on the camera itself.</span>'
|
||||
));
|
||||
echo $this->Form->input('AlarmMaxFPS', array(
|
||||
'after' => '<span class="help-block">Override the above Max FPS option during alarms.</span>'
|
||||
));
|
||||
echo $this->Form->input('RefBlendPerc', array(
|
||||
'after' => '<span class="help-block">Each analysed image in ZoneMinder is a composite of previous images and is formed by applying the current image as a certain percentage of the previous reference image. This value specifies that percentage.</span>'
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<ul class="nav nav-tabs">
|
||||
<li><a data-toggle="tab" href="#general">General</a></li>
|
||||
<li><a data-toggle="tab" href="#source">Source</a></li>
|
||||
<li><a data-toggle="tab" href="#timestamp">Timestamp</a></li>
|
||||
<li><a data-toggle="tab" href="#buffers">Buffers</a></li>
|
||||
<li><a data-toggle="tab" href="#control">Control</a></li>
|
||||
<li><a data-toggle="tab" href="#misc">Misc</a></li>
|
||||
</ul>
|
|
@ -1,3 +1,88 @@
|
|||
<?php
|
||||
$optionsColours = array(
|
||||
1 => '8 bit grayscale',
|
||||
3 => '24 bit color',
|
||||
4 => '32 bit color'
|
||||
);
|
||||
$this->set('optionsColours', $optionsColours);
|
||||
|
||||
$protocoloptions = array(
|
||||
'rtsp' => 'RTSP',
|
||||
'http' => 'HTTP'
|
||||
);
|
||||
$this->set('protocoloptions', $protocoloptions);
|
||||
|
||||
$methodoptions = array(
|
||||
'simple' => 'Simple',
|
||||
'regexp' => 'Regexp'
|
||||
);
|
||||
$this->set('methodoptions', $methodoptions);
|
||||
|
||||
$channeloptions = array();
|
||||
for ($i=1; $i<32; $i++) {
|
||||
array_push($channeloptions, $i);
|
||||
}
|
||||
$this->set('channeloptions', $channeloptions);
|
||||
|
||||
$formatoptions = array(
|
||||
255 => "PAL",
|
||||
45056 => "NTSC",
|
||||
1 => "PAL B",
|
||||
2 => "PAL B1",
|
||||
4 => "PAL G",
|
||||
8 => "PAL H",
|
||||
16 => "PAL I",
|
||||
32 => "PAL D",
|
||||
64 => "PAL D1",
|
||||
128 => "PAL K",
|
||||
256 => "PAL M",
|
||||
512 => "PAL N",
|
||||
1024 => "PAL Nc",
|
||||
2048 => "PAL 60",
|
||||
4096 => "NTSC M",
|
||||
8192 => "NTSC M JP",
|
||||
16384 => "NTSC 443",
|
||||
32768 => "NTSC M KR",
|
||||
65536 => "SECAM B",
|
||||
131072 => "SECAM D",
|
||||
262144 => "SECAM G",
|
||||
524288 => "SECAM H",
|
||||
1048576 => "SECAM K",
|
||||
2097152 => "SECAM K1",
|
||||
4194304 => "SECAM L",
|
||||
8388608 => "SECAM LC",
|
||||
16777216 => "ATSC 8 VSB",
|
||||
33554432 => "ATSC 16 VSB"
|
||||
);
|
||||
$this->set('formatoptions', $formatoptions);
|
||||
|
||||
$optionsPalette = array(
|
||||
0 => 'Auto',
|
||||
1497715271 => 'Gray',
|
||||
877807426 => 'BGR32',
|
||||
876758866 => 'RGB32',
|
||||
861030210 => 'BGR24',
|
||||
859981650 => 'RGB24',
|
||||
1448695129 => '*YUYV',
|
||||
1195724874 => '*JPEG',
|
||||
1196444237 => '*MJPEG',
|
||||
875836498 => '*RGB444',
|
||||
1329743698 => '*RGB555',
|
||||
1346520914 => '*RGB565',
|
||||
1345466932 => '*YUV422P',
|
||||
1345401140 => '*YUV411P',
|
||||
875836505 => '*YUV444',
|
||||
961959257 => '*YUV410',
|
||||
842093913 => '*YUV420'
|
||||
);
|
||||
$this->set('optionsPalette', $optionsPalette);
|
||||
|
||||
$optionsMethod = array(
|
||||
'v4l2' => 'Video For Linux 2'
|
||||
);
|
||||
$this->set('optionsMethod', $optionsMethod);
|
||||
?>
|
||||
|
||||
<div class="tab-pane" id="source">
|
||||
<?php
|
||||
switch ($monitor['Type']) {
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
'LabelFormat',
|
||||
'LabelX',
|
||||
'LabelY',
|
||||
'legend' => false
|
||||
'legend' => false,
|
||||
'fieldset' => false
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
App::uses('AppHelper', 'View/Helper');
|
||||
|
||||
class LiveStreamHelper extends AppHelper {
|
||||
public function makeLiveStream($name, $src, $id, $width=0) {
|
||||
$liveStream = "<img class=\"livestream_resize\" id=\"liveStream_$id\" alt=\"Live Stream of $name\" src=\"$src&monitor=$id\">";
|
||||
return $src;
|
||||
}
|
||||
|
||||
public function showNoImage($name, $src, $id, $width=0) {
|
||||
$liveStream = "<img class=\"livestream_resize\" id=\"liveStream_$id\" alt=\"No Live stream available for $name\" src=\"/img/no-image.png\">";
|
||||
return $liveStream;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -42,6 +42,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
|
|||
echo $this->Html->script('jquery-ui.min');
|
||||
echo $this->Html->script('jquery.colorbox-min');
|
||||
echo $this->Html->script('bootstrap.min');
|
||||
echo $this->Html->script('masonry.pkgd.min');
|
||||
echo $this->Html->script('main');
|
||||
?>
|
||||
</head>
|
||||
|
|
|
@ -1,46 +1,14 @@
|
|||
<h2>Add Monitor</h2>
|
||||
<?php echo $this->element('tabs-nav'); ?>
|
||||
|
||||
<?php
|
||||
$typeoptions = array("Local" => "Local", "Remote" => "Remote", "File" => "File", "Ffmpeg" => "Ffmpeg");
|
||||
$functionoptions = array('Modect' => 'Modect', 'Monitor' => 'Monitor', 'Record' => 'Record', 'None' => 'None', 'Nodect' => 'Nodect', 'Mocord' => 'Mocord');
|
||||
$defaultviewoptions = array('Events' => 'Events', 'Control' => 'Control');
|
||||
$defaultrateoptions = array(10000 => '100x', 5000 => '50x', 2500 => '25x', 1000 => '10x', 400 => '4x', 200 => '2x', 100 => 'Real', 50 => '1/2x', 25 => '1/4x');
|
||||
$defaultscaleoptions = array(400 => '4x', 300 => '4x', 200 => '2x', 100 => 'Actual', 75 => '3/4x', 50 => '1/2x', 33 => '1/3x', 25 => '1/4x');
|
||||
<?php echo $this->element('tabs-form-create'); ?>
|
||||
|
||||
echo $this->Form->create('Monitor');
|
||||
echo $this->Form->inputs(array(
|
||||
'legend' => 'General',
|
||||
'Name',
|
||||
'Type' => array('type' => 'select', 'options' => $typeoptions),
|
||||
'Function' => array('type' => 'select', 'options' => $functionoptions),
|
||||
'Enabled' => array('type' => 'checkbox')
|
||||
));
|
||||
echo $this->Form->inputs(array(
|
||||
'legend' => 'Buffers',
|
||||
'Image Buffer Size (frames)',
|
||||
'Warmup Frames',
|
||||
'Pre Event Image Count',
|
||||
'Post Event Image Count',
|
||||
'Stream Reply Image Buffer',
|
||||
'Alarm Frame Count'
|
||||
));
|
||||
echo $this->Form->inputs(array(
|
||||
'Timestamp Label Format' => array('default' => '%N - %d/%m/%y %H:%M:%S'),
|
||||
'Timestamp Label X' => array('default' => 0),
|
||||
'Timestamp Label Y' => array('default' => 0)
|
||||
));
|
||||
echo $this->Form->inputs(array(
|
||||
'legend' => 'Misc',
|
||||
'Event Prefix' => array('default' => 'Event-'),
|
||||
'Section Length' => array('default' => 600),
|
||||
'Frame Skip' => array('default' => 0),
|
||||
'FPS Report Interval' => array('default' => 1000),
|
||||
'Web Colour' => array('default' => 'red'),
|
||||
'Signal Check Colour' => array('default' => '#0000c0'),
|
||||
'Default View' => array('type' => 'select', 'options' => $defaultviewoptions, 'selected' => 'Events'),
|
||||
'Default Rate' => array('type' => 'select', 'options' => $defaultrateoptions, 'selected' => 100),
|
||||
'Default Scale' => array('type' => 'select', 'options' => $defaultscaleoptions, 'selected' => 100)
|
||||
));
|
||||
echo $this->Form->end('Save');
|
||||
<div class="tab-content" style="width:400px;">
|
||||
<?php echo $this->element('tabs-general'); ?>
|
||||
<?php echo $this->element('tabs-source'); ?>
|
||||
<?php echo $this->element('tabs-timestamp'); ?>
|
||||
<?php echo $this->element('tabs-buffers'); ?>
|
||||
<?php echo $this->element('tabs-control'); ?>
|
||||
<?php echo $this->element('tabs-misc'); ?>
|
||||
</div>
|
||||
|
||||
?>
|
||||
<?php echo $this->element('tabs-form-end'); ?>
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
<ul class="nav nav-tabs">
|
||||
<li><a data-toggle="tab" href="#general">General</a></li>
|
||||
<li><a data-toggle="tab" href="#source">Source</a></li>
|
||||
<li><a data-toggle="tab" href="#timestamp">Timestamp</a></li>
|
||||
<li><a data-toggle="tab" href="#buffers">Buffers</a></li>
|
||||
<li><a data-toggle="tab" href="#control">Control</a></li>
|
||||
<li><a data-toggle="tab" href="#misc">Misc</a></li>
|
||||
</ul>
|
||||
<?php echo $this->element('tabs-nav'); ?>
|
||||
|
||||
<?php echo $this->Form->create('Monitor', array( 'inputDefaults' => array( 'legend' => false, 'fieldset' => false))); ?>
|
||||
<?php echo $this->Form->input('Id', array('type' => 'hidden')); ?>
|
||||
<?php echo $this->element('tabs-form-create'); ?>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-content" style="width:400px;">
|
||||
<?php echo $this->element('tabs-general'); ?>
|
||||
<?php echo $this->element('tabs-source'); ?>
|
||||
<?php echo $this->element('tabs-timestamp'); ?>
|
||||
|
@ -19,4 +11,4 @@
|
|||
<?php echo $this->element('tabs-misc'); ?>
|
||||
</div>
|
||||
|
||||
<?php echo $this->Form->end('Save Monitor'); ?>
|
||||
<?php echo $this->element('tabs-form-end'); ?>
|
||||
|
|
|
@ -4,22 +4,19 @@
|
|||
$this->end();
|
||||
?>
|
||||
|
||||
<div class="row" id="monitors">
|
||||
<div id="monitors" class="js-masonry" data-masonry-options='{ "gutter": 10, "itemSelector": ".monitor" }'>
|
||||
<?php foreach ($monitors as $monitor => $mon): ?>
|
||||
<div class="col-md-4" id="Monitor_<?= $mon['Monitor']['Id']; ?>">
|
||||
<div class="thumbnail">
|
||||
<?php
|
||||
if($daemonStatus && $mon['Monitor']['Function'] != "None" && $mon['Monitor']['Enabled']) {
|
||||
echo $this->Html->image($streamSrc[$mon['Monitor']['Id']], array(
|
||||
'alt' => 'Live stream of ' . $mon['Monitor']['Name'],
|
||||
'id' => 'liveStream_' . $mon['Monitor']['Id'],
|
||||
));
|
||||
} else {
|
||||
echo $this->LiveStream->showNoImage($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $width);
|
||||
}
|
||||
?>
|
||||
<div class="panel panel-default monitor" id="Monitor_<?= $mon['Monitor']['Id']; ?>" style="width:<?php $mon['img']['width'];?>">
|
||||
<div class="panel-heading">
|
||||
<h4><?php echo $this->Html->link($mon['Monitor']['Name'],array('controller' => 'monitors', 'action' => 'view', $mon['Monitor']['Id'])); ?></h4>
|
||||
</div>
|
||||
<div class="thumbnail panel-body">
|
||||
<?php echo $this->Html->image($mon['img']['src'], array(
|
||||
'alt' => $mon['img']['alt'],
|
||||
'id' => $mon['img']['id'],
|
||||
'width' => Configure::read('ZM_WEB_LIST_THUMB_WIDTH')
|
||||
)); ?>
|
||||
<div class="caption">
|
||||
<h4><?php echo $this->Html->link($mon['Monitor']['Name'],array('controller' => 'monitors', 'action' => 'view', $mon['Monitor']['Id'])); ?></h4>
|
||||
<p><?php echo $this->Html->link($mon['Monitor']['Function'], array('action' => 'edit', $mon['Monitor']['Id'])); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
<h2><?php echo $monitor['Monitor']['Name']; ?> Live Stream</h2>
|
||||
|
||||
<?php
|
||||
if($daemonStatus && $monitor['Monitor']['Function'] != "None" && $monitor['Monitor']['Enabled'])
|
||||
echo $this->Html->image($streamSrc, array(
|
||||
'alt' => 'Live stream of ' . $monitor['Monitor']['Name'],
|
||||
'id' => 'liveStream_' . $monitor['Monitor']['Id']
|
||||
));
|
||||
else
|
||||
echo $this->LiveStream->showNoImage($monitor['Monitor']['Name'], $streamSrc, $monitor['Monitor']['Id']);
|
||||
echo $this->Html->image($streamSrc['src'], array(
|
||||
'alt' => $streamSrc['alt'],
|
||||
'id' => $streamSrc['id']
|
||||
));
|
||||
?>
|
||||
|
|
|
@ -211,18 +211,6 @@ $(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 //
|
||||
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue