Browse Source

Itermediate Version (on some changes)

master
Evgeny Gagua 4 years ago
parent
commit
381794a50b
  1. 2
      index.php
  2. 2
      lib/controller/addModule.php
  3. 33
      lib/controller/dash/node_10.js
  4. 108
      lib/controller/dash/node_13.js
  5. BIN
      lib/controller/data/factory.db
  6. BIN
      lib/controller/data/mysqlitedb.db
  7. BIN
      lib/controller/data/reports/094c688e5e8dc1f8ef21d6e2db1f6a5f.mp4
  8. BIN
      lib/controller/data/reports/3d795f358a9132dbfcd9893d1da802ce.mp4
  9. BIN
      lib/controller/data/reports/5867808c7150d49c86fd81abb3eeeafe.mp4
  10. BIN
      lib/controller/data/reports/69c511bc894dffaae421028dc1906ef7.mp4
  11. BIN
      lib/controller/data/reports/863cc02857069ff580c79e1cb1647f71.mp4
  12. BIN
      lib/controller/data/reports/99f3f89ac1dfe06dd18f8d18ce0ca8ab.mp4
  13. BIN
      lib/controller/data/reports/9eb1ee93cb0fc840c852676d78acb131.mp4
  14. BIN
      lib/controller/data/reports/a821bcaac7313ef47ef3a9fd48dc153b.mp4
  15. BIN
      lib/controller/data/reports/cf2ae8197f26e5e0be501e364237a6c2.mp4
  16. 51
      lib/controller/doCameraOperation.php
  17. 106
      lib/controller/doNodeOperation.php
  18. 49
      lib/controller/getCameraEditor.php
  19. 2
      lib/controller/getCameraPreview.php
  20. 182
      lib/controller/getDashBoardItems.php
  21. 59
      lib/controller/getDashBoardStatus.php
  22. 0
      lib/controller/getDeviceDraw.php
  23. 0
      lib/controller/getDeviceMask.php
  24. 0
      lib/controller/getGrabberEritor.php
  25. 220
      lib/controller/getResourceEditor.php
  26. 32
      lib/controller/getSensors.php
  27. 4
      lib/controller/getStatus.php
  28. 0
      lib/controller/setAnalogStreamCtrl.php
  29. 8
      lib/controller/updateDashBoardItems.php
  30. 1299
      lib/javascript/jsapi_dynamic/mojo_dashboard.js
  31. 95
      lib/javascript/jsapi_dynamic/mojo_monitoring.js
  32. 510
      lib/javascript/jsapi_dynamic/mojo_settings.js
  33. 15
      lib/javascript/jsapi_dynamic/rgoose_global_vars.js
  34. 125
      lib/javascript/jsapi_dynamic/rgoose_main.js
  35. 5
      lib/php/db/SQLite_Class.php
  36. BIN
      style/assets/ed-0.png
  37. BIN
      style/assets/ed-1.png
  38. BIN
      style/assets/ed-1.psd
  39. BIN
      style/assets/ed-2.png
  40. BIN
      style/assets/ed-3.png

2
index.php

@ -15,7 +15,7 @@
'mojo_monitoring.js',
//'rgoose_sysmap_editor.js',
'rgoose_location_editor.js',
'rgoose_dashboard.js',
'mojo_dashboard.js',
'rgoose_users.js',
'rgoose_logs.js',
'rgoose_single_ipi.js',

2
lib/controller/addModule.php

@ -43,7 +43,7 @@
$DATABASE->Query( $QS );
break;
};
case 9:{
case 8:{
//EmbedVido
$QS = "INSERT INTO `module_eve`(`web_port`) VALUES(8972)";
$DATABASE->Query( $QS );

33
lib/controller/dash/node_10.js

@ -1,18 +1,39 @@
{
id: 'db_node_%%%NODEID%%%',
xtype: 'portlet',
width: 258,
height: %%%HEIGHT%%%+40,
//xtype: 'portlet',
layout:'fit',
//width: 258,
//height: %%%HEIGHT%%%+40,
tools: [{
id:'gear',
handler: function(){
editAnalogStream( %%%STREAMID%%%, 1 );
//editAnalogStream( %%%STREAMID%%%, 1 );
}
}],
frame: true,
draggable: false,
bodyStyle: 'padding: 0px;',
title: '%%%NODENAME%%%',
items:[{
html: '<img data-enlargeable000 ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" id="img-%%%NODEID%%%" src="%%%SELURL%%%" width="%%%WIDTH%%%" height="%%%HEIGHT%%%"/>',
}]
id: 'db_node_%%%NODEID%%%_pic',
html: '',
}],
sukaMineWidth: -1,
listeners:{
resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
if( rawWidth!= undefined ){
if( p.sukaMineWidth != adjWidth ){
p.sukaMineWidth = adjWidth;
var XX = 32 + p.sukaMineWidth * %%%HEIGHT%%% / %%%WIDTH%%%;
p.setHeight( XX );
};
};
var z = Ext.getCmp('db_node_%%%NODEID%%%_pic');
z.update('<img data-enlargeable000 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+32 );
}
}
}

108
lib/controller/dash/node_13.js

