Browse Source

AGP send

master
Evgeny Gagua 12 months ago
parent
commit
9a5dba52d1
  1. 2
      lib/1.json
  2. 1
      lib/4.json
  3. 43
      lib/controller/doApplicationOperation.php
  4. 16
      lib/controller/getApplicationSettings.php
  5. 9
      lib/controller/getHistoryMapView.php
  6. 26
      lib/controller/getHistorySettings.php
  7. 2
      lib/controller/getMediaSettings.php
  8. 2
      lib/controller/getMonitoringSessionView.php
  9. 2
      lib/controller/getMonitoringTrackView.php
  10. 140
      lib/controller/getProfileSettings.php
  11. 22
      lib/controller/getStatus.php
  12. 14
      lib/controller/updateUserSettings.php
  13. 50
      lib/javascript/jsapi_dynamic/argus_main.js
  14. 376
      lib/javascript/jsapi_dynamic/argus_monitoring.js
  15. 1
      lib/javascript/jsapi_dynamic/argus_reports.js
  16. 94
      lib/javascript/jsapi_dynamic/argus_settings.js
  17. 14
      lib/php/argus/server.php
  18. 18
      lib/php/argus/templates.php
  19. 8
      lib/php/ui/UI_functions.php
  20. 49
      style/style.css

2
lib/1.json
File diff suppressed because it is too large
View File

1
lib/4.json
File diff suppressed because it is too large
View File

43
lib/controller/doApplicationOperation.php

@ -13,6 +13,49 @@
case 1:{ case 1:{
$QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`,`param`) VALUES(250,0,'')"; $QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`,`param`) VALUES(250,0,'')";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
break;
};
case 2:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `histo_limit`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 3:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `histo_days`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 4:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `histo_perc`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 5:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `histo_megs`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 6:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `session_end`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 7:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `encoder_limit`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
}; };
case 41:{ case 41:{
$P = intval( $_POST['OPCODE'] ); $P = intval( $_POST['OPCODE'] );

16
lib/controller/getApplicationSettings.php

@ -15,7 +15,7 @@
items:[{ items:[{
xtype: 'form', xtype: 'form',
labelAlign: 'right', labelAlign: 'right',
labelWidth: 180,
labelWidth: 250,
//height: PanelH - 30, //height: PanelH - 30,
items:[{ items:[{
xtype:'panel', xtype:'panel',
@ -46,7 +46,6 @@
loadHelpTopic( 'application_op_small', 32 ); loadHelpTopic( 'application_op_small', 32 );
}, },
select: function( t, r, i ){ select: function( t, r, i ){
//alert('buba');
doApplicationOperation( 41, r.data.cid ); doApplicationOperation( 41, r.data.cid );
} }
}, },
@ -66,7 +65,7 @@
mode: 'local', mode: 'local',
store: new Ext.data.ArrayStore({ store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'], fields: ['cid', 'cnam'],
data: [['1',"1 Minute"], ['2',"2 Minutes"], ['3',"3 Minutes"], ['4',"4 Minutes"],['5',"5 Minutes"]]
data: [['1',"30 Seconds"],['2',"1 Minute"], ['3',"2 Minutes"], ['4',"3 Minutes"], ['5',"4 Minutes"],['6',"5 Minutes"]]
}), }),
valueField: 'cid', valueField: 'cid',
displayField: 'cnam', displayField: 'cnam',
@ -75,11 +74,10 @@
loadHelpTopic( 'application_op_small', 33 ); loadHelpTopic( 'application_op_small', 33 );
}, },
select: function( t, r, i ){ select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
doApplicationOperation( 6, r.data.cid );
} }
}, },
value: 1//'{$CS['menc_container']}'
value: '{$CS['session_end']}'
},{ },{
xtype: 'spacer', xtype: 'spacer',
height: 10 height: 10
@ -104,8 +102,7 @@
loadHelpTopic( 'application_op_small', 34 ); loadHelpTopic( 'application_op_small', 34 );
}, },
select: function( t, r, i ){ select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
doApplicationOperation( 7, r.data.cid );
} }
}, },
value: '{$CS['encoder_limit']}' value: '{$CS['encoder_limit']}'
@ -123,7 +120,6 @@
loadHelpTopic( 'application_op_small', 35 ); loadHelpTopic( 'application_op_small', 35 );
}, },
change: function( t, r, i ){ change: function( t, r, i ){
//alert('buba');
doApplicationOperation( 43, r ); doApplicationOperation( 43, r );
} }
} }
@ -150,7 +146,6 @@
loadHelpTopic( 'application_op_small', 36 ); loadHelpTopic( 'application_op_small', 36 );
}, },
select: function( t, r, i ){ select: function( t, r, i ){
//alert('buba');
doApplicationOperation( 44, r.data.cid, true ); doApplicationOperation( 44, r.data.cid, true );
} }
}, },
@ -178,7 +173,6 @@
loadHelpTopic( 'application_op_small', 37 ); loadHelpTopic( 'application_op_small', 37 );
}, },
select: function( t, r, i ){ select: function( t, r, i ){
//alert('buba');
doApplicationOperation( 45, r.data.cid, true ); doApplicationOperation( 45, r.data.cid, true );
} }
}, },

9
lib/controller/getHistoryMapView.php

@ -18,15 +18,6 @@
enableToggle: true, enableToggle: true,
pressed: true, pressed: true,
allowDepress: false allowDepress: false
},'->',{
xtype: 'button',
id: 'aer_button',
text: 'Event Auto Rise',
enableToggle: true,
pressed: autoRiseEvent,
handler: function( t ){
autoRiseEvent = t.pressed;
}
}], }],
items: [{ items: [{
xtype: 'panel', xtype: 'panel',

26
lib/controller/getHistorySettings.php

@ -48,11 +48,10 @@
displayField: 'cnam', displayField: 'cnam',
listeners:{ listeners:{
focus: function( t ){ focus: function( t ){
loadHelpTopic( 'history_op_small', 32 );
loadHelpTopic( 'history_op_small', 4 );
}, },
select: function( t, r, i ){ select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
doApplicationOperation( 2, r.data.cid );
} }
}, },
value: '{$CS['histo_limit']}' value: '{$CS['histo_limit']}'
@ -65,11 +64,10 @@
fieldLabel: '{$Labels->GetLabel('_HAR_DAYS_')}', fieldLabel: '{$Labels->GetLabel('_HAR_DAYS_')}',
listeners:{ listeners:{
focus: function( t ){ focus: function( t ){
loadHelpTopic( 'history_op_small', 33 );
loadHelpTopic( 'history_op_small', 5 );
}, },
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
change: function( t, r, i ){
doApplicationOperation( 3, r );
} }
}, },
value: '{$CS['histo_days']}' value: '{$CS['histo_days']}'
@ -82,11 +80,10 @@
fieldLabel: '{$Labels->GetLabel('_HAR_FREE_PERC_')}', fieldLabel: '{$Labels->GetLabel('_HAR_FREE_PERC_')}',
listeners:{ listeners:{
focus: function( t ){ focus: function( t ){
loadHelpTopic( 'history_op_small', 33 );
loadHelpTopic( 'history_op_small', 6 );
}, },
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
change: function( t, r, i ){
doApplicationOperation( 4, r );
} }
}, },
value: '{$CS['histo_perc']}' value: '{$CS['histo_perc']}'
@ -99,11 +96,10 @@
fieldLabel: '{$Labels->GetLabel('_HAR_FREE_MEGS_')}', fieldLabel: '{$Labels->GetLabel('_HAR_FREE_MEGS_')}',
listeners:{ listeners:{
focus: function( t ){ focus: function( t ){
loadHelpTopic( 'history_op_small', 33 );
loadHelpTopic( 'history_op_small', 7 );
}, },
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
change: function( t, r, i ){
doApplicationOperation( 5, r );
} }
}, },
value: '{$CS['histo_megs']}' value: '{$CS['histo_megs']}'

