|
|
//<?php require_once('../../js_asm.php'); ?>
var winW = <?=intval($CUser->Data['width']);?>;var winH = <?=intval($CUser->Data['height']);?>;var initView = <?=intval($CUser->Data['last_content_view']);?>;var PanelW = winW;var PanelH = winH-90;var SelectedSite = <?=$SiteID;?>;var SettingsLidar3D = null;var SelectedNodeID = 0;var StatusTS = -1;var LoadTS = <?=time();?>;var SoundEnable = <?=intval($CUser->Data['sound_enable']);?>;var nodeDashboardStatuses = new Array();var nodeTHREEviewers = new Array();var nodeTHREEanimationId = 0;
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';};
function failureAJAXFunction( responce, opts ){ if( tlInterval!= null ){ window.clearInterval( tlInterval ); tlInterval = 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: { UID: <?=$UserID;?>, SID: '<?=$Session;?>', SSS: 15, WID: x, HEI: y }, success: function( response, opts ){ doRefresh(); }, failure: failureAJAXFunction });};
function setUserContent( c_id ){ Ext.Ajax.request({ url: '/lib/controller/updateUserSettings.php', params: { UID: <?=$UserID;?>, SID: '<?=$Session;?>', SSS: 26, CID: c_id }, failure: failureAJAXFunction });};
var gSessionValidatorInterval = null;
function sessionValidator(){ Ext.Ajax.request({ url: '/lib/controller/updateUserSssion.php', params: { UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( !data.sessionIsValid ){ playSound(); Ext.Msg.show({ title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>', msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>', buttons: Ext.Msg.OK, icon: Ext.MessageBox.INFO }); doLogout(); }; }, 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(); gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 ); 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"> <?=$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//,
//activeOnTop: true
}, items: [{ title: '<?=$Labels->GetLabel('_DASHBOARD_');?>', layout: 'vbox', height: 120, pack: 'center', align : 'strech', collapsed: <?=($CUser->Data['last_content_view']<3)?'false':'true';?>, items:[{ xtype: 'button', width: '100%', id:'go_home', text: '<?=$Labels->GetLabel('_GO_HOME_');?>', toggled: (initView == 0 ), handler: loadDashBoard },{ xtype: 'button', width: '100%', id:'go_monitor', text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>', toggled: (initView == 1 ), handler: loadMonitoring },{ xtype: 'button', width: '100%', id:'go_archive', text: '<?=$Labels->GetLabel('_EVT_ARCHIVE_');?>', toggled: (initView == 2 ), handler: loadArchive },{ 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', collapsed: <?=($CUser->Data['last_content_view']>2)?'false':'true';?>, items:[{ xtype: 'button', width: '100%', id:'sys_edit', text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>', toggled: (initView == 3 ), handler: loadSystemEditor },{ xtype: 'button', width: '100%', id:'map_edit', text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>', toggled: (initView == 4 ), handler: loadLocationEditor },{ xtype: 'button', width: '100%', id:'soft_update', text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>', toggled: (initView == 5 ), handler: loadUpgradeManagmenet }] },{ 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: '' }, listeners:{ drop: function( a ){ updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position ); } } }] }] }); switch( <?=intval($CUser->Data['last_content_view']);?> ){ case 0: loadDashBoard(); break; case 1: loadMonitoring(); break; case 2: loadArchive(); break; case 3: loadSystemEditor(); break; case 4: loadLocationEditor(); break; case 5: loadUpgradeManagmenet(); break; default: loadDashBoard(); };});
|