From: Florian G. <re...@us...> - 2008-12-11 09:37:12
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10697/phpgui Modified Files: Makefile.am Makefile.in perfparse.php utils.php Log Message: start of mor intuitive menu Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** utils.php 4 Jul 2008 00:02:34 -0000 1.51 --- utils.php 11 Dec 2008 09:37:01 -0000 1.52 *************** *** 920,925 **** $query= 'select s.service_description, s.host_id, s.is_deleted, h.host_name '; $query.='from perfdata_service s, perfdata_host h where s.service_id=? and h.host_id=s.host_id'; ! $ret=$db->GetRow($query,array($serviceid)); ! return($ret); } --- 920,928 ---- $query= 'select s.service_description, s.host_id, s.is_deleted, h.host_name '; $query.='from perfdata_service s, perfdata_host h where s.service_id=? and h.host_id=s.host_id'; ! if($ret=$db->GetRow($query,array($serviceid))) { ! return($ret); ! } else { ! return(FALSE); ! } } Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/Makefile.in,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile.in 9 Nov 2008 00:14:32 -0000 1.18 --- Makefile.in 11 Dec 2008 09:37:01 -0000 1.19 *************** *** 268,271 **** --- 268,272 ---- templates/error.tpl.html \ templates/graph.tpl.html \ + templates/availability.tpl.html \ templates/graphmenu.tpl.html \ templates/mainmenu.tpl.html \ *************** *** 280,285 **** --- 281,291 ---- templates/edit_host_list.tpl.html \ templates/select_metric.tpl.html \ + templates/select_service.tpl.html \ templates/tabber.tpl.html \ templates/default.css \ + templates/print.css \ + templates/graph.png \ + templates/open.png \ + templates/avail.png \ templates_c/index.php \ Smarty/COPYING.lib \ Index: Makefile.am =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.am 9 Nov 2008 00:14:32 -0000 1.11 --- Makefile.am 11 Dec 2008 09:37:01 -0000 1.12 *************** *** 29,32 **** --- 29,33 ---- templates/error.tpl.html \ templates/graph.tpl.html \ + templates/availability.tpl.html \ templates/graphmenu.tpl.html \ templates/mainmenu.tpl.html \ *************** *** 41,46 **** --- 42,52 ---- templates/edit_host_list.tpl.html \ templates/select_metric.tpl.html \ + templates/select_service.tpl.html \ templates/tabber.tpl.html \ templates/default.css \ + templates/print.css \ + templates/graph.png \ + templates/open.png \ + templates/avail.png \ templates_c/index.php \ Smarty/COPYING.lib \ Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** perfparse.php 3 Jul 2008 23:50:43 -0000 1.65 --- perfparse.php 11 Dec 2008 09:37:01 -0000 1.66 *************** *** 142,146 **** ! case 'select_host': // get_hosts is defined in utils.php $hosts=get_hosts($db); --- 142,152 ---- ! case 'select_host_for_graph': ! case 'select_host_for_availability': ! //Next Wizard step depend on initial link ! $wizard_next=($page=='select_host_for_graph')?'select_metric':'select_service'; ! $wizard_dest=($page=='select_host_for_graph')?'graph':'availability'; ! $smarty->assign_by_ref('wizard_next',$wizard_next); ! $smarty->assign_by_ref('wizard_dest',$wizard_dest); // get_hosts is defined in utils.php $hosts=get_hosts($db); *************** *** 154,157 **** --- 160,164 ---- case 'select_metric': + case 'select_service': // get host array get_request_var('host_id','array'); *************** *** 187,193 **** --- 194,203 ---- // used for selecting all metrics of a type via js $diffmetrics=array(); + $diffservices=array(); foreach($metrics as $hostId => $servicearray) { foreach($servicearray as $serviceid => $metricarray) { $service_description=$metricarray['service_description']; + $diffservices[$service_description]['hostids'][]=$hostId; + $diffservices[$service_description]['count']=count($diffservices[$service_description]['hostids']); foreach($metricarray['metrics'] as $metricid=>$metric ) { $diffmetrics[$service_description][$metric]["metric_ids"][]=$metricid; *************** *** 197,203 **** } // echo "diffmetrics array:<br /><pre>"; print_r($diffmetrics); echo "</pre>"; $smarty->assign_by_ref('diffmetrics',$diffmetrics); ! ! $smarty->display($config['PHP_Style'].'select_metric.tpl.html'); break; --- 207,215 ---- } // echo "diffmetrics array:<br /><pre>"; print_r($diffmetrics); echo "</pre>"; + // echo "diffservices array:<br /><pre>"; print_r($diffservices); echo "</pre>"; $smarty->assign_by_ref('diffmetrics',$diffmetrics); ! $smarty->assign_by_ref('diffservices',$diffservices); ! ! $smarty->display($config['PHP_Style'].$page.'.tpl.html'); break; *************** *** 205,209 **** case 'graph': ! // for the uri if($_SERVER['SERVER_PORT']==443 || (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')) { $proto='https'; --- 217,221 ---- case 'graph': ! // for the uri TODO: put in common startup code if($_SERVER['SERVER_PORT']==443 || (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')) { $proto='https'; *************** *** 272,276 **** $formvars=array('s_val'=>1, 's_smo'=>0, 's_war'=>1, 's_cri'=>1, 's_sta'=>1); foreach($formvars as $fvar=>$vdef) { ! if(!isset($actgraph['timerange'])) { // first call, set defaults $actgraph[$fvar]=$vdef; --- 284,288 ---- $formvars=array('s_val'=>1, 's_smo'=>0, 's_war'=>1, 's_cri'=>1, 's_sta'=>1); foreach($formvars as $fvar=>$vdef) { ! if(!isset($actgraph[$fvar])) { // first call, set defaults $actgraph[$fvar]=$vdef; *************** *** 355,359 **** } // if(get_request_var('graphs' ... ! // echo "<pre>\ndisplaygraphs:\n";print_r($displaygraphs); echo "</pre>"; if($numgraphs>0) { --- 367,371 ---- } // if(get_request_var('graphs' ... ! // echo "<pre>\ndisplaygraphs:\n";print_r($displaygraphs); echo "</pre>"; if($numgraphs>0) { *************** *** 363,367 **** $smarty->display($config['PHP_Style'].'graph.tpl.html'); } else { ! $smarty->assign('message','Wrong input vars'); $smarty->display($config['PHP_Style'].'error.tpl.html'); die(); --- 375,379 ---- $smarty->display($config['PHP_Style'].'graph.tpl.html'); } else { ! $smarty->assign('message','No metric selected'); $smarty->display($config['PHP_Style'].'error.tpl.html'); die(); *************** *** 370,373 **** --- 382,413 ---- + case 'availability': + + $numreports=0; + + $servicearray=array(); + if(get_request_var('availability','array')) { + echo "<pre>\navailability:\n";print_r($availability); echo "</pre>"; + foreach($availability as $serviceId => $dummyarray) { + if ($dummyarray['display'] && $servicearray[$serviceId]=get_info_from_service_id($db,$serviceId)) { + $numreports++; + } + } + } + echo "<pre>\nservicearray:\n";print_r($servicearray); echo "</pre>"; + $smarty->assign_by_ref('servicearray',$servicearray); + + if($numreports>0) { + $smarty->assign_by_ref('availability',$availability); + $smarty->display($config['PHP_Style'].'availability.tpl.html'); + } else { + $smarty->assign('message','No Service selected'); + $smarty->display($config['PHP_Style'].'error.tpl.html'); + die(); + } + break; + + + /* depreciated pages. shall be removed as soon as possible*/ case 'all_bin': case 'all_raw': *************** *** 397,400 **** --- 437,441 ---- + /* depreciated pages. shall be removed as soon as possible*/ case 'raw_history': case 'raw_history_summary': |