2
lib/controller/getMediaSettings.php

@ -15,7 +15,7 @@
items:[{ items:[{
xtype: 'form', xtype: 'form',
labelAlign: 'right', labelAlign: 'right',
labelWidth: 180,
labelWidth: 250,
//height: PanelH - 30, //height: PanelH - 30,
items:[{ items:[{
xtype:'panel', xtype:'panel',

2
lib/controller/getMonitoringSessionView.php

@ -115,7 +115,7 @@
if( $CS['status'] >= $S['lvl'] ){ if( $CS['status'] >= $S['lvl'] ){
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>"; $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
} else { } else {
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']});\" >{$S['label']}</span></td>";
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']}, true );\" >{$S['label']}</span></td>";
}; };
}; };
$PLAT_PARTS[] =<<<DATA_BOUNDARY $PLAT_PARTS[] =<<<DATA_BOUNDARY

2
lib/controller/getMonitoringTrackView.php

@ -122,7 +122,7 @@
if( $CS['status'] >= $S['lvl'] ){ if( $CS['status'] >= $S['lvl'] ){
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>"; $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
} else { } else {
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']});\" >{$S['label']}</span></td>";
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']}, false );\" >{$S['label']}</span></td>";
}; };
}; };
}; };

140
lib/controller/getProfileSettings.php

@ -0,0 +1,140 @@
<?php
require_once('../ajax_asm.php');
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
if( $UID > 1 ){
ob_start();
$ZIGA = array();
foreach( $Site_Languages as $SL ) $ZIGA[] = "[{$SL['id']},'{$SL['name']}']";
$LAN_DATA = implode(',',$ZIGA );
$CUser->Data['ss_timeout'] = $CUser->Data['ss_timeout']/1000;
$BASIC_CONTENT=<<<DATA_BOUNDARY
{
xtype: 'panel',
layout: 'hbox',
items:[{
xtype: 'form',
labelAlign: 'right',
labelWidth: 250,
width: '50%',
height: PanelH - 16,
items:[{
xtype:'panel',
border: false,
frame: false,
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="appis_logo_img"></div></td><td valign="middle">User Profile Settings</td></tr><tr><td colspan=2></td></tr></table><br/>'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
id: 'pf_language',
fieldLabel: '{$Labels->GetLabel('_LANGUAGE_')}',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [{$LAN_DATA}]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'profile_op_small', 1 );
},
select: function( t, r, i ){
doUserOperation( 21, r.data.cid, true );
}
},
value: '{$CUser->Data['language']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'numberfield',
fieldLabel: 'Screen Saver Time',
editable: true,
width: 250,
value: '{$CUser->Data['ss_timeout']}',
listeners:{
focus: function( t ){
loadHelpTopic( 'profile_op_small', 2 );
},
change: function( t, r, i ){
doUserOperation( 28, r, true );
}
}
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
id: 'pf_theme',
fieldLabel: '{$Labels->GetLabel('_UI_THEME_')}',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [[0,'Dark'],[1,'Gray'],[2,'Blue'],[3,'Default']]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'profile_op_small', 3 );
},
select: function( t, r, i ){
doUserOperation( 29, r.data.cid, true );
}
},
value: '{$CUser->Data['ui_theme']}'
}]
},{
xtype: 'panel',
id: 'profile_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
items:[{
html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
}]
}]
}
DATA_BOUNDARY;
$Data['status'] = 'ok';
if( $CUser->Data['access'] < 6 ){
$TAB_CTX = '';
$MAIN_A_6 = '';
if( $CUser->Data['access'] < 5 ){
$MAIN_A_5 = '';
if( $CUser->Data['access'] < 4 ){
$MAIN_A_4 = '';
};
};
};
$Data['content'] = $BASIC_CONTENT;
$Data['content'] = str_ireplace( '%%CTX_ACCESS_4%%', $MAIN_A_4, $Data['content'] );
$Data['content'] = str_ireplace( '%%CTX_ACCESS_5%%', $MAIN_A_5, $Data['content'] );
$Data['content'] = str_ireplace( '%%CTX_ACCESS_6%%', $MAIN_A_6, $Data['content'] );
$Data['content'] = str_ireplace( '%%TAB_CTX%%%', $TAB_CTX, $Data['content'] );
$Data['messages'] = ob_get_clean();
} else {
header('location: /');
exit();
};
echo json_encode( $Data );
?>

22
lib/controller/getStatus.php

@ -178,17 +178,26 @@
$RR = $DATABASE->Query( $QS ); $RR = $DATABASE->Query( $QS );
if( count( $RR ) ){ if( count( $RR ) ){
$Modules = array(); $Modules = array();
$TrainPos = 0;
foreach( $RR as $CT ){ foreach( $RR as $CT ){
$CM = intval( $CT['near_module_id'] ); $CM = intval( $CT['near_module_id'] );
$LD = array(); $LD = array();
if( $CM ){ if( $CM ){
$LD['id']=$CM; $LD['id']=$CM;
if( getOnlineStatus( $CM ) ){
$MOS = getOnlineStatus( $CM );
if( $MOS ){
$LD['status'] = 2; $LD['status'] = 2;
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM}"; $QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM}";
$RZ = $DATABASE->Query( $QS ); $RZ = $DATABASE->Query( $QS );
$MM = $RZ[0]; $MM = $RZ[0];
//$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}"; //$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
if( $MOS == 3 ) {
if( $CT['side'] == 'U' ){
$TrainPos = $TrainPos | 1;
} else {
$TrainPos = $TrainPos | 8;
};
};
$LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}"; $LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `final`='N'"; $QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `final`='N'";
$RZ = $DATABASE->Query( $QS ); $RZ = $DATABASE->Query( $QS );
@ -208,12 +217,20 @@
$LD = array(); $LD = array();
if( $CM ){ if( $CM ){
$LD['id']=$CM; $LD['id']=$CM;
if( getOnlineStatus( $CM ) ){
$MOS = getOnlineStatus( $CM );
if( $MOS ){
$LD['status'] = 2; $LD['status'] = 2;
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM}"; $QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM}";
$RZ = $DATABASE->Query( $QS ); $RZ = $DATABASE->Query( $QS );
$MM = $RZ[0]; $MM = $RZ[0];
//$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}"; //$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
if( $MOS == 3 ) {
if( $CT['side'] == 'U' ){
$TrainPos = $TrainPos | 2;
} else {
$TrainPos = $TrainPos | 4;
};
};
$LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}"; $LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `final`='N'"; $QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `final`='N'";
$RZ = $DATABASE->Query( $QS ); $RZ = $DATABASE->Query( $QS );
@ -252,6 +269,7 @@
}; };
}; };
}; };
$Data['train']=array( 'status'=>$TrainPos );
}; };
}; };
break; break;

14
lib/controller/updateUserSettings.php

@ -19,7 +19,7 @@
break; break;
}; };
case 21:{ case 21:{
$LAN = intval($_POST['LAN']);
$LAN = intval($_POST['CID']);
$QS="UPDATE `users` SET `language`={$LAN} WHERE id={$CUser->Data['id']}"; $QS="UPDATE `users` SET `language`={$LAN} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
break; break;
@ -42,6 +42,18 @@
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
break; break;
}; };
case 28:{
$CID = 1000*intval($_POST['CID']);
$QS="UPDATE `users` SET `ss_timeout`={$CID} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 29:{
$CID = intval($_POST['CID']);
$QS="UPDATE `users` SET `ui_theme`={$CID} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
}; };
}; };
}; };

50
lib/javascript/jsapi_dynamic/argus_main.js

@ -7,6 +7,10 @@ function uuidv4() {
} }
function ssShowSS() { function ssShowSS() {
if( monitoringActiveSession ){
ssResetTimer();
return;
};
ssStopTimer(); ssStopTimer();
document.removeEventListener( "mousemove", ssResetTimer ); document.removeEventListener( "mousemove", ssResetTimer );
document.removeEventListener( "mousedown", ssResetTimer ); document.removeEventListener( "mousedown", ssResetTimer );
@ -18,16 +22,17 @@ function ssShowSS() {
document.addEventListener( "keypress", ssHideSS, false ); document.addEventListener( "keypress", ssHideSS, false );
document.addEventListener( "touchmove", ssHideSS, false ); document.addEventListener( "touchmove", ssHideSS, false );
document.getElementById('ss_bg').className='ss_bg_overlay'; document.getElementById('ss_bg').className='ss_bg_overlay';
document.getElementById('ss_content').className='ss_overlay';
document.getElementById('ss_content').className='ss_overlay';
ssShowTime(); ssShowTime();
updateSSMode( 1 );
changeContent(0,0,'');
updateUserContent();
showContent();
if( ssInterval == null ){ if( ssInterval == null ){
ssInterval = window.setInterval( ssShowTime, 333 ); ssInterval = window.setInterval( ssShowTime, 333 );
}; };
ssIsActive = true; ssIsActive = true;
autoRiseEvent = true;
var tt = Ext.getCmp('aer_button');
if( tt != undefined ) tt.toggle( true, true );
updateSSMode( 1 );
autoRiseEvent = true;
}; };
function ssShowTime(){ function ssShowTime(){
document.getElementById('ss_content').style.fontSize = '240px'; document.getElementById('ss_content').style.fontSize = '240px';
@ -71,9 +76,15 @@ function ssHideSS(){
window.clearInterval( ssInterval ); window.clearInterval( ssInterval );
ssInterval = null; ssInterval = null;
}; };
updateSSMode( 0 );
ssIsActive = true;
autoRiseEvent = true;
var tt = Ext.getCmp('aer_button');
if( tt != undefined ){
tt.toggle( true, true );
} else doRefresh();
ssSetupTimer(); ssSetupTimer();
ssIsActive = false; ssIsActive = false;
updateSSMode( 0 );
}; };
@ -146,6 +157,22 @@ function failureAJAXFunction( responce, opts ){
doLogout(); doLogout();
}; };
function doUserOperation( OPId, Param, reload ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: OPId,
CID: Param
},
success: function( response, opts ){
if( reload ) doRefresh();
},
failure: failureAJAXFunction
});
};
function updateUserScreenResolution( x, y ){ function updateUserScreenResolution( x, y ){
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php', url: '/lib/controller/updateUserSettings.php',
@ -162,7 +189,7 @@ function updateUserScreenResolution( x, y ){
failure: failureAJAXFunction failure: failureAJAXFunction
}); });
}; };
var contentChangesCount = 0;
function updateUserContent(){ function updateUserContent(){
var ser_c = Ext.encode( contentView ); var ser_c = Ext.encode( contentView );
if( contentViewConfig != ser_c ) { if( contentViewConfig != ser_c ) {
@ -176,6 +203,8 @@ function updateUserContent(){
}, },
success: function(){ success: function(){
contentViewConfig = ser_c; contentViewConfig = ser_c;
contentChangesCount++;
if( contentChangesCount%5== 0 ) doRefresh();
}, },
failure: failureAJAXFunction failure: failureAJAXFunction
}); });
@ -188,6 +217,7 @@ if( contentView.l == undefined ){
contentView.l =[]; contentView.l =[];
contentView.l[0] = { v: 0, p: '' }; contentView.l[0] = { v: 0, p: '' };
contentView.l[1] = { v: 0, p: '' }; contentView.l[1] = { v: 0, p: '' };
contentView.l[2] = { v: 0, p: '' };
contentView.l[3] = { v: 0, p: '' }; contentView.l[3] = { v: 0, p: '' };
updateUserContent(); updateUserContent();
}; };
@ -298,7 +328,7 @@ function showContent( force ){
var tZ = Ext.getCmp('right_side_menu'); var tZ = Ext.getCmp('right_side_menu');
tZ.setVisible( false ); tZ.setVisible( false );
initMonitoring(); initMonitoring();
Ext.getCmp('main_viewport').doLayout();
Ext.getCmp('main_viewport').doLayout();
break; break;
}; };
case 1:{ case 1:{
@ -435,7 +465,9 @@ Ext.onReady(function(){
toggleGroup: 'gopa_gopa', toggleGroup: 'gopa_gopa',
toggleHandler: function( bt, state ){ toggleHandler: function( bt, state ){
if( state ) { if( state ) {
autoRiseEvent = true;
changeContent(0,0,''); changeContent(0,0,'');
updateUserContent();
showContent(); showContent();
}; };
} }
@ -455,6 +487,7 @@ Ext.onReady(function(){
toggleHandler: function( bt, state ){ toggleHandler: function( bt, state ){
if( state ){ if( state ){
changeContent(0,1,''); changeContent(0,1,'');
updateUserContent();
showContent(); showContent();
}; };
} }
@ -473,6 +506,7 @@ Ext.onReady(function(){
toggleHandler: function( bt, state ){ toggleHandler: function( bt, state ){
if( state ) { if( state ) {
changeContent(0,2,''); changeContent(0,2,'');
updateUserContent();
showContent(); showContent();
}; };
} }

376
lib/javascript/jsapi_dynamic/argus_monitoring.js

@ -2,11 +2,13 @@
var monitoringViewLevel = 0; var monitoringViewLevel = 0;
var monitoringActiveSession = false;
var mon_selectedEventId = 0; var mon_selectedEventId = 0;
var mon_selectedPlatform = 0; var mon_selectedPlatform = 0;
var mon_selectedStation = 0; var mon_selectedStation = 0;
var mon_selectedTrack = 0; var mon_selectedTrack = 0;
var mon_selectedModule = 0; var mon_selectedModule = 0;
var mon_platform_train = 0;
var autoRiseEvent = true; var autoRiseEvent = true;
var activeEvents = []; var activeEvents = [];
var expiredEvents = []; var expiredEvents = [];
@ -283,8 +285,8 @@ function addSetSessionUI( session_id ){
}; };
}; };
},
failure: failureAJAXFunction
}//,
//failure: failureAJAXFunction
}); });
}; };
@ -316,6 +318,8 @@ function loadPlatformView( pid, buba ){
autoRiseEvent = buba; autoRiseEvent = buba;
}; };
if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); if( mon_selectedEventId ) unselectEvent( mon_selectedEventId );
mon_platform_train = 0;
mTrainSvgElements = [];
mon_selectedPlatform = pid; mon_selectedPlatform = pid;
changeContent( 1, 2, pid ); changeContent( 1, 2, pid );
updateUserContent(); updateUserContent();
@ -361,6 +365,14 @@ function loadTrackViewBySession( session_id ){
Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').removeAll(true);
Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').add( Ext.decode( data.content ) );
Ext.getCmp('main_content').doLayout(); Ext.getCmp('main_content').doLayout();
tt=document.getElementById('trx_status_txt');
tt.classList.remove('static_status_text');
tt.classList.add('blinking_status_text');
tt.innerText = 'ACTIVE';
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.add('top_status_red_lbl');
monitoringActiveSession = true;
fetchStatus(); fetchStatus();
}; };
}, },
@ -390,6 +402,12 @@ function loadTrackView( tid ){
Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').removeAll(true);
Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').add( Ext.decode( data.content ) );
Ext.getCmp('main_content').doLayout(); Ext.getCmp('main_content').doLayout();
tt=document.getElementById('trx_status_txt');
tt.innerText = 'LIVE VIEW';
monitoringActiveSession = false;
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.add('top_status_green_lbl');
fetchStatus(); fetchStatus();
}; };
}, },
@ -428,6 +446,8 @@ function loadModuleView( pid, mid ){
}; };
function loadMapView(){ function loadMapView(){
changeContent( 0, 0, 0 );
updateUserContent();
autoRiseEvent = false; autoRiseEvent = false;
if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); if( mon_selectedEventId ) unselectEvent( mon_selectedEventId );
Ext.Ajax.request({ Ext.Ajax.request({
@ -519,8 +539,9 @@ function initMonitoring( x, y ){
},{ },{
id: 'sme_inner', id: 'sme_inner',
layout:'vbox', layout:'vbox',
width: "100%",
width: '100%',
height: PanelH/2, height: PanelH/2,
autoScroll: true ,
frame: false, frame: false,
border: false, border: false,
items:[] items:[]
@ -530,10 +551,10 @@ function initMonitoring( x, y ){
},{ },{
id: 'sme_outer', id: 'sme_outer',
layout:'vbox', layout:'vbox',
width: "100%",
height: PanelH/2,
width: '100%',
height: 1000,//PanelH/2,
frame: false, frame: false,
border: true,
border: false,
items:[] items:[]
}] }]
}); });
@ -542,6 +563,11 @@ function initMonitoring( x, y ){
switch( monitoringViewLevel ){ switch( monitoringViewLevel ){
case 0:{ case 0:{
loadMapView(); loadMapView();
autoRiseEvent = true;
var tt = Ext.getCmp('aer_button');
if( tt != undefined ){
tt.toggle( true, true );
}
break; break;
}; };
case 1:{ case 1:{
@ -606,10 +632,11 @@ function manageSideTags( tag_area, buba ){
}; };
}; };
if( !f ){ if( !f ){
var ichu = createEventTagContent( buba[zz] );
tP.insert( 0,{ tP.insert( 0,{
id: 'tag_panel_'+buba[zz].id, id: 'tag_panel_'+buba[zz].id,
width: "100%",
html: createEventTagContent( buba[zz] )
width: '100%',
html: ichu
}); });
tt++; tt++;
}; };
@ -648,12 +675,192 @@ function manageSideTags( tag_area, buba ){
}; };
}; };
tP.doLayout(); tP.doLayout();
}; };
}; };
var mSvgElements = []; var mSvgElements = [];
var mTrainSvgElements=[];
function animateTrainOnPlatform( _in, _out ){
if( ( _out & 3 ) > 0 ){
if( typeof mTrainSvgElements[0] === 'undefined') {
switch( _out & 3 ) {
case 1:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[0].setAttribute('x', '1550');
mTrainSvgElements[0].setAttribute('y', '50' );
mTrainSvgElements[0].setAttribute('rx','5' );
mTrainSvgElements[0].setAttribute('height', ''+100);
mTrainSvgElements[0].setAttribute('width', ''+540);
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '2000' );
anim1.setAttribute('to', '1100' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[0].appendChild( anim1 );
mTrainSvgElements[0].appendChild( anim2 );
break;
};
case 2:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[0].setAttribute('x', '-550');
mTrainSvgElements[0].setAttribute('y', '50' );
mTrainSvgElements[0].setAttribute('rx','5' );
mTrainSvgElements[0].setAttribute('height', ''+100);
mTrainSvgElements[0].setAttribute('width', ''+540);
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '-550' );
anim1.setAttribute('to', '300' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[0].appendChild( anim1 );
mTrainSvgElements[0].appendChild( anim2 );
break;
};
case 3:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[0].setAttribute('x', '700');
mTrainSvgElements[0].setAttribute('y', '50' );
mTrainSvgElements[0].setAttribute('rx','5' );
mTrainSvgElements[0].setAttribute('height', ''+100);
mTrainSvgElements[0].setAttribute('width', ''+540);
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF');
var anim = document.createElementNS(svgns, 'animate');
anim.setAttribute('dur', '3s' );
anim.setAttribute('attributeName', 'opacity' );
anim.setAttribute('from', '0' );
anim.setAttribute('to', '1' );
anim.setAttribute('calcMode','linear' );
anim.setAttribute('fill', 'freeze' );
mTrainSvgElements[0].appendChild( anim );
};
};
var tt = document.getElementById('svgTrackMap');
tt.appendChild( mTrainSvgElements[0] );
} else {
};
} else {
if( typeof mTrainSvgElements[0] != 'undefined') {
var tt = document.getElementById('svgTrackMap');
tt.removeChild( mTrainSvgElements[0] );
mTrainSvgElements[0] = null;
};
};
if( ( _out & 12 ) > 0 ){
if( typeof mTrainSvgElements[1] === 'undefined') {
switch( ( _out >> 2 ) ) {
case 2:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[1].setAttribute('x', '1550');
mTrainSvgElements[1].setAttribute('y', '550' );
mTrainSvgElements[1].setAttribute('rx','5' );
mTrainSvgElements[1].setAttribute('height', ''+100);
mTrainSvgElements[1].setAttribute('width', ''+540);
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '2000' );
anim1.setAttribute('to', '1100' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[1].appendChild( anim1 );
mTrainSvgElements[1].appendChild( anim2 );
break;
};
case 1:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[1].setAttribute('x', '-550');
mTrainSvgElements[1].setAttribute('y', '550' );
mTrainSvgElements[1].setAttribute('rx','5' );
mTrainSvgElements[1].setAttribute('height', ''+100);
mTrainSvgElements[1].setAttribute('width', ''+540);
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '-550' );
anim1.setAttribute('to', '300' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[1].appendChild( anim1 );
mTrainSvgElements[1].appendChild( anim2 );
break;
};
case 3:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[1].setAttribute('x', '700');
mTrainSvgElements[1].setAttribute('y', '550' );
mTrainSvgElements[1].setAttribute('rx','5' );
mTrainSvgElements[1].setAttribute('height', ''+100);
mTrainSvgElements[1].setAttribute('width', ''+540);
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF');
var anim = document.createElementNS(svgns, 'animate');
anim.setAttribute('dur', '3s' );
anim.setAttribute('attributeName', 'opacity' );
anim.setAttribute('from', '0' );
anim.setAttribute('to', '1' );
anim.setAttribute('calcMode','linear' );
anim.setAttribute('fill', 'freeze' );
mTrainSvgElements[1].appendChild( anim );
};
};
var tt = document.getElementById('svgTrackMap');
tt.appendChild( mTrainSvgElements[1] );
} else {
};
} else {
if( typeof mTrainSvgElements[1] != 'undefined') {
var tt = document.getElementById('svgTrackMap');
tt.removeChild( mTrainSvgElements[1] );
mTrainSvgElements[1] = null;
};
};
};
function fetchStatus(){ function fetchStatus(){
if( tlInterval!= null ){ if( tlInterval!= null ){
window.clearTimeout( tlInterval ); window.clearTimeout( tlInterval );
@ -753,8 +960,8 @@ function fetchStatus(){
}; };
//debugger; //debugger;
switch( monitoringViewLevel ){ switch( monitoringViewLevel ){
case 0:{
for( i=0; i < data.station_ids.length; i++ ){
case 0:{ //Map
for( i=0; i < data.station_ids.length; i++ ){
switch( data.station_status[i] ){ switch( data.station_status[i] ){
case 0: { case 0: {
if( stationMarkers[data.station_ids[i]].options.icon != GREY_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREY_Icon ); if( stationMarkers[data.station_ids[i]].options.icon != GREY_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREY_Icon );
@ -784,7 +991,7 @@ function fetchStatus(){
}; };
break; break;
}; };
case 1:{
case 1:{ //Platforms
if( data.platforms != undefined ){ if( data.platforms != undefined ){
for( i=0; i< data.platforms.length; i++ ){ for( i=0; i< data.platforms.length; i++ ){
var tt = document.getElementById( 'plat_table_'+data.platforms[i].id ); var tt = document.getElementById( 'plat_table_'+data.platforms[i].id );
@ -813,7 +1020,7 @@ function fetchStatus(){
}; };
break; break;
}; };
case 2:{
case 2:{ // Platform
if( data.modules != undefined ){ if( data.modules != undefined ){
for( var i=0; i< data.modules.length; i++){ for( var i=0; i< data.modules.length; i++){
if( data.modules[i].status > 0 ){ if( data.modules[i].status > 0 ){
@ -942,16 +1149,20 @@ function fetchStatus(){
for( var i=0; i< max_grad_levels; i++ ) for( var i=0; i< max_grad_levels; i++ )
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000'); if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000');
}; };
if( data.scada != undefined ){
if( data.train != undefined ){
if( mon_platform_train != data.train.status ){
animateTrainOnPlatform( mon_platform_train, data.train.status );
mon_platform_train = data.train.status;
};
}; };
break; break;
}; };
case 3:{
case 3:{ // Track
if( data.active_session_id != undefined ){ if( data.active_session_id != undefined ){
if( data.active_session_id > 0 ){ if( data.active_session_id > 0 ){
if( mon_selectedEventId != data.active_session_id ){
if( mon_selectedEventId != data.active_session_id ){
mon_selectedEventId = data.active_session_id; mon_selectedEventId = data.active_session_id;
monitoringActiveSession = true;
for( var zz=0; zz< activeEvents.length; zz++ ){ for( var zz=0; zz< activeEvents.length; zz++ ){
var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); var tP = document.getElementById('event_tag_'+activeEvents[zz].id );
if( tP != undefined ){ if( tP != undefined ){
@ -964,6 +1175,47 @@ function fetchStatus(){
}; };
}; };
addSetSessionUI( mon_selectedEventId ); addSetSessionUI( mon_selectedEventId );
tt=document.getElementById('trx_status_txt');
tt.classList.remove('static_status_text');
tt.classList.add('blinking_status_text');
tt.innerText = 'ACTIVE';
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.remove('top_status_green_lbl');
tt.classList.add('top_status_red_lbl');
};
} else {
if( mon_selectedEventId ){
var d = true;
for( var zz=activeEvents.length-1; zz> -1; zz-- ){
if( activeEvents[zz].id != mon_selectedEventId ){
selectEvent( activeEvents[zz].id, false );
d = false;
break;
};
};
if( d ){
mon_selectedEventId = 0;
monitoringActiveSession = false;
tt=document.getElementById('trx_status_txt');
tt.classList.remove('blinking_status_text');
tt.classList.add('static_status_text');
tt.innerText = 'LIVE VEW';
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.remove('top_status_red_lbl');
tt.classList.add('top_status_green_lbl');
var tv = Ext.getCmp('trx_view');
if( tv != undefined ){
var tt = Ext.getCmp('sets_ui');
if( tt != undefined ){
tv.remove( tt );
};
tv.doLayout();
};
for( var i=0; i< max_grad_levels; i++ )
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000');
};
}; };
}; };
}; };
@ -1045,36 +1297,38 @@ function selectEvent( ii, bb ){
window.clearTimeout( tlInterval ); window.clearTimeout( tlInterval );
tlInterval = null; 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");
if( bb ){
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 ){
monitoringActiveSession = false;
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");
loadMonitoringSessionView( ii );
} else {
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 ){
monitoringActiveSession = true;
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
};
}; };
}; };
};
if( bb ){
loadMonitoringSessionView( ii );
} else {
loadTrackViewBySession( ii ); loadTrackViewBySession( ii );
}; };
}; };
function setSessionStatus( a , b ){
function setSessionStatus( a , b, autoremove ){
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/doSessionOperations.php', url: '/lib/controller/doSessionOperations.php',
params: { params: {
@ -1087,16 +1341,34 @@ function setSessionStatus( a , b ){
success: function( response, opts ){ success: function( response, opts ){
var data = Ext.decode(response.responseText); var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){ 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 );
if( autoremove ){
//On Expired
var d = true;
for( var zz=expiredEvents.length-1; zz> -1; zz-- ){
if( expiredEvents[zz].id != mon_selectedEventId ){
selectEvent( expiredEvents[zz].id, true );
d = false;
break;
};
};
if( d ){
loadMapView();
autoRiseEvent = true;
var tt = Ext.getCmp('aer_button');
if( tt != undefined ) tt.toggle( true, true );
};
} else {
// On LiveSession
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();
}; };
tv.add( Ext.decode( data.content ) );
tv.doLayout();
}; };
}; };
}, },
failure: failureAJAXFunction failure: failureAJAXFunction
@ -1144,7 +1416,17 @@ function loadMonitoringSessionView( session_id ){
Ext.getCmp('main_content').removeAll(true); Ext.getCmp('main_content').removeAll(true);
Ext.getCmp('main_content').add( Ext.decode( data.content ) ); Ext.getCmp('main_content').add( Ext.decode( data.content ) );
Ext.getCmp('main_content').doLayout(); Ext.getCmp('main_content').doLayout();
tt=document.getElementById('trx_status_txt');
//tt.classList.remove('static_status_text');
//tt.classList.add('blinking_status_text');
tt.innerText = 'EXPIRED';
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.remove('top_status_red_lbl');
tt.classList.remove('top_status_green_lbl');
tt.classList.add('top_status_orange_lbl');
mSesPlay = new argusSessionPlayer( mon_selectedEventId ); mSesPlay = new argusSessionPlayer( mon_selectedEventId );
mSesPlay.play();
fetchStatus(); fetchStatus();
}; };
}, },

1
lib/javascript/jsapi_dynamic/argus_reports.js

@ -1547,6 +1547,7 @@ function loadHistorySessionView( session_id ){
changeContent( 2, 5, rep_selectedStation+'-'+rep_selectedDateTS+'-'+rep_selectedEventId ); changeContent( 2, 5, rep_selectedStation+'-'+rep_selectedDateTS+'-'+rep_selectedEventId );
updateUserContent(); updateUserContent();
mSesPlay = new argusSessionPlayer( rep_selectedEventId ); mSesPlay = new argusSessionPlayer( rep_selectedEventId );
mSesPlay.play();
fetchStatus(); fetchStatus();
}; };
}, },

94
lib/javascript/jsapi_dynamic/argus_settings.js

@ -1365,7 +1365,30 @@ function addFilter(){
} }
}); });
}; };
function showSettingsProfile(){
stopStatusUpdater();
//if( contentView.l[3] == undefined ){
// contentView.l[3] = {v:0,p:''};
//};
Ext.Ajax.request({
url: '/lib/controller/getProfileSettings.php',
params: {
UID: <?=$UserID;?>,
TYP: contentView.l[3].v,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var tData = Ext.decode(response.responseText);
if( tData.status == 'ok' ){
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
tPanel.add(Ext.decode(tData.content));
tPanel.doLayout();
};
},
failure: failureAJAXFunction
});
};
function showSettingsServer(){ function showSettingsServer(){
stopStatusUpdater(); stopStatusUpdater();
if( contentView.l[3] == undefined ){ if( contentView.l[3] == undefined ){
@ -2200,8 +2223,9 @@ function initSettingsView(){
enableToggle: true, enableToggle: true,
pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 0 ), pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 0 ),
allowDepress: false, allowDepress: false,
toggleGroup: 'sys_settings',
toggleGroup: '_settings',
handler: function(){ handler: function(){
changeContent( 1, 0, '' );
changeContent( 2, 0, '' ); changeContent( 2, 0, '' );
updateUserContent(); updateUserContent();
showSettingsServer(); showSettingsServer();
@ -2216,8 +2240,9 @@ function initSettingsView(){
enableToggle: true, enableToggle: true,
pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 0 ), pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 0 ),
allowDepress: false, allowDepress: false,
toggleGroup: 'sys_settings',
toggleGroup: '_settings',
handler: function(){ handler: function(){
changeContent( 1, 0, '' );
changeContent( 2, 1, '' ); changeContent( 2, 1, '' );
updateUserContent(); updateUserContent();
showSettingsInfrastructure(); showSettingsInfrastructure();
@ -2231,32 +2256,40 @@ function initSettingsView(){
}; ?> }; ?>
tP.add({ tP.add({
title: "<?=$Labels->GetLabel('_PROF_SETTINGS_');?>", title: "<?=$Labels->GetLabel('_PROF_SETTINGS_');?>",
items:[<?php
$ZIGA = array();
foreach( $Site_Languages as $SL ){
if( $SL['id'] == $CUser->Data['language'] ){
$ZIGA[] = "{ xtype:'button', text:'{$SL['name']}', width: '100%', enableToggle: true, pressed : true, handler: function(){ window.location = '/?Lang={$SL['id']}'; } }";
} else {
$ZIGA[] = "{ xtype:'button', text:'{$SL['name']}', width: '100%', handler: function(){ window.location = '/?Lang={$SL['id']}'; } }";
};
};
echo implode(',',$ZIGA );
?>]
collapsed: ( contentView.l[1].v != 1 ),
items:[{
xtype:'button',
text:'<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
enableToggle: true,
pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 1 ),
allowDepress: false,
toggleGroup: '_settings',
width: '100%',
handler: function(){
changeContent( 1, 1, 0 );
//changeContent( 2, 0, '' ); - will do automatically
updateUserContent();
showSettingsProfile();
}
}]
}); });
<?php if( $CUser->Data['access'] > 5 ){ ?> <?php if( $CUser->Data['access'] > 5 ){ ?>
tP.add({ tP.add({
title: "<?=$Labels->GetLabel('_ADM_SETTINGS_');?>", title: "<?=$Labels->GetLabel('_ADM_SETTINGS_');?>",
collapsed: ( contentView.l[1].v != 3 ),
collapsed: ( contentView.l[1].v != 2 ),
items:[{ items:[{
xtype: 'button', xtype: 'button',
width: '100%', width: '100%',
id:'adm_acc', id:'adm_acc',
text: "<?=$Labels->GetLabel('_USERS_MNGMT_');?>", text: "<?=$Labels->GetLabel('_USERS_MNGMT_');?>",
enableToggle: true, enableToggle: true,
pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 3 ),
pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 2 ),
allowDepress: false, allowDepress: false,
toggleGroup: 'adm_settings',
toggleGroup: '_settings',
handler: function( b, e ){ handler: function( b, e ){
changeContent( 1, 2, 0 );
changeContent( 2, 0, '' );
updateUserContent();
loadUserEditor(); loadUserEditor();
} }
},{ },{
@ -2265,10 +2298,13 @@ function initSettingsView(){
id:'adm_acclog', id:'adm_acclog',
text: "<?=$Labels->GetLabel('_ACC_LOG_');?>", text: "<?=$Labels->GetLabel('_ACC_LOG_');?>",
enableToggle: true, enableToggle: true,
pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 3 ),
pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 2 ),
allowDepress: false, allowDepress: false,
toggleGroup: 'adm_settings',
toggleGroup: '_settings',
handler: function( b, e ){ handler: function( b, e ){
changeContent( 1, 2, 0 );
changeContent( 2, 1, '' );
updateUserContent();
loadAccessLog(); loadAccessLog();
} }
},{ },{
@ -2277,10 +2313,13 @@ function initSettingsView(){
id:'adm_servlog', id:'adm_servlog',
text: "<?=$Labels->GetLabel('_SERV_LOG_');?>", text: "<?=$Labels->GetLabel('_SERV_LOG_');?>",
enableToggle: true, enableToggle: true,
pressed: ( contentView.l[2].v == 2 && contentView.l[1].v == 3 ),
pressed: ( contentView.l[2].v == 2 && contentView.l[1].v == 2 ),
allowDepress: false, allowDepress: false,
toggleGroup: 'adm_settings',
toggleGroup: '_settings',
handler: function( b, e ){ handler: function( b, e ){
changeContent( 1, 2, 0 );
changeContent( 2, 2, '' );
updateUserContent();
loadServerLog(); loadServerLog();
} }
}] }]
@ -2291,28 +2330,31 @@ function initSettingsView(){
tP.setVisible( true ); tP.setVisible( true );
tP.doLayout(); tP.doLayout();
switch( contentView.l[1].v ){ switch( contentView.l[1].v ){
default:{
case 0:{
switch( contentView.l[2].v ){ switch( contentView.l[2].v ){
default: showSettingsServer(); break;
case 0: showSettingsServer(); break;
<?php if( $CUser->Data['access'] > 5 ){ ?> <?php if( $CUser->Data['access'] > 5 ){ ?>
case 1: showSettingsInfrastructure(); break; case 1: showSettingsInfrastructure(); break;
<?php }; ?> <?php }; ?>
//case 4: showSettingsUpgrade(); break; //case 4: showSettingsUpgrade(); break;
}; };
break;
}; };
case 1:{ case 1:{
switch( contentView.l[2].v ){ switch( contentView.l[2].v ){
case 0: break;
case 0: showSettingsProfile(); break;
}; };
break; break;
}; };
<?php if( $CUser->Data['access'] > 5 ){ ?> <?php if( $CUser->Data['access'] > 5 ){ ?>
case 3:{
case 2:{
switch( contentView.l[2].v ){ switch( contentView.l[2].v ){
case 0: loadUserEditor(); break; case 0: loadUserEditor(); break;
case 1: loadAccessLog(); break;
case 2: loadServerLog(); break;
}; };
break; break;
}; };
<?php }; ?>
<?php }; ?>
}; };
}; };

14
lib/php/argus/server.php

@ -355,7 +355,7 @@ DATA_BIUNDARY;
function createPlatformBackground( $Layout, $pid=0, $Modules=array() ){ function createPlatformBackground( $Layout, $pid=0, $Modules=array() ){
$SVG['C']=<<<DATA_BOUNDARY $SVG['C']=<<<DATA_BOUNDARY
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse"> <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
<rect x="20" y="5" width="10" height="90" fill="#000000" /> <rect x="20" y="5" width="10" height="90" fill="#000000" />
@ -401,7 +401,7 @@ $SVG['C']=<<<DATA_BOUNDARY
</svg> </svg>
DATA_BOUNDARY; DATA_BOUNDARY;
$SVG['E']=<<<DATA_BOUNDARY $SVG['E']=<<<DATA_BOUNDARY
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse"> <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
<rect x="20" y="5" width="10" height="90" fill="#000000" /> <rect x="20" y="5" width="10" height="90" fill="#000000" />
@ -487,7 +487,7 @@ DATA_BOUNDARY;
function createPlatformAnimation( $PLayout, $PNames=array(), $Colors=array() ){ function createPlatformAnimation( $PLayout, $PNames=array(), $Colors=array() ){
$SVG['C']=<<<jjdgfjjdfh $SVG['C']=<<<jjdgfjjdfh
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse"> <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
<rect x="20" y="5" width="10" height="90" fill="#000000" /> <rect x="20" y="5" width="10" height="90" fill="#000000" />
@ -532,7 +532,7 @@ $SVG['C']=<<<jjdgfjjdfh
</svg> </svg>
jjdgfjjdfh; jjdgfjjdfh;
$SVG['E']=<<<khksdhfiwer $SVG['E']=<<<khksdhfiwer
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse"> <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
<rect x="20" y="5" width="10" height="90" fill="#000000" /> <rect x="20" y="5" width="10" height="90" fill="#000000" />
@ -901,7 +901,7 @@ function getOnlineStatus( $mid ){
$CTS = time() - 3; // 3 seconds lag $CTS = time() - 3; // 3 seconds lag
$QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10 AND `ts`>={$CTS}"; $QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10 AND `ts`>={$CTS}";
$RV = $DATABASE->Query( $QS, false ); $RV = $DATABASE->Query( $QS, false );
return ( count( $RV ) > 0 );
if( count( $RV ) ) return intval( $RV[0]['status'] );
}; };
return false; return false;
}; };
@ -909,7 +909,7 @@ function getOnlineStatus( $mid ){
function createTopLabel( $Station, $Platform, $Lines, $Track="", $color_class="" ){ function createTopLabel( $Station, $Platform, $Lines, $Track="", $color_class="" ){
if( $Track!=''){ if( $Track!=''){
$TR_INS=<<<DATA_BOUNDARY $TR_INS=<<<DATA_BOUNDARY
<td rowspan=3 valign="middle" align="center" style="width: 200px; border-radius: 5px; font-size: 44px; font-weight: bold; color: white; background-color: black;">{$Track}</td>
<td rowspan=3 valign="middle" align="center" class="top_track_lbl">{$Track}</td>
DATA_BOUNDARY; DATA_BOUNDARY;
} else { } else {
$TR_INS = ''; $TR_INS = '';
@ -917,7 +917,7 @@ $TR_INS = '';
$AA=<<<DATA_BOUNDARY $AA=<<<DATA_BOUNDARY
<table border=0 width="100%" class="setEd_infoPanelX {$color_class}"> <table border=0 width="100%" class="setEd_infoPanelX {$color_class}">
<tr> <tr>
<td valign="middle" align="left" style="max-width: 20em; padding-left:30px;font-size: 22px; font-weight: bold;">{$Station}</td>{$TR_INS}
<td valign="middle" align="left" style="max-width: 20em; padding-left:30px;font-size: 22px; font-weight: bold;">{$Station}</td><td id="trx_status_cell" rowspan=3 valign="middle" align="center" class="top_status_hidden"><span id="trx_status_txt" class="static_status_text">STATUS</span></td>{$TR_INS}
</tr> </tr>
<tr> <tr>
<td valign="middle" align="left" style="padding-left:30px;font-size: 16px; font-weight: bold;">{$Platform}</td> <td valign="middle" align="left" style="padding-left:30px;font-size: 16px; font-weight: bold;">{$Platform}</td>

18
lib/php/argus/templates.php

@ -68,15 +68,6 @@ $STATION_HISTORY_CTX=<<<DATA_BOUNDARY
pressed: true, pressed: true,
disabled: false, disabled: false,
allowDepress: false allowDepress: false
},'->',{
xtype: 'button',
id: 'aer_button',
text: 'Event Auto Rise',
enableToggle: true,
pressed: autoRiseEvent,
handler: function( t ){
autoRiseEvent = t.pressed;
}
}], }],
items: [{ xtype:'spacer', height: 10 },%%%PANELS%%%] items: [{ xtype:'spacer', height: 10 },%%%PANELS%%%]
}] }]
@ -219,15 +210,6 @@ $TRACK_HISTORY_CTX=<<<DATA_BOUNDARY
enableToggle: true, enableToggle: true,
pressed: true, pressed: true,
allowDepress: false allowDepress: false
},'->',{
xtype: 'button',
id: 'aer_button',
text: 'Event Auto Rise',
enableToggle: true,
pressed: autoRiseEvent,
handler: function( t ){
autoRiseEvent = t.pressed;
}
}], }],
items: [{ xtype:'spacer', height: 10 },%%%PANELS%%%] items: [{ xtype:'spacer', height: 10 },%%%PANELS%%%]
}] }]