@ -1,63 +1,21 @@
{
id: 'db_node_%%%NODEID%%%',
//xxtype: 'panel',
xtype: 'portlet',
//columnWidth:.33,
//layout: 'fit',
width: 258,
height: %%%HEIGHT%%%+68,
layout:'vbox',
tools: [{
id:'gear',
handler: function(){
Ext.Msg.alert('Message', 'The Settings tool was clicked.');
}
}],
frame: true,
bodyStyle: 'padding: 0px;',
plr: null,
title: '%%%NODENAME%%%',
sukaMineWidth: -1,
items:[{
html: '<img onmouseover="ptzCtrl(\'img-%%%NODEID%%%\');" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" id="img-%%%NODEID%%%" src="%%%SELURL%%%" width="%%%WIDTH%%%" height="%%%HEIGHT%%%"/>',
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ptz_btn_%%%NODEID%%%',
id: 'db_node_%%%NODEID%%%_pic',
border: true,
width: '100%',
text: 'PTZ Control',
enableToggle: true,
handler: function(){
var t = Ext.getCmp('db_node_%%%NODEID%%%');
if( Ext.getCmp('ptz_btn_%%%NODEID%%%').pressed ){
t.setSize( 258, %%%HEIGHT%%%+162 );
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 );
} else {
t.setSize( 258, %%%HEIGHT%%%+68 );
//Ext.Msg.alert('Message', 'The 270 tool was clicked.');
};
t.doLayout();
}
html: ''
},{
xtype: 'spacer',
height: 3
@ -66,24 +24,46 @@
height: 90
}],
listeners:{
afterrender: function( t ){
/*
t.plr = videojs.getPlayer('hls-%%%NODEID%%%');
if( t.plr == null ){
t.plr = videojs('hls-%%%NODEID%%%',{
autoplay: 'muted',
controls: true,
controlBar: {
volumePanel: false,
playToggle: false,
pictureInPictureToggle: false
}
});
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 );
};
};
t.plr.src({type: 'application/x-mpegURL', src: '%%%SELURL%%%'});
*/
return true;
},
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;

BIN
lib/controller/data/factory.db

Binary file not shown.

BIN
lib/controller/data/mysqlitedb.db

Binary file not shown.

BIN
lib/controller/data/reports/094c688e5e8dc1f8ef21d6e2db1f6a5f.mp4

Binary file not shown.

BIN
lib/controller/data/reports/3d795f358a9132dbfcd9893d1da802ce.mp4

Binary file not shown.

BIN
lib/controller/data/reports/5867808c7150d49c86fd81abb3eeeafe.mp4

Binary file not shown.

BIN
lib/controller/data/reports/69c511bc894dffaae421028dc1906ef7.mp4

Binary file not shown.

BIN
lib/controller/data/reports/863cc02857069ff580c79e1cb1647f71.mp4

Binary file not shown.

BIN
lib/controller/data/reports/99f3f89ac1dfe06dd18f8d18ce0ca8ab.mp4

Binary file not shown.

BIN
lib/controller/data/reports/9eb1ee93cb0fc840c852676d78acb131.mp4

Binary file not shown.

BIN
lib/controller/data/reports/a821bcaac7313ef47ef3a9fd48dc153b.mp4

Binary file not shown.

BIN
lib/controller/data/reports/cf2ae8197f26e5e0be501e364237a6c2.mp4

Binary file not shown.

51
lib/controller/doCameraOperation.php

@ -186,6 +186,57 @@
break;
};
case 7:{
//Remove Camera
$QS ="SELECT * FROM `cameras` WHERE `id`={$CameraID}";
$RR = $DATABASE->Query( $QS );
if( count ( $RR ) ){
$CCD = $RR[0];
$QS ="DELETE FROM `nodes` WHERE `type` IN (10,11,12,13) AND `aux_id`={$CameraID}";
$DATABASE->Query( $QS );
if( $CCD['type'] < 12 ){//Analog
$QS="UPDATE `cameras` SET `status`=0 WHERE `id`={$CameraID}";
$DATABASE->Query( $QS );
} else { // IP
$QS ="DELETE FROM `media_streams` WHERE `source_id`={$CameraID}";
$DATABASE->Query( $QS );
$QS ="DELETE FROM `cameras` WHERE `id`={$CameraID}";
$DATABASE->Query( $QS );
};
$Data['status'] = 'ok';
};
break;
};
case 8:{
// Direct PTZ Controll
//$QS = "SELECT `aux_id` FROM `nodes` WHERE `id`={$CameraID}";
//$RR = $DATABASE->Query( $QS );
//$CameraID = intval( $RR[0]['aux_id'] );
if( $CameraID && isset( $_POST['MOV'] ) ){
$CCC = intval( $_POST['MOV'] );
switch( $CCC ){
case 0: $ACMD = 0x01; break; //Stop
case 10: $ACMD = 0x21; break; //Zoom In
case 11: $ACMD = 0x41; break; //Zoom Out
case 27: $ACMD = 0x03; break; // Right
case 28: $ACMD = 0x13; break; // RD
case 29: $ACMD = 0x11; break; // Down
case 30: $ACMD = 0x15; break; // LD
case 31: $ACMD = 0x05; break; // Left
case 32: $ACMD = 0x0d; break; // LU
case 33: $ACMD = 0x09; break; // Up
case 34: $ACMD = 0x0B; break; // RU
};
echo $CameraID . " -> " .$ACMD;
if( $ACMD ){
$QS = "INSERT INTO `nodes_qcq`(`cmd`,`node_id`,`status`) VALUES ({$ACMD},{$CameraID},0)";
@$MEMDB = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$MEMDB->Query( $QS );
};
};
break;
};
case 10:{
$OP = intval( $_POST['OPID'] );
switch( $OP ){

106
lib/controller/doNodeOperation.php

@ -2,32 +2,92 @@
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data = array();
$Data['success'] = false;
$Data['status'] = 'na';
if( isset( $_POST['CCMD'] ) ){
$CCMD = intval( $_POST['CCMD'] );
} else $CCMD = 0;
if( isset( $_POST['NID'] ) ) {
$NodeID = intval($_POST['NID']);
} else $NodeID = 0;
if( isset( $_POST['CMD'] ) ){
$CMD = intval( $_POST['CMD'] );
} else {
$CMD = 0;
};
if( isset( $_POST['PARAM'] ) ){
$PARAM = $DATABASE->escape( $_POST['PARAM'] );
} else {
$PARAM = '';
};
if( $NodeID > 0 && $CMD > 0 ){
$Data['success'] = true;
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$NodeID},{$CMD},0,'{$PARAM}')";
$Data['query'] = $QS ;
@$MEMDB = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$MEMDB->Query( $QS, false );
$Data['operation_id'] = intval( $MEMDB->getLastInsertID() );
} else {
$Data['msg']='Wrong Parameters';
switch( $CCMD ){
case 0:{
// Default Op Mode ------> NCQ Commands
if( isset( $_POST['CMD'] ) ){
$CMD = intval( $_POST['CMD'] );
} else {
$CMD = 0;
};
if( isset( $_POST['PARAM'] ) ){
$PARAM = $DATABASE->escape( $_POST['PARAM'] );
} else {
$PARAM = '';
};
if( $NodeID > 0 && $CMD > 0 ){
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$Data['success'] = true;
$Data['status'] = 'ok';
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$NodeID},{$CMD},0,'{$PARAM}')";
$Data['query'] = $QS;
$RBASE->Query( $QS, false );
$Data['operation_id'] = intval( $RBASE->getLastInsertID() );
} else {
$Data['msg']='Wrong Parameters';
};
break;
};
case 1:{
// Add Sensor
if( isset( $_POST['SENSID'] ) ) {
$SensorID = intval($_POST['SENSID']);
} else $SensorID = 0;
$ETYP = intval( $_POST['TYPE'] );
$EPROTOID = intval( $_POST['DEVID'] );
$EUARTID = intval( $_POST['UART'] );
$ERANGE = intval( $_POST['RANGE'] );
if( $EUARTID ){
$QS = "SELECT `id`, `device_id` FROM `lrf_sensors` WHERE `uart_id`={$EUARTID}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
if( $EPROTOID == 0 ){
$Data['msg'] = 'Cannot Assign Protocol Device ID[0] on selected UART<br/>Another devices already exists!<br/>Device ID[0] May be set just in exclusive UART usage mode';
} else {
foreach( $RR as $R ){
if( $R['device_id'] == $EPROTOID ) {
$Data['msg'] = "On the selected UART line already exists sensor with selected Device ID[{$EPROTOID}]";
};
if( $R['device_id'] == 0 ){
$Data['msg'] = "On the selected UART line already exists sensor with Device ID[0]<br/>This UART can not be assigned to another sensor!";
};
};
if( !isset( $Data['msg'] ) ){
// All OK
$QS="INSERT INTO `lrf_sensors`(`type`,`data_status`,`uart_id`,`device_id`,`max_range`,`enabled_lrf`) VALUES({$ETYP},1,{$EUARTID},{$EPROTOID},{$ERANGE},255)";
$DATABASE->Query( $QS );
$SIID = $DATABASE->getLastInsertID();
$NAME = 'SENSOR_'.$SIID;
$QS="INSERT INTO `nodes`(`type`,`aux_id`,`name`,`online`) VALUES({$ETYP},{$SIID},'{$NAME}',0)";
$DATABASE->Query( $QS );
$Data['status'] = 'ok';
};
};
} else {
// No device assigned with this UART
$QS="INSERT INTO `lrf_sensors`(`type`,`data_status`,`uart_id`,`device_id`,`max_range`,`enabled_lrf`) VALUES({$ETYP},1,{$EUARTID},{$EPROTOID},{$ERANGE},255)";
$DATABASE->Query( $QS );
$SIID = $DATABASE->getLastInsertID();
$NAME = 'SENSOR_'.$SIID;
$QS="INSERT INTO `nodes`(`type`,`aux_id`,`name`,`online`) VALUES({$ETYP},{$SIID},'{$NAME}',0)";
$DATABASE->Query( $QS );
$Data['status'] = 'ok';
};
} else {
$Data['msg'] = 'The UART Not Selected!';
};
break;
};
};
echo json_encode( $Data );
exit();
};
header('location: /');
} else {
header('location: /');
};
?>

49
lib/controller/getCameraEditor.php

