').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
});
};