8
lib/php/ui/UI_functions.php

@ -170,7 +170,7 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title><?=$Labels->GetLabel('_SITE_TITLE_');?></title> <title><?=$Labels->GetLabel('_SITE_TITLE_');?></title>
<meta name="description" CONTENT="<?=$Labels->GetLabel('_SITE_DESCRIPT_');?>"> <meta name="description" CONTENT="<?=$Labels->GetLabel('_SITE_DESCRIPT_');?>">
<meta http-equiv="refresh" content="600">
<!--meta http-equiv="refresh" content="600"-->
<base href="<?=$WEBPath;?>"> <base href="<?=$WEBPath;?>">
<meta name="robots" content="index, follow"/> <meta name="robots" content="index, follow"/>
<meta name="keywords" content=""/> <meta name="keywords" content=""/>
@ -204,6 +204,12 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
?> ?>
<link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/ext-all-notheme.css"/> <link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/ext-all-notheme.css"/>
<link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/xtheme-blue.css"/> <link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/xtheme-blue.css"/>
<?php
break;
case 3:
?>
<link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/ext-all-notheme.css"/>
<link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/yourtheme.css"/>
<?php <?php
break; break;
default: default:

49
style/style.css

@ -2189,4 +2189,53 @@ input[type="range"]:focus::-moz-range-thumb {
} }
.aaBB{ .aaBB{
height: 12px; height: 12px;
}
@keyframes blinker {
50%{
opacity: 0;
}
}
.blinking_status_text {
animation: blinker 1s linear infinite;
}
.top_track_lbl{
width: 200px;
border-radius: 5px;
font-size: 44px;
font-weight: bold;
color: white;
background-color: black;
}
.top_status_hidden{
display: none;
}
.static_status_text{
}
.top_status_red_lbl{
width: 200px;
border-radius: 5px;
font-size: 20px;
font-weight: bold;
color: yellow;
background-color: red;
}
.top_status_green_lbl{
width: 200px;
border-radius: 5px;
font-size: 20px;
font-weight: bold;
color: yellow;
background-color: green;
}
.top_status_orange_lbl{
width: 200px;
border-radius: 5px;
font-size: 20px;
font-weight: bold;
color: black;
background-color: orange;
} }
Loading…
Cancel
Save