Add Janus_RTSP_User and related UI code
parent
d2c461bcc9
commit
d32fe1cf55
|
@ -148,6 +148,7 @@ public static function getStatuses() {
|
|||
'JanusAudioEnabled' => array('type'=>'boolean','default'=>0),
|
||||
'Janus_Profile_Override' => '',
|
||||
'Janus_Use_RTSP_Restream' => array('type'=>'boolean','default'=>0),
|
||||
'Janus_RTSP_User' => null,
|
||||
'LinkedMonitors' => array('type'=>'set', 'default'=>null),
|
||||
'Triggers' => array('type'=>'set','default'=>''),
|
||||
'EventStartCommand' => '',
|
||||
|
|
|
@ -72,6 +72,21 @@ function loadLocations( element ) {
|
|||
}
|
||||
}
|
||||
|
||||
function Janus_Use_RTSP_Restream_onclick(e) {
|
||||
console.log("hello");
|
||||
Janus_Use_RTSP_Restream = $j('[name="newMonitor[Janus_Use_RTSP_Restream]"]');
|
||||
if (Janus_Use_RTSP_Restream.length) {
|
||||
const Janus_RTSP_User = $j('#Janus_RTSP_User');
|
||||
if (Janus_Use_RTSP_Restream[0].checked) {
|
||||
Janus_RTSP_User.show();
|
||||
} else {
|
||||
Janus_RTSP_User.hide();
|
||||
}
|
||||
} else {
|
||||
console.log("DIdn't find newMonitor[Janus_Use_RTSP_Restream]");
|
||||
}
|
||||
}
|
||||
|
||||
function initPage() {
|
||||
var backBtn = $j('#backBtn');
|
||||
var onvifBtn = $j('#onvifBtn');
|
||||
|
@ -285,6 +300,14 @@ function initPage() {
|
|||
}
|
||||
});
|
||||
|
||||
const Janus_Use_RTSP_Restream = document.getElementsByName('newMonitor[Janus_Use_RTSP_Restream]');
|
||||
if (Janus_Use_RTSP_Restream.length) {
|
||||
Janus_Use_RTSP_Restream[0].onclick = Janus_Use_RTSP_Restream_onclick;
|
||||
console.log("Setup Janus_RTSP_Restream.onclick");
|
||||
} else {
|
||||
console.log("newMonitor[Janus_Use_RTSP_Restream] not found");
|
||||
}
|
||||
|
||||
// Amcrest API controller
|
||||
if (document.getElementsByName("newMonitor[ONVIF_Event_Listener]")[0].checked) {
|
||||
document.getElementById("function_use_Amcrest_API").hidden = false;
|
||||
|
@ -469,6 +492,7 @@ function updateLatitudeAndLongitude(latitude, longitude) {
|
|||
map.invalidateSize(true);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function getLocation() {
|
||||
if ('geolocation' in navigator) {
|
||||
navigator.geolocation.getCurrentPosition((position) => {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
require_once('includes/Server.php');
|
||||
require_once('includes/Storage.php');
|
||||
require_once('includes/User.php');
|
||||
require_once('includes/Zone.php');
|
||||
|
||||
if (!canEdit('Monitors', empty($_REQUEST['mid'])?0:$_REQUEST['mid'])) {
|
||||
|
@ -1245,6 +1246,19 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
|
|||
if ( isset($OLANG['FUNCTION_JANUS_USE_RTSP_RESTREAM']) ) {
|
||||
echo '<div class="form-text">'.$OLANG['FUNCTION_JANUS_USE_RTSP_RESTREAM']['Help'].'</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="Janus_RTSP_User" <?php echo (!ZM_OPT_USE_AUTH or !$monitor->Janus_Use_RTSP_Restream()) ? 'style="display:none;"' : ''?>>
|
||||
<td><?php echo translate('User for RTSP Server Auth') ?></td>
|
||||
<td><?php
|
||||
$users = array(''=>translate('None'));
|
||||
foreach (ZM\User::find() as $u) {
|
||||
if ($u->MonitorIds() and (!$monitor->Id() or in_array($monitor->Id(), explode(',', $u->monitorIds()))))
|
||||
continue;
|
||||
$users[$u->Id()] = $u->Username();
|
||||
}
|
||||
echo htmlSelect("newMonitor[Janus_RTSP_User]", $users, $monitor->Janus_RTSP_User());
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue