Browse Source

Direct RTSP Stream from Camera enabled WebUI of Module

master
Evgeny Gagua 4 months ago
parent
commit
03e2304428
  1. 2
      lib/1.json
  2. 5
      lib/controller/dash/node_12.js
  3. 3
      lib/controller/dash/node_13.js
  4. 3
      lib/controller/dash/node_14.js
  5. 3
      lib/controller/dash/node_15.js
  6. 20
      lib/controller/doModuleOperation.php
  7. 2
      lib/controller/doSensorOperation.php
  8. 4
      lib/controller/getApplicationSettings.php
  9. 16
      lib/controller/getDashBoardItems.php
  10. 6
      lib/controller/getGeoZones.php
  11. 118
      lib/controller/getModuleSettings.php
  12. 7
      lib/controller/getReportLayout.php
  13. 2
      lib/controller/getVideoInfo.php
  14. 9
      lib/controller/report/node_10.js
  15. 78
      lib/controller/report/node_11.js
  16. 9
      lib/controller/report/node_12.js
  17. 72
      lib/controller/report/node_13 - Copy.js
  18. 7
      lib/controller/report/node_13.js
  19. 19
      lib/controller/report/node_13.js.bk2
  20. 7
      lib/controller/report/node_14.js
  21. 7
      lib/controller/report/node_15.js
  22. 95
      lib/controller/report/node_3 - Copy.js
  23. 466
      lib/javascript/jsapi_dynamic/mojo_dashboard.js
  24. 7
      lib/javascript/jsapi_dynamic/mojo_main.js
  25. 139
      lib/javascript/jsapi_dynamic/mojo_reports.js
  26. 60
      lib/javascript/jsapi_dynamic/mojo_settings.js
  27. 1
      lib/javascript/leaflet/leaflet.css
  28. 1
      lib/javascript/opencv/26135642c47363fed2a2e12ec518cfc1837de5e92ffb6e767f074cb9a3e3865a.map
  29. 8
      lib/javascript/opencv/opencv.min.js
  30. 13
      lib/upgrade_database.php
  31. 1
      style/leaflet.css

2
lib/1.json
File diff suppressed because it is too large
View File

5
lib/controller/dash/node_12.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><img id="img-img-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" src="%%%SELURL%%%" width="100%" /></div>'
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><video id="img-vid-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" autoplay playsinline muted width="100%" ></video></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -35,6 +35,9 @@
p.setHeight( xx + 32 );
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.setHeight( xx );
var tt = document.getElementById( 'img-vid-%%%NODEID%%%' );
tt.poster = "/style/assets/no-signal.png";
startWhepClient( 'img-vid-%%%NODEID%%%', 'stream_%%%NODEID%%%' );
}
}
}

3
lib/controller/dash/node_13.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><img id="img-img-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" src="%%%SELURL%%%" width="100%" /><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>%%%HBTN%%%</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><video id="img-vid-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" autoplay playsinline muted width="100%" ></video><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>%%%HBTN%%%</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -57,6 +57,7 @@
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop );
%%%CAM_CTRL_HOME_BTN_BIND%%%
startWhepClient( 'img-vid-%%%NODEID%%%', 'stream_%%%NODEID%%%' );
}
}
}

3
lib/controller/dash/node_14.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><img id="img-img-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" src="%%%SELURL%%%" width="100%" /><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>%%%HBTN%%%</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><video id="img-vid-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" autoplay playsinline muted width="100%" ></video><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>%%%HBTN%%%</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -57,6 +57,7 @@
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop );
%%%CAM_CTRL_HOME_BTN_BIND%%%
startWhepClient( 'img-vid-%%%NODEID%%%', 'stream_%%%NODEID%%%' );
}
}
}

3
lib/controller/dash/node_15.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><img id="img-img-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" src="%%%SELURL%%%" width="100%" /><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>%%%HBTN%%%</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><video id="img-vid-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" autoplay playsinline muted width="100%" ></video><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>%%%HBTN%%%</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -57,6 +57,7 @@
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop );
%%%CAM_CTRL_HOME_BTN_BIND%%%
startWhepClient( 'img-vid-%%%NODEID%%%', 'stream_%%%NODEID%%%' );
}
}
}

20
lib/controller/doModuleOperation.php

@ -123,6 +123,26 @@
$QS = "UPDATE `module_attention` SET `range`={$OPCODE} WHERE `id`={$JJ['aux_id']}";
break;
};
case 15:{
$QS = "UPDATE `module_bvms` SET `auth_mode`={$OPCODE} WHERE `id`={$JJ['aux_id']}";
break;
};
case 16:{
$QS = "UPDATE `module_bvms` SET `detection_evt_ena`={$OPCODE} WHERE `id`={$JJ['aux_id']}";
break;
};
case 17:{
$QS = "UPDATE `module_bvms` SET `detection_evt_id`={$OPCODE} WHERE `id`={$JJ['aux_id']}";
break;
};
case 18:{
$QS = "UPDATE `module_bvms` SET `camera_evt_ena`={$OPCODE} WHERE `id`={$JJ['aux_id']}";
break;
};
case 19:{
$QS = "UPDATE `module_bvms` SET `camera_evt_id`={$OPCODE} WHERE `id`={$JJ['aux_id']}";
break;
};
};
};
if( $QS != '' ) $DATABASE->Query( $QS );

2
lib/controller/doSensorOperation.php