@ -57,7 +57,7 @@
$ATAB = 0;
//v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1 --stream-to=output.jpg
if( $CAM_IP ){
$RESET_CREDENTIALS=<<<kskjhiiuwye
$RESET_CREDENTIALS=<<<kskjhiiuwye
,{
xtype: 'button',
width: '100%',
@ -69,7 +69,8 @@ kskjhiiuwye;
} else {
$RESET_CREDENTIALS='';
};
$ADD_CAMERA=<<<hzzhoiuyhetrkh
if( $Cam['status'] < 3 ){
$ADD_CAMERA=<<<hzzhoiuyhetrkh
{
xtype: 'button',
width: '100%',
@ -101,15 +102,41 @@ kskjhiiuwye;
}
}
hzzhoiuyhetrkh;
$REMOVE_CAMERA=<<<hhoiuyhetrkh
} else {
$RESET_CREDENTIALS='';
$ADD_CAMERA=<<<hhoiuyhetrkh
{
xtype: 'button',
width: '100%',
text: '{$Labels->GetLabel('_REMOVE_CAMERA_')}',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/doCameraOperation.php',
params: {
UID: {$UserID},
SID: '{$Session}',
CMD: 7,
CID: {$CID}
},
success: function( response, opts ){
var tData = Ext.decode(response.responseText);
if( tData.status == 'ok' ){
loadAssignedCameras();
} else {
Ext.Msg.show({
title:'Error!',
msg: tData.msg,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
}
}
hhoiuyhetrkh;
};
$BBAR_BTN = $ADD_CAMERA;
$TPL_SET_CREDS_IP=<<<ZUZAKA
{
@ -230,6 +257,14 @@ ZUZAKA;
}]
}
CHUPAKABRA;
$QS="SELECT * FROM `module_eve` WHERE `id`=1";
$S=$DATABASE->Query( $QS );
$MODULE_DATA = $S[0];
if( $Cam['status'] < 3 ){
$FU = "/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID=";
} else {
$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id=';
};
$TPL_CAM_EDITOR=<<<PZAKSJEJSDKGJHGASD
{
id: 'camedi_tabs',
@ -286,8 +321,9 @@ CHUPAKABRA;
SelectedSource = rec.data.id;
doCamOperation( {$CID}, 1, SelectedSource );
var tt = Ext.getCmp('pic_prev');
if( tt!= undefined ){
tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
if( tt!= undefined ){
//tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
tt.update( '<center><img width="100%" ondblclick="fullScreen(\'img-{$CID}\');" style="cursor: zoom-in" id="img-{$CID}" src="{$FU}'+SelectedSource+'"></center>' );
};
}
}
@ -787,8 +823,7 @@ PZAKSJEJSDKGJHGASD;
if( $CAM_IP ){
switch( $Cam['status'] ){
case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
case 1: $Data['content'] = $TPL_CAM_EDITOR; break;
case 2: $Data['content'] = $TPL_CAM_EDITOR; break;
default: $Data['content'] = $TPL_CAM_EDITOR; break;
};
} else {
$Data['content'] = $TPL_CAM_EDITOR;

2
lib/controller/getCameraPreview.php

@ -22,7 +22,7 @@
$tmp = '/tmp/some_tmp_file_'.md5(time()).'.jpg';
$CMD_SET = "v4l2-ctl --device {$Result[0]['ip']} -set-fmt-video=width={$Result[0]['width']},height={$Result[0]['height'] },pixelformat=MJPG";
$A = `$CMD_SET`;
$CMD_GRAB = "ffmpeg -f video4linux2 -i {$Result[0]['ip']} -frames:v 3 -update 1 {$tmp}";
$CMD_GRAB = "ffmpeg -f video4linux2 -i {$Result[0]['ip']} -frames:v 10 -update 1 -qscale:v 2 {$tmp}";
$B = `$CMD_GRAB`;
if( file_exists( $tmp ) ){
$Data = file_get_contents( $tmp );

182
lib/controller/getDashBoardItems.php

@ -0,0 +1,182 @@
<?php
require_once('../ajax_asm.php');
$UID = intval( $CUser->Data['id'] );
$Data = '';
if( $UID > 1 ){
$QS = "SELECT * FROM `system_props` LIMIT 1";
$SPD = $DATABASE->Query( $QS );
if( count( $SPD ) ){
$SP = $SPD[0];
$DUMM = array();
$DUMM['camera']="{xtype:'panel',html:'NO CAMERA'}";
$DUMM['sensor']="{xtype:'panel',html:'NO SENSOR'}";
$DUMM['map']="{xtype:'panel',html:'NO MAP'}";
$DUMM['log']="{xtype:'panel',html:'NO LOG'}";
$STA = array();
$END="]}";
$STA[0]="{ columnWidth: 1, style:'padding:10px 0 10px 10px', items:[";
$STA[1]="{ columnWidth: 0.5, style:'padding:10px 0 10px 10px', items:[";
$STA[2]="{ columnWidth: 0.5, style:'padding:10px 0 10px 10px', items:[";
$STA[3]="{ columnWidth: 0.25, style:'padding:10px 0 10px 10px', items:[";
$STA[4]="{ columnWidth: 0.25, style:'padding:10px 0 10px 10px', items:[";
$STA[5]="{ columnWidth: 0.25, style:'padding:10px 0 10px 10px', items:[";
$STA[6]="{ columnWidth: 0.25, style:'padding:10px 0 10px 10px', items:[";
$MCOL = 7;
$P1="{ columnWidth: .25, style:'padding:10px 0 10px 10px', items:[";
$P2="]}";
$QS = "SELECT * FROM nodes WHERE `type`> 0 ";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) > 0 ){
$QS = "SELECT * FROM users_dash_layout WHERE user_id={$UID} ORDER BY x,y";
$Lay = $DATABASE->Query( $QS, false );
$AL = array();
foreach( $Lay as $L ){
$AL[$L['node_id']]=$L;
};
$COLS = array();
$Z = array();
foreach( $result as $R ){
if( isset( $AL[$R['id']] ) ){
$COLS[intval($AL[$R['id']]['x'])][intval($AL[$R['id']]['y'])] = $R;
} else {
$Z[] = $R;
};
};
if( count( $Z ) ) foreach( $Z as $z ) $COLS[$MCOL-1][]=$z;
$STOL = array();
for( $i=0; $i < $MCOL; $i++ ){
$index = 0;
$TPL = array();
$STOL[] = array();
if( isset( $COLS[$i] ) ){
foreach( $COLS[$i] as $R ){
$TFN = 'dash/node_' . $R['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL[$index] = file_get_contents( $TFN );
$TPL[$index] = str_replace('%%%NODEID%%%', ''.$R['id'] , $TPL[$index] );
$TPL[$index] = str_replace('%%%NODENAME%%%', ''.$R['name'] , $TPL[$index] );
switch( $R['type'] ){
case ARGUS_SERVER:{
$TPL[$index] = str_replace('%%%SYSSERVERNAME%%%', $Labels->getLabel( 'SYS_SERVNAME' ), $TPL[$index] );
if( $R['online']== 1 ){
$TPL[$index] = str_replace('%%%SERVERSTATUS%%%', $Labels->getLabel('SRV_STATUS_ON') , $TPL[$index]);
$TPL[$index] = str_replace('%%%SERVERSTATUSIMG%%%', 'accept.png' , $TPL[$index]);
} else {
$TPL[$index] = str_replace('%%%SERVERSTATUS%%%', $Labels->getLabel('SRV_STATUS_OFF') , $TPL[$index]);
$TPL[$index] = str_replace('%%%SERVERSTATUSIMG%%%', 'stop.png' , $TPL[$index]);
};
$QS="SELECT * FROM `server_modules` WHERE `server_id`={$R['aux_id']}";
$Z=$DATABASE->Query($QS);
$MODULES = array();
if(count($Z)){
foreach( $Z as $mod ){
$QS="SELECT * FROM server_module_types WHERE id={$mod['type']}";
$mtt=$DATABASE->Query( $QS );
$CM['xtype'] = 'panel';
if( $mod['enabled'] == 1 ){
$CM['html'] = '<table width="100%"><tr><td><p class="super_small">'.$Labels->getLabel( $mtt[0]['name'] ).'</p></td><td width="16px"><img title="'.$Labels->getLabel( '__ENABLED__' ).'" src="/style/icons/icons/plugin_add.png"></td></tr></table>';
} else {
$CM['html'] = '<table width="100%"><tr><td><p class="super_small">'.$Labels->getLabel( $mtt[0]['name'] ).'</p></td><td width="16px"><img title="'.$Labels->getLabel( '__DISABLED__' ).'" src="/style/icons/icons/plugin_delete.png"></td></tr></table>';
};
$CM['height'] = 25;
$MODULES[] = $CM;
};
$MODULES_CNT = json_encode( $MODULES );
} else {
$MODULES_CNT = '[{ html: \'No Modules Defined\'}]';
};
$TPL[$index] = str_replace('%%%MODULES%%%', ''.$MODULES_CNT , $TPL[$index] );
break;
};
case ARGUS_LFS_SENSOR:
case ARGUS_PLS_200_SENSOR:
case ARGUS_PLS_360_SENSOR:{
break;
};
case ARGUS_3D_SENSOR:{
break;
};
case 10:
case 11:
case 12:
case ARGUS_IP_PTZ_CAMERA:{
//$QS="SELECT * FROM cameras WHERE node_id={$R['id']}";
$QS="SELECT * FROM `nodes` WHERE `id`={$R['id']}";
$Z=$DATABASE->Query( $QS );
$QS="SELECT * FROM `module_eve` WHERE `id`=1";
$S=$DATABASE->Query( $QS );
$MODULE_DATA = $S[0];
$TPL[$index] = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL[$index] );
$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
$CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
$TPL[$index] = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%', $FU, $TPL[$index] );
$TPL[$index] = str_replace( '%%%STREAMID%%%', $R['aux_parameter'], $TPL[$index] );
$FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
$W = 244;
$H = $W * $FK;
$TPL[$index] = str_replace( '%%%WIDTH%%%', $W, $TPL[$index] );
$TPL[$index] = str_replace( '%%%HEIGHT%%%', $H, $TPL[$index] );
/*
$QS="SELECT mss.*, ms.name, ms.img_width, ms.img_height FROM media_server_streams mss LEFT JOIN media_streams ms ON ( mss.media_stream_id = ms.id ) WHERE ms.source_id={$Z[0]['id']} AND mss.valid=1 AND mss.online=1";
$S=$DATABASE->Query( $QS );
if( count( $S ) ){
$CS = array();
$FID = 0;
$FUL = '';
foreach( $S as $sou ){
$QS = "SELECT * FROM media_servers WHERE id = {$sou['media_server_id']}";
$F = $DATABASE->Query( $QS );
$FF=$F[0];
if( $FF['ip']=='127.0.0.1'){
//Localhost
$FF['ip'] = $_SERVER['SERVER_ADDR'];
};
$ACC_URL='http://' . $FF['ip'] . ':' . $FF['REST_port'];
$CU = str_replace( $FF['virtual_host'], $ACC_URL, $sou['key'] ) . '/hls.m3u8';
if( $FID == 0 ){
// First URL as default
$FID = $sou['id'];
$FUL = $CU;
};
$CS[] = '[' . $sou['id'] . ',\'[' . $sou['img_width'] . 'x' . $sou['img_height'] . '] '. $sou['name'].'\',\'' . $CU .'\']';
};
$TPL[$index] = str_replace( '%%%URLS%%%', '['. implode( ',', $CS ) . ']' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: '. $FID .',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%', $FUL, $TPL[$index] );
} else {
// Handle No Video From Camera!
$TPL[$index] = str_replace( '%%%URLS%%%', '[]' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: \'No Video Sources\',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%','', $TPL[$index] );
};
*/
break;
};
};
$index++;
};
};
//if( $i == 0 ) $TPL[] = '{ id: \'db_node_22311232\', frame: false, colspan: 2, width: 516, height: 200, border: true, title: \'PIZDA\', items:[{ html: \'<p>Server</p>\'}]}';
$STOL[$i] = $STA[$i] . implode( ',', $TPL ) . $END;
};
//$STOL[] = "{ columnWidth: 0.5, style:'padding:10px 0 10px 10px', items:[]}";
//$STOL[] = "{ columnWidth: 0.5, style:'padding:10px 0 10px 10px', items:[]}";
//$STOL[] = "{ columnWidth: 1, style:'padding:10px 0 10px 10px', items:[]}";
$Data = '[' . implode( ',' , $STOL ) . ']';
};
} else {
$Data = '[{columnWidth: 1, items:{html:"NO SYSTEM PROPS"}} ]';
};
};
if( $Data != '' ) {
echo $Data;
} else {
echo '[]';
};
?>

59
lib/controller/getDashBoardStatus.php

@ -0,0 +1,59 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$SiteID = intval( $_POST['SITE'] );
$UID = intval( $CUser->Data['id'] );
$Data = array();
$Data['nodes'] = array();
$QS = "SELECT * FROM nodes WHERE site_id = {$SiteID}";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) > 0 ){
foreach( $result as $R ){
$CN = array();
$CN['id'] = $R['id'];
$CN['status'] = intval($R['online']);
switch( $R['type'] ){
case ARGUS_SERVER:{
break;
};
case ARGUS_ALS_SENSOR:
case ARGUS_LFS_SENSOR:
case ARGUS_PLS_200_SENSOR:
case ARGUS_PLS_360_SENSOR:
case ARGUS_NET_PLS_200:{
if( $CN['status'] ){
// check Targets
$CN['targets'] = array();
$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) AND (UNIX_TIMESTAMP(NOW())-ts)<60 ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY ts, ts_ms DESC LIMIT 32";
//echo $QS . "\n\n";
$zult = $DATABASE->Query( $QS );
if( count( $zult ) ){
$CN['status'] = 2; // Alarmed
$CT = array();
foreach( $zult as $Z ){
$CT['digital'] = $Z['range_digital'];
$CT['az'] = $Z['azimuth'];
$CN['targets'][] = $CT;
};
};
};
break;
};
case ARGUS_3D_SENSOR:{
break;
};
case ARGUS_IP_PTZ_CAMERA:{
break;
};
};
//$index++;
$Data['nodes'][] = $CN;
};
};
echo json_encode( $Data );
} else {
echo '[]';
};
?>

