ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/latest/latest.php
(Generate patch)

Comparing projects/cms/source/reports/php/latest/latest.php (file contents):
Revision 1.41 by tdb, Tue May 21 16:47:15 2002 UTC vs.
Revision 1.42 by tdb, Sun Oct 13 12:41:16 2002 UTC

# Line 38 | Line 38 | function printLine($title) {
38   }
39  
40  
41 < function showStat($title, $value, $input) {
41 > function showStat($title, $value, $input, $graph="") {
42  
43      $report = $value;
44  
# Line 54 | Line 54 | function showStat($title, $value, $input) {
54              </td>
55              <td width="50%" align="left" valign="top">
56               <? if (preg_match("/^[0-9]+\.?[0-9]*$/", $value)) {
57 <                    linkToHistory($report);
57 >                    linkToHistory($graph);
58                  } ?>
59                <?=$value?></td>
60            </tr>
# Line 63 | Line 63 | function showStat($title, $value, $input) {
63   }
64  
65  
66 < function linkToHistory($report) {
66 > function linkToHistory($graph) {
67      global $machine;
68 <    $yesterday = date("Y-m-d", time() - 86400);
69 <    echo <<<EOT
70 <        <a href="browser.php?machine_name=$machine&report=$report&day=$yesterday&submit=Show"><img src="minichart.gif" alt="View yesterday's 24-hour chart" width="20" height="20" border="0"></a>
68 >    if(!empty($graph)) {
69 >        echo <<<EOT
70 >        <a href="graphs.php?machine_name=$machine&graph=$graph&submit=Show"><img src="minichart.gif" alt="View historical graphs of this data" width="20" height="20" border="0"></a>
71   EOT;
72 +    }
73   }
74  
75  
# Line 83 | Line 84 | function showDisks($diskRoot, $units, $input) {
84          if ($name || $mount) {
85              $used = "$diskRoot.p$i.attributes.used";
86              $kbytes = "$diskRoot.p$i.attributes.kbytes";
87 <            showBar("$name<br>($mount)", $used, $kbytes, $units, $input);
87 >            $graph = preg_replace("/_/", "$hex_underscore", $mount);
88 >            $graph = preg_replace("/\//", "$hex_slash", $graph);
89 >            showBar("$name<br>($mount)", $used, $kbytes, $units, $input, "disk-$graph");
90          }
91          else {
92              break;
# Line 100 | Line 103 | function getPregMatch($value, $input) {
103  
104  
105   # show a bar-represented value.
106 < function showBar($title, $value, $max, $units, $input, $arrange='normal') {
106 > function showBar($title, $value, $max, $units, $input, $graph="", $arrange='normal') {
107  
108      include("latest_config.inc.php");
109  
# Line 131 | Line 134 | function showBar($title, $value, $max, $units, $input,
134      ?>
135          <table border="0" cellpadding="0" cellspacing="0" align="center">
136            <tr>
137 <            <td colspan="2"><? linkToHistory($report); ?> <b><?=$title?></b> <font size="2">(<?=$value?><?=$units?>)</font></td>
137 >            <td colspan="2"><? linkToHistory($graph); ?> <b><?=$title?></b> <font size="2">(<?=$value?><?=$units?>)</font></td>
138            </tr>
139            <tr>
140              <td colspan="2" bgcolor="#eeeeff"><img src="<?=$barImage?>" border="0" height="20" width="<?=$width?>"></td>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines