').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 );
}
},{
xtype: 'button',
text: 'Initialize Hardware',
width: '100%',
textAlign: 'left',
iconCls: 'server_btn_hwinit',
scale: 'large',
iconAlign: 'left',
handler: function(){
doDeviceOperation( currentNodeID, 251 );
}
},{
xtype: 'button',
text: 'Clear Site',
width: '100%',
textAlign: 'left',
iconCls: 'server_btn_restart',
scale: 'large',
iconAlign: 'left'
}]
});
};
serverToolBox.show();
};
var detectionProfileWindow = null;
var deviceCtrlNode = '';
function showSensorToolBox( NodeID ){
currentNodeID = NodeID;
deviceCtrlNode = NodeID + ':0';
Data['access']>4 ) $ColSpan = 4; else $ColSpan = 3; ?>
if( detectionProfileWindow == null ){
detectionProfileWindow = new Ext.Window({
title: '=$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>',
modal: true,
width: =$ColSpan*80+16;?>,
height: 328,
closeAction: 'hide',
items:[]
});
};
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_');?>');
detectionProfileWindow.removeAll( true );
//detectionProfileWindow.setSize( data.width, data.height );
if( data.additional !== 'undefined' ){
var addi = Ext.decode( data.additional );
detectionProfileWindow.add( addi );
};
if( data.data_status == 3 ){
detectionProfileWindow.add({
xtype: 'panel',
layout: 'table',
layoutConfig: {
columns: =$ColSpan;?>
},
items:[{
xtype: 'spacer',
height: 30,
style: {
marginTop: '13px'
},
html: '
=$Labels->GetLabel('_DET_SENSITIVITY_');?>',
colspan: =$ColSpan;?>
},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'
}]
});
for( i=0; i < data.profiles.length; i++ ){
Ext.getCmp('DDSPBTN'+data.profiles[i] ).enable();
if( i == data.profile_id ) Ext.getCmp('DDSPBTN'+data.profiles[i] ).toggle();
};
} else if( data.data_status == 4 ){
detectionProfileWindow.add({
xtype: 'panel',
//layout: 'fit',
//layoutConfig: {
// columns: 3
//},
items:[{
xtype: 'spacer',
height: 40,
//colspan: 3,
style: {
marginTop: '20px'
},
html: '
=$Labels->GetLabel('_DET_SENSITIVITY_');?>',
}Data['access']>4 ){
?>,{
xtype: 'button',
text: 'Resolve Trouble',
width: '100%',
//colspan: 3,
iconCls: 'ctrl_panel_cog',
scale: 'large',
iconAlign: 'left',
handler: function(){
detectionProfileWindow.hide();
resolveDeviceMistmatch( deviceCtrlNode );
}
}]
});
};
detectionProfileWindow.add({
xtype: 'spacer',
height: 30,
style: {
marginTop: '13px'
},
html: '
=$Labels->GetLabel('_DET_GENWORKS_');?>',
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
text: 'Clear Alarm',
scale: 'large',
iconCls: 'ctrl_panel_clean',
iconAlign: 'left'
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
text: 'Draw Background',
scale: 'large',
iconCls: 'ctrl_panel_drawscan',
iconAlign: 'left',
handler: function(){
doDeviceOperation( deviceCtrlNode, 3 );
}
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
text: 'Force Study Background',
scale: 'large',
iconCls: 'ctrl_panel_study',
iconAlign: 'left',
handler: function(){
doDeviceOperation( deviceCtrlNode, 2 );
}
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
buttonAlign: 'left',
//text: '
',
text: 'Force Reset Sensor',
scale: 'large',
iconCls: 'ctrl_panel_reset',
iconAlign: 'left',
handler: function(){
doDeviceOperation( deviceCtrlNode, 1 );
}
});
detectionProfileWindow.doLayout();
//detectionProfileWindow.show();
},
failure: failureAJAXFunction
});
};