Browse Source

OnVif Discovery fixes

master
Evgeny Gagua 2 months ago
parent
commit
7196273fa4
  1. 2
      files.list
  2. 46
      lib/controller/getDashBoardItems.php
  3. 127
      lib/controller/getReportLayout.php
  4. 15
      lib/controller/settings/node_1.js
  5. 13
      lib/controller/settings/node_2.js
  6. 8
      lib/javascript/jsapi_dynamic/mojo_dashboard.js
  7. 8
      lib/javascript/jsapi_dynamic/mojo_global_vars.js
  8. 22
      lib/javascript/jsapi_dynamic/mojo_main.js
  9. 9
      lib/javascript/jsapi_dynamic/mojo_reports.js
  10. 44
      lib/javascript/jsapi_dynamic/mojo_settings.js
  11. 378
      lib/javascript/jsapi_dynamic/mojo_windows.js
  12. 12
      lib/php/onvif/toto.php
  13. BIN
      style/assets/3b4ad2078aa0b06e78fa417e2e47bf05.png
  14. BIN
      style/assets/987698d-1.png
  15. BIN
      style/assets/blue-staks-sucksd.png
  16. 43
      style/style.css

2
files.list

@ -3385,7 +3385,6 @@
./style/assets/and.png
./style/assets/lfs_draw_empty_25.png
./style/assets/argus_logo.png
./style/assets/987698d-1.png
./style/assets/14_node.png
./style/assets/map-icon.png
./style/assets/0_node.png
@ -3515,7 +3514,6 @@
./style/assets/13_node.png
./style/assets/16-9-nocam.png
./style/assets/draw100.svg
./style/assets/blue-staks-sucksd.png
./style/assets/map_mode_wgs84.png
./android-chrome-256x256.png
./mstile-150x150.png

46
lib/controller/getDashBoardItems.php

