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.
 
 
 
 

284 lines
6.3 KiB

//<?php require_once('../../js_asm.php'); ?>
var winW = <?=intval($CUser->Data['width']);?>;
var winH = <?=intval($CUser->Data['height']);?>;
var PanelH = winH-90;
var SelectedSite = <?=$SiteID;?>;
var SettingsLidar3D = null;
var SelectedNodeID = 0;
var ServerPID = -1;
var SoundEnable = <?=intval($CUser->Data['sound_enable']);?>;
var sndBeep = new Howl({
src: [
'/style/assets/audio/beep-07a.mp3',
'/style/assets/audio/beep-07a.wav'
],
loop: false,
volume: 0.99,
onend: function() {
console.log('Finished!');
}
});
var sndExcl = new Howl({
src: [
'/style/assets/audio/button-42.mp3',
'/style/assets/audio/button-42.wav'
],
loop: false,
volume: 0.99
});
function playSound( t ){
if( SoundEnable ){
switch( t ){
case 1:{
sndBeep.play();
break;
};
default:{
sndExcl.play();
};
};
};
};
function doRefresh(){
window.location="/?t="+123;
};
function doLogout(){
//window.location = '/login.php?UID=1';
};
//https://www.javascripttutorial.net/web-apis/javascript-notification/
//https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web
function failureAJAXFunction( responce, opts ){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
//timelineObj = null;
};
playSound();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
doLogout();
};
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
SAID: SelectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
WID: x,
HEI: y
},
success: function( response, opts ){
doRefresh();
},
failure: failureAJAXFunction
});
};
function removeAllFromSite(){
Ext.Ajax.request({
url: '/lib/controller/resetAllSettings.php',
params: {
SAID: SelectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
doRefresh();
},
failure: failureAJAXFunction
});
};
function doCheckWindowSize(){
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;
};
};
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
};
};
var NotificationStack = null;
Ext.onReady(function(){
doCheckWindowSize();
NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
//window.onresize = doCheckWindowSize;
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;zcolor:#556677;font-size:24px;"><img src="/style/img/logo32.png">&nbsp;<?=$Labels->GetLabel('_APP_TITLE_');?></p>'
}]
},{
xtype: 'panel',
id:'btns',
region:'west',
bsaseCls:'x-plain',
title: '<?=$Labels->GetLabel('_SEC_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: '<?=$Labels->GetLabel('_DASHBOARD_');?>',
layout: 'vbox',
height: 120,
pack: 'center',
align : 'strech',
items:[{
xtype: 'button',
width: '100%',
id:'go_home',
text: '<?=$Labels->GetLabel('_GO_HOME_');?>',
handler: function( b, e ){
loadDashBoard();
}
},{
xtype: 'button',
width: '100%',
id:'go_monitor',
text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>',
handler: function( b, e ){
loadTimeLine();
}
},{
xtype: 'button',
width: '100%',
id:'go_out',
text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
handler: doLogout
}]
},{
title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
layout: 'vbox',
height: 120,
pack: 'center',
align : 'strech',
items:[{
xtype: 'button',
width: '100%',
id:'sys_edit',
text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
handler: function( b, e ){
loadSystemEditor();
}
},{
xtype: 'button',
width: '100%',
id:'map_edit',
text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
handler: function( b, e ){
loadLocationEditor();
}
},{
xtype: 'button',
width: '100%',
id:'logout',
text: '<?=$Labels->GetLabel('_CLEAR_SITE_');?>',
handler: removeAllFromSite
}]
},{
title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
html: '<p>Panel content!</p>'
}
<?php
if( $CUser->Data['access'] > 5 ){
?>,{
title: '<?=$Labels->GetLabel('_ADM_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: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
handler: function( b, e ){
loadAccessLog();
}
},{
xtype: 'button',
width: '100%',
id:'adm_servlog',
text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
handler: function( b, e ){
loadServerLog();
}
}]
}
<?php
};
?>
]
},{
xtype: 'panel',
region:'center',
margins: '5 5 5 0',
id: 'main_content',
title: '<?=$Labels->GetLabel('_SYS_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();
});