@ -85,7 +85,7 @@
};
case 9:{
$OPCODE = intval( $_POST['OPCODE'] );
if( $OPCODE < 65535 ){
if( $OPCODE < 600000 ){
$QS = "UPDATE `lrf_ini_settings` SET `AUTORESET_TIMEOUT`={$OPCODE} WHERE `sensor_id`={$SNID}";
$Data['success'] = true;
};

4
lib/controller/getApplicationSettings.php

@ -207,8 +207,12 @@ DATA_BOUNDARY;
columnWidth: 0.83,
frame: false,
border: false,
title: false,
items: [{
xtype: 'panel',
border: false,
title: false,
frame: false,
id: 'sys_location_map',
height: PanelH-170,
html: '&nbsp;',

16
lib/controller/getDashBoardItems.php

@ -689,12 +689,16 @@ _DATA_BOUNDARY;
//$STA[2]="{ columnWidth: .75, stylse:'padding:10px 0 10px 10px', items:[";
$STA[1]="{ columnWidth: 1.0, stylse:'padding:10px 0 10px 10px', items:[";
$MH = 4;
$DUMMY['map']="{xtype:'panel', title: '{$Labels->GetLabel('_MAP_')}', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*{$MH}); initMapMonitoring();}} }";
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
$OUT[]= $STA[0] . $DUMMY['map'] . $END;
//$OUT[]= $STA[1] . $DUMMY['sensor'] . $END;
$OUT[]= $STA[1] . $DUMMY['log'] . $END;
if( $CUser->Data['access'] > 2 ){
$DUMMY['map']="{xtype:'panel', title: '{$Labels->GetLabel('_MAP_')}', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*{$MH}); initMapMonitoring();}} }";
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
$OUT[]= $STA[0] . $DUMMY['map'] . $END;
//$OUT[]= $STA[1] . $DUMMY['sensor'] . $END;
$OUT[]= $STA[1] . $DUMMY['log'] . $END;
} else {
$DUMMY['map']="{xtype:'panel', title: '{$Labels->GetLabel('_MAP_')}', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9); initMapMonitoring();}} }";
$OUT[]= $STA[0] . $DUMMY['map'] . $END;
};
break;
};
default:

6
lib/controller/getGeoZones.php

@ -408,11 +408,11 @@ function ToLL($north, $east, $utmZone){
};
$RAN = floatval( $CC['max_range'] );
if(1){
$K = pi()/ 36; // 10 deg//
$K = pi()/ 18.0; // 10 deg//
$Points = array();
$Points[] = array( 'lat'=>$LAT, 'lon'=>$LON );
$SANG = ( pi() / 180 ) * floatval( $CC['z_rot'] ) + ( pi()/3000.0 * floatval( $CC['base_shift'] ) );
for( $i = 0; $i < 40; $i++ ){
$SANG = ( pi() / 180.0 ) * floatval( $CC['z_rot'] ) + ( pi()/3000.0 * floatval( $CC['base_shift'] ) );
for( $i = 0; $i < 21; $i++ ){
$CA = $i * $K;
if( $GPS ){
$B = new gPoint();

118
lib/controller/getModuleSettings.php

@ -1044,7 +1044,7 @@ $TPL =<<<EFUFU
xtype: 'form',
labelAlign: 'right',
autoScroll: 'auto',
labelWidth: 250,
labelWidth: 350,
items:[{
border: false,
frame: false,
@ -1095,6 +1095,44 @@ $TPL =<<<EFUFU
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
id: 'am_auth_mode',
fieldLabel: '{$Labels->GetLabel('_AUTH_MODE_0_')}',
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'BASIC'],
[1,'DIGEST'],
[2,'DIGEST_IE'],
[3,'BEARER'],
[4,'NEGOTIATE'],
[5,'NTLM'],
[6,'NTLM_WB'],
[7,'ANY'],
[8,'ANYSAFE'],
[9,'ONLY'],
[10,'AWS_SIGV4']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$CI['auth_mode']}',
width: 220,
listeners:{
select: function( t, r, i ){
doModuleOperation( {$EID}, 15, r.data.wm_id, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'textfield',
fieldLabel: '{$Labels->GetLabel('_API_USER_')}',
@ -1123,6 +1161,84 @@ $TPL =<<<EFUFU
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_DET_EVT_ENA_')}',
id: 'det_evt_ena',
lazyRender:true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['status_val','status_txt'],
data: [[0,'Disabled'],[1,'Enabled']]
}),
value: '{$CI['detection_evt_ena']}',
valueField: 'status_val',
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) doModuleOperation( {$EID}, 16, 1, false ); else doModuleOperation( {$EID}, 16, 0, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'numberfield',
fieldLabel: '{$Labels->GetLabel('_DETECTION_ID_')}',
id: 'det_evt_id',
width: 220,
value: '{$CI['detection_evt_id']}',
listeners:{
change: function( t, n, o ){
doModuleOperation( {$EID}, 17, n, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_CAM_EVT_ENA_')}',
id: 'cam_evt_ena',
lazyRender:true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['status_val','status_txt'],
data: [[0,'Disabled'],[1,'Enabled']]
}),
value: '{$CI['camera_evt_ena']}',
valueField: 'status_val',
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) doModuleOperation( {$EID}, 18, 1, false ); else doModuleOperation( {$EID}, 18, 0, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'numberfield',
fieldLabel: '{$Labels->GetLabel('_CAM_EVT_ID_')}',
id: 'cam_evt_id',
width: 220,
value: '{$CI['camera_evt_id']}',
listeners:{
change: function( t, n, o ){
doModuleOperation( {$EID}, 19, n, false );
}
}
},{
xtype: 'spacer',
height: 5
}]
}
EFUFU;

7
lib/controller/getReportLayout.php

@ -112,8 +112,11 @@ $MAPIO=<<<_DATA_BOUNDARY
{
id: 'report_map',
height: 200,
title: 'Map',
frame: true,
//title: 'Map',
title: false,
/* frame: true,*/
frame: false,
border: false,
draggable: false,
collapsible: false,
html: '&nbsp;',

2
lib/controller/getVideoInfo.php

@ -6,7 +6,7 @@
if( $EID ){
$DS = date("Y/m/d", $DTS );
//$QS = "SELECT * FROM `videos` WHERE `id` = {$VID}";
$QS = "SELECT `videos`.`id`, `videos`.`fps`,`videos`.`uts` as `ts`, `videos`.`md5`, `videos`.`media_stream_id`, `events_2_videos`.`frame` FROM `events_2_videos` LEFT JOIN `videos` ON( `videos`.`id` = `events_2_videos`.`video_id` ) WHERE `events_2_videos`.`evt_id`={$EID}";
$QS = "SELECT `videos`.`id`, `videos`.`fps`,`videos`.`uts` as `ts`, `videos`.`md5`, `videos`.`ext`, `videos`.`media_stream_id`, `events_2_videos`.`frame` FROM `events_2_videos` LEFT JOIN `videos` ON( `videos`.`id` = `events_2_videos`.`video_id` ) WHERE `events_2_videos`.`evt_id`={$EID}";
$ZIZI = new SQLite_DB( '/srv/www/web/lib/controller/data/reports/'.$DS.'/report.db');
$LREC = $ZIZI->Query( $QS );
if( count( $LREC ) ){

9
lib/controller/report/node_10.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><!--img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /--><video id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" width="100%" src="/style/assets/nosignal.mp4"></video><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -64,11 +64,16 @@
maxValue: 100,
listeners:{
change: function( t, b, o ){
setVideoSource( %%%STREAMID%%%, b );
setVideoMp4Source( %%%STREAMID%%%, b );
}
}
}]
});
var tt = document.getElementById( 'video-img-' + %%%STREAMID%%% );
tt.addEventListener('timeupdate', () => {
console.log('Progress updated:', tt.currentTime);
});
tt.poster = "/style/assets/no-signal.png";
},
beforedestroy: function(){
var oldPlayer = document.getElementById( 'video-%%%STREAMID%%%' );

78
lib/controller/report/node_11.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="img-%%%NODEID%%%" style="display: flex;align-items: center;" ><img id="img-img-%%%NODEID%%%" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" src="%%%SELURL%%%" width="100%" /><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table></div></div>'
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><!--img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /--><video id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" width="100%" src="/style/assets/nosignal.mp4"></video><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -25,37 +25,61 @@
p.sukaMineWidth = adjWidth;
var XX = p.sukaMineWidth * %%%HEIGHT%%% / %%%WIDTH%%%;
p.setHeight( XX + 32 );
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.setHeight( XX );
var z = document.getElementById( 'video-%%%STREAMID%%%' );
z.height = XX;
};
};
},
afterrender: function( p ){
var xx = p.getWidth() * %%%HEIGHT%%% / %%%WIDTH%%%;
var xx = p.getWidth() * ( %%%HEIGHT%%% / %%%WIDTH%%% );
p.setHeight( xx + 32 );
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.setHeight( xx );
document.getElementById('img_btn_010_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_010_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_011_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_011_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_027_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_027_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_028_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_028_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_029_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_029_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_030_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_030_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_031_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_031_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_032_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_032_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_033_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_033_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop );
videoElements[videoElements.length] = %%%STREAMID%%%;
var xx = new Ext.Panel({
id: 'video-ctl-panel-%%%STREAMID%%%',
renderTo: 'video-ctl-%%%STREAMID%%%',
border: false,
hidden: true,
frame: false,
width: 400,
height: 42,
layout: 'hbox',
items:[{
xtype: 'button',
width: 32,
iconCls: 'download',
scale: 'medium',
id: 'video-btn-download-%%%STREAMID%%%',
handler: function(){
downloadCurrentVideo( %%%STREAMID%%% );
}
},{
xtype: 'spacer',
width: 20
},{
xtype: 'slider',
width: 250,
id: 'video-slider-%%%STREAMID%%%',
value: 0,
minValue: 0,
maxValue: 100,
listeners:{
change: function( t, b, o ){
setVideoMp4Source( %%%STREAMID%%%, b );
}
}
}]
});
var tt = document.getElementById( 'video-img-' + %%%STREAMID%%% );
tt.addEventListener('timeupdate', () => {
console.log('Progress updated:', tt.currentTime);
});
tt.poster = "/style/assets/no-signal.png";
},
beforedestroy: function(){
var oldPlayer = document.getElementById( 'video-%%%STREAMID%%%' );
/*
videojs( oldPlayer ).dispose();
*/
}
}
}

9
lib/controller/report/node_12.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><!--img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /--><video id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" width="100%" src="/style/assets/nosignal.mp4"></video><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -64,11 +64,16 @@
maxValue: 100,
listeners:{
change: function( t, b, o ){
setVideoSource( %%%STREAMID%%%, b );
setVideoMp4Source( %%%STREAMID%%%, b );
}
}
}]
});
var tt = document.getElementById( 'video-img-' + %%%STREAMID%%% );
tt.addEventListener('timeupdate', () => {
console.log('Progress updated:', tt.currentTime);
});
tt.poster = "/style/assets/no-signal.png";
},
beforedestroy: function(){
var oldPlayer = document.getElementById( 'video-%%%STREAMID%%%' );

72
lib/controller/report/node_13 - Copy.js

@ -1,72 +0,0 @@
{
id: 'db_node_%%%NODEID%%%',
layout:'vbox',
tools: [{
id:'gear',
handler: function(){
}
}],
frame: true,
bodyStyle: 'padding: 0px;',
plr: null,
title: '%%%NODENAME%%%',
sukaMineWidth: -1,
items:[{
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: ''
},{
xtype: 'spacer',
height: 3
},{
html: '<table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table>',
height: 90
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
if( rawWidth!= undefined ){
if( p.sukaMineWidth != adjWidth ){
p.sukaMineWidth = adjWidth;
var XX = p.sukaMineWidth * %%%HEIGHT%%% / %%%WIDTH%%%;
p.setHeight( XX + 120 );
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.setHeight( XX );
};
};
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.update('<img onmouseover="ptzCtrl(\'img-%%%NODEID%%%\');" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" id="img-%%%NODEID%%%" src="%%%SELURL%%%" width="100%" />');
},
afterrender: function( p ){
var xx = p.getWidth() * %%%HEIGHT%%% / %%%WIDTH%%%;
p.setHeight( xx + 120 );
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.setHeight( xx );
document.getElementById('img_btn_010_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_010_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_011_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_011_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_027_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_027_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_028_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_028_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_029_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_029_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_030_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_030_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_031_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_031_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_032_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_032_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_033_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_033_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop );
},
destroy: function( t ){
if( t.plr != null ) t.plr.dispose();
t.plr = null;
}
}
}

7
lib/controller/report/node_13.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><!--img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /--><video id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" width="100%" src="/style/assets/nosignal.mp4"></video><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -69,6 +69,11 @@
}
}]
});
var tt = document.getElementById( 'video-img-' + %%%STREAMID%%% );
tt.addEventListener('timeupdate', () => {
console.log('Progress updated:', tt.currentTime);
});
tt.poster = "/style/assets/no-signal.png";
},
beforedestroy: function(){
var oldPlayer = document.getElementById( 'video-%%%STREAMID%%%' );

19
lib/controller/report/node_13.js.bk2

@ -1,19 +0,0 @@
{
id: 'db_node_%%%NODEID%%%',
xtype: 'panel',
width: 400,
height: 400,
frame: true,
title: 'Camera %%%NODEID%%%',
items:[{
html: '<video id="hls-example" class="video-js vjs-default-skin" width="400" height="300"><source type="application/x-mpegURL" src="http://192.168.0.116:8081/d7d823703f68ba05c04efdb7474c2de5/7/hls.m3u8"></video>',
}],
listeners:{
afterrender: function(){
var player = videojs('hls-example',{
autoplay: 'muted'
});
return true;
},
}
}

7
lib/controller/report/node_14.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><!--img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /--><video id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" width="100%" src="/style/assets/nosignal.mp4"></video><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -69,6 +69,11 @@
}
}]
});
var tt = document.getElementById( 'video-img-' + %%%STREAMID%%% );
tt.addEventListener('timeupdate', () => {
console.log('Progress updated:', tt.currentTime);
});
tt.poster = "/style/assets/no-signal.png";
},
beforedestroy: function(){
var oldPlayer = document.getElementById( 'video-%%%STREAMID%%%' );

7
lib/controller/report/node_15.js

@ -16,7 +16,7 @@
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
html: '<div id="video-%%%STREAMID%%%" style="display: flex;align-items: center;" ><!--img id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" src="/style/assets/no-signal.png" width="100%" /--><video id="video-img-%%%STREAMID%%%" ondblclick="fullScreen(\'video-%%%STREAMID%%%\');" style="cursor: zoom-in" width="100%" src="/style/assets/nosignal.mp4"></video><div id="video-ctl-%%%STREAMID%%%" style="float: left; position: absolute; left: 30px; bottom: 30px; z-index: 1000;"></div></div>'
}],
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
@ -69,6 +69,11 @@
}
}]
});
var tt = document.getElementById( 'video-img-' + %%%STREAMID%%% );
tt.addEventListener('timeupdate', () => {
console.log('Progress updated:', tt.currentTime);
});
tt.poster = "/style/assets/no-signal.png";
},
beforedestroy: function(){
var oldPlayer = document.getElementById( 'video-%%%STREAMID%%%' );

95
lib/controller/report/node_3 - Copy.js

@ -1,95 +0,0 @@
{
id: 'db_node_%%%NODEID%%%',
width: 258,
height: 320,
title: '%%%NODENAME%%%',
tools: [{
id:'gear',
handler: function(){
//Ext.Msg.alert('Message', 'The Settings tool was clicked.');
showSensorToolBox( %%%NODEID%%% );
}
}],
listeners:{
afterrender: function(){
cleanup2DDraw( %%%NODEID%%% );
drawZoomLevels[%%%NODEID%%%]=100;
}
},
items:[{
html: '<center><img id="draw_img_%%%NODEID%%%" src="/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100" style="cursor: crosshair;"><canvas id="targ_canvas_%%%NODEID%%%" style="display: none; cursor: crosshair;" onclick="DrawClicker( %%%NODEID%%%, event );" width="200" height="210"></canvas></center>',
height: '260px'
},{
id: 'status_%%%NODEID%%%',
border: true,
frame: true,
height: 36,
html: ''
}],
bbar:[{
xtype: 'button',
text: '12.5%',
enableToggle: true,
id: 'zoom_bt12_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=12;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '25%',
enableToggle: true,
id: 'zoom_bt25_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=25;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '50%',
enableToggle: true,
id: 'zoom_bt50_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=50;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '100%',
pressed: true,
enableToggle: true,
id: 'zoom_bt100_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=100;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
}]
}

466
lib/javascript/jsapi_dynamic/mojo_dashboard.js

@ -26,7 +26,6 @@ var log_store = new Ext.data.JsonStore({
{name: 'ts', type: 'int'},
{name: 'ms', type: 'string'},
{name: 'type', type: 'int'},
{name: 'bid', type: 'int'},
{name: 'range', type: 'string'},
{name: 'az', type: 'string'},
{name: 'el', type: 'string'},
@ -65,7 +64,7 @@ function log_et_Renderer( value, meta, record ){
case 42: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_TD_');?>"; break;
case 43: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_TUPD_');?>"; break;
case 44: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPA_');?>"; break;
case 79: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPN_');?>"; break;
case 45: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPN_');?>"; break;
case 46: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_RD_');?>"; break;
case 47: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_DD_');?>"; break;
case 48: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPD_');?>"; break;
@ -87,18 +86,12 @@ function log_et_Renderer( value, meta, record ){
case 74: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_OM_UP_');?>"; break;
case 75: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_OM_TG_');?>"; break;
case 76: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_OM_EXPIRED_');?>"; break;
case 77: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_TD_EXPIRED_');?>"; break;
case 78: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_SUSP_EXPIRED_');?>"; break;
case 86: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_BUBBLE_CREATED_');?>"; break;
case 87: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_BUBBLE_POPPED_');?>"; break;
case 93: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_BUBBLE_BLOCK_T_');?>"; break;
case 94: ov = "<?=$Labels->GetLabel('_EVT_MSG_TF_BUBBLE_BLOCK_P_');?>"; break;
default: ov = "<?=$Labels->GetLabel('_EVENT_');?> ["+value+"]";
};
return '<div class="log_line_' + kaka + '">'+ov+'</div>';
};
function no_target_filter( value, meta, record ){
if( record.data.type >9 && record.data.type < 52 || record.data.type == 86 || record.data.type == 87 || record.data.type == 93 || record.data.type == 94 ) return value;
if( record.data.type >9 && record.data.type < 37 ) return value;
return '';
};
var log_ColModel_ops = {
@ -106,7 +99,6 @@ var log_ColModel_ops = {
{header: "<?=$Labels->GetLabel('_TIME_');?>", width: 180, fixed: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'dts' },
{header: "<?=$Labels->GetLabel('_SOURCE_');?>", width: 100, renderer: log_sn_Renderer, align: 'left', css: 'vertical-align: middle;', dataIndex: 'node_name' },
{header: "<?=$Labels->GetLabel('_TYPE_');?>", width: 180, renderer: log_et_Renderer, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'type' },
{header: "<?=$Labels->GetLabel('_BUBBLE_ID_');?>", width: 100, dataIndex: 'bid', renderer: no_target_filter },
{header: "<?=$Labels->GetLabel('_RANGE_');?>", width: 100, dataIndex: 'range', renderer: no_target_filter },
{header: "<?=$Labels->GetLabel('_AZIMUTH_');?>", width: 100, dataIndex: 'az', renderer: no_target_filter },
{header: "<?=$Labels->GetLabel('_ELEVATION_');?>", width: 100, dataIndex: 'el', renderer: no_target_filter },
@ -194,117 +186,120 @@ var selectROI_mode = 0;
function select2DROI( id, event ){
var x = event.offsetX-100;
var y = event.offsetY-100;
var csvg = document.getElementById( 'draw_svg_' + id );
if( csvg!= undefined ){
var roi = csvg.getElementById( "roi" );
if( roi != null ) csvg.removeChild( roi );
var x = ( 287.0 / csvg.clientWidth ) * event.offsetX;
var y = ( 287.0 / csvg.clientHeight ) * event.offsetY;
var dx= x - ( 287.0 / 2 );
var dy= y - ( 287.0 / 2 );
var hr = Math.sqrt( dx*dx + dy*dy ) * 2;
if( hr > ( 284.0 ) ) hr = 284.0 ;
var zat = -1.0 * Math.atan2( dy, dx );
if( zat < 0.0 ) zat += Math.PI * 2.0;
var lts = -1;
var r = -1;
if( targets_lts_2d[ id ] != undefined ) lts = targets_lts_2d[ id ];
switch( drawZoomLevels[ id ] ){
case 100:{
r = Math.round( hr * ( 2048.0 / 284.0 ) );
if( r > 2048 ) r = 2048;
break;
};
case 50:{
r = Math.round( hr * ( 1024.0 / 284.0 ) );
if( r > 1024 ) r = 1024;
break;
};
case 25:{
r = Math.round( hr * ( 512.0 / 284.0 ) );
if( r > 512 ) r = 512;
break;
};
case 12:{
r = Math.round( hr * ( 256.0 / 284.0 ) );
if( r > 256 ) r = 256;
break;
if( selectROI_mode == 0 ){
var csvg = document.getElementById( 'draw_svg_' + id );
if( csvg!= undefined ){
var roi = csvg.getElementById( "roi" );
if( roi != null ) csvg.removeChild( roi );
var x = ( 287.0 / csvg.clientWidth ) * event.offsetX;
var y = ( 287.0 / csvg.clientHeight ) * event.offsetY;
var dx= x - ( 287.0 / 2 );
var dy= y - ( 287.0 / 2 );
var hr = Math.sqrt( dx*dx + dy*dy ) * 2;
if( hr > ( 284.0 ) ) hr = 284.0 ;
var zat = -1.0 * Math.atan2( dy, dx );
if( zat < 0.0 ) zat += Math.PI * 2.0;
var lts = -1;
var r = -1;
if( targets_lts_2d[ id ] != undefined ) lts = targets_lts_2d[ id ];
switch( drawZoomLevels[ id ] ){
case 100:{
r = Math.round( hr * ( 2048.0 / 284.0 ) );
if( r > 2048 ) r = 2048;
break;
};
case 50:{
r = Math.round( hr * ( 1024.0 / 284.0 ) );
if( r > 1024 ) r = 1024;
break;
};
case 25:{
r = Math.round( hr * ( 512.0 / 284.0 ) );
if( r > 512 ) r = 512;
break;
};
case 12:{
r = Math.round( hr * ( 256.0 / 284.0 ) );
if( r > 256 ) r = 256;
break;
};
};
default:{
r = -1;
break;
roi_2d[id]={ range: r, az: zat, ts: lts };
//alert('R:'+r+' AZ:'+zat+' TS:'+lts );
if( r > -1 ){
set2DZoomLevel( id, drawZoomLevels[ id ] );
var z = Math.round( zat * 3000 / Math.PI );
if( z < 0 ) z += 6000 ;
doDeviceOperation( id, 42, r+':'+z, true );
};
};
roi_2d[id]={ range: r, az: zat, ts: lts };
//alert('R:'+r+' AZ:'+zat+' TS:'+lts );
switch( selectROI_mode ){
case 0:{
if( r > -1 ){
set2DZoomLevel( id, drawZoomLevels[ id ] );
var z = Math.round( zat * 3000 / Math.PI );
if( z < 0 ) z += 6000 ;
doDeviceOperation( id, 42, r+':'+z, true );
} else {
var csvg = document.getElementById( 'draw_svg_' + id );
if( csvg!= undefined ){
var x = ( 287.0 / csvg.clientWidth ) * event.offsetX;
var y = ( 287.0 / csvg.clientHeight ) * event.offsetY;
var dx= x - ( 287.0 / 2 );
var dy= y - ( 287.0 / 2 );
var hr = Math.sqrt( dx*dx + dy*dy ) * 2;
if( hr > ( 284.0 ) ) hr = 284.0 ;
var zat = -1.0 * Math.atan2( dy, dx );
if( zat < 0.0 ) zat += Math.PI * 2.0;
var r = -1;
switch( drawZoomLevels[ id ] ){
case 100:{
r = Math.round( hr * ( 2048.0 / 284.0 ) );
if( r > 2048 ) r = 2048;
break;
};
break;
};
case 1:{
if( r > -1 ){
var z = Math.round( zat * 3000 / Math.PI );
if( z < 0 ) z += 6000 ;
Ext.Ajax.request({
url: '/lib/controller/doMaskOperation.php',
params: {
NID: id,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>',
CMD: 4,
R: r,
A: z
},
success: function( response, opts ){
load2DMasks( id );
},
failure: failureAJAXFunction
});
case 50:{
r = Math.round( hr * ( 1024.0 / 284.0 ) );
if( r > 1024 ) r = 1024;
break;
};
t = Ext.getCmp('cp_radar_'+id );
if( t != undefined ){
t.removeClass( 'yellow_bg' );
case 25:{
r = Math.round( hr * ( 512.0 / 284.0 ) );
if( r > 512 ) r = 512;
break;
};
t = document.getElementById('draw_svg_'+id );
if( t != undefined ){
t.style.cursor = 'crosshair';
case 12:{
r = Math.round( hr * ( 256.0 / 284.0 ) );
if( r > 256 ) r = 256;
break;
};
default:{
r = -1;
break;
};
selectROI_mode = 0;
break;
};
case 2:{
if( r > -1 ){
var z = Math.round( zat * 3000 / Math.PI );
if( z < 0 ) z += 6000 ;
Ext.Ajax.request({
url: '/lib/controller/doMaskOperation.php',
params: {
NID: id,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>',
CMD: 5,
R: r,
A: z
},
success: function( response, opts ){
//Ext.getCmp('cp_daf_btn_'+id).toggle( false );
//selectROI_mode = 0;
doNodeNCQ( 1, 212, '' );//Reload Bubbles
},
failure: failureAJAXFunction
});
} else alert( 'Range is Negative' );
Ext.getCmp('cp_daf_btn_'+id).toggle( false );
selectROI_mode = 0;
break;
if( r > -1 ){
var z = Math.round( zat * 3000 / Math.PI );
if( z < 0 ) z += 6000 ;
Ext.Ajax.request({
url: '/lib/controller/doMaskOperation.php',
params: {
NID: id,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>',
CMD: 4,
R: r,
A: z
},
success: function( response, opts ){
load2DMasks( id );
},
failure: failureAJAXFunction
});
};
t = Ext.getCmp('cp_radar_'+id );
if( t != undefined ){
t.removeClass( 'yellow_bg' );
};
t = document.getElementById('draw_svg_'+id );
if( t != undefined ){
t.style.cursor = 'crosshair';
};
selectROI_mode = 0;
};
};
};
@ -750,33 +745,78 @@ function cleanup2DTargets( a ){
targets_2d_el[a] = [];
};
function cleanup2DDraw( a , zzz = '' ){
function cleanup2DBubbles( a, zzz = '' ){
if( zzz == '') zzz = 'draw_svg_';
var csvg = document.getElementById( zzz + a );
if( csvg!= undefined ){
if( targets_2d_el[a] != undefined ){
if( targets_2d_el[a] ){
for( idx = 0; idx < targets_2d_el[a]; idx++ ){
var juja = csvg.getElementById( "targ_"+a+"_"+idx );
if( bubbles_2d_el[a] != undefined ){
if( bubbles_2d_el[a] ){
for( idx = 0; idx < bubbles_2d_el[a]; idx++ ){
var juja = csvg.getElementById( "bubble_"+a+"_"+idx );
if( juja != null ) csvg.removeChild( juja );
};
};
targets_2d_el[a] = 0;
bubbles_2d_el[a] = 0;
};
};
};
function cleanup2DBubbles( a, zzz = '' ){
function draw2DBubbles( a ){
cleanup2DBubbles( a );
var csvg = document.getElementById( 'draw_svg_' + a );
if( csvg!= undefined ){
var cpath = csvg.getElementById( "svg_mask_"+a );
var max = 2048.0;
switch( drawZoomLevels[a] ){
case 50: max = 1024.0; break;
case 25: max = 512.0; break;
case 12: max = 256.0; break;
};
//var rk = bBox.width / ( max * 2 );
var cpx= 287.0;
var cpy= 287.0;
var rk = 284.0 / max;
//console.log( '2 box: '+ bBox.width+'x'+bBox.height );
if( bubbles_2d[a] != undefined ){
if( bubbles_2d[a].length ) {
var ak = 2.0*Math.PI/360;
var ok = 1.0/35;
for( idx = bubbles_2d[a].length-1; idx > -1; idx-- ){
if( bubbles_2d[a][idx].range < max ){
x = cpx + rk * bubbles_2d[a][idx].range * Math.cos( bubbles_2d[a][idx].az*ak );
y = cpy - rk * bubbles_2d[a][idx].range * Math.sin( bubbles_2d[a][idx].az*ak );
var cc = document.createElementNS('http://www.w3.org/2000/svg', "circle");
var rz = 574 / csvg.clientWidth;
cc.setAttributeNS(null, "cx", x );
cc.setAttributeNS(null, "cy", y );
cc.setAttributeNS(null, "r", ""+(6*rz)+"" );
cc.setAttributeNS(null, "stroke", "#"+bubbles_2d[a][idx].stroke );
cc.setAttributeNS(null, "stroke-width", ""+(2*rz)+"" );
cc.setAttributeNS(null, "stroke-opacity", "1.0" );//+(1.0-ok*idx));
cc.setAttributeNS(null, "fill", "#"+bubbles_2d[a][idx].color );
cc.setAttributeNS(null, "fill-opacity", ""+(1.0-ok*idx));
cc.setAttributeNS(null, "id", "bubble_"+a+"_"+idx );
csvg.appendChild( cc );
};
};
bubbles_2d_el[a] = bubbles_2d[a].length;
};
};
};
};
function cleanup2DDraw( a , zzz = '' ){
if( zzz == '') zzz = 'draw_svg_';
var csvg = document.getElementById( zzz + a );
if( csvg!= undefined ){
if( bubbles_2d_el[a] != undefined ){
if( bubbles_2d_el[a] ){
for( idx = 0; idx < bubbles_2d_el[a]; idx++ ){
var juja = csvg.getElementById( "bubble_"+a+"_"+idx );
if( targets_2d_el[a] != undefined ){
if( targets_2d_el[a] ){
for( idx = 0; idx < targets_2d_el[a]; idx++ ){
var juja = csvg.getElementById( "targ_"+a+"_"+idx );
if( juja != null ) csvg.removeChild( juja );
};
};
bubbles_2d_el[a] = 0;
targets_2d_el[a] = 0;
};
};
};
@ -811,7 +851,7 @@ function draw2DTargets( a ){
playSound( 1 );
var ak = 2.0*Math.PI/360;
var ok = 1.0/35;
for( idx = targets_2d[a].length-1; idx > -1; idx-- ){
for( idx = targets_2d[a].length-1; idx > 0; idx-- ){
if( targets_2d[a][idx].range < max ){
x = cpx + rk * targets_2d[a][idx].range * Math.cos( targets_2d[a][idx].az*ak );
y = cpy - rk * targets_2d[a][idx].range * Math.sin( targets_2d[a][idx].az*ak );
@ -820,10 +860,10 @@ function draw2DTargets( a ){
cc.setAttributeNS(null, "cx", x );
cc.setAttributeNS(null, "cy", y );
cc.setAttributeNS(null, "r", ""+(6*rz)+"" );
cc.setAttributeNS(null, "stroke", "#"+targets_2d[a][idx].stroke );
cc.setAttributeNS(null, "stroke", "#800000" );
cc.setAttributeNS(null, "stroke-width", ""+(2*rz)+"" );
cc.setAttributeNS(null, "stroke-opacity", ""+(1.0-ok*idx));
cc.setAttributeNS(null, "fill", "#"+targets_2d[a][idx].color );
cc.setAttributeNS(null, "fill", "#ff0000" );
cc.setAttributeNS(null, "fill-opacity", ""+(1.0-ok*idx));
cc.setAttributeNS(null, "id", "targ_"+a+"_"+idx );
csvg.appendChild( cc );
@ -856,50 +896,6 @@ function draw2DTargets( a ){
};
};
function draw2DBubbles( a ){
cleanup2DBubbles( a );
var csvg = document.getElementById( 'draw_svg_' + a );
if( csvg!= undefined ){
var cpath = csvg.getElementById( "svg_mask_"+a );
var max = 2048.0;
switch( drawZoomLevels[a] ){
case 50: max = 1024.0; break;
case 25: max = 512.0; break;
case 12: max = 256.0; break;
};
//var rk = bBox.width / ( max * 2 );
var cpx= 287.0;
var cpy= 287.0;
var rk = 284.0 / max;
//console.log( '2 box: '+ bBox.width+'x'+bBox.height );
if( bubbles_2d[a] != undefined ){
if( bubbles_2d[a].length ) {
var ak = 2.0*Math.PI/360;
var ok = 1.0/35;
for( idx = bubbles_2d[a].length-1; idx > -1; idx-- ){
if( bubbles_2d[a][idx].range < max ){
x = cpx + rk * bubbles_2d[a][idx].range * Math.cos( bubbles_2d[a][idx].az*ak );
y = cpy - rk * bubbles_2d[a][idx].range * Math.sin( bubbles_2d[a][idx].az*ak );
var cc = document.createElementNS('http://www.w3.org/2000/svg', "circle");
var rz = 574 / csvg.clientWidth;
cc.setAttributeNS(null, "cx", x );
cc.setAttributeNS(null, "cy", y );
cc.setAttributeNS(null, "r", ""+(6*rz)+"" );
cc.setAttributeNS(null, "stroke", "#"+bubbles_2d[a][idx].stroke );
cc.setAttributeNS(null, "stroke-width", ""+(2*rz)+"" );
cc.setAttributeNS(null, "stroke-opacity", "1.0" );//+(1.0-ok*idx));
cc.setAttributeNS(null, "fill", "#"+bubbles_2d[a][idx].color );
cc.setAttributeNS(null, "fill-opacity", ""+(1.0-ok*idx));
cc.setAttributeNS(null, "id", "bubble_"+a+"_"+idx );
csvg.appendChild( cc );
};
};
bubbles_2d_el[a] = bubbles_2d[a].length;
};
};
};
};
function cleanup2DMasks( a ){
var csvg = document.getElementById( 'draw_svg_' + a );
if( csvg!= undefined ){
@ -1082,7 +1078,6 @@ function draw2DDraw( a, zzz = '' ){
};
};
draw2DTargets( a );
draw2DBubbles( a );
};
function load2DDraw( a, id='' ){
@ -1096,7 +1091,7 @@ function load2DDraw( a, id='' ){
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data != null ){
if( data!= null ){
if( data.count > 0 ){
draws_2d[a] = data.data;
draw2DDraw( a, id );
@ -1104,7 +1099,7 @@ function load2DDraw( a, id='' ){
} else {
load2DMasks( a, id );
};
};
} else load2DMasks( a, id );
},
failure: failureAJAXFunction
});
@ -1259,7 +1254,6 @@ function set2DZoomLevel( a, zl ){
};
draw2DTargets( a );
draw2DBubbles( a );
};
@ -1712,19 +1706,15 @@ function fetchSiteStatus(){
if( data.nodes[i].targets.length ){
targets_2d[data.nodes[i].id]=[];
for( idx = 0; idx < data.nodes[i].targets.length; idx++)
targets_2d[data.nodes[i].id][idx]={ range: data.nodes[i].targets[idx].digital, az: data.nodes[i].targets[idx].az, color: data.nodes[i].targets[idx].color, stroke: data.nodes[i].targets[idx].stroke };
targets_2d[data.nodes[i].id][idx]={ range: data.nodes[i].targets[idx].digital, az: data.nodes[i].targets[idx].az };
draw2DTargets( data.nodes[i].id );
} else cleanup2DDraw( data.nodes[i].id );
} else cleanup2DDraw( data.nodes[i].id );
};
if( data.nodes[i].bubbles !== undefined ){
if( data.nodes[i].bubbles.length ){
bubbles_2d[data.nodes[i].id]=[];
for( idx = 0; idx < data.nodes[i].bubbles.length; idx++)
bubbles_2d[data.nodes[i].id][idx]={ range: data.nodes[i].bubbles[idx].digital, az: data.nodes[i].bubbles[idx].az, color: data.nodes[i].bubbles[idx].color, stroke: data.nodes[i].bubbles[idx].stroke };
draw2DBubbles( data.nodes[i].id );
} else cleanup2DBubbles( data.nodes[i].id );
} else cleanup2DBubbles( data.nodes[i].id );
} else {
cleanup2DDraw( data.nodes[i].id );
}
} else {
cleanup2DDraw( data.nodes[i].id );
};
};
setStatus2D( data.nodes[i].id, data.nodes[i].status, data.nodes[i].masks_exist, data.nodes[i].masks_status );
break;
};
@ -1761,6 +1751,14 @@ function fetchSiteStatus(){
if( data.nodes[i].src != iel.src ) iel.src = data.nodes[i].src;
};
};
iel = document.getElementById('img-vid-'+data.nodes[i].id );
if( iel != null ){
if( data.nodes[i].status == 0 ){
if( iel.srcObject ) stopWhepClient( 'img-vid-'+data.nodes[i].id, 'stream_'+data.nodes[i].id );
} else {
if( iel.srcObject == null ) startWhepClient( 'img-vid-'+data.nodes[i].id, 'stream_'+data.nodes[i].id );
};
};
break;
};
};
@ -2102,34 +2100,6 @@ function clear2DACK( a ){
};
function doNodeNCQ( nodeId, CMD, param ){
Ext.Ajax.request({
url: '/lib/controller/doNodeOperation.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
CMD: CMD,
CCMD: 0,
NID: nodeId,
PARAM: param
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){
//loadAttachedSensors();
} else {
Ext.Msg.show({
title:'Error!',
msg: data.msg,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.WARNING
});
};
},
failure: failureAJAXFunction
});
};
function doAckOperation( NodeID, Cmd ){
if( Cmd ){
Ext.Msg.show({
@ -2169,7 +2139,7 @@ function doAckOperation( NodeID, Cmd ){
buttons: Ext.Msg.YESNOCANCEL,
fn: function( btn ){
if( btn == 'yes' ){
if( selectROI_mode == 1 ){
if( selectROI_mode ){
t = Ext.getCmp('cp_radar_'+NodeID );
if( t != undefined ){
t.removeClass( 'yellow_bg' );
@ -2190,3 +2160,67 @@ function doAckOperation( NodeID, Cmd ){
});
};
};
var peerConnections = [];
async function startWhepClient( video_id, stream_id ){
const STREAM_PATH = stream_id; // 'stream_3'; // Replace with your stream name
const MEDIAMTX_URL = `http://<?=$_SERVER['SERVER_ADDR'];?>:8889/${STREAM_PATH}/whep`;
// 1. Initialize the RTCPeerConnection
//if( peerConnection == null ){
const peerConnection = new RTCPeerConnection({
iceServers: [{ urls: 'stun:stun.l.google.com:19302' }] // Standard STUN for local/NAT routing
});
peerConnections[video_id] = peerConnection;
//};
// 2. Set up media placeholders (MediaMTX requires transceivers before the offer)
peerConnection.addTransceiver('video', { direction: 'recvonly' });
//peerConnection.addTransceiver('audio', { direction: 'recvonly' });
// 3. Handle incoming stream track
peerConnection.ontrack = (event) => {
var videoElement = document.getElementById( video_id );
if (videoElement && event.streams[0]) {
videoElement.srcObject = event.streams[0];
}
};
// 4. Create and set Local Description (Offer)
const offer = await peerConnection.createOffer();
await peerConnection.setLocalDescription(offer);
// 5. Send Offer to MediaMTX via HTTP POST
const response = await fetch(MEDIAMTX_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/sdp' },
body: peerConnection.localDescription.sdp
});
if (!response.ok) {
throw new Error(`MediaMTX WHEP signaling failed: ${response.statusText}`);
}
// 6. Set Remote Description (Answer) received from MediaMTX
const answerSdp = await response.text();
await peerConnection.setRemoteDescription(new RTCSessionDescription({
type: 'answer',
sdp: answerSdp
}));
};
function stopWhepClient( video_id, stream_id ){
if( peerConnections[video_id] != undefined ){
peerConnections[video_id].getReceivers().forEach( receiver => {
if( receiver.track ){
receiver.track.stop();
}
});
peerConnections[video_id].close();
delete( peerConnections[video_id] );
var videoElement = document.getElementById( video_id );
videoElement.srcObject = null;
videoElement.load();
};
}

7
lib/javascript/jsapi_dynamic/mojo_main.js

@ -203,9 +203,10 @@ function sessionValidator(){
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
icon: Ext.MessageBox.INFO,
fn: doLogout
});
doLogout();
};
},
failure: failureAJAXFunction
@ -293,7 +294,7 @@ Ext.onReady(function(){
//initMultiWindows();
loadSystemDevices();
gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
gSessionValidatorInterval = window.setInterval( sessionValidator, 10000 );
NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
window.onresize = doCheckWindowSize;

139
lib/javascript/jsapi_dynamic/mojo_reports.js

@ -978,6 +978,34 @@ function setVideoSource( mid, frame ){
};
};
function setVideoMp4Source( mid, frame ){
var video_t = document.getElementById( 'video-img-' + mid );
if( video_t != undefined ){
var d = new Date( videoNfo[mid][0] * 1000 );
var basePath = '/lib/controller/data/reports/'+d.getFullYear().toString().padStart(4, '0')+'/'+(d.getMonth()+1).toString().padStart(2, '0')+'/'+d.getDate().toString().padStart(2, '0')+'/'+videoNfo[mid][1]+'.mp4';
//video_t.src = "/video_view/stream?id="+videoNfo[mid][1]+"&TS="+videoNfo[mid][0]+"&sf=" + frame;
//"/style/assets/nosignal.mp4";
const parsedUrl = new URL( video_t.src );
if( parsedUrl.pathname != basePath ) {
console.log('Video Source Changed!');
video_t.src = basePath;
video_t.play();
};
video_t.currentTime = parseInt( frame / videoNfo[mid][2] );
/*
var store = grid.getStore();
var rowIndex = store.find('fieldName', 'desiredValue');
if (rowIndex !== -1) {
grid.getSelectionModel().selectRow(rowIndex);
}
*/
};
};
function loadEventData( record ){
ReportSelectionMode = 3; // Just One Event
cEventTSS = record.ts+record.ms/1000;
@ -996,7 +1024,7 @@ function loadEventData( record ){
markEventOnRadar( record.node_id, record.az, record.r, "#ff0000", "#800000" );
};
};
if( record.video ){
if( record.video ){
if( record.video == 2 ){
showVideos();
Ext.Ajax.request({
@ -1017,11 +1045,15 @@ function loadEventData( record ){
videoNfo[data.videos[i].media_stream_id][0] = data.videos[i].ts;
videoNfo[data.videos[i].media_stream_id][1] = data.videos[i].md5;
videoNfo[data.videos[i].media_stream_id][2] = data.videos[i].fps;
videoNfo[data.videos[i].media_stream_id][3] = data.videos[i].ext;
data.videos[i].frame -= 20;
if( data.videos[i].frame < 0 ) data.videos[i].frame = 0;
setVideoSource( data.videos[i].media_stream_id, data.videos[i].frame );
if( data.videos[i].ext == "mp4" ){
setVideoMp4Source( data.videos[i].media_stream_id, data.videos[i].frame );
} else {
setVideoSource( data.videos[i].media_stream_id, data.videos[i].frame );
};
var slider_t = Ext.getCmp( 'video-slider-'+data.videos[i].media_stream_id );
if( slider_t != undefined ){
@ -1832,6 +1864,14 @@ function showVideo( a ){
var tt = Ext.getCmp( 'video-ctl-panel-' + a );
if( tt != undefined ) tt.show();
};
function showMp4( a, b ){
var tt = Ext.getCmp( 'video-ctl-panel-' + a );
if( tt != undefined ) tt.show();
var video_t = document.getElementById( 'video-img-' + a );
if( video_t != undefined ){
video_t.src = "/lib/controller/data/reports/"+b;
};
};
function setPicture( a, b ){
var tt = Ext.getCmp( 'video-ctl-panel-' + a );
if( tt != undefined ) tt.hide();
@ -1847,8 +1887,8 @@ function showVideos(){
function downloadCurrentVideo( stid ){
var d = new Date( videoNfo[stid][0] * 1000 );
var videoFileDownloadTarget = d.getFullYear().toString().padStart(4, '0')+'_'+(d.getMonth()+1).toString().padStart(2, '0')+'_'+d.getDate().toString().padStart(2, '0')+'_'+d.getHours().toString().padStart(2, '0')+'-'+d.getMinutes().toString().padStart(2, '0')+'-'+d.getSeconds().toString().padStart(2, '0');
// TS, MD5, FPS
downloadVideoFile( videoNfo[stid][0], videoNfo[stid][1], videoNfo[stid][2], videoFileDownloadTarget );
// TS, MD5, FPS, EXT
downloadVideoFile( videoNfo[stid][0], videoNfo[stid][1], videoNfo[stid][2], videoFileDownloadTarget, videoNfo[stid][3] );
};
function initReportsView(){
@ -1918,41 +1958,60 @@ function initReportsView(){
sPanel.doLayout();
};
function downloadVideoFile( a, b, c, d ){
function downloadVideoFile( a, b, c, d, e ){
ReportMask = new Ext.LoadMask( Ext.getBody(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."} );
ReportMask.show();
Ext.Ajax.request({
url: '/lib/controller/downloadVideo.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
FTS: a,
FMD: b,
FPS: c
},
success: function(response, opts ){
const a = document.createElement('a');
a.style.display = 'none';
a.href = response.responseText;
a.download = d + response.responseText.substring( response.responseText.lastIndexOf('.'), response.responseText.length );
document.body.appendChild(a);
a.click();
ReportMask.hide();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_SUCCESS_');?>',
msg: '<?=$Labels->GetLabel('_VIDEO_FILE_HAS_DOWNLOADED_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
},
error: function(){
ReportMask.hide();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
});
if( e == "mp4" ){
var z = new Date( a * 1000 );
var videoFileDownloadTarget = '/lib/controller/data/reports/'+z.getFullYear().toString().padStart(4, '0')+'/'+(z.getMonth()+1).toString().padStart(2, '0')+'/'+z.getDate().toString().padStart(2, '0')+'/'+b+'.mp4';
const l = document.createElement('a');
l.style.display = 'none';
l.href = videoFileDownloadTarget;
l.download = d + '.mp4';
document.body.appendChild(l);
l.click();
ReportMask.hide();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_SUCCESS_');?>',
msg: '<?=$Labels->GetLabel('_VIDEO_FILE_HAS_DOWNLOADED_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else {
Ext.Ajax.request({
url: '/lib/controller/downloadVideo.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
FTS: a,
FMD: b,
FPS: c,
FEX: e
},
success: function(response, opts ){
const l = document.createElement('a');
l.style.display = 'none';
l.href = response.responseText;
l.download = d + response.responseText.substring( response.responseText.lastIndexOf('.'), response.responseText.length );
document.body.appendChild(l);
l.click();
ReportMask.hide();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_SUCCESS_');?>',
msg: '<?=$Labels->GetLabel('_VIDEO_FILE_HAS_DOWNLOADED_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
},
error: function(){
ReportMask.hide();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
});
};
};

60
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -921,7 +921,13 @@ function removeModule( ID ){
};
function disableServOps(){
var tC = Ext.getCmp('servopPanel01');
var tC = Ext.getCmp('servopPanel00');
tC.removeClass('servopInfo_item00');
tC.addClass('servopInfo_item00');
tC.disable();
Ext.getCmp('tbtn_sop00').disable();
tC = Ext.getCmp('servopPanel01');
tC.removeClass('servopInfo_item01');
tC.addClass('servopInfo_item00');
tC.disable();
@ -948,7 +954,15 @@ function disableServOps(){
};
function enableServOps(){
var tC = Ext.getCmp('servopPanel01');
var tC = Ext.getCmp('servopPanel00');
if( tC != undefined ){
tC.removeClass('servopInfo_item00');
tC.addClass('servopInfo_item01');
Ext.getCmp('tbtn_sop00').enable();
tC.enable();
};
tC = Ext.getCmp('servopPanel01');
if( tC != undefined ){
tC.removeClass('servopInfo_item00');
tC.addClass('servopInfo_item01');
@ -1901,9 +1915,47 @@ tPanel.add({
flex: 1,
height: PanelH-15,
autoScroll: false,
items:[
items:[{
xtype: 'panel',
baseCls:'servopInfo_item01',
id: 'servopPanel00',
items:[{
xtype: 'panel',
frame: false,
border: false,
unstyled: true,
html: "<p><?=$Labels->GetLabel('_SENS_ALL_RESTART_DESC_');?></p><br/>"
},{
xtype: 'button',
lazyRender: true,
iconCls: 'srv_op_restart',
text: "<?=$Labels->GetLabel('_SENS_ALL_RESTART_OP_');?>",
id: 'tbtn_sop00',
scale: 'large',
width: '95%',
disabled: true,
handler: function( bt ){
Ext.Msg.show({
title:"<?=$Labels->GetLabel('_SENS_ALL_RESTART_QT_');?>",
msg: "<?=$Labels->GetLabel('_SENS_ALL_RESTART_QM_');?>",
buttons: Ext.Msg.YESNO,
width: 400,
icon: Ext.MessageBox.INFO,
fn: function(btn, text){
if( btn == 'yes' ){
disableServOps();
doDeviceOperation( 1, 213,'', true );
};
}
});
}
}]
},{
xtype: 'spacer',
height: 8
}
<?php if( $CUser->Data['access'] > 3 ){ ?>
{
,{
xtype: 'panel',
baseCls:'servopInfo_item00',
id: 'servopPanel01',

1
lib/javascript/leaflet/leaflet.css

@ -16,6 +16,7 @@
}
.leaflet-container {
overflow: hidden;
background-color: #ffffff !important;
}
.leaflet-tile,
.leaflet-marker-icon,

1
lib/javascript/opencv/26135642c47363fed2a2e12ec518cfc1837de5e92ffb6e767f074cb9a3e3865a.map
File diff suppressed because it is too large
View File

8
lib/javascript/opencv/opencv.min.js
File diff suppressed because it is too large
View File

13
lib/upgrade_database.php

@ -109,10 +109,23 @@ CREATE TABLE "module_bvms" (
"api_uri" TEXT NOT NULL,
"access_user" TEXT,
"access_pass" TEXT,
"use_ssl" INTEGER DEFAULT 1,
PRIMARY KEY("id")
)
DATA_BOUNDARY;
$DATABASE->Query( $QS );
$UPGRADE = true;
} else {
//if exists check additionally new fields
$QS = "SELECT * FROM `module_bvms` LIMIT 1";
$RJ = $DATABASE->Query( $QS );
if( count( $RJ ) ){
if( !isset( $RJ[0]['use_ssl'] ) ){
$QS = "ALTER TABLE `module_bvms` ADD COLUMN `use_ssl` INTEGER DEFAULT 1;";
$DATABASE->Query( $QS, false );
$UPGRADE = true;
};
};
};
$QS = "SELECT name FROM sqlite_master WHERE type='table' AND name='module_attention';";
$JKA = $DATABASE->Query( $QS );

1
style/leaflet.css

@ -15,6 +15,7 @@
top: 0;
}
.leaflet-container {
background-color: #ffffff !important;
overflow: hidden;
}
.leaflet-tile,

Loading…
Cancel
Save