').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
+ });
+};
+
+function showServerToolBox( ServerNodeId ){
+ currentNodeID = ServerNodeId;
+ if( serverToolBox == null ){
+ serverToolBox = new Ext.Window({
+ title: '=$Labels->GetLabel('_SERV_CTLPANEL_SHRT_');?>',
+ modal: true,
+ width: 400,
+ height: 328,
+ closeAction: 'hide',
+ items:[{
+ xtype: 'button',
+ text: 'Restart',
+ width: '100%',
+ textAlign: 'left',
+ iconCls: 'server_btn_restart',
+ scale: 'large',
+ iconAlign: 'left',
+ handler: function(){
+ doDeviceOperation( currentNodeID, 250,'', true );
+ }
+ },{
+ xtype: 'button',
+ text: 'Initialize Hardware',
+ width: '100%',
+ textAlign: 'left',
+ iconCls: 'server_btn_hwinit',
+ scale: 'large',
+ iconAlign: 'left',
+ handler: function(){
+ doDeviceOperation( currentNodeID, 251,'', true );
+ }
+ },{
+ xtype: 'button',
+ text: 'Sync Time With Browser',
+ width: '100%',
+ textAlign: 'left',
+ iconCls: 'server_btn_timeinit',
+ scale: 'large',
+ iconAlign: 'left',
+ handler: function(){
+ doDeviceOperation( currentNodeID, 252, ((new Date())/1000), true );
+ }
+ }]
+ });
+ };
+ serverToolBox.show();
+};
+
+var detectionProfileWindow = null;
+var deviceCtrlNode = '';
+function showSensorToolBox( NodeID ){
+ currentNodeID = NodeID;
+ deviceCtrlNode = NodeID + ':0';
+ if( detectionProfileWindow == null ){
+ detectionProfileWindow = new Ext.Window({
+ title: '=$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>',
+ modal: true,
+ width: 340,
+ height: 328,
+ autoScroll: 'auto',
+ closeAction: 'hide',
+ resizable: false,
+ items:[{
+ xtype: 'panel',
+ title: '=$Labels->GetLabel('_SPEC_FUNCTI_');?>',
+ height: 95,
+ id: 'sf_panel',
+ frame: true,
+ flex: 1,
+ layout: 'vbox',
+ hidden: true,
+ items:[{
+ xtype: 'button',
+ text: 'Resolve Trouble',
+ width: '100%',
+ iconCls: 'ctrl_panel_cog',
+ scale: 'large',
+ iconAlign: 'left',
+ handler: function(){
+ detectionProfileWindow.hide();
+ resolveDeviceMistmatch( deviceCtrlNode );
+ }
+ }]
+ },{
+ xtype: 'panel',
+ title: '=$Labels->GetLabel('_DET_GENWORKS_');?>',
+ height: 193,
+ frame: true,
+ flex: 1,
+ layout: 'vbox',
+ items:[{
+ xtype: 'button',
+ width: '100%',
+ text: 'Clear Alarm',
+ scale: 'large',
+ iconCls: 'ctrl_panel_clean',
+ iconAlign: 'left',
+ handler: function(){
+ clearDeviceEvents( deviceCtrlNode );
+ }
+ },{
+ xtype: 'button',
+ width: '100%',
+ text: 'Draw Background',
+ scale: 'large',
+ iconCls: 'ctrl_panel_drawscan',
+ iconAlign: 'left',
+ handler: function(){
+ doDeviceOperation( deviceCtrlNode, 3 );
+ }
+ },{
+ xtype: 'button',
+ width: '100%',
+ text: 'Force Study Background',
+ scale: 'large',
+ iconCls: 'ctrl_panel_study',
+ iconAlign: 'left',
+ handler: function(){
+ doDeviceOperation( deviceCtrlNode, 2 );
+ }
+ },{
+ xtype: 'button',
+ width: '100%',
+ buttonAlign: 'left',
+ //text: '
',
+ text: 'Force Reset Sensor',
+ scale: 'large',
+ iconCls: 'ctrl_panel_reset',
+ iconAlign: 'left',
+ handler: function(){
+ doDeviceOperation( deviceCtrlNode, 1 );
+ }
+ }]
+ },{
+ xtype: 'panel',
+ title: 'Zone Masking Management',
+ height: 140,
+ frame: true,
+ flex: 1,
+ layout: 'vbox',
+ items:[{
+ xtype: 'button',
+ text: 'Mask Editor',
+ id: 'DMED',
+ width: '100%',
+ handler: function(){
+ showMaskEditor( true, 0, deviceCtrlNode );
+ }
+ },{
+ xtype: 'spacer',
+ height: 6
+ },{
+ xtype: 'panel',
+ frame: false,
+ border: false,
+ flex: 1,
+ width: '100%',
+ height: 40,
+ layout: 'hbox',
+ items:[{
+ xtype: 'button',
+ enableToggle: true,
+ width: '20%',
+ scale: 'large',
+ id: 'mz_btn_0',
+ iconCls: 'mask_zone1_btn',
+ iconAlign: 'top',
+ pressed: false,
+ disabled: true,
+ handler: function(){
+ Ext.getCmp('MAPPLY').enable();
+ }
+ },{
+ xtype: 'button',
+ enableToggle: true,
+ width: '20%',
+ scale: 'large',
+ id: 'mz_btn_1',
+ iconCls: 'mask_zone2_btn',
+ iconAlign: 'top',
+ pressed: false,
+ disabled: true,
+ handler: function(){
+ Ext.getCmp('MAPPLY').enable();
+ }
+ },{
+ xtype: 'button',
+ enableToggle: true,
+ width: '20%',
+ scale: 'large',
+ id: 'mz_btn_2',
+ iconCls: 'mask_zone3_btn',
+ iconAlign: 'top',
+ pressed: false,
+ disabled: true,
+ handler: function(){
+ Ext.getCmp('MAPPLY').enable();
+ }
+ },{
+ xtype: 'button',
+ enableToggle: true,
+ width: '20%',
+ scale: 'large',
+ id: 'mz_btn_3',
+ iconCls: 'mask_zone4_btn',
+ iconAlign: 'top',
+ pressed: false,
+ disabled: true,
+ handler: function(){
+ Ext.getCmp('MAPPLY').enable();
+ }
+ },{
+ xtype: 'button',
+ enableToggle: true,
+ width: '20%',
+ scale: 'large',
+ id: 'mz_btn_4',
+ iconCls: 'mask_zone5_btn',
+ iconAlign: 'top',
+ pressed: false,
+ disabled: true,
+ handler: function(){
+ Ext.getCmp('MAPPLY').enable();
+ }
+ }]
+ },{
+ xtype: 'spacer',
+ height: 6
+ },{
+ xtype: 'button',
+ text: 'Apply Zone Masks',
+ id: 'MAPPLY',
+ disabled: true,
+ width: '100%',
+ handler: function(){
+
+ }
+ }]
+ },{
+ xtype: 'panel',
+ title: '=$Labels->GetLabel('_DET_SENSITIVITY_');?>',
+ height: 95,
+ frame: true,
+ flex: 1,
+ layout: 'hbox',
+ items:[Data['access']>4 ){
+ ?>{
+ xtype: 'button',
+ text: 'Factory',
+ id: 'DDSPBTN0',
+ width: 80,
+ iconCls: 'detection_btn_factory',
+ enableToggle: true,
+ toggleGroup: 'det_sens_btn_grp',
+ disabled: true,
+ scale: 'large',
+ iconAlign: 'top'
+ },{
+ xtype: 'button',
+ text: 'Low',
+ id: 'DDSPBTN1',
+ width: 80,
+ iconCls: 'detection_btn_low',
+ enableToggle: true,
+ toggleGroup: 'det_sens_btn_grp',
+ disabled: true,
+ scale: 'large',
+ iconAlign: 'top'
+ },{
+ xtype: 'button',
+ text: 'Meduim',
+ id: 'DDSPBTN2',
+ width: 80,
+ iconCls: 'detection_btn_medium',
+ enableToggle: true,
+ toggleGroup: 'det_sens_btn_grp',
+ disabled: true,
+ scale: 'large',
+ iconAlign: 'top'
+ },{
+ xtype: 'button',
+ text: 'High',
+ id: 'DDSPBTN3',
+ width: 80,
+ iconCls: 'detection_btn_high',
+ enableToggle: true,
+ toggleGroup: 'det_sens_btn_grp',
+ disabled: true,
+ scale: 'large',
+ iconAlign: 'top'
+ }]
+ }]
+ });
+ };
+ detectionProfileWindow.show();
+ var myMask = new Ext.LoadMask( detectionProfileWindow.getEl(), {msg:"Please wait..."});
+ myMask.show();
+
+ Ext.Ajax.request({
+ url: '/lib/controller/getDetectionProfile.php',
+ params: {
+ SITE: SelectedSite,
+ UID: =$UserID;?>,
+ SID: '=$Session;?>',
+ NID: NodeID
+ },
+ success: function( response, opts ){
+ var data = Ext.decode( response.responseText );
+ myMask.hide();
+ detectionProfileWindow.setTitle( '['+data.name + '] =$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>');
+ if(data.masks_array != 'undefined' ){
+ for( i = 0; i < 5; i++ ){
+ var cE = Ext.getCmp('mz_btn_'+i );
+ if( data.masks_array[i]=='E'){
+ cE.enable();
+ cE.toggle( true, true );
+ } else {
+ cE.toggle( false, true );
+ if( data.masks_array[i]=='D' ){
+ cE.enable();
+ } else {
+ cE.disable();
+ };
+ };
+ };
+ };
+ if( data.data_status == 3 ){
+ if( data.profiles.length > 1 ){
+ for( i=0; i < data.profiles.length; i++ ){
+ Ext.getCmp('DDSPBTN'+i ).enable();
+ if( i == data.profile_id ) Ext.getCmp('DDSPBTN'+i ).toggle( true, false );
+ };
+ } else {
+ Ext.getCmp('DDSPBTN0').toggle( true, false );
+ Ext.getCmp('DDSPBTN0').disable();
+ };
+ } else if( data.data_status == 4 ){
+ Ext.getCmp('sf_panel').show();
+ };
+ detectionProfileWindow.doLayout();
+ },
+ failure: failureAJAXFunction
+ });
+};
+
diff --git a/lib/javascript/jsapi_dynamic/mojo_monitoring.js b/lib/javascript/jsapi_dynamic/mojo_monitoring.js
index 299a62e..5a23cbb 100644
--- a/lib/javascript/jsapi_dynamic/mojo_monitoring.js
+++ b/lib/javascript/jsapi_dynamic/mojo_monitoring.js
@@ -1,12 +1,101 @@
//
+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 = $('
').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();
};
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/mojo_settings.js b/lib/javascript/jsapi_dynamic/mojo_settings.js
index f8340e0..3c6a0d0 100644
--- a/lib/javascript/jsapi_dynamic/mojo_settings.js
+++ b/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:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
+ zPanel.doLayout();
} else {
tPanel.removeAll( true );
tPanel.doLayout();
- var tPanel = Ext.getCmp('mod_ed_small');
- tPanel.removeAll( true );
- tPanel.add( { html:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
- tPanel.doLayout();
+ var zPanel = Ext.getCmp('dcam_op_small');
+ zPanel.removeAll( true );
+ zPanel.add( { html:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
+ 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:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
+ zPanel.doLayout();
+ } else {
+ tPanel.removeAll( true );
+ tPanel.doLayout();
+ var zPanel = Ext.getCmp('acam_op_small');
+ zPanel.removeAll( true );
+ zPanel.add( { html:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
+ 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:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
+ zPanel.doLayout();
+ } else {
+ tPanel.removeAll( true );
+ tPanel.doLayout();
+ var zPanel = Ext.getCmp('sens_op_small');
+ zPanel.removeAll( true );
+ zPanel.add( { html:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
' } );
+ 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: '
'
+ },{
+ 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: [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 );
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:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
+ }]
+ }]
+ });
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: '
|
\
- \
- | \
- | \
- | \
- | \
-
|
\
- \
- =$AP_DATA['build'];?> \
- =$AP_DATA['os_info'];?> \
- =$AP_DATA['hw_info'];?> \
- |
\
- | |
'
+ autoScroll: 'auto',
+ items:[]
},{
-
+ xtype: 'panel',
+ id: 'acam_op_small',
+ flex: 1,
+ height: PanelH-15,
+ layout: 'fit',
+ items:[{
+ html:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
+ }]
}]
}],
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: '

