2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2015-09-17 02:51:23 +08:00
|
|
|
require_once('includes/Server.php');
|
2016-01-05 03:51:24 +08:00
|
|
|
$servers = Server::find_all();
|
2016-02-03 22:42:50 +08:00
|
|
|
require_once('includes/Storage.php');
|
|
|
|
$storage_areas = Storage::find_all();
|
|
|
|
$show_storage_areas = count($storage_areas) > 1 and canEdit( 'System' ) ? 1 : 0;
|
2015-09-17 02:51:23 +08:00
|
|
|
|
2015-05-10 21:10:30 +08:00
|
|
|
xhtmlHeaders( __FILE__, translate('Console') );
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<body>
|
2014-12-05 07:44:23 +08:00
|
|
|
<form name="monitorForm" method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<input type="hidden" name="action" value=""/>
|
2016-03-12 16:28:02 +08:00
|
|
|
|
2016-03-16 01:43:49 +08:00
|
|
|
<?php include("skins/$skin/views/header.php") ?>
|
2016-03-12 16:28:02 +08:00
|
|
|
|
|
|
|
<div class="container-fluid">
|
2008-07-14 21:54:50 +08:00
|
|
|
<table id="consoleTable" cellspacing="0">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colName"><?php echo translate('Name') ?></th>
|
|
|
|
<th class="colFunction"><?php echo translate('Function') ?></th>
|
2016-01-05 03:59:04 +08:00
|
|
|
<?php if ( count($servers) ) { ?>
|
2016-04-15 01:53:10 +08:00
|
|
|
<th class="colServer"><?php echo translate('Server') ?></th>
|
2016-01-05 03:51:24 +08:00
|
|
|
<?php } ?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colSource"><?php echo translate('Source') ?></th>
|
2016-02-03 22:42:50 +08:00
|
|
|
<?php if ( $show_storage_areas ) { ?>
|
|
|
|
<th class="colStorage"><?php echo translate('Storage') ?></th>
|
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ )
|
|
|
|
{
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<th class="colEvents"><?php echo $eventCounts[$i]['title'] ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colZones"><?php echo translate('Zones') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
if ( canEdit('Monitors') )
|
|
|
|
{
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colOrder"><?php echo translate('Order') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colMark"><?php echo translate('Mark') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
2016-02-03 22:42:50 +08:00
|
|
|
<td class="colLeftButtons" colspan="<?php $columns = 3;
|
|
|
|
if ( count($servers) > 1 ) { $columns += 1; }
|
|
|
|
if ( $show_storage_areas ) { $columns += 1; }
|
|
|
|
echo $columns;
|
|
|
|
?>">
|
2016-03-12 16:28:02 +08:00
|
|
|
<input type="button" class="btn btn-default" value="<?php echo translate('AddNewMonitor'); ?>" onclick="createPopup( '?view=monitor', 'zmMonitor0', 'monitor' ); return( false );"></input>
|
2008-07-14 21:54:50 +08:00
|
|
|
</td>
|
|
|
|
<?php
|
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ )
|
|
|
|
{
|
|
|
|
parseFilter( $eventCounts[$i]['filter'] );
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colEvents"><?php echo makePopupLink( '?view='.$eventsView.'&page=1'.$eventCounts[$i]['filter']['query'], $eventsWindow, $eventsView, $eventCounts[$i]['total'], canView( 'Events' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colZones"><?php echo $zoneCount ?></td>
|
2016-03-13 09:36:39 +08:00
|
|
|
<td class="colRightButtons" colspan="<?php echo canEdit('Monitors')?2:1 ?>"><input class="btn btn-default" type="button" name="editBtn" value="<?php echo translate('Edit') ?>" onclick="editMonitor( this )" disabled="disabled"/><input class="btn btn-default" type="button" name="deleteBtn" value="<?php echo translate('Delete') ?>" onclick="deleteMonitor( this )" disabled="disabled"/></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2008-10-06 03:16:45 +08:00
|
|
|
foreach( $displayMonitors as $monitor )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2016-01-15 00:05:05 +08:00
|
|
|
<tr title="<?php echo $monitor['Id'] ?>">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
if ( !$monitor['zmc'] )
|
|
|
|
$dclass = "errorText";
|
|
|
|
else
|
|
|
|
{
|
2016-04-15 01:53:10 +08:00
|
|
|
// https://github.com/ZoneMinder/ZoneMinder/issues/1082
|
2015-10-01 23:35:38 +08:00
|
|
|
if ( !$monitor['zma'] && $monitor['Function']!='Monitor' )
|
2008-07-14 21:54:50 +08:00
|
|
|
$dclass = "warnText";
|
|
|
|
else
|
|
|
|
$dclass = "infoText";
|
|
|
|
}
|
|
|
|
if ( $monitor['Function'] == 'None' )
|
|
|
|
$fclass = "errorText";
|
2015-10-01 23:35:38 +08:00
|
|
|
//elseif ( $monitor['Function'] == 'Monitor' )
|
|
|
|
// $fclass = "warnText";
|
2008-07-14 21:54:50 +08:00
|
|
|
else
|
|
|
|
$fclass = "infoText";
|
|
|
|
if ( !$monitor['Enabled'] )
|
|
|
|
$fclass .= " disabledText";
|
|
|
|
$scale = max( reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colName"><?php echo makePopupLink( '?view=watch&mid='.$monitor['Id'], 'zmWatch'.$monitor['Id'], array( 'watch', reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) ), $monitor['Name'], $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
2015-05-22 01:23:31 +08:00
|
|
|
<td class="colFunction"><?php echo makePopupLink( '?view=function&mid='.$monitor['Id'], 'zmFunction', 'function', '<span class="'.$fclass.'">'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2016-01-05 03:59:04 +08:00
|
|
|
<?php if ( count($servers) ) { ?>
|
2016-04-15 01:53:10 +08:00
|
|
|
<td class="colServer"><?php
|
2015-09-18 03:34:48 +08:00
|
|
|
$Server = new Server( $monitor['ServerId'] );
|
|
|
|
echo $Server->Name();
|
|
|
|
?></td>
|
2016-01-05 03:51:24 +08:00
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php if ( $monitor['Type'] == "Local" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$monitor['Device'].' ('.$monitor['Channel'].')</span>', canEdit( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "Remote" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.preg_replace( '/^.*@/', '', $monitor['Host'] ).'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "File" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.preg_replace( '/^.*\//', '', $monitor['Path'] ).'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2015-07-17 19:59:40 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "Ffmpeg" || $monitor['Type'] == "Libvlc" ) {
|
2013-12-22 09:29:40 +08:00
|
|
|
$domain = parse_url( $monitor['Path'], PHP_URL_HOST );
|
|
|
|
$shortpath = $domain ? $domain : preg_replace( '/^.*\//', '', $monitor['Path'] );
|
2016-04-15 01:53:10 +08:00
|
|
|
if ( $shortpath == '' ) {
|
|
|
|
$shortpath = 'Monitor ' . $monitor['Id'];
|
|
|
|
}
|
2013-12-22 09:29:40 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$shortpath.'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2013-11-04 23:28:15 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "cURL" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.preg_replace( '/^.*\//', '', $monitor['Path'] ).'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td class="colSource"> </td>
|
|
|
|
<?php } ?>
|
2016-02-03 22:42:50 +08:00
|
|
|
<?php if ( $show_storage_areas ) { ?>
|
|
|
|
<td class="colStorage"><?php
|
|
|
|
$Storage = new Storage( $monitor['StorageId'] );
|
|
|
|
echo $Storage->Name();
|
|
|
|
?></td>
|
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ )
|
|
|
|
{
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colEvents"><?php echo makePopupLink( '?view='.$eventsView.'&page=1'.$monitor['eventCounts'][$i]['filter']['query'], $eventsWindow, $eventsView, $monitor['EventCount'.$i], canView( 'Events' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colZones"><?php echo makePopupLink( '?view=zones&mid='.$monitor['Id'], 'zmZones', array( 'zones', $monitor['Width'], $monitor['Height'] ), $monitor['ZoneCount'], canView( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
if ( canEdit('Monitors') )
|
|
|
|
{
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colOrder"><?php echo makeLink( '?view='.$view.'&action=sequence&mid='.$monitor['Id'].'&smid='.$seqIdUpList[$monitor['Id']], '<img src="'.$seqUpFile.'" alt="Up"/>', $monitor['Sequence']>$minSequence ) ?><?php echo makeLink( '?view='.$view.'&action=sequence&mid='.$monitor['Id'].'&smid='.$seqIdDownList[$monitor['Id']], '<img src="'.$seqDownFile.'" alt="Down"/>', $monitor['Sequence']<$maxSequence ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colMark"><input type="checkbox" name="markMids[]" value="<?php echo $monitor['Id'] ?>" onclick="setButtonStates( this )"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2016-03-12 16:28:02 +08:00
|
|
|
|
|
|
|
<div id="footer">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="pull-left">
|
|
|
|
<?php echo makePopupLink( '?view=bandwidth', 'zmBandwidth', 'bandwidth', $bwArray[$_COOKIE['zmBandwidth']], ($user && $user['MaxBandwidth'] != 'low' ) ) ?> <?php echo translate('BandwidthHead') ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="pull-right">
|
|
|
|
<?php echo makePopupLink( '?view=version', 'zmVersion', 'version', '<span class="'.$versionClass.'">v'.ZM_VERSION.'</span>', canEdit( 'System' ) ) ?>
|
|
|
|
</div>
|
|
|
|
<ul class="list-inline">
|
|
|
|
<li><?php echo translate('Load') ?>: <?php echo getLoad() ?></li>
|
|
|
|
<li><?php echo translate('Disk') ?>: <?php echo getDiskPercent() ?>%</li>
|
|
|
|
</ul>
|
|
|
|
</div> <!-- End .footer -->
|
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|