lib/controller/zuza/getDeviceDraw.php → lib/controller/getDeviceDraw.php

lib/controller/zuza/getDeviceMask.php → lib/controller/getDeviceMask.php

lib/controller/zuza/getAnalogStreamCtrl.php → lib/controller/getGrabberEritor.php

220
lib/controller/getResourceEditor.php

@ -173,6 +173,11 @@
END_TEMPLATE;
return $TPL;
};
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['RID'] );
$QS = "SELECT * FROM resources WHERE id = {$EID}";
@ -337,11 +342,220 @@ EFUFU;
case 31: //Video In
$R_name = 'Video Frame Grabber';
$R_dev = $CR['device'];
$QS="SELECT * FROM `media_streams` WHERE `id`={$CR['aux_id']}";
$II = $DATABASE->Query( $QS );
$CI = $II[0];
$STREAM = $CR['aux_id'];
//$QS="SELECT * FROM `media_streams` WHERE `id`={$CR['aux_id']}";
//$II = $DATABASE->Query( $QS );
//$CI = $II[0];
$R_nfo = 'Frame Size: '.$CI['img_width'].'x'.$CI['img_height'].'<br/>Driver: '.$CI['mrl_proto'];
$R_image = 'RCA-Connector-Plug-icon.png';
$QS = "SELECT * FROM `media_streams` WHERE `id`={$STREAM}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$CS = $Result[0];
$R_nfo = 'Frame Size: '.$CS['img_width'].'x'.$CS['img_height'].'<br/>Driver: '.$CS['mrl_proto'];
$R_image = 'RCA-Connector-Plug-icon.png';
if( $CS['source_type'] == 'A' ){
$Sizes = array();
$Formats = array();
//If Source not assigned or not active
if( $CS['source_id'] == 0 || $CR['active'] == 0 ){
$CMD="v4l2-ctl -d {$CS['mrl']} --list-formats-ext";
$Data = `$CMD`;
$TArr = explode( "\n", $Data );
foreach( $TArr as $R ){
$CL = trim( $R );
if( stripos($CL,']:')!== false ){
$ID = intval( substr( $CL, 1 ) );
$FCC = substr( $CL, stripos( $CL, ':' ) + 3, 4 );
$DSC = substr( $CL, stripos( $CL, ':' ) + 9 );
$Formats[] = array('id'=>$ID, '4cc'=>$FCC, 'desc'=>$DSC );
};
if( stripos($CL,'Size:')!== false ){
$TBarr=explode( ' ', $CL );
if( intval( $TBarr[1] ) ){
$ZArr = explode( 'x', $TBarr[1] );
$Sizes[$TBarr[1]] = array( 'width'=>$ZArr[0], 'height'=>$ZArr[1], 'title'=>$TBarr[1] );
} else {
$ZArr = explode( 'x', $TBarr[2] );
$Sizes[$TBarr[2]] = array( 'width'=>$ZArr[0], 'height'=>$ZArr[1], 'title'=>$TBarr[2] );
};
};
};
};
$CMD="v4l2-ctl -d {$CS['mrl']} --list-ctrls-menu";
$Data = `$CMD`;
$TArr = explode( "\n", $Data );
$Controls = array();
$MFlag = false;
$MID = 0;
$id = 0;
foreach( $TArr as $R ){
$CL = trim( $R );
if( stripos( $CL, ':' ) !== false ){
$ctrl = array();
$RR = explode( ':', $CL );
$TArr=explode( ' ', $CL );
if( stripos( $CL, 'int' )!== false ){
$ctrl['type'] = 'slider';
$ctrl['name'] = trim( $TArr[0] );
$ctrl['name_cod'] = md5( $ctrl['name'] );
$ctrl['id'] = hexdec( $TArr[1] );
$TArr=explode( ' ', $RR[1] );
$TBrr = explode( '=', $TArr[1] );
$ctrl['min'] = intval( $TBrr[1] );
$TBrr = explode( '=', $TArr[2] );
$ctrl['max'] = intval( $TBrr[1] );
$TBrr = explode( '=', $TArr[3] );
$ctrl['step'] = intval( $TBrr[1] );
$TBrr = explode( '=', $TArr[5] );
$ctrl['value'] = intval( $TBrr[1] );
$MFlag = false;
$Controls[$id] = $ctrl;
$id++;
} else if( stripos( $CL, 'bool' )!== false ){
$ctrl['type'] = 'checkbox';
$ctrl['name'] = trim( $TArr[0] );
$ctrl['name_cod'] = md5( $ctrl['name'] );
$ctrl['id'] = hexdec( $TArr[1] );
$TArr=explode( ' ', $RR[1] );
$TBrr = explode( '=', $TArr[2] );
$ctrl['value'] = intval( $TBrr[1] );
$MFlag = false;
$Controls[$id] = $ctrl;
$id++;
} else if( stripos( $CL, 'menu' )!== false ){
$ctrl['type'] = 'combo';
$ctrl['name'] = trim( $TArr[0] );
$ctrl['name_cod'] = md5( $ctrl['name'] );
$ctrl['id'] = hexdec( $TArr[1] );
$TArr=explode( ' ', $RR[1] );
$TBrr = explode( '=', $TArr[4] );
$ctrl['value'] = intval( $TBrr[1] );
$MFlag = true;
$MID = $id;
$Controls[$id] = $ctrl;
$id++;
} else {
if( $MFlag ){
$ZV = explode( ':', $CL );
$cmi= array();
$cmi['id']=intval( $ZV[0] );
$cmi['text']=trim( $ZV[1] );
$Controls[$MID]['data'][]=$cmi;
};
};
};
};
$CCC = 0;
$OUT = array();
if( count( $Formats ) ){
$ll = "{
xtype: 'combo',
fieldLabel: '". $Labels->GetLabel('_FRAME_FORMAT_') ."',
lazyRender: true,
id: 'frmt_id',
name: 'frame_format',
mode: 'local',
forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
listeners:{ change: function(t,n,o){ changeASS( {$STREAM }, 'frmt_id'); }},
store: new Ext.data.ArrayStore({
fields: ['fmt','fmt_txt'],
data: [";
$cl = array();
foreach( $Formats as $F ){
$cl[]="[{$F['id']},\"{$F['desc']}\"]";
};
$ll .= implode( ',', $cl );
$ll .="]
}),
valueField: 'fmt',
displayField: 'fmt_txt'
}";
$OUT[$CCC] = $ll;
$CCC++;
};
if( count( $Sizes ) ){
$ll = "{
xtype: 'combo',
fieldLabel: '". $Labels->GetLabel('_FRAME_SIZE_') ."',
lazyRender: true,
id: 'sizes_id',
name: 'frame_size',
mode: 'local',
forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
listeners:{ change: function(t,n,o){ changeASS( {$STREAM }, 'sizes_id'); }},
store: new Ext.data.ArrayStore({
fields: ['size','size_txt'],
data: [";
$cl = array();
$id = 0;
$csid = 0;
foreach( $Sizes as $Key=>$Val ){
if( $Val['width'] == $CS['img_width'] && $Val['height'] == $CS['img_height'] ) $csid = $Key;//$id;
//$cl[]="[{$id},\"{$Key}\"]";
$cl[]="[\"{$Key}\",\"{$Key}\"]";
$id++;
};
$ll .= implode( ',', $cl );
$ll .="]
}),
valueField: 'size',
displayField: 'size_txt',
value: '{$csid}'
}";
$OUT[$CCC] = $ll;
$CCC++;
};
//print_r( $Controls );
if( count( $Controls )){
foreach( $Controls as $CC ){
$ll = "{ xtype: '{$CC['type']}', id: '{$CC['id']}', name: '{$CC['name']}', fieldLabel: '".$Labels->GetLabel($CC['name_cod'])."', value: {$CC['value']}, listeners:{ change: function(t,n,o){ changeASS( {$STREAM }, '{$CC['id']}' ); } }, ";
switch( $CC['type'] ){
case 'slider':{
$ll .= "minValue: {$CC['min']}, maxValue: {$CC['max']}, width: 235 }";
break;
};
case 'checkbox':{
if( $CC['value'] == 1 ){
$ll .= "checked: true }";
} else {
$ll .= "checked: false }";
};
break;
};
case 'combo':{
$ll .= "lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({
fields: ['{$CC['id']}_id','{$CC['id']}_txt'],
data: [";
$cl = array();
foreach( $CC['data'] as $D ) $cl[]="[{$D['id']},\"{$D['text']}\"]";
$ll .= implode(',', $cl );
$ll .="]
}),
valueField: '{$CC['id']}_id',
displayField: '{$CC['id']}_txt'
}";
break;
};
};
$OUT[$CCC] = $ll;
$CCC++;
};
}; //https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT
$CCA = implode( ',', $OUT );
echo "{ xtype: 'form', id:'an_str_edit', frame: false, autoScroll: true, border: false, layout: 'form', labelAlign: 'right', labelWidth: 150, items: [". $CCA ."] }";
} else {
echo "{ xtype: 'panel', html: '<center>Incorrect Stream</center>'}";
};
} else {
echo "{ xtype: 'panel', html: '<center>Incorrect Stream</center>'}";
};
break;
case 101: // Ethernet
$R_name = $Labels->GetLabel('_RES_ETHERNET_DESC_');