'
+ },{
+ xtype: 'spacer',
+ width: 100
+ },{
+ xtype: 'radio',
+ width: '100%',
+ name: 'layo_apa',
+ id: 'db_layout_1',
+ checked: true
+ },{
+ frame: false,
+ border: false,
+ html: '

'
+ },{
+ xtype: 'spacer',
+ width: 100
+ },{
+ xtype: 'radio',
+ name: 'layo_apa',
+ id: 'db_layout_2',
+ checked: true
+ },{
+ frame: false,
+ border: false,
+ html: '

'
+ },{
+ xtype: 'spacer',
+ width: 100
+ },{
+ xtype: 'radio',
+ width: '100%',
+ name: 'layo_apa',
+ id: 'db_layout_3',
+ checked: true
+ },{
+ frame: false,
+ border: false,
+ html: '

'
+ }]
+ }]
+ });
+ 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;
+ };
+ };
+ };
};
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/rgoose_global_vars.js b/lib/javascript/jsapi_dynamic/rgoose_global_vars.js
index 7f7cb9a..9ae65fe 100644
--- a/lib/javascript/jsapi_dynamic/rgoose_global_vars.js
+++ b/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;
+
+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;
+
+var ssEnabled = false;
+
diff --git a/lib/javascript/jsapi_dynamic/rgoose_main.js b/lib/javascript/jsapi_dynamic/rgoose_main.js
index 47a515f..e30fc79 100644
--- a/lib/javascript/jsapi_dynamic/rgoose_main.js
+++ b/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: '

