2016-04-11 04:33:55 +08:00
|
|
|
|
2020-09-03 05:28:08 +08:00
|
|
|
var requestQueue = new Request.Queue({
|
|
|
|
concurrent: monitorData.length,
|
|
|
|
stopOnFailure: false
|
|
|
|
});
|
|
|
|
function streamCmdQuit( ) {
|
2019-01-19 23:32:40 +08:00
|
|
|
if ( action ) {
|
2017-10-04 22:48:37 +08:00
|
|
|
streamCmdReq.send( streamCmdParms+"&command="+CMD_QUIT );
|
2019-01-19 23:32:40 +08:00
|
|
|
}
|
2016-04-11 04:33:55 +08:00
|
|
|
}
|
|
|
|
|
2020-09-25 23:52:13 +08:00
|
|
|
// Manage the Add New Zone button
|
|
|
|
function AddNewZone(el) {
|
|
|
|
url = el.getAttribute('data-url');
|
|
|
|
window.location.assign(url);
|
|
|
|
}
|
|
|
|
|
2020-09-03 05:28:08 +08:00
|
|
|
var monitors = new Array();
|
|
|
|
|
|
|
|
function initPage() {
|
2020-09-04 22:02:43 +08:00
|
|
|
for ( var i = 0, length = monitorData.length; i < length; i++ ) {
|
2020-09-03 05:28:08 +08:00
|
|
|
monitors[i] = new MonitorStream(monitorData[i]);
|
|
|
|
|
|
|
|
// Start the fps and status updates. give a random delay so that we don't assault the server
|
|
|
|
var delay = Math.round( (Math.random()+0.5)*statusRefreshTimeout );
|
|
|
|
monitors[i].start(delay);
|
|
|
|
}
|
2020-09-26 02:44:55 +08:00
|
|
|
|
|
|
|
// Manage the BACK button
|
|
|
|
document.getElementById("backBtn").addEventListener("click", function onBackClick(evt) {
|
|
|
|
evt.preventDefault();
|
|
|
|
window.history.back();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Disable the back button if there is nothing to go back to
|
|
|
|
$j('#backBtn').prop('disabled', !document.referrer.length);
|
|
|
|
|
|
|
|
// Manage the REFRESH Button
|
|
|
|
document.getElementById("refreshBtn").addEventListener("click", function onRefreshClick(evt) {
|
|
|
|
evt.preventDefault();
|
|
|
|
window.location.reload(true);
|
|
|
|
});
|
2020-09-03 05:28:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('DOMContentLoaded', initPage);
|
|
|
|
|