Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

224 lines
4.6 KiB

//<?php require_once('../../js_asm.php'); ?>
var winW = <?=0+$CUser->Data['width'];?>;
var winH = <?=0+$CUser->Data['height'];?>;
var PanelH = winH-90;
function Refresh(){
window.location="/?t="+123;
};
function failureAJAXFunction( responce, opts ){
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
};
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
SAID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
WID: x,
HEI: y
},
success: function( response, opts ){
Refresh();
},
failure: failureAJAXFunction
});
};
function CheckWindowSize(delay){
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW2 = window.innerWidth;
winH2 = window.innerHeight;
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW2 = document.body.offsetWidth;
winH2 = document.body.offsetHeight;
if ( winH2<700 ) winH2=700;
};
};
//alert(winW2+':'+winW+' '+winH2+':'+winH);
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
};
};
Ext.onReady(function(){
//Check Screen Size
//alert( winW + 'x' + winH );
CheckWindowSize();
Ext.QuickTips.init();
var viewport = new Ext.Viewport({
id: 'main_viewport',
layout:'border',
items: [{
xtype: 'panel',
region: 'north',
baseCls: 'x-plain',
height: 50,
items:[{
xtype: 'panel',
id:'top',
baseCls: 'x-plain',
html: '<p style="padding:10px;color:#556677;font-size:11px;"><img src="/style/img/logo32.png">&nbsp;R-Goose Security System</p>'
}]
},{
xtype: 'panel',
id:'btns',
region:'west',
bsaseCls:'x-plain',
title: 'R-Goose System',
collapsible: true,
split:true,
width:150,
minWidth: 100,
maxWidth: 250,
layout:'accordion',
margins: '5 0 5 5',
cmargins:'5 5 5 5',
layoutConfig:{
animate:true
},
items: [{
title: 'Dashboard',
layout: 'vbox',
height: 120,
pack: 'center',
align : 'strech',
items:[{
xtype: 'button',
width: '100%',
id:'go_home',
text: 'Go Home',
handler: function( b, e ){
loadDashBoard();
}
},{
xtype: 'button',
width: '100%',
id:'go_monitor',
text: 'Monitor Events',
handler: function( b, e ){
loadTimeLine();
}
},{
xtype: 'button',
width: '100%',
id:'go_out',
text: 'Logout',
handler: function( b, e ){
window.location = '/login.php?UID=1';
}
}]
},{
title: 'System Settings',
layout: 'vbox',
height: 120,
pack: 'center',
align : 'strech',
items:[{
xtype: 'button',
width: '100%',
id:'sys_edit',
text: 'Edit Connections',
handler: function( b, e ){
loadSystemEditor();
}
},{
xtype: 'button',
width: '100%',
id:'map_edit',
text: 'Edit Locations',
handler: function( b, e ){
loadLocationEditor();
}
},{
xtype: 'button',
width: '100%',
id:'logout',
text: 'Logout',
handler: function( b, e ){
window.location = '/login.php?UID=1';
}
}]
},{
title: 'Profile Settings',
html: '<p>Panel content!</p>'
}
<?php
if( $CUser->Data['access'] > 5 ){
?>,{
title: 'Admin Settings',
items:[{
xtype: 'button',
width: '100%',
id:'adm_acc',
text: '<?=$Labels->GetLabel("_USERS_MNGMT_");?>',
handler: function( b, e ){
loadUserEditor();
}
},{
xtype: 'button',
width: '100%',
id:'adm_acclog',
text: 'Access Log',
handler: function( b, e ){
loadAccessLog();
}
},{
xtype: 'button',
width: '100%',
id:'adm_servlog',
text: 'Server Log',
handler: function( b, e ){
loadServerLog();
}
}]
}
<?php
};
?>
]
},{
xtype: 'panel',
region:'center',
margins: '5 5 5 0',
id: 'main_content',
title: 'System Dashboard',
items:[{
xtype: 'portal',
id: 'main_portal',
frame: false,
border: false,
items:{
html: '<p style="padding:10px;color:#556677;font-size:11px;"><center><img src="/style/img/logo.png"></center></p>'
},
listeners:{
drop: function( a ){
updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
}
}
}]
}]
});
loadDashBoard();
});