|
|
|
@ -23,6 +23,8 @@ |
|
|
|
$SP = $SPD[0]; |
|
|
|
$DUMMY = array(); |
|
|
|
if( $CUser->Data['access'] > 5 ){ |
|
|
|
//$CUser->Data['width']
|
|
|
|
//$CUser->Data['height']
|
|
|
|
$TABA =<<<_DATA_BOUNDARY |
|
|
|
{ |
|
|
|
xtype: 'panel', |
|
|
|
@ -107,7 +109,11 @@ _DATA_BOUNDARY; |
|
|
|
afterrender : function( t ){ |
|
|
|
var papa = Ext.getCmp('main_portal'); |
|
|
|
var jj = papa.getComponent( 0 ).getHeight(); |
|
|
|
t.setHeight( PanelH - jj - 20 ); |
|
|
|
var zz = t.ownerCt.ownerCt.getHeight(); |
|
|
|
//alert( PanelW );
|
|
|
|
//alert( PanelH - zz );
|
|
|
|
//t.setHeight( PanelH - jj - 20 );
|
|
|
|
t.setHeight( PanelH - zz - 42 ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -128,13 +134,14 @@ $MAPIO=<<<_DATA_BOUNDARY |
|
|
|
} |
|
|
|
} |
|
|
|
_DATA_BOUNDARY; |
|
|
|
|
|
|
|
$DUMMY['map']="{xtype:'panel', title: '{$Labels->GetLabel('_MAP_')}', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9); initMapMonitoring();}} }"; |
|
|
|
$MH = 9; |
|
|
|
if( $SP['app_layout'] == 2 ) $MH = 6; |
|
|
|
$DUMMY['map']="{xtype:'panel', title: '{$Labels->GetLabel('_MAP_')}', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*{$MH}); initMapMonitoring();}} }"; |
|
|
|
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }"; |
|
|
|
$STA = array(); |
|
|
|
$END="]}"; |
|
|
|
$OUT = array(); |
|
|
|
if( $SP['type'] == 2 ) $SP['app_layout'] = 1; |
|
|
|
|
|
|
|
switch( $SP['app_layout'] ){ |
|
|
|
case 0:{ |
|
|
|
$STA[0]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:["; |
|
|
|
@ -372,17 +379,19 @@ _DATA_BOUNDARY; |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 2:{ |
|
|
|
$STA[0]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; |
|
|
|
$STA[1]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; |
|
|
|
$STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; |
|
|
|
$STA[3]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:["; |
|
|
|
$STA[4]="{ columnWidth: .5, stylde:'padding:10px 0 10px 10px', items:["; |
|
|
|
$STA[0]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Sen1
|
|
|
|
$STA[1]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Cam1
|
|
|
|
$STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Cam2
|
|
|
|
|
|
|
|
$STA[3]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Sen2
|
|
|
|
$STA[4]="{ columnWidth: .66, stylde:'padding:10px 0 10px 10px', items:[";//Log/Map
|
|
|
|
$idx = 0; |
|
|
|
$QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1"; |
|
|
|
$R = $DATABASE->Query( $QS ); |
|
|
|
if( count( $R ) ){ |
|
|
|
foreach( $R as $DD ){ |
|
|
|
if( $idx < 3 ){ |
|
|
|
$DEVS = $DATABASE->Query( $QS ); |
|
|
|
if( count( $DEVS ) ){ |
|
|
|
$WOU = array(); |
|
|
|
foreach( $DEVS as $DD ){ |
|
|
|
if( $idx < 2 ){ |
|
|
|
$TFN = 'dash/node_' . $DD['type'] . '.js'; |
|
|
|
if(!file_exists( $TFN )) continue; |
|
|
|
$TPL = file_get_contents( $TFN ); |
|
|
|
@ -392,25 +401,22 @@ _DATA_BOUNDARY; |
|
|
|
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); |
|
|
|
$TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); |
|
|
|
$TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); |
|
|
|
$OUT[]= $STA[$idx] . $TPL . $END; |
|
|
|
$WOU[]= $TPL; |
|
|
|
} else break; |
|
|
|
$idx++; |
|
|
|
}; |
|
|
|
if( $idx < 3 ){ |
|
|
|
for( ;$idx<3;$idx++ ){ |
|
|
|
$OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if( $idx < 2 ) for( ;$idx<2;$idx++ ) $WOU[]= $DUMMY['sensor']; |
|
|
|
$OUT[]= $STA[0] . implode(',', $WOU ) . $END; |
|
|
|
} else { |
|
|
|
for( ;$idx<3;$idx++ ){ |
|
|
|
$OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; |
|
|
|
}; |
|
|
|
}; |
|
|
|
$QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1"; |
|
|
|
$R = $DATABASE->Query( $QS ); |
|
|
|
$CAMS = $DATABASE->Query( $QS ); |
|
|
|
$idx = 0; |
|
|
|
if( count( $R ) ){ |
|
|
|
foreach( $R as $DD ){ |
|
|
|
if( count( $CAMS ) ){ |
|
|
|
foreach( $CAMS as $DD ){ |
|
|
|
if( $idx < 2 ){ |
|
|
|
$TFN = 'dash/node_' . $DD['type'] . '.js'; |
|
|
|
if(!file_exists( $TFN )) continue; |
|
|
|
@ -458,24 +464,24 @@ _DATA_BOUNDARY; |
|
|
|
|
|
|
|
$TPL = str_replace( '%%%WIDTH%%%', $W, $TPL ); |
|
|
|
$TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL ); |
|
|
|
$OUT[]= $STA[3+$idx] . $TPL . $END; |
|
|
|
$OUT[]= $STA[1+$idx] . $TPL . $END; |
|
|
|
} else break; |
|
|
|
$idx++; |
|
|
|
}; |
|
|
|
if( $idx < 2 ){ |
|
|
|
for( ;$idx<2;$idx++ ){ |
|
|
|
$T = str_replace( '%%ID%%', 2+$idx , $DUMMY['camera'] ); |
|
|
|
$OUT[]= $STA[3+$idx] . $T . $END; |
|
|
|
$OUT[]= $STA[1+$idx] . $T . $END; |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { |
|
|
|
for( ;$idx<2;$idx++ ){ |
|
|
|
$T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] ); |
|
|
|
$OUT[]= $STA[3+$idx] . $T . $END; |
|
|
|
$OUT[]= $STA[1+$idx] . $T . $END; |
|
|
|
}; |
|
|
|
}; |
|
|
|
$OUT[]= $STA[3] . $DUMMY['log'] . $END; |
|
|
|
$OUT[]= $STA[4] . $DUMMY['map'] . $END; |
|
|
|
$OUT[]= $STA[4] . $DUMMY['map'] .','. $DUMMY['log'] . $END; |
|
|
|
//$OUT[]= $STA[4] . . $END;
|
|
|
|
break; |
|
|
|
}; |
|
|
|
case 3:{ |
|
|
|
|