|
|
//<?php require_once('../../js_asm.php'); ?>
var monitoringViewLevel = 0;var mon_selectedEventId = 0;var mon_selectedPlatform = 0;var mon_selectedStation = 0;var mon_selectedTrack = 0;var mon_selectedModule = 0;var autoRiseEvent = true;var activeEvents = [];var expiredEvents = [];
function imgLoadEvent(){ alert('l c');};
function createEventTagContent( a ){ var gif='green_2.gif'; var add=','+a.status; if( a.status == 0 ){ gif='red_2.gif'; }; if( mon_selectedEventId == a.id ){ return '<div id="event_tag_'+a.id+'"class="evt_side_tag_selected" onclick="selectEvent('+a.id+add+');"><table width="100%" border=0><tr><td colspan=2><div class="evt_side_stname">'+a.station_name+'</div></td><td width="18px"><img src="/style/assets/'+gif+'"></td></tr><tr><td><div class="evt_side_plname">'+a.id+' '+a.platform_name+'</div></td><td colspan=2><div class="level_label_title">'+a.track_tag+'</div></td></tr></div>'; }; return '<div id="event_tag_'+a.id+'"class="evt_side_tag" onclick="selectEvent('+a.id+add+');"><table width="100%" border=0><tr><td colspan=2><div class="evt_side_stname">'+a.station_name+'</div></td><td width="18px"><img src="/style/assets/'+gif+'"></td></tr><tr><td><div class="evt_side_plname">'+a.id+' '+a.platform_name+'</div></td><td colspan=2><div class="level_label_title">'+a.track_tag+'</div></td></tr></div>';};
var GREEN_Icon = L.icon({ iconUrl: '/style/assets/igr.png', iconSize: [44, 44], iconAnchor: [22, 22], popupAnchor: [0, -22] //shadowUrl: 'leaf-shadow.png',
//shadowSize: [50, 64], // size of the shadow
//shadowAnchor: [4, 62], // the same for the shadow
});var RED_Icon = L.icon({ iconUrl: '/style/assets/ira.png', iconSize: [44, 44], iconAnchor: [22, 22], popupAnchor: [0, -22]});var REDB_Icon = L.icon({ iconUrl: '/style/assets/irabl.gif', iconSize: [44, 44], iconAnchor: [22, 22], popupAnchor: [0, -22]});var GREY_Icon = L.icon({ iconUrl: '/style/assets/ign.png', iconSize: [44, 44], iconAnchor: [22, 22], popupAnchor: [0, -22]});var GREYN_Icon = L.icon({ iconUrl: '/style/assets/ign.png', iconSize: [44, 44], iconAnchor: [22, 22], popupAnchor: [0, -22]});
function makePtzMove( me ){ var name = me.target.id; const myArray = name.split("_"); Ext.Ajax.request({ url: '/lib/controller/doModuleOperations.php', params: { UID: <?=$UserID;?>, SID: '<?=$Session;?>', OPID: 8, MID: myArray[3], MOV: myArray[2] }, failure: failureAJAXFunction });};
function makePtzStop( me ){ var name = me.target.id; const myArray = name.split("_"); Ext.Ajax.request({ url: '/lib/controller/doModuleOperations.php', params: { SITE: <?=$SiteID;?>, UID: <?=$UserID;?>, SID: '<?=$Session;?>', OPID: 8, MID: myArray[3], MOV: 0 }, failure: failureAJAXFunction });};
function makePtzHome( me ){ var name = me.target.id; const myArray = name.split("_"); Ext.Ajax.request({ url: '/lib/controller/doModuleOperation.php', params: { SITE: <?=$SiteID;?>, UID: <?=$UserID;?>, SID: '<?=$Session;?>', OPID: 9, MID: myArray[3], MOV: 0 }, failure: failureAJAXFunction });};
var fsDrawID = 0;function exitFullScreen( evt ){ if( document.fullscreenElement ){ } else { if( fsDrawID ){ console.log("Leaving fullscreen mode."); }; };};
function fullScreen( id = '' ){ if( id == '' || document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement ){ if( document.exitFullscreen ){ document.exitFullscreen(); }else if( document.mozCancelFullScreen ){ document.mozCancelFullScreen(); }else if( document.webkitExitFullscreen ){ document.webkitExitFullscreen(); }else if( document.msExitFullscreen ){ document.msExitFullscreen(); }; if( fsDrawID ){ console.log('resized'); }; }else{ var element = document.getElementById( id ); if( element.requestFullscreen ){ element.requestFullscreen(); }else if( element.mozRequestFullScreen ){ element.mozRequestFullScreen(); }else if( element.webkitRequestFullscreen ){ element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); }else if( element.msRequestFullscreen ){ element.msRequestFullscreen(); }; };};
function loadStationViewEvt( e ){ loadStationView( e.target.options.mycustomid );};
function loadStationView( STT, buba ){ if( buba == undefined ){ autoRiseEvent = false; } else { autoRiseEvent = buba; }; if( mon_selectedEventId ) unselectEvent(); changeContent( 1, 1, STT ); updateUserContent(); Ext.Ajax.request({ url: '/lib/controller/getMonitoringStationView.php', params: { STT: STT, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 1; Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); if( data.pids != undefined ){ if( data.pids.length > 0 ){ //for( i=0; i<data.pids.length; i++ )correctPlatformView( data.pids[i] );
}; }; fetchStatus(); } else { if( data.status == 'steight' ){ loadPlatformView( data.next_id ); }; }; }, failure: failureAJAXFunction }); return;};
function correctPlatformView( id ){ var pp = Ext.getCmp('plat_panel_'+id); var pawi = pp.getWidth() / 70; var tt = document.getElementById('plat_table_'+id ); if( tt != null ){ tt.width = 36.5 * pawi +'px'; }; tt = Ext.getCmp('plat_schematics_'+id ); if( tt != null ){ tt.setHeight( 18 * pawi + 2 * 56 ); }; tt = document.getElementById('plat_video_'+id+'_'+pp.getComponent(0).custom); if( tt != null ){ tt.style.width = 16 * pawi +'px'; tt.style.height = 9 * pawi +'px'; }; tt = document.getElementById('plat_video_'+id+'_'+pp.getComponent(2).custom); if( tt != null ){ tt.style.width = 16 * pawi +'px'; tt.style.height = 9 * pawi +'px'; }; tt = document.getElementById('plat_video_'+id+'_'+pp.getComponent(3).custom); if( tt != null ){ tt.style.width = 16 * pawi +'px'; tt.style.height = 9 * pawi +'px'; }; tt = document.getElementById('plat_video_'+id+'_'+pp.getComponent(4).custom); if( tt != null ){ tt.style.width = 16 * pawi +'px'; tt.style.height = 9 * pawi +'px'; };};
function correctModuleView( id ){ var juja = Ext.getCmp('module_panel_'+id ); var pawi = juja.getWidth() / 70; var tt = Ext.getCmp('module_schematics_'+id); tt.setWidth( 20+35 * pawi ); tt.setHeight( 38+19 * pawi ); tt = document.getElementById('plat_video_div_'+id ); tt.style.width = 32 * pawi +'px'; tt.style.height = 18 * pawi +'px'; pawi = Ext.getCmp('plat_video_panel_'+id); pawi.setWidth( 32+32 * pawi); pawi.setHeight( 32+ 18 * pawi);};
function addSetSessionUI( session_id ){ Ext.Ajax.request({ url: '/lib/controller/doSessionOperations.php', params: { SESSION: session_id, OPID: 2, OPAR: 0, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ var tv = Ext.getCmp('trx_view'); if( tv != undefined ){ var tt = Ext.getCmp('sets_ui'); if( tt != undefined ){ tv.remove( tt ); }; tv.add( Ext.decode( data.content ) ); tv.doLayout(); }; }; }, failure: failureAJAXFunction });};
function doSessionOperation( session_id, op, param, reload ){ Ext.Ajax.request({ url: '/lib/controller/doSessionOperations.php', params: { SESSION: session_id, OPID: op, OPAR: param, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ if( reload ){ }; }; }, failure: failureAJAXFunction });};
function loadPlatformView( pid, buba ){ if( buba == undefined ){ autoRiseEvent = false; } else { autoRiseEvent = buba; }; if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); mon_selectedPlatform = pid; changeContent( 1, 2, pid ); updateUserContent(); Ext.Ajax.request({ url: '/lib/controller/getMonitoringPlatformView.php', params: { PID: mon_selectedPlatform, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 2; Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); correctPlatformView( data.pid ); fetchStatus(); }; }, failure: failureAJAXFunction }); return;};function loadTrackViewBySession( session_id ){ autoRiseEvent = false; mSvgElements = []; Ext.Ajax.request({ url: '/lib/controller/getMonitoringTrackView.php', params: { SESSION: session_id, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 3; mon_selectedTrack = data.track_id; changeContent( 1, 3, mon_selectedTrack ); updateUserContent(); Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); fetchStatus(); }; }, failure: failureAJAXFunction }); return;};function loadTrackView( tid ){ autoRiseEvent = false; mon_selectedTrack = tid; changeContent( 1, 3, mon_selectedTrack ); updateUserContent(); mSvgElements = []; Ext.Ajax.request({ url: '/lib/controller/getMonitoringTrackView.php', params: { TID: mon_selectedTrack, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 3; mon_selectedPlatform = data.platform_id; mon_selectedStation = data.station_id; Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); fetchStatus(); }; }, failure: failureAJAXFunction }); return;};
function loadModuleView( pid, mid ){ autoRiseEvent = false; if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); changeContent( 1, 4, pid+'-'+mid ); updateUserContent(); Ext.Ajax.request({ url: '/lib/controller/getMonitoringModuleView.php', params: { PID: pid, MID: mid, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 4; Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); correctModuleView( mid ); fetchStatus(); }; }, failure: failureAJAXFunction }); return;};
function loadMapView(){ autoRiseEvent = false; if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); Ext.Ajax.request({ url: '/lib/controller/getMonitoringMapView.php', params: { UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 0; Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); }; }, failure: failureAJAXFunction }); return;};
var monitoring_map = null;var c_icon = null;var stationMarkers = [];
function initMonitoringMap( map_id, x, y ){ var mapLayers = []; if( monitoring_map != null ){ monitoring_map.off(); monitoring_map.remove(); monitoring_map = null; }; monitoring_map = L.map( map_id,{ crs: L.CRS.Simple, attributionControl: false, preferCanvas: true, zoomControl: true, center: [x,y], zoom: 0, minZoom: -3, maxZoom: 0, keyboard: false }); var bounds = [[SCHEMATIC_SET.bounds_lx,SCHEMATIC_SET.bounds_ly], [SCHEMATIC_SET.bounds_rx,SCHEMATIC_SET.bounds_ry]]; var image = L.imageOverlay( SCHEMATIC_SET.layer_url, bounds ).addTo( monitoring_map ); Ext.Ajax.request({ url: '/lib/controller/listStations.php', params: { UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ for( i=0; i < data.stations.length; i++ ){ stationMarkers[ data.stations[i].id ] = L.marker([data.stations[i].y, data.stations[i].x], { draggable: false, icon: GREY_Icon, zIndexOffset: 1000, mycustomid: data.stations[i].id } ).addTo( monitoring_map ).on('click', loadStationViewEvt );; }; }; // Ready -> Start Getting data
fetchStatus(); }, failure: failureAJAXFunction });};
function getBackToMap(){ autoRiseEvent = true; changeContent( 1, 0 ); updateUserContent(); loadMapView();};
function initMonitoring( x, y ){ if( tlInterval!= null ){ window.clearInterval( tlInterval ); tlInterval = null; timelineObj = null; }; var tP = Ext.getCmp('left_side_menu'); tP.removeAll( true ); tP.add({ layout:'vbox', frame: false, border: false, items:[{ width: "100%", html: '<div class="mon_side_tag">Active Alerts</div>' },{ id: 'sme_inner', layout:'vbox', width: "100%", height: PanelH/2, frame: false, border: false, items:[] },{ width: "100%", html: '<div class="mon_side_tag">Expired Alerts</div>' },{ id: 'sme_outer', layout:'vbox', width: "100%", height: PanelH/2, frame: false, border: true, items:[] }] }); tP.doLayout(); monitoringViewLevel = contentView.l[1].v; switch( monitoringViewLevel ){ case 0:{ loadMapView(); break; }; case 1:{ loadStationView( parseInt( contentView.l[1].p ), autoRiseEvent ); break; }; case 2:{ loadPlatformView( parseInt( contentView.l[1].p ), autoRiseEvent ); break; }; case 3:{ loadTrackView( parseInt( contentView.l[1].p ), autoRiseEvent ); break; }; case 4:{ var tA = contentView.l[1].p.split('-'); a = parseInt( tA[0] ); b = parseInt( tA[1] ); loadModuleView( a, b ); break; }; case 5:{ selectEvent( parseInt( contentView.l[1].p ), true ); break; }; }; Ext.getCmp('main_content').doLayout();};
var statusLTS = 0;var statusLID = 0;
function manageSideTags( tag_area, buba ){ var tP = Ext.getCmp( tag_area ); if( tP != undefined ){ if( buba != undefined ){ if( buba.length ){ var idx_a = 0; //alert( tag_area + ' has '+tP.items.getCount() );
while( a = tP.getComponent( idx_a ) ){ var f=false; for( var zz=0; zz < buba.length; zz++ ){ if( a.getId() == 'tag_panel_'+buba[zz].id ){ f = true; break; }; }; if( !f ) { tt--; tP.remove( a, true ); } else idx_a++; }; tP.doLayout(); var aa = tP.items.getRange(); var tt = aa.length; for( var zz=0; zz < buba.length; zz++ ){ var f=false; for( var i=0; i < aa.length; i++ ){ if( aa[i].getId() == 'tag_panel_'+buba[zz].id ){ f = true; break; }; }; if( !f ){ tP.insert( 0,{ id: 'tag_panel_'+buba[zz].id, width: "100%", html: createEventTagContent( buba[zz] ) }); tt++; }; if( tt > 32 ){ tP.remove( aa[31], true ); tt--; }; }; if( tag_area == 'sme_inner' ){ // Active
activeEvents = []; for( var zz=0; zz < buba.length; zz++ ) activeEvents[zz]={id: buba[zz].id}; } else { // Expired
expiredEvents = []; for( var zz=0; zz < buba.length; zz++ ) expiredEvents[zz]={id: buba[zz].id}; }; } else { tP.removeAll( true ); if( tag_area == 'sme_inner' ){ // Active
activeEvents = []; } else { // Expired
expiredEvents = []; }; }; } else { tP.removeAll( true ); if( tag_area == 'sme_inner' ){ // Active
activeEvents = []; } else { // Expired
expiredEvents = []; }; }; tP.doLayout(); };};
var mSvgElements = [];
function fetchStatus(){ if( tlInterval!= null ){ window.clearTimeout( tlInterval ); tlInterval = null; }; switch(monitoringViewLevel){ case 0:{ var ll = monitoring_map.getCenter(); CX = ll.lat; CY = ll.lng; ajax_params = { VLVL: monitoringViewLevel, UID: <?=$UserID;?>, SID: '<?=$Session;?>', LTS: statusLTS, LID: statusLID, MX: CX, MY: CY }; break; }; case 1:{ ajax_params = { VLVL: monitoringViewLevel, UID: <?=$UserID;?>, SID: '<?=$Session;?>', LTS: statusLTS, LID: statusLID, SSID: mon_selectedStation }; break; }; case 2:{ ajax_params = { VLVL: monitoringViewLevel, UID: <?=$UserID;?>, SID: '<?=$Session;?>', PID: mon_selectedPlatform, LTS: statusLTS, LID: statusLID }; break; }; case 3:{ ajax_params = { VLVL: monitoringViewLevel, UID: <?=$UserID;?>, SID: '<?=$Session;?>', TID: mon_selectedTrack, LTS: statusLTS, LID: statusLID }; break; }; case 4:{ ajax_params = { VLVL: monitoringViewLevel, UID: <?=$UserID;?>, SID: '<?=$Session;?>', MID: mon_selectedModule, LTS: statusLTS, LID: statusLID }; break; }; case 5:{ ajax_params = { VLVL: monitoringViewLevel, UID: <?=$UserID;?>, SID: '<?=$Session;?>', SESSION: mon_selectedEventId, LTS: statusLTS, LID: statusLID }; break; }; }; Ext.Ajax.request({ url: '/lib/controller/getStatus.php', params: ajax_params, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ if( monitoringViewLevel == data.VLVL ){ statusLTS = data.LTS; //debugger;
switch( monitoringViewLevel ){ case 0:{ for( i=0; i < data.station_ids.length; i++ ){ switch( data.station_status[i] ){ case 0: { if( stationMarkers[data.station_ids[i]].options.icon != GREY_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREY_Icon ); break; }; case 1: { if( stationMarkers[data.station_ids[i]].options.icon != GREEN_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREEN_Icon ); break; }; case 2: { if( stationMarkers[data.station_ids[i]].options.icon != GREY_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREY_Icon ); break; }; case 3: { if( ( Math.floor(Date.now() / 1000) % 2 ) == 0 ) { if( stationMarkers[data.station_ids[i]].options.icon != GREEN_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREEN_Icon ); } else { if( stationMarkers[data.station_ids[i]].options.icon != RED_Icon ) stationMarkers[data.station_ids[i]].setIcon( RED_Icon ); }; break; }; case 4: { if( stationMarkers[data.station_ids[i]].options.icon != REDB_Icon ) stationMarkers[data.station_ids[i]].setIcon( REDB_Icon ); break; }; }; }; break; }; case 2:{ if( data.modules != undefined ){ for( var i=0; i< data.modules.length; i++){ if( data.modules[i].status > 0 ){ var tt = document.getElementById('plat_video_'+mon_selectedPlatform+'_'+data.modules[i].id ); if( tt.src != data.modules[i].img ) tt.src = data.modules[i].img; tt = document.getElementById('plat_status_'+mon_selectedPlatform+'_'+data.modules[i].id ); switch( data.modules[i].status ){ case 1: tt.innerHTML='<img src="/style/assets/bul_gray.png">'; break; case 2: tt.innerHTML='<img src="/style/assets/bul_green.png">'; break; case 3: tt.innerHTML='<img src="/style/assets/bul_green_rst.png">'; break; }; }; }; }; if( data.events != undefined ){ }; if( data.scada != undefined ){ }; break; }; case 3:{ if( data.active_session_id != undefined ){ if( mon_selectedEventId != data.active_session_id ){ mon_selectedEventId = data.active_session_id; for( var zz=0; zz< activeEvents.length; zz++ ){ var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); if( tP != undefined ){ tP.className =''; if( activeEvents[zz].id == mon_selectedEventId ){ tP.classList.add("evt_side_tag_selected"); } else { tP.classList.add("evt_side_tag"); }; }; }; addSetSessionUI( mon_selectedEventId ); }; }; if( data.modules != undefined ){ for( var i=0; i< data.modules.length; i++){ if( data.modules[i].status > 0 ){ var tt = document.getElementById('plat_video_img_'+data.modules[i].id ); if( tt.src != data.modules[i].img ) tt.src = data.modules[i].img; tt = document.getElementById('plat_status_'+mon_selectedPlatform+'_'+data.modules[i].id ); var tt = document.getElementById('cam_ctrl_'+data.modules[i].id ); if( data.modules[i].status > 1 ) { if( tt.style.display != 'block' )tt.style.display = 'block'; } else { if( tt.style.display != 'none' )tt.style.display = 'none'; }; }; }; }; if( data.events != undefined ){ var sid = data.events.length - 1; if( sid > -1 ){ for( var i=0; i< max_grad_levels; i++ ){ var cid = sid-i; var csize = getSize( i ); //debugger;
if( typeof mSvgElements[i] === 'undefined') { if( cid > -1 ){ var svgns = "http://www.w3.org/2000/svg"; mSvgElements[i] = document.createElementNS(svgns, 'rect'); mSvgElements[i].setAttribute('x', data.events[cid].x+'%'); mSvgElements[i].setAttribute('y', ''+(50+(100-csize)/2) ); mSvgElements[i].setAttribute('height', ''+csize); mSvgElements[i].setAttribute('width', ''+csize); mSvgElements[i].setAttribute('fill', '#FF0000'+getTransperecy(i)); var tt = document.getElementById('svgTrackMap'); var zz = document.getElementById('scheme_anch'); tt.insertBefore( mSvgElements[i], zz ); //document.getElementById('svgTrackMap').appendChild(this.mSvgElements[i]);
}; } else { if( cid > -1 ){ mSvgElements[i].setAttribute('x', data.events[cid].x+'%'); mSvgElements[i].setAttribute('y', ''+(50+(100-csize)/2) ); mSvgElements[i].setAttribute('height', ''+csize); mSvgElements[i].setAttribute('width', ''+csize); mSvgElements[i].setAttribute('fill', '#FF0000'+getTransperecy(i) ); } else { mSvgElements[i].setAttribute('fill', '#FF000000'); }; }; }; } else for( var i=0; i< max_grad_levels; i++ ) if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000'); }; if( data.scada != undefined ){ }; break; }; }; manageSideTags('sme_inner', data.actual ); manageSideTags('sme_outer', data.expired ); }; }; tlInterval = window.setTimeout( fetchStatus, 333, selectedSite ); }, failure: failureAJAXFunction }); };
function selectEvent( ii, bb ){ mon_selectedEventId = ii; if( tlInterval!= null ){ window.clearTimeout( tlInterval ); tlInterval = null; }; for( var zz=0; zz< expiredEvents.length; zz++ ){ var tP = document.getElementById('event_tag_'+expiredEvents[zz].id ); if( tP != undefined ){ tP.className =''; if( expiredEvents[zz].id == mon_selectedEventId ){ tP.classList.add("evt_side_tag_selected"); } else { tP.classList.add("evt_side_tag"); }; }; }; for( var zz=0; zz< activeEvents.length; zz++ ){ var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); if( tP != undefined ){ tP.className =''; if( activeEvents[zz].id == mon_selectedEventId ){ tP.classList.add("evt_side_tag_selected"); } else { tP.classList.add("evt_side_tag"); }; }; }; if( bb ){ loadMonitoringSessionView( ii ); } else { loadTrackViewBySession( ii ); }; };
function setSessionStatus( a , b ){ Ext.Ajax.request({ url: '/lib/controller/doSessionOperations.php', params: { SESSION: a, OPID: 2, OPAR: b, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ var tv = Ext.getCmp('trx_view'); if( tv != undefined ){ var tt = Ext.getCmp('sets_ui'); if( tt != undefined ){ tv.remove( tt ); }; tv.add( Ext.decode( data.content ) ); tv.doLayout(); }; }; }, failure: failureAJAXFunction });};
function unselectEvent( ii ){ mon_selectedEventId = 0; for( var zz=0; zz< activeEvents.length; zz++ ){ var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); if( tP != undefined ){ tP.className =''; tP.classList.add("evt_side_tag"); }; }; for( var zz=0; zz< expiredEvents.length; zz++ ){ var tP = document.getElementById('event_tag_'+expiredEvents[zz].id ); if( tP != undefined ){ tP.className =''; tP.classList.add("evt_side_tag"); }; };};
function loadMonitoringSessionView( session_id ){ autoRiseEvent = false; mon_selectedEventId = session_id; changeContent( 1, 5, mon_selectedEventId ); updateUserContent(); Ext.Ajax.request({ url: '/lib/controller/getMonitoringSessionView.php', params: { SESSION: mon_selectedEventId, UID: <?=$UserID;?>, SID: '<?=$Session;?>' }, success: function( response, opts ){ var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ monitoringViewLevel = 5; if( mSesPlay!= null ) { mSesPlay.dispose(); mSesPlay = null; }; Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').doLayout(); mSesPlay = new argusSessionPlayer( mon_selectedEventId ); fetchStatus(); }; }, failure: failureAJAXFunction });};
|