32
lib/controller/getSensors.php

@ -0,0 +1,32 @@
<?php
require_once('../ajax_asm.php');
ob_start();
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
if( $UID > 1 ){
$QS = "SELECT `sen`.*, `no`.`enable`, `no`.`name` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`)";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$SenPart = array();
foreach( $Result as $R ){
switch( $R['type'] ){
case 1: $HWT = 'ALS ' . $R['max_range'] . ' meters'; break;
case 2: $HWT = 'LFS ' . $R['max_range'] . ' meters'; break;
case 3: $HWT = 'PLS200 ' . $R['max_range'] . ' meters'; break;
case 4: $HWT = 'PLS360 ' . $R['max_range'] . ' meters'; break;
};
$SenPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['enable']==0)?'N':'O').'" onclick="editSensorHW('.$R['id'].');">'.urldecode($R['name']).'['.$HWT.']</a>\'}';
};
$Data['status']='ok';
$Data['sensors'] = '['.implode( ',', $SenPart ) .']';
} else {
$Data['status']='na';
};
$Data['messages'] = ob_get_clean();
echo json_encode( $Data );
} else {
header('location: /');
};
?>

lib/controller/zuza/getStatus.php → lib/controller/getStatus.php

lib/controller/zuza/setAnalogStreamCtrl.php → lib/controller/setAnalogStreamCtrl.php

lib/controller/zuza/updateDashBoardItems.php → lib/controller/updateDashBoardItems.php

1299
lib/javascript/jsapi_dynamic/mojo_dashboard.js
File diff suppressed because it is too large
View File

95
lib/javascript/jsapi_dynamic/mojo_monitoring.js

@ -1,12 +1,101 @@
//<?php require_once('../../js_asm.php'); ?>
function updateDashBoardItemLayout( id, x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateDashBoardItems.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
PANEL: id,
X: x,
Y: y
},
success: function( response, opts ){
//var data = Ext.decode(response.responseText);
//var tPanel = Ext.getCmp('main_portal');
//tPanel.removeAll(true);
//for( i=0; i < data.length; i++) tPanel.add( data[i] );
//tPanel.doLayout();
},
failure: failureAJAXFunction
});
};
function initMonitoring(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
tPanel.doLayout();
Ext.Ajax.request({
url: '/lib/controller/getDashBoardItems.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>' );
Ext.getCmp('main_content').removeAll(true);
Ext.getCmp('main_content').add({
xtype: 'portal',
id: 'main_portal',
frame: false,
border: false,
items:{
html: ''
},
listeners:{
drop: function( a ){
updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
}
}
});
Ext.getCmp('main_content').doLayout();
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll(true);
nodeDashboardStatuses = new Array();
for( i=0; i < data.length; i++) tPanel.add( data[i] );
tPanel.doLayout();
$('img[data-enlargeable]').addClass('img-enlargeable').click(function() {
var src = $(this).attr('src');
var modal;
function removeModal() {
modal.remove();
$('body').off('keyup.modal-close');
}
modal = $('<div>').css({
background: 'RGBA(0,0,0,.5) url(' + src + ') no-repeat center',
backgroundSize: 'contain',
width: '100%',
height: '100%',
position: 'fixed',
zIndex: '10000',
top: '0',
left: '0',
cursor: 'zoom-out'
}).click(function() {
removeModal();
}).appendTo('body');
//handling ESC
$('body').on('keyup.modal-close', function(e) {
if (e.key === 'Escape') {
removeModal();
}
});
});
tlInterval = window.setInterval( fetchSiteStatus, 333, selectedSite );
},
failure: failureAJAXFunction
});
//var tPanel = Ext.getCmp('main_content');
//tPanel.removeAll( true );
//tPanel.add({
// xtype: 'panel',
// html: 'KOKO'
//});
//tPanel.doLayout();
};

