mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-12-23 12:43:35 +00:00
fix unicast urls for v2s / disable editing of camera config (#558)
* Update config.js correct RSTP links for V2 * Update config.cgi fix urls for v2 RTSP in config.cgi * Update cam.cgi prevent editing of cam config (not hack config) in www
This commit is contained in:
parent
9dc5e756e8
commit
c94a678467
@ -144,7 +144,7 @@ function ini_to_html_free
|
|||||||
classes=""
|
classes=""
|
||||||
printf '<div class="ii"><div class="ii_key_DIV">%s</div><div class="ii_value_DIV">' $1
|
printf '<div class="ii"><div class="ii_key_DIV">%s</div><div class="ii_value_DIV">' $1
|
||||||
select_block $1 $3
|
select_block $1 $3
|
||||||
printf '<input class="ii_value'$classes'" type="text" name="%s" value="%s" default_value="%s" row="%s" /></div>' "row_$3[$1]" $2 $2 $3
|
printf '<input disabled=TRUE class="ii_value'$classes'" type="text" name="%s" value="%s" default_value="%s" row="%s" /></div>' "row_$3[$1]" $2 $2 $3
|
||||||
documentation_to_html $1
|
documentation_to_html $1
|
||||||
printf '</div>'
|
printf '</div>'
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ echo -ne "</head>"
|
|||||||
echo -ne '<body ip="'$ipaddr'" mac="'$macaddr'" >'
|
echo -ne '<body ip="'$ipaddr'" mac="'$macaddr'" >'
|
||||||
echo -ne "<h1>$title</h1>";
|
echo -ne "<h1>$title</h1>";
|
||||||
|
|
||||||
echo -ne "<div>cam.cgi only lists values in your current configuration file. To add other values, edit manually! </div>"
|
echo -ne "<div>cam.cgi only lists values in your current configuration file. <div style='font-weight:bold;color:red' >To Prevent Bricking This Form is Disabled!</div> </div>"
|
||||||
|
|
||||||
if [ "$updated" = true ];
|
if [ "$updated" = true ];
|
||||||
then
|
then
|
||||||
@ -182,7 +182,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo -ne '<form name="update_config" method="POST" enctype="application/x-www-form-urlencoded" >'
|
echo -ne '<form action="#" onsubmit="return false;" name="update_config" method="POST" enctype="application/x-www-form-urlencoded" >'
|
||||||
|
|
||||||
|
|
||||||
CONFIG_BLOCK=0
|
CONFIG_BLOCK=0
|
||||||
@ -212,9 +212,9 @@ done < $cam_config
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo -ne '<input type="submit" name="update" id="update" value="Update" disabled="disabled" />'
|
#echo -ne '<input type="submit" name="update" id="update" value="Update" disabled="disabled" />'
|
||||||
echo -ne '</form>'
|
echo -ne '</form>'
|
||||||
echo -ne '<button onclick="enable_submit();" >Enable Submit</button>';
|
#echo -ne '<button onclick="enable_submit();" >Enable Submit</button>';
|
||||||
|
|
||||||
revert_menu $base_hack_ini $cam_config
|
revert_menu $base_hack_ini $cam_config
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ echo '<script type="text/javascript" src="/feed.js" ></script>'
|
|||||||
echo -ne "</head>"
|
echo -ne "</head>"
|
||||||
|
|
||||||
|
|
||||||
echo -ne '<body ip="'$ipaddr'" mac="'$macaddr'" >'
|
echo -ne '<body ip="'$ipaddr'" mac="'$macaddr'" camtype="'$camtype'" >'
|
||||||
echo -ne "<h1>$title</h1>";
|
echo -ne "<h1>$title</h1>";
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ window.scrollTo({
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function compose_rtsp_block(stype)
|
function compose_rtsp_block(stype,streams)
|
||||||
{
|
{
|
||||||
const formElement = document.querySelector("form");
|
const formElement = document.querySelector("form");
|
||||||
var fdata = new FormData(formElement);
|
var fdata = new FormData(formElement);
|
||||||
@ -42,12 +42,13 @@ function compose_rtsp_block(stype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stream = "/unicast";
|
stream = "unicast";
|
||||||
|
|
||||||
if ((fdata.get('RTSP_HI_RES_ENABLED') == "true") && (fdata.get('RTSP_LOW_RES_ENABLED') == "true")) {
|
if ((fdata.get('RTSP_HI_RES_ENABLED') == "true") && (fdata.get('RTSP_LOW_RES_ENABLED') == "true")) {
|
||||||
if (stype == "RTSP_HI_RES") { stream = "/video1_unicast" } else { stream ="/video2_unicast" }
|
if (stype == "RTSP_HI_RES") { stream = streams['high']; } else { stream = streams['low']; }
|
||||||
}
|
}
|
||||||
|
|
||||||
var link = "rtsp://" + auth + document.body.getAttribute("ip") + ":" + fdata.get('RTSP_PORT') + stream;
|
var link = "rtsp://" + auth + document.body.getAttribute("ip") + ":" + fdata.get('RTSP_PORT') + '/' stream;
|
||||||
|
|
||||||
var vb = document.querySelectorAll('[block_name="VIDEOSTREAM"]')[0];
|
var vb = document.querySelectorAll('[block_name="VIDEOSTREAM"]')[0];
|
||||||
var url_block = document.createElement('DIV');
|
var url_block = document.createElement('DIV');
|
||||||
@ -64,9 +65,11 @@ function enable_submit()
|
|||||||
|
|
||||||
window.addEventListener("load", function()
|
window.addEventListener("load", function()
|
||||||
{
|
{
|
||||||
compose_rtsp_block('RTSP_HI_RES');
|
var streams = {'low': 'video2_unicast', 'high':'video1_unicast'};
|
||||||
compose_rtsp_block('RTSP_LOW_RES');
|
if (document.body.getAttribute('camtype') != 'T31') { streams = {'low': 'video7_unicast', 'high':'video6_unicast'}; }
|
||||||
|
|
||||||
|
compose_rtsp_block('RTSP_HI_RES',streams);
|
||||||
|
compose_rtsp_block('RTSP_LOW_RES',streams);
|
||||||
document.querySelector('[name="update_config"]').addEventListener('submit',
|
document.querySelector('[name="update_config"]').addEventListener('submit',
|
||||||
function(e){
|
function(e){
|
||||||
const mac_addrs = document.getElementsByClassName('mac_addr');
|
const mac_addrs = document.getElementsByClassName('mac_addr');
|
||||||
|
Loading…
Reference in New Issue
Block a user