@ -487,6 +487,52 @@ _DATA_BOUNDARY;
break;
};
case 3:{
$LOGIO=<<<_DATA_BOUNDARY
{
xtype: 'grid',
id: 'log_grid',
border: false,
frame: false,
autoScroll: true,
//width: '100%',
lazyRender: true,
height: 210,
ds: log_store,
cm: new Ext.grid.ColumnModel( log_ColModel_ops ),
sm: new Ext.grid.RowSelectionModel( log_SelModel_ops ),
viewConfig: {
forceFit: true,
getRowClass: function( record, rowIndex, rowParams, store){
switch( record.get('node_id')%5 ){
case 0: return 'row-level01';
case 1: return 'row-level02';
case 2: return 'row-level03';
case 3: return 'row-level04';
case 4: return 'row-level05';
};
return '';
}
},
listeners:{
afterrender : function( t ){
var papa = Ext.getCmp('main_portal');
var jj = papa.getComponent( 0 ).getHeight();
var zz = t.ownerCt.ownerCt.getHeight();
//alert( PanelW );
//alert( PanelH - zz );
//t.setHeight( PanelH - jj - 20 );
//t.setHeight( PanelH - zz - 42 );
var mama = Ext.getCmp('lg_panel');
var R = papa.getHeight() - papa.getComponent( 1 ).getHeight() - 41;
mama.setHeight( R+40 );
t.setHeight( R );
}
}
}
_DATA_BOUNDARY;
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
$STA[0]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
$STA[1]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
$STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";

127
lib/controller/getReportLayout.php

@ -297,6 +297,133 @@ _DATA_BOUNDARY;
$OUT[]= $STA[3] . $DUMMY['log'] . $END;
break;
};
case 3:{
$LOGIO=<<<_DATA_BOUNDARY
{
xtype: 'grid',
id: 'rep_grid',
border: false,
frame: false,
autoScroll: true,
//width: '100%',
lazyRender: true,
height: 210,
ds: rep_store,
tbar:[{
text: 'Analyze Bubbles',
handler: doBubbleAnalyze
}],
cm: new Ext.grid.ColumnModel( rep_ColModel_ops ),
sm: new Ext.grid.RowSelectionModel( rep_SelModel_ops ),
viewConfig: {
forceFit: true,
getRowClass: function( record, rowIndex, rowParams, store){
switch( record.get('node_id')%5 ){
case 0: return 'row-level01';
case 1: return 'row-level02';
case 2: return 'row-level03';
case 3: return 'row-level04';
case 4: return 'row-level05';
};
return '';
}
},
listeners:{
afterrender : function( t ){
var papa = Ext.getCmp('segment_portal');
var mama = Ext.getCmp('lg_panel');
var R = papa.getHeight() - papa.getComponent( 1 ).getHeight() - 73;
mama.setHeight( R+40 );
t.setHeight( R );
}
}
}
_DATA_BOUNDARY;
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: 'Report Log', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
$STA[0]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
$STA[1]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
if( $UP['width'] > 1.6* $UP['height'] ){
$STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
$STA[3]="{ columnWidth: .67, stylse:'padding:10px 0 10px 10px', items:[";
} else {
$STA[2]="{ columnWidth: .45, stylse:'padding:10px 0 10px 10px', items:[";
$STA[3]="{ columnWidth: .55, stylse:'padding:10px 0 10px 10px', items:[";
};
$OUT[]= $STA[0] . $DUMMY['map'] . $END;
$QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1";
$R = $DATABASE->Query( $QS );
$idx = 0;
if( count( $R ) ){
foreach( $R as $DD ){
if( $idx < 1 ){
$TFN = 'report/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
$TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
$QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}";
$Z=$DATABASE->Query( $QS );
$QS="SELECT * FROM `module_eve` LIMIT 1";
$S=$DATABASE->Query( $QS );
$MODULE_DATA = $S[0];
$TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL );
//$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
$FU = '/video_feed/stream?id='. $Z[0]['aux_parameter'];
$CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
$TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL );
$TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL );
$TPL = str_replace( '%%%SELURL%%%', $FU, $TPL );
$TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL );
$FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
$W = 244;
$H = $W * $FK;
$TPL = str_replace( '%%%WIDTH%%%', $W, $TPL );
$TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL );
$OUT[]= $STA[1+$idx] . $TPL . $END;
} else break;
$idx++;
};
if( $idx < 1 ){
for( ;$idx<1;$idx++ ){
$T = str_replace( '%%ID%%', 2+$idx , $DUMMY['camera'] );
$OUT[]= $STA[1+$idx] . $T . $END;
};
};
} else {
for( ;$idx<1;$idx++ ){
$T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
$OUT[]= $STA[1+$idx] . $T . $END;
};
};
$QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1";
$R = $DATABASE->Query( $QS );
$idx = 0;
if( count( $R ) ){
foreach( $R as $DD ){
if( $idx < 2 ){
$TFN = 'report/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
$TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
$OUT[]= $STA[2+$idx] . $TPL . $END;
} else break;
$idx++;
};
} else {
for( ;$idx<1;$idx++ ){
$OUT[]= $STA[2+$idx] . $DUMMY['sensor'] . $END;
};
};
$OUT[]= $STA[3] . $DUMMY['log'] . $END;
break;
};
case 4:{
//Mekorot
$STA[0]="{ columnWidth: .20, stylse:'padding:10px 0 10px 10px', items:[";

15
lib/controller/settings/node_1.js

@ -23,20 +23,11 @@
//var expH = document.body.clientHeight - p.ownerCt.ownerCt.getHeight();
var W = p.getWidth();
var H = 9*(W/16) - 28;
if( %%%APPTYPE%%% == 2 ){
H = PanelH - p.ownerCt.getHeight() + 64;
if( H > ( W * 0.5625 )+ 32 ){
H = ( W * 0.5625 ) + 32;
};
} else {
H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight();
};
//alert( H );
var H = PanelH - 15;// 9*(W/16) - 28;
//alert( W + ' '+ H );
//var W = 16*(H/9);
//p.ownerCt.setWidth( W );
p.setHeight( H );
p.setHeight( H );
Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setHeight( H - 70 );
Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setWidth( H - 70 );
//alert( W+" "+H );

13
lib/controller/settings/node_2.js

@ -23,18 +23,11 @@
//var expH = document.body.clientHeight - p.ownerCt.ownerCt.getHeight();
var W = p.getWidth();
var H = 9*(W/16) - 28;
if( %%%APPTYPE%%% == 1 || %%%APPTYPE%%% == 4 ){
H = PanelH - p.ownerCt.getHeight() + 64;
if( H > ( W * 0.5625 )+ 32 ){
H = ( W * 0.5625 ) + 32;
};
} else {
H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight();
};
var H = PanelH - 15;// 9*(W/16) - 28;
//alert( W + ' '+ H );
//var W = 16*(H/9);
//p.ownerCt.setWidth( W );
p.setHeight( H );
p.setHeight( H );
Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setHeight( H - 70 );
Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setWidth( H - 70 );
//alert( W+" "+H );

8
lib/javascript/jsapi_dynamic/mojo_dashboard.js

@ -1674,6 +1674,14 @@ function fetchSiteStatus(){
if( log != null ){
if( data.log != undefined ){
if( data.log.length ){
if( log_store_id ) {
if( data.log[0].type >9 && data.log[0].type < 37 ){
playSound( 1 );
} else {
playSound();
};
if( ssIsActive ) ssHideSS();
}
log_store_id = data.log[0].id;
log_array = data.log.concat( log_array );
if( log_array.length > 32 ){

8
lib/javascript/jsapi_dynamic/mojo_global_vars.js

@ -51,7 +51,7 @@ var MAP_SET=<?php
?>;
<?php
if( intval($CUser->Data['ss_timeout']) ){
if( 0 && intval($CUser->Data['ss_timeout']) ){
?>
var ssEnabled = true;
var ssTimer = null;
@ -61,7 +61,11 @@ var ssInterval = null;
<?php
} else {
?>
var ssEnabled = false;
var ssEnabled = true;
var ssTimer = null;
var ssTimeOut = 60000; //1min
var ssIsActive = false;
var ssInterval = null;
<?php
};
?>

22
lib/javascript/jsapi_dynamic/mojo_main.js

@ -1,5 +1,6 @@
//<?php require_once('../../js_asm.php'); ?>
var ssSeconds = 0;
var ssOldSeconds = 0;
function ssShowSS() {
ssStopTimer();
document.removeEventListener( "mousemove", ssResetTimer );
@ -13,6 +14,8 @@ function ssShowSS() {
document.addEventListener( "touchmove", ssHideSS, false );
document.getElementById('ss_bg').className='ss_bg_overlay';
document.getElementById('ss_content').className='ss_overlay';
ssSeconds = 0;
ssOldSeconds = 0;
ssShowTime();
if( ssInterval == null ){
ssInterval = window.setInterval( ssShowTime, 333 );
@ -20,10 +23,23 @@ function ssShowSS() {
ssIsActive = true;
};
function ssShowTime(){
document.getElementById('ss_content').style.fontSize = '240px';
document.getElementById('ss_content').style.fontSize = '240px';
var currentdate = new Date();
if( ssOldSeconds == 0 ){
ssOldSeconds = currentdate.getSeconds();
} else {
if( ssOldSeconds != currentdate.getSeconds() ) {
ssOldSeconds = currentdate.getSeconds();
ssSeconds++;
};
};
if( ssSeconds > 300 ){
document.getElementById('ss_content').style.color = '#606060';
} else {
document.getElementById('ss_content').style.color = '#c0c0c0';
};
var cTime = (( currentdate.getHours()<10 )? '0'+currentdate.getHours(): currentdate.getHours() ) + ":" + (( currentdate.getMinutes()<10 )? '0'+currentdate.getMinutes(): currentdate.getMinutes() ) + ":" + (( currentdate.getSeconds()<10 )? '0'+currentdate.getSeconds(): currentdate.getSeconds() );
document.getElementById('ss_content').innerHTML= cTime;
document.getElementById('ss_content').innerHTML= cTime;
};
function ssResetTimer() {
ssStopTimer();

9
lib/javascript/jsapi_dynamic/mojo_reports.js

@ -1863,6 +1863,15 @@ function hideVideo( a ){
function showVideo( a ){
var tt = Ext.getCmp( 'video-ctl-panel-' + a );
if( tt != undefined ) tt.show();
<?php
// Disable Button in KIOSK mode
if( $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'] ){
?>
tt = Ext.getCmp( 'video-btn-download-' + a );
if( tt != undefined ) tt.hide();
<?php
};
?>
};
function showMp4( a, b ){
var tt = Ext.getCmp( 'video-ctl-panel-' + a );

44
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -922,32 +922,32 @@ function removeModule( ID ){
function disableServOps(){
var tC = Ext.getCmp('servopPanel00');
tC.removeClass('servopInfo_item00');
tC.removeClass('servopInfo_item01');
tC.addClass('servopInfo_item00');
tC.disable();
Ext.getCmp('tbtn_sop00').disable();
tC = Ext.getCmp('servopPanel01');
tC.removeClass('servopInfo_item01');
tC.addClass('servopInfo_item00');
tC.removeClass('servopInfo_item11');
tC.addClass('servopInfo_item10');
tC.disable();
Ext.getCmp('tbtn_sop01').disable();
//tC.doLayout();
tC = Ext.getCmp('servopPanel02');
tC.removeClass('servopInfo_item11');
tC.addClass('servopInfo_item10');
tC.removeClass('servopInfo_item21');
tC.addClass('servopInfo_item20');
tC.disable();
Ext.getCmp('tbtn_sop02').disable();
//tC.doLayout();
tC = Ext.getCmp('servopPanel03');
tC.removeClass('servopInfo_item21');
tC.addClass('servopInfo_item20');
tC.removeClass('servopInfo_item31');
tC.addClass('servopInfo_item30');
tC.disable();
Ext.getCmp('tbtn_sop03').disable();
//tC.doLayout();
tC = Ext.getCmp('servopPanel04');
tC.removeClass('servopInfo_item31');
tC.addClass('servopInfo_item30');
tC.removeClass('servopInfo_item41');
tC.addClass('servopInfo_item40');
tC.disable();
Ext.getCmp('tbtn_sop04').disable();
//tC.doLayout();
@ -964,32 +964,32 @@ function enableServOps(){
tC = Ext.getCmp('servopPanel01');
if( tC != undefined ){
tC.removeClass('servopInfo_item00');
tC.addClass('servopInfo_item01');
tC.removeClass('servopInfo_item10');
tC.addClass('servopInfo_item11');
Ext.getCmp('tbtn_sop01').enable();
tC.enable();
};
//tC.doLayout();
tC = Ext.getCmp('servopPanel02');
if( tC != undefined ){
tC.removeClass('servopInfo_item10');
tC.addClass('servopInfo_item11');
tC.removeClass('servopInfo_item20');
tC.addClass('servopInfo_item21');
tC.enable();
Ext.getCmp('tbtn_sop02').enable();
};
//tC.doLayout();
tC = Ext.getCmp('servopPanel03');
if( tC != undefined ){
tC.removeClass('servopInfo_item20');
tC.addClass('servopInfo_item21');
tC.removeClass('servopInfo_item30');
tC.addClass('servopInfo_item31');
tC.enable();
Ext.getCmp('tbtn_sop03').enable();
};
//tC.doLayout();
tC = Ext.getCmp('servopPanel04');
if( tC != undefined ){
tC.removeClass('servopInfo_item30');
tC.addClass('servopInfo_item31');
tC.removeClass('servopInfo_item40');
tC.addClass('servopInfo_item41');
tC.enable();
Ext.getCmp('tbtn_sop04').enable();
};
@ -1917,7 +1917,7 @@ tPanel.add({
autoScroll: false,
items:[{
xtype: 'panel',
baseCls:'servopInfo_item01',
baseCls:'servopInfo_item00',
id: 'servopPanel00',
items:[{
xtype: 'panel',
@ -1957,7 +1957,7 @@ tPanel.add({
<?php if( $CUser->Data['access'] > 3 ){ ?>
,{
xtype: 'panel',
baseCls:'servopInfo_item00',
baseCls:'servopInfo_item10',
id: 'servopPanel01',
items:[{
xtype: 'panel',
@ -1997,7 +1997,7 @@ tPanel.add({
<?php if( $CUser->Data['access'] > 4 ){ ?>
,{
xtype: 'panel',
baseCls:'servopInfo_item10',
baseCls:'servopInfo_item20',
id: 'servopPanel02',
items:[{
xtype: 'panel',
@ -2036,7 +2036,7 @@ tPanel.add({
<?php if( $CUser->Data['access'] > 5 ){ ?>
,{
xtype: 'panel',
baseCls:'servopInfo_item20',
baseCls:'servopInfo_item30',
id: 'servopPanel03',
items:[{
xtype: 'panel',
@ -2074,7 +2074,7 @@ tPanel.add({
height: 8
},{
xtype: 'panel',
baseCls:'servopInfo_item30',
baseCls:'servopInfo_item40',
id: 'servopPanel04',
items:[{
xtype: 'panel',

378
lib/javascript/jsapi_dynamic/mojo_windows.js

@ -1,188 +1,192 @@
//<?php require_once('../../js_asm.php'); ?>
var mWindowID = <?=(isset($_GET['w']))?intval($_GET['w']):0;?>;
var mAuxWindows = [];
function isMasterWindow(){
var cWindowSessionID = window.localStorage.getItem("cWindowSID");
if( cWindowSessionID == undefined ){
window.localStorage.clear();
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' );
} else {
if( cWindowSessionID != '<?=$Session;?>' ){
window.localStorage.clear();
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' );
} else {
return false;
};
};
return true;
};
function refreshAuxWindows(){
};
function closeAuxWindows(){
};
function isFullScreen() {
return document.fullscreenElement !== null;
}
let previousX = window.screenX;
let previousY = window.screenY;
setInterval(() => {
const currentX = window.screenX;
const currentY = window.screenY;
if (currentX !== previousX || currentY !== previousY) {
// Window has moved
console.log("Window moved!");
console.log("New Position X:", currentX, "Y:", currentY);
previousX = currentX;
previousY = currentY;
}
}, 700); // Check every 700 milliseconds
/*
if (!('getScreenDetails' in window)) {
// Returning a one-element array with the current screen,
// noting that there might be more.
window.getScreenDetails = async () => [window.screen];
// Set to `false`, noting that this might be a lie.
window.screen.isExtended = false;
}
*/
async function getDisplayInfo() {
if (window.screen.isExtended) {
console.log("Multiple displays detected.");
} else {
console.log("Single display detected.");
}
if ('getScreenDetails' in window) {
try {
const screenDetails = await window.getScreenDetails();
screenDetails.screens.forEach((screen, index) => {
console.log(`Display ${index + 1}:`);
console.log(` Width: ${screen.width}`);
console.log(` Height: ${screen.height}`);
console.log(` Left: ${screen.left}`);
console.log(` Top: ${screen.top}`);
});
} catch (error) {
console.error("Error getting screen details:", error);
}
} else {
console.log("window.getScreenDetails() is not supported.");
console.log(`Display 0:`);
console.log(` Width: ${window.screen.width}`);
console.log(` Height: ${window.screen.height}`);
console.log(` Left: ${window.screen.left}`);
console.log(` Top: ${window.screen.top}`);
}
};
function doCheckWindowSize(){
//var zz = window.getScreenDetails();
if ('getScreenDetails' in window) {
screenDetails = window.getScreenDetails();
screenDetails.addEventListener('screenschange', (event) => {
if (screenDetails.screens.length !== currentScreenLength) {
currentScreenLength = screenDetails.screens.length;
//updateScreenInfo();
}
});
try {
permission =
((navigator.permissions.query({ name: 'window-management' })).state === 'granted')
? 'Granted'
: 'No Permission';
} catch (err) {
console.error(err);
}
currentScreenLength = screenDetails.screens.length;
//updateScreenInfo();
} else {
screenDetails = window.screen;
permission = 'Window Management API - NOT SUPPORTED';
currentScreenLength = 1;
//updateScreenInfo();
};
getDisplayInfo();
if( isMasterWindow() ){
//window.open('/?w=1', 'app_second', 'location=0,menubar=0,status=0,titlebar=0,toolbar=0,left=20,top=20,width=' + screen.availWidth + ',height=' + screen.availHeight);
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW2 = window.innerWidth;
winH2 = window.innerHeight;
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW2 = document.body.offsetWidth;
winH2 = document.body.offsetHeight;
if ( winH2<700 ) winH2=700;
};
};
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
};
} else {
//requestBodyFullscreen();
//alert( "AUX Window:"+mWindowID );
};
};
function requestBodyFullscreen() {
const body = document.body;
if (body.requestFullscreen) {
body.requestFullscreen();
} else if (body.mozRequestFullScreen) { /* Firefox */
body.mozRequestFullScreen();
} else if (body.webkitRequestFullscreen) { /* Chrome, Safari, Opera */
body.webkitRequestFullscreen();
} else if (body.msRequestFullscreen) { /* IE/Edge */
body.msRequestFullscreen();
}
};
function exitBodyFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) { /* Firefox */
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) { /* Chrome, Safari, Opera */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) { /* IE/Edge */
document.msExitFullscreen();
}
};
function initMultiWindows(){
return;
document.addEventListener('fullscreenchange', function() {
if (isFullScreen()) {
console.log("Fullscreen mode activated.");
} else {
console.log("Fullscreen mode deactivated.");
}
});
document.addEventListener("fullscreenerror", (event) => {
console.log("Fullscreen Error.");
});
if( mWindowID == 0 ){
} else {
//Unreg Windows
mAuxWindows = undefined;
window.addEventListener('beforeunload', function(event) {
console.log("BeforeUnload Woerks!");
//event.preventDefault();
//event.returnValue = null;
});
};
doCheckWindowSize();
//<?php require_once('../../js_asm.php'); ?>
var mWindowID = <?=(isset($_GET['w']))?intval($_GET['w']):0;?>;
var mAuxWindows = [];
function isMasterWindow(){
var cWindowSessionID = window.localStorage.getItem("cWindowSID");
if( cWindowSessionID == undefined ){
window.localStorage.clear();
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' );
} else {
if( cWindowSessionID != '<?=$Session;?>' ){
window.localStorage.clear();
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' );
} else {
return false;
};
};
return true;
};
function refreshAuxWindows(){
};
function closeAuxWindows(){
};
function isFullScreen() {
return document.fullscreenElement !== null;
}
let previousX = window.screenX;
let previousY = window.screenY;
setInterval(() => {
const currentX = window.screenX;
const currentY = window.screenY;
if (currentX !== previousX || currentY !== previousY) {
// Window has moved
console.log("Window moved!");
console.log("New Position X:", currentX, "Y:", currentY);
previousX = currentX;
previousY = currentY;
}
}, 700); // Check every 700 milliseconds
/*
if (!('getScreenDetails' in window)) {
// Returning a one-element array with the current screen,
// noting that there might be more.
window.getScreenDetails = async () => [window.screen];
// Set to `false`, noting that this might be a lie.
window.screen.isExtended = false;
}
*/
async function getDisplayInfo() {
if (window.screen.isExtended) {
console.log("Multiple displays detected.");
} else {
console.log("Single display detected.");
}
if ('getScreenDetails' in window) {
try {
const screenDetails = await window.getScreenDetails();
screenDetails.screens.forEach((screen, index) => {
console.log(`Display ${index + 1}:`);
console.log(` Width: ${screen.width}`);
console.log(` Height: ${screen.height}`);
console.log(` Left: ${screen.left}`);
console.log(` Top: ${screen.top}`);
});
} catch (error) {
console.error("Error getting screen details:", error);
}
} else {
console.log("window.getScreenDetails() is not supported.");
console.log(`Display 0:`);
console.log(` Width: ${window.screen.width}`);
console.log(` Height: ${window.screen.height}`);
console.log(` Left: ${window.screen.left}`);
console.log(` Top: ${window.screen.top}`);
}
};
async function doCheckWindowSize(){
//var zz = window.getScreenDetails();
if ('getScreenDetails' in window) {
try{
const screenDetails = await window.getScreenDetails();
screenDetails.addEventListener('screenschange', (event) => {
if (screenDetails.screens.length !== currentScreenLength) {
currentScreenLength = screenDetails.screens.length;
//updateScreenInfo();
}
});
} catch( err ){
console.log( 'Permission denied or API not supported:', err );
};
try {
permission =
((navigator.permissions.query({ name: 'window-management' })).state === 'granted')
? 'Granted'
: 'No Permission';
} catch (err) {
console.error(err);
}
currentScreenLength = screenDetails.screens.length;
//updateScreenInfo();
} else {
screenDetails = window.screen;
permission = 'Window Management API - NOT SUPPORTED';
currentScreenLength = 1;
//updateScreenInfo();
};
getDisplayInfo();
if( isMasterWindow() ){
//window.open('/?w=1', 'app_second', 'location=0,menubar=0,status=0,titlebar=0,toolbar=0,left=20,top=20,width=' + screen.availWidth + ',height=' + screen.availHeight);
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW2 = window.innerWidth;
winH2 = window.innerHeight;
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW2 = document.body.offsetWidth;
winH2 = document.body.offsetHeight;
if ( winH2<700 ) winH2=700;
};
};
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
};
} else {
//requestBodyFullscreen();
//alert( "AUX Window:"+mWindowID );
};
};
function requestBodyFullscreen() {
const body = document.body;
if (body.requestFullscreen) {
body.requestFullscreen();
} else if (body.mozRequestFullScreen) { /* Firefox */
body.mozRequestFullScreen();
} else if (body.webkitRequestFullscreen) { /* Chrome, Safari, Opera */
body.webkitRequestFullscreen();
} else if (body.msRequestFullscreen) { /* IE/Edge */
body.msRequestFullscreen();
}
};
function exitBodyFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) { /* Firefox */
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) { /* Chrome, Safari, Opera */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) { /* IE/Edge */
document.msExitFullscreen();
}
};
function initMultiWindows(){
return;
document.addEventListener('fullscreenchange', function() {
if (isFullScreen()) {
console.log("Fullscreen mode activated.");
} else {
console.log("Fullscreen mode deactivated.");
}
});
document.addEventListener("fullscreenerror", (event) => {
console.log("Fullscreen Error.");
});
if( mWindowID == 0 ){
} else {
//Unreg Windows
mAuxWindows = undefined;
window.addEventListener('beforeunload', function(event) {
console.log("BeforeUnload Woerks!");
//event.preventDefault();
//event.returnValue = null;
});
};
doCheckWindowSize();
};

12
lib/php/onvif/toto.php

@ -686,6 +686,9 @@ class Ponvif {
}
protected function _xml2array($response) {
//$FD = fopen( "TEST.xml", "a+" );
//fprintf( $FD, $response );
//fclose( $FD );
$sxe = new SimpleXMLElement($response);
$dom_sxe = dom_import_simplexml($sxe);
$dom = new DOMDocument('1.0');
@ -740,6 +743,15 @@ class Ponvif {
switch( $this->AuthMethod ){
case 0: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ); break;
case 1: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST ); break;
case 2: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST_IE ); break;
case 3: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_BEARER ); break;
case 4: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_NEGOTIATE ); break;
case 5: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_NTLM ); break;
case 6: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_NTLM_WB ); break;
case 7: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_ANY ); break;
case 8: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE ); break;
case 9: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_ONLY ); break;
case 10: curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_AWS_SIGV4 ); break;
};
curl_setopt($soap_do, CURLOPT_USERPWD, $this->username . ":" . $this->password); // HTTP authentication
if ( ($result = curl_exec($soap_do)) === false) {

BIN
style/assets/3b4ad2078aa0b06e78fa417e2e47bf05.png

Binary file not shown.

Before

Width: 681  |  Height: 107  |  Size: 13 KiB

After

Width: 681  |  Height: 107  |  Size: 41 KiB

BIN
style/assets/987698d-1.png

Binary file not shown.

Before

Width: 488  |  Height: 210  |  Size: 48 KiB

BIN
style/assets/blue-staks-sucksd.png

Binary file not shown.

Before

Width: 660  |  Height: 440  |  Size: 431 KiB

43
style/style.css

@ -1176,7 +1176,6 @@ A.CalendarDS:hover {
width: 100% !important;
/*text-align: left !important;*/
}
.servopInfo_item00{
color: #fcfcfc !important;
background-color: #606e89 !important;
@ -1195,7 +1194,7 @@ A.CalendarDS:hover {
}
.servopInfo_item01{
color: #fcfcfc !important;
background-color: green !important;
background-color: brown !important;
text-align: left;
background-image: url(wicons/006.png);
@ -1227,7 +1226,7 @@ A.CalendarDS:hover {
}
.servopInfo_item11{
color: #fcfcfc !important;
background-color: #4169e1 !important;
background-color: green !important;
text-align: left;
background-image: url(wicons/006.png);
@ -1245,7 +1244,7 @@ A.CalendarDS:hover {
color: #fcfcfc !important;
background-color: #606e89 !important;
text-align: left;
background-image: url(wicons/005.png);
background-image: url(wicons/006.png);
display: block;
border-radius: 4px;
@ -1259,9 +1258,9 @@ A.CalendarDS:hover {
}
.servopInfo_item21{
color: #fcfcfc !important;
background-color: darkviolet !important;
background-color: #4169e1 !important;
text-align: left;
background-image: url(wicons/005.png);
background-image: url(wicons/006.png);
display: block;
border-radius: 4px;
@ -1290,6 +1289,38 @@ A.CalendarDS:hover {
background-size: 32px 32px;
}
.servopInfo_item31{
color: #fcfcfc !important;
background-color: darkviolet !important;
text-align: left;
background-image: url(wicons/005.png);
display: block;
border-radius: 4px;
padding: 5px;
margin-top: 1px;
margin-bottom: 1px;
background-repeat: no-repeat;
background-position: 5px 5px;
padding-left: 42px !important;
background-size: 32px 32px;
}
.servopInfo_item40{
color: #fcfcfc !important;
background-color: #606e89 !important;
text-align: left;
background-image: url(wicons/005.png);
display: block;
border-radius: 4px;
padding: 5px;
margin-top: 1px;
margin-bottom: 1px;
background-repeat: no-repeat;
background-position: 5px 5px;
padding-left: 42px !important;
background-size: 32px 32px;
}
.servopInfo_item41{
color: yellow !important;
background-color: red !important;
text-align: left;

Loading…
Cancel
Save