'
+ },{
+ 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: '
'+ap_title+'
',
- flex: 1
- },{
- xtype: 'panel',
- layout: 'fit',
- baseCls: 'x-plain',
- frame: false,
- border: false,
- margins: {top:10, right:10, bottom:10, left:10},
- items:['+ap_title+''
+ },{
+ xtype: 'spacer',
+ width: 10
+ },{
- xtype: 'button',
- id: 'logout_btn',
- text: 'Logout',
- iconCls: 'lout',
- scale: 'large',
- handler: doLogout
- }{
+ xtype: 'button',
+ id: 'logout_btn',
+ text: 'Logout',
+ iconCls: 'lout',
+ scale: 'large',
+ style:'text-align: right;',
+ handler: doLogout
+ }{
- 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 );
+ }
}]
+ };
+ ?>
+ ]
}]
},{
xtype: 'panel',
diff --git a/lib/php/db/SQLite_Class.php b/lib/php/db/SQLite_Class.php
index 0bbd376..06d9f54 100644
--- a/lib/php/db/SQLite_Class.php
+++ b/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 );
};
}
}
diff --git a/style/assets/ed-0.png b/style/assets/ed-0.png
new file mode 100644
index 0000000..6e07b57
Binary files /dev/null and b/style/assets/ed-0.png differ
diff --git a/style/assets/ed-1.png b/style/assets/ed-1.png
new file mode 100644
index 0000000..63ca7b6
Binary files /dev/null and b/style/assets/ed-1.png differ
diff --git a/style/assets/ed-1.psd b/style/assets/ed-1.psd
new file mode 100644
index 0000000..3a938c7
Binary files /dev/null and b/style/assets/ed-1.psd differ
diff --git a/style/assets/ed-2.png b/style/assets/ed-2.png
new file mode 100644
index 0000000..21ca292
Binary files /dev/null and b/style/assets/ed-2.png differ
diff --git a/style/assets/ed-3.png b/style/assets/ed-3.png
new file mode 100644
index 0000000..2b4a8dd
Binary files /dev/null and b/style/assets/ed-3.png differ