510
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -93,13 +93,17 @@ function loadDetectedCameras(){
tPanel.removeAll( true );
tPanel.add( res );
tPanel.doLayout();
var zPanel = Ext.getCmp('dcam_op_small');
zPanel.removeAll( true );
zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
zPanel.doLayout();
} else {
tPanel.removeAll( true );
tPanel.doLayout();
var tPanel = Ext.getCmp('mod_ed_small');
tPanel.removeAll( true );
tPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
tPanel.doLayout();
var zPanel = Ext.getCmp('dcam_op_small');
zPanel.removeAll( true );
zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
zPanel.doLayout();
};
},
failure: failureAJAXFunction
@ -107,9 +111,68 @@ function loadDetectedCameras(){
};
function loadAssignedCameras(){
Ext.Ajax.request({
url: '/lib/controller/getCameras.php',
params: {
UID: <?=$UserID;?>,
TYP: 1,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var tData = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('acam_container');
if( tData.status == 'ok' ){
var res = Ext.decode( tData.cameras );
tPanel.removeAll( true );
tPanel.add( res );
tPanel.doLayout();
var zPanel = Ext.getCmp('acam_op_small');
zPanel.removeAll( true );
zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
zPanel.doLayout();
} else {
tPanel.removeAll( true );
tPanel.doLayout();
var zPanel = Ext.getCmp('acam_op_small');
zPanel.removeAll( true );
zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
zPanel.doLayout();
};
},
failure: failureAJAXFunction
});
};
function loadAttachedSensors(){
Ext.Ajax.request({
url: '/lib/controller/getSensors.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var tData = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('sens_container');
if( tData.status == 'ok' ){
var res = Ext.decode( tData.sensors );
tPanel.removeAll( true );
tPanel.add( res );
tPanel.doLayout();
var zPanel = Ext.getCmp('sens_op_small');
zPanel.removeAll( true );
zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
zPanel.doLayout();
} else {
tPanel.removeAll( true );
tPanel.doLayout();
var zPanel = Ext.getCmp('sens_op_small');
zPanel.removeAll( true );
zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
zPanel.doLayout();
};
},
failure: failureAJAXFunction
});
};
function editResource( rid ){
var loadEditor = true;
if( settingsAreChanged ){
@ -597,6 +660,164 @@ function addEthernet2Uart(){
addE2UDialog.show();
};
var addSensorDialog = null;
var addSensWM = null;
function addSensor(){
if( addSensorDialog == null ){
addSensorDialog = new Ext.Window({
modal: true,
title: '<?=$Labels->GetLabel('_SMM_ADD_LSEN_');?>',
width: 500,
height: 438,
layout: 'form',
closeAction: 'hide',
labelWidth: 160,
labelAlign: 'right',
items:[{
xtype: 'panel',
frame: false,
border: false,
html: '<table width="100%" border=0><tr><td align="center" valign="middle"><div class="node_1_img_set"></div></td></tr></table>'
},{
xtype: 'spacer',
height: 8
},{
xtype: 'combo',
id: 'sens_type',
fieldLabel: "<?=$Labels->GetLabel('SENS_TYPE');?>",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[1,'ALS Sensor'],
[2,'LFS Sensor'],
[3,'PLS 200 Sensor'],
[4,'PLS 360 Sensor']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: 1,
width: 200
},{
xtype: 'combo',
id: 'sens_range',
fieldLabel: "<?=$Labels->GetLabel('SENS_RANGE');?>",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['range','range_txt'],
data: [
[15,'15 Meters'],
[35,'35 Meters'],
[65,'65 Meters'],
[75,'75 Meters'],
[150,'150 Meters'],
[200,'200 Meters'],
[300,'300 Meters']
]
}),
valueField: 'range',
displayField: 'range_txt',
value: 15,
width: 200
},{
xtype: 'numberfield',
id: 'sens_id',
fieldLabel: '<?=$Labels->GetLabel('_PROTO_DEVICE_ID_');?>',
width: 200,
value: 0
},{
xtype: 'combo',
fieldLabel: '<?=$Labels->GetLabel('_UART_PORT_');?>',
lazyRender: true,
id: 'uart_id',
mode: 'local',
disabled: false,
forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['uart','uart_txt'],
data: [<?php
$QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
$RR=$DATABASE->Query( $QS );
if( count( $RR ) ){
$RE=array();
foreach( $RR as $R ){
$RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
};
echo implode( ',', $RE );
} else {
echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
};
?>]
}),
valueField: 'uart',
displayField: 'uart_txt',
width: 200
},{
xtype:'button',
width: '100%',
text: '<?=$Labels->GetLabel('_ADD_');?>',
handler: function(){
var TYP = parseInt( Ext.getCmp('sens_type').getValue() );
var RAN = parseInt( Ext.getCmp('sens_range').getValue() );
var PID = parseInt( Ext.getCmp('sens_id').getValue() );
var RTI = parseInt( Ext.getCmp('uart_id').getValue() );
if( RTI > 0 ){
addSensWM = new Ext.LoadMask( addSensorDialog.getEl(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
addSensWM.show();
Ext.Ajax.request({
url: '/lib/controller/doNodeOperation.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
TYPE: TYP,
DEVID: PID,
UART: RTI,
RANGE: RAN,
CCMD: 1
},
success: function( response, opts ){
addSensWM.hide();
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
});
};
addSensorDialog.hide();
},
failure: failureAJAXFunction
});
} else {
Ext.Msg.show({
title:'Error!',
msg: 'Please Choose UART Port',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.WARNING
});
};
}
}]
});
};
addSensorDialog.show();
};
var addDetCamDialog = null;
var addDetCamWM = null;
function addDetectedIPCam(){
@ -688,12 +909,6 @@ function addDetectedIPCam(){
addDetCamWM.hide();
var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){
Ext.Msg.show({
title:'Sucess!',
msg: data.msg,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
loadDetectedCameras();
} else {
Ext.Msg.show({
@ -718,7 +933,7 @@ function showSettingsGeneral(){
stopStatusUpdater();
content_lvl1 = 1;
content_lvl2 = 4;
content_lvl2 = 0;
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
<?php
@ -1122,16 +1337,77 @@ function showSettingsSensors(){
content_lvl2 = 4;
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
tPanel.add({
xtype: 'panel',
id: 'sen_set',
layout: 'hbox',
tbar:[{
text: '<?=$Labels->GetLabel( '_SMM_ADD_LSEN_' );?>',
handler: function(){
addSensor();
}
}],
items:[{
xtype: 'panel',
id: 'sens_container',
flex: 1,
height: PanelH-15,
autoScroll: 'auto',
items:[]
},{
xtype: 'panel',
id: 'sens_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
items:[{
html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
}]
}]
});
tPanel.doLayout();
updateServerStatus();
loadAttachedSensors();
};
var cameraEditorContent = null;
function editSensorHW( cid ){
SelectedSensor = cid;
Ext.Ajax.request({
url: '/lib/controller/getSensorEditor.php',
params: {
CID: SelectedSensor,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var tComp = Ext.getCmp('sens_op_small');
if( data.status == 'ok' ){
if( tComp!= null ){
var content = Ext.decode( data.content );
tComp.removeAll( true );
tComp.add( content );
tComp.doLayout();
};
} else {
if( tComp!= null ){
tComp.removeAll( true );
tComp.add( data );
tComp.doLayout();
};
};
},
failure: function(){
}
});
};
var cameraEditorContent = null;
function editCamera( cid, etyp ){
SelectedCam = cid;
switch( etyp ){
case 0: cameraEditorContent = Ext.getCmp('dcam_op_small'); break;
case 1: cameraEditorContent = Ext.getCmp('acam_op_small'); break;
};
Ext.Ajax.request({
url: '/lib/controller/getCameraEditor.php',
@ -1157,15 +1433,7 @@ function editCamera( cid, etyp ){
};
};
},
failure: function( response, opts ) {
//Ext.getCmp('cam_login').setValue('');
Ext.getCmp('cam_password').setValue('');
Ext.getCmp('cac_tab').enable();
Ext.getCmp('str_tab').disable();
Ext.getCmp('ptz_tab').disable();
Ext.getCmp('loc_tab').disable();
Ext.getCmp('coc_tabs').setActiveTab( 0 );
sourceListStore.removeAll();
failure: function(){
}
});
@ -1214,29 +1482,25 @@ function showSettingsVideo(){
}]
},{
xtype: 'panel',
id: 'gi_tab',
id: 'cam_ass_tab',
title: 'Assigned Cameras',
layout: 'hbox',
items:[{
xtype: 'panel',
id: 'acam_container',
flex: 1,
height: PanelH-15,
autoScroll: false,
html: '<table width="100%" height="100%" border=0><tr><td height="290px" align="center" valign="middle"><div class="server_img_set"></div></td></tr>\
<tr><td height="100px"><table width="100%" border=0><tr>\
<td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut0_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue0">0</text><text x="50%" y="50%" class="chart-label">CPU</text></g></svg></td>\
<td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut1_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut1_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut1_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue1">0</text><text x="50%" y="50%" class="chart-label">MEM</text></g></svg></td>\
<td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut2_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut2_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut2_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue2">0</text><text x="50%" y="50%" class="chart-label">DISK</text></g></svg></td>\
<td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut3_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut3_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut3_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue3">0</text><text x="50%" y="50%" class="chart-label">TEMP</text></g></svg></td>\
</tr></table></td></tr>\
<tr><td valign="top"><div class="setEd_infoPanel" id="INFO_SPS">\
<div class="sideInfo_item" id="SW_INFO"><?=$AP_DATA['build'];?></div>\
<div class="sideInfo_item" id="OS_INFO"><?=$AP_DATA['os_info'];?></div>\
<div class="sideInfo_item" id="HW_INFO"><?=$AP_DATA['hw_info'];?></div>\
</div></td></tr>\
<tr><td height="60%">&nbsp;</td></tr></table>'
autoScroll: 'auto',
items:[]
},{
xtype: 'panel',
id: 'acam_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
items:[{
html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
}]
}]
}],
listeners:{
@ -1248,10 +1512,10 @@ function showSettingsVideo(){
loadDetectedCameras();
break;
};
case 'res_tab': {
case 'cam_ass_tab': {
content_lvl3=1;
stopStatusUpdater();
loadRessources();
loadAssignedCameras();
break;
};
case 'mod_tab':{
@ -1274,9 +1538,117 @@ function showSettingsVideo(){
}
});
tPanel.doLayout();
updateUserContent();
updateServerStatus();
};
function showSettingsApplication(){
stopStatusUpdater();
content_lvl1 = 1;
content_lvl2 = 3;
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
tPanel.add({
xtype: 'tabpanel',
frame: false,
id: 'settings_a_content',
border: false,
activeTab: 0,
items:[{
title: '<?=$Labels->GetLabel('_WORKING_MODE_');?>',
xtype: 'form',
labelAlign: 'right',
labelWidth: 180,
items:[{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
fieldLabel: '<?=$Labels->GetLabel('_DEBUGGING_MODE_');?>',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['sid', 'snam'],
data: [[0,'<?=$Labels->GetLabel('__DISABLED__');?>'], [1,'<?=$Labels->GetLabel('___ENABLED__');?>']]
}),
value: <?=0;?>,
valueField: 'sid',
displayField: 'snam'
}]
},{
title: '_MONIT_LAYOUT_',
layout:'table',
defaults: {
// applied to each contained panel
bodyStyle:'padding:20px'
},
layoutConfig: {
// The total column count must be specified here
columns: 3
},
frame: false,
border: false,
height: 800,
items:[{
xtype: 'spacer',
width: 100
},{
xtype: 'radio',
width: '100%',
name: 'layo_apa',
id: 'db_layout_0',
checked: true
},{
frame: false,
border: false,
html: '<img src="/style/assets/ed-0.png" />'
},{
xtype: 'spacer',
width: 100
},{
xtype: 'radio',
width: '100%',
name: 'layo_apa',
id: 'db_layout_1',
checked: true
},{
frame: false,
border: false,
html: '<img src="/style/assets/ed-1.png" />'
},{
xtype: 'spacer',
width: 100
},{
xtype: 'radio',
name: 'layo_apa',
id: 'db_layout_2',
checked: true
},{
frame: false,
border: false,
html: '<img src="/style/assets/ed-2.png" />'
},{
xtype: 'spacer',
width: 100
},{
xtype: 'radio',
width: '100%',
name: 'layo_apa',
id: 'db_layout_3',
checked: true
},{
frame: false,
border: false,
html: '<img src="/style/assets/ed-3.png" />'
}]
}]
});
tPanel.doLayout();
updateUserContent();
};
function showSettingsUpgrade(){
stopStatusUpdater();
@ -1294,7 +1666,6 @@ function initSettingsView(){
tlInterval = null;
timelineObj = null;
};
setUserContent( 210 );
var tP = Ext.getCmp('left_side_menu');
tP.doLayout();
tP.setVisible( false );
@ -1315,7 +1686,7 @@ function initSettingsView(){
id:'go_home',
text: '<?=$Labels->GetLabel('_UPPER_SENSOR_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 0 ),
pressed: ( content_lvl2 == 0 && content_lvl1 == 0 ),
allowDepress: false,
toggleGroup: 'det_settings',
handler: loadDashBoard
@ -1325,7 +1696,7 @@ function initSettingsView(){
id:'go_monitor',
text: '<?=$Labels->GetLabel('_BOTTOM_SENSOR_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 1 ),
pressed: ( content_lvl2 == 1 && content_lvl1 == 0 ),
allowDepress: false,
toggleGroup: 'det_settings',
handler: loadMonitoring
@ -1335,7 +1706,7 @@ function initSettingsView(){
id:'go_archive',
text: '<?=$Labels->GetLabel('_FUSION_ENGINE_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 2 ),
pressed: ( content_lvl2 == 2 && content_lvl1 == 0 ),
allowDepress: false,
toggleGroup: 'det_settings',
handler: loadArchive
@ -1350,7 +1721,7 @@ function initSettingsView(){
id:'go_singleIpi',
text: '<?=$Labels->GetLabel('_EVT_MONITOR_IPI_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 3 ),
pressed: ( content_lvl2 == 3 && content_lvl1 == 0 ),
allowDepress: false,
toggleGroup: 'det_settings',
handler: loadSingleIPI
@ -1381,7 +1752,7 @@ function initSettingsView(){
id:'sys_edit',
text: '<?=$Labels->GetLabel('_SYS_GENERAL_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 4 ),
pressed: ( content_lvl2 == 0 && content_lvl1 == 1 ),
allowDepress: false,
toggleGroup: 'sys_settings',
handler: showSettingsGeneral
@ -1391,7 +1762,7 @@ function initSettingsView(){
id:'map_edit',
text: '<?=$Labels->GetLabel('_SENSOR_CONNECTION_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 5 ),
pressed: ( content_lvl2 == 1 && content_lvl1 == 1 ),
allowDepress: false,
toggleGroup: 'sys_settings',
handler: showSettingsSensors
@ -1401,17 +1772,27 @@ function initSettingsView(){
id:'video_set',
text: '<?=$Labels->GetLabel('_CAMERA_MNGMNT_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 6 ),
pressed: ( content_lvl2 == 2 && content_lvl1 == 1 ),
allowDepress: false,
toggleGroup: 'sys_settings',
handler: showSettingsVideo
},{
xtype: 'button',
width: '100%',
id:'app_set',
text: '<?=$Labels->GetLabel('_APPLICA_MNGMNT_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 3 && content_lvl1 == 1 ),
allowDepress: false,
toggleGroup: 'sys_settings',
handler: showSettingsApplication
},{
xtype: 'button',
width: '100%',
id:'soft_update',
text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 7 ),
pressed: ( content_lvl2 == 4 && content_lvl1 == 1 ),
allowDepress: false,
toggleGroup: 'sys_settings',
handler: showSettingsUpgrade
@ -1425,7 +1806,7 @@ function initSettingsView(){
width: '100%',
text: 'Ethernet',
enableToggle: true,
pressed: ( content_lvl2 == 8 ),
pressed: ( content_lvl2 == 0 && content_lvl1 == 2 ),
allowDepress: false,
id:'ethernet',
},{
@ -1433,7 +1814,7 @@ function initSettingsView(){
width: '100%',
text: 'WiFi',
enableToggle: true,
pressed: ( content_lvl2 == 9 ),
pressed: ( content_lvl2 == 1 && content_lvl1 == 2 ),
allowDepress: false,
id:'wifi',
},{
@ -1441,7 +1822,7 @@ function initSettingsView(){
width: '100%',
text: 'Integration',
enableToggle: true,
pressed: ( content_lvl2 == 10 ),
pressed: ( content_lvl2 == 2 && content_lvl1 == 2 ),
allowDepress: false,
id:'api_serv',
}]
@ -1494,5 +1875,22 @@ function initSettingsView(){
};
?>
tP.setVisible( true );
tP.doLayout();
tP.doLayout();
switch( content_lvl1 ){
case 0:{
switch( content_lvl2 ){
case 0: break;
};
break;
};
case 1:{
switch( content_lvl2 ){
case 0: showSettingsGeneral(); break;
case 1: showSettingsSensors(); break;
case 2: showSettingsVideo(); break;
case 3: showSettingsApplication(); break;
case 4: showSettingsUpgrade(); break;
};
};
};
};

15
lib/javascript/jsapi_dynamic/rgoose_global_vars.js

@ -26,8 +26,21 @@ var nodeDashboardStatuses = new Array();
var nodeTHREEviewers = new Array();
var nodeTHREEanimationId = 0;
var serverIsOnLine = false;
var SelectedSensor = 0;
<?php
if( intval($CUser->Data['ss_timeout']) ){
?>
var ssEnabled = true;
var ssTimer = null;
var ssTimeOut = 60000; //1min
var ssTimeOut = <?=intval($CUser->Data['ss_timeout']);?>; //1min
var ssIsActive = false;
var ssInterval = null;
<?php
} else {
?>
var ssEnabled = false;
<?php
};
?>

125
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -156,7 +156,7 @@ function setUserContent( c_id ){
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 26,
CID: c_id
CID: initView
},
failure: failureAJAXFunction
});
@ -164,7 +164,7 @@ function setUserContent( c_id ){
function updateUserContent(){
cid = content_lvl3 + content_lvl2 * 10 + content_lvl1*100 + content_lvl0*1000;
setUserContent( cid );
if( initView != cid ) setUserContent( cid );
};
var gSessionValidatorInterval = null;
@ -279,14 +279,15 @@ Ext.onReady(function(){
//window.onresize = doCheckWindowSize;
Ext.QuickTips.init();
ssSetupTimer();
$(window).focus(function() {
ssResetTimer();
});
$(window).blur(function() {
ssStopTimer();
});
if( ssEnabled ){
ssSetupTimer();
$(window).focus(function() {
ssResetTimer();
});
$(window).blur(function() {
ssStopTimer();
});
};
var viewport = new Ext.Viewport({
@ -299,24 +300,31 @@ Ext.onReady(function(){
region: 'north',
baseCls: 'x-plain',
height: 60,
//layout: 'fit',
layout: 'hbox',
frame: false,
border: false,
items:[{
xtype: 'panel',
width: 600,
layout: 'hbox',
width: '100%',
layout: 'table',
baseCls: 'x-plain',
layoutConfig: {
columns: 11
},
frame: false,
border: false,
border: true,
margins: {top:10, right:10, bottom:10, left:10},
items:[{
xtype: 'panel',
baseCls: 'x-plain',
frame: false,
border: false,
margins: {top:5, right:20, bottom:0, left:10},
margins: {top:5, right:20, bottom:0, left:20},
html: '<img src="/style/assets/argus_logo_text.png" height="42px">'
},{
xtype: 'spacer',
width: 10
},{
xtype: 'button',
text: '<?=$Labels->GetLabel('_MONITORING_');?>',
@ -344,7 +352,10 @@ Ext.onReady(function(){
allowDepress: false,
toggleGroup: 'gopa_gopa',
toggleHandler: function( bt, state ){
if( state ) showContent( 1000 );
if( state ) {
content_lvl0 = 2000;
updateUserContent();
};
}
},{
xtype: 'spacer',
@ -356,56 +367,56 @@ Ext.onReady(function(){
iconCls: 'cog',
scale: 'large',
enableToggle: true,
//pressed: (Math.floor(initView/100)==2),
allowDepress: false,
toggleGroup: 'gopa_gopa',
toggleHandler: function( bt, state ){
if( state ) showContent( 2000 );
}
}]
},{
xtype: 'panel',
baseCls: 'x-plain',
frame: false,
border: false,
margins: {top:5, right:0, bottom:0, left:0},
html: '<p style="font-family: \'Ubuntu\';font-size: 24px;">'+ap_title+'</p>',
flex: 1
},{
xtype: 'panel',
layout: 'fit',
baseCls: 'x-plain',
frame: false,
border: false,
margins: {top:10, right:10, bottom:10, left:10},
items:[<?php
},{
xtype: 'spacer',
width: 10
},{
xtype: 'panel',
baseCls: 'x-plain',
frame: false,
border: false,
margins: {top:5, right:0, bottom:0, left:0},
width: PanelW-700,
html: '<p style="font-family: \'Ubuntu\';font-size: 24px;">'+ap_title+'</p>'
},{
xtype: 'spacer',
width: 10
},<?php
if( $AP_DATA['type'] == 1 ){
?>{
xtype: 'button',
id: 'logout_btn',
text: 'Logout',
iconCls: 'lout',
scale: 'large',
handler: doLogout
}<?php
?>{
xtype: 'button',
id: 'logout_btn',
text: 'Logout',
iconCls: 'lout',
scale: 'large',
style:'text-align: right;',
handler: doLogout
}<?php
} else {
?>{
xtype: 'button',
id: 'snd_mode_btn',
text: 'Sound',
iconCls: 'snd'+SoundMode,
scale: 'large',
handler: function(){
if( SoundMode == 0 ){
SoundMode = 3;
} else {
SoundMode --;
};
Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode );
}
?>{
xtype: 'button',
id: 'snd_mode_btn',
text: 'Sound',
iconCls: 'snd'+SoundMode,
scale: 'large',
style:'text-align: right;',
handler: function(){
if( SoundMode == 0 ){
SoundMode = 3;
} else {
SoundMode --;
};
Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode );
}
}<?php
};
?>]
};
?>
]
}]
},{
xtype: 'panel',

5
lib/php/db/SQLite_Class.php

@ -14,6 +14,10 @@ class SQLite_DB{
$this->DBENCRYPT=$encryptionKey;
try{
$this->DBLink = new SQLite3( $this->DBFILE, $this->DBFLAGS, $this->DBENCRYPT );
$this->DBLink->busyTimeout(5000);
// WAL mode has better control over concurrency.
// Source: https://www.sqlite.org/wal.html
$this->DBLink->exec('PRAGMA journal_mode = wal;');
$this->isConnected = true;
}catch( Exception $e ){
echo $e->getMessage();
@ -124,6 +128,7 @@ class SQLite_DB{
function __destruct(){
if( $this->isConnected ){
$this->DBLink->close();
unset( $this->DBLink );
};
}
}

BIN
style/assets/ed-0.png

Binary file not shown.

After

Width: 128  |  Height: 128  |  Size: 3.0 KiB

BIN
style/assets/ed-1.png

Binary file not shown.

After

Width: 128  |  Height: 128  |  Size: 3.0 KiB

BIN
style/assets/ed-1.psd

Binary file not shown.

BIN
style/assets/ed-2.png

Binary file not shown.

After

Width: 128  |  Height: 128  |  Size: 3.0 KiB

BIN
style/assets/ed-3.png

Binary file not shown.

After

Width: 128  |  Height: 128  |  Size: 3.0 KiB

Loading…
Cancel
Save