// var winW = Data['width']);?>; var winH = Data['height']);?>; var initView = Data['last_content_view']);?>; var PanelW = winW; var PanelH = winH-90; var SelectedSite = ; var SettingsLidar3D = null; var SelectedNodeID = 0; var StatusTS = -1; var LoadTS = ; var SoundEnable = 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'; }; //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:'GetLabel('_REQ_FAILURE_');?>', msg: '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: , SID: '', 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: , SID: '', SSS: 26, CID: c_id }, failure: failureAJAXFunction }); }; function removeAllFromSite(){ Ext.Msg.show({ title:'GetLabel('_CLEAR_SITE_');?>', msg: 'GetLabel('_SITE_DEL_ALL_ABO_');?>', buttons: Ext.Msg.YESNO, icon: Ext.MessageBox.WARNING, fn: function(btn, text){ if (btn == 'yes'){ Ext.Ajax.request({ url: '/lib/controller/resetAllSettings.php', params: { SAID: SelectedSite, UID: , SID: '' }, 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: '

 GetLabel('_APP_TITLE_');?>

' }] },{ xtype: 'panel', id:'btns', region:'west', bsaseCls:'x-plain', title: '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: 'GetLabel('_DASHBOARD_');?>', layout: 'vbox', height: 120, pack: 'center', align : 'strech', collapsed: Data['last_content_view']<2)?'false':'true';?>, items:[{ xtype: 'button', width: '100%', id:'go_home', text: 'GetLabel('_GO_HOME_');?>', toggled: (initView == 0 ), handler: function( b, e ){ loadDashBoard(); } },{ xtype: 'button', width: '100%', id:'go_monitor', text: 'GetLabel('_EVT_MONITOR_');?>', handler: function( b, e ){ loadMonitoring(); } },{ xtype: 'button', width: '100%', id:'go_archive', text: 'GetLabel('_EVT_ARCHIVE_');?>', handler: function( b, e ){ loadArchive(); } },{ xtype: 'button', width: '100%', id:'go_out', text: 'GetLabel('_LOGOUT_');?>', handler: doLogout }] },{ title: 'GetLabel('_SYS_SETTINGS_');?>', layout: 'vbox', height: 120, pack: 'center', align : 'strech', collapsed: Data['last_content_view']>1)?'false':'true';?>, items:[{ xtype: 'button', width: '100%', id:'sys_edit', text: 'GetLabel('_EDT_CONNECTIONS_');?>', handler: function( b, e ){ loadSystemEditor(); } },{ xtype: 'button', width: '100%', id:'map_edit', text: 'GetLabel('_EDT_LOCATIONS_');?>', handler: function( b, e ){ loadLocationEditor(); } },{ xtype: 'button', width: '100%', id:'logout', text: 'GetLabel('_CLEAR_SITE_');?>', handler: removeAllFromSite }] },{ title: 'GetLabel('_PROF_SETTINGS_');?>', html: '

Panel content!

' } Data['access'] > 5 ){ ?>,{ title: 'GetLabel('_ADM_SETTINGS_');?>', items:[{ xtype: 'button', width: '100%', id:'adm_acc', text: 'GetLabel("_USERS_MNGMT_");?>', handler: function( b, e ){ loadUserEditor(); } },{ xtype: 'button', width: '100%', id:'adm_acclog', text: 'GetLabel('_ACC_LOG_');?>', handler: function( b, e ){ loadAccessLog(); } },{ xtype: 'button', width: '100%', id:'adm_servlog', text: 'GetLabel('_SERV_LOG_');?>', handler: function( b, e ){ loadServerLog(); } }] } ] },{ xtype: 'panel', region:'center', margins: '5 5 5 0', id: 'main_content', title: '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 ); } } }] }] }); loadDashBoard(); });