- Timestamp:
- Sep 6, 2011, 11:00:22 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/ippMonitor
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
raw/czartool_labels.php (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor (added) merged: 31876,31891-31892,31895-31896,32025,32028,32060,32093-32098,32101-32102,32172-32173,32178,32186,32212-32214,32224-32226,32278,32325
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20110710/ippMonitor/raw/czartool_labels.php
r31834 r32337 31 31 $servers=array( 32 32 "addstar", 33 "addstarlap", 33 34 "cleanup", 34 35 "detrend", … … 39 40 "registration", 40 41 "replication", 42 "stack", 41 43 "stdscience", 42 44 "summitcopy"); … … 46 48 $menu = $ID['menu']; 47 49 50 $selectedMode = $_GET[mode]; 48 51 $selectedStage = $_GET[stage]; 49 52 $selectedLabel = $_GET[label]; … … 55 58 $allServerCmd = $_GET[allservercmd]; 56 59 57 if ($selectedLabel == "") { $selectedLabel = "all_stdscience_labels"; } 60 $headerColor = "#0080c0"; 61 $columnHeaderColor = "lavender"; 62 63 if ($selectedMode == "") { $selectedMode = "stdscience"; } 64 if ($selectedLabel == "") { $selectedLabel = "all"; } 58 65 if ($selectedStage == "") { $selectedStage = "all_stages"; } 59 66 if ($plotType == "") { $plotType = "linear"; } … … 73 80 74 81 $debug = 0; 75 76 $stdsLabels = getLabels($czardb, "stdscience"); 82 $table = "<table bgcolor=\"#FFFFFF\" width=\"700\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 83 84 $labels = getLabels($czardb, $selectedMode); 77 85 $distLabels = getLabels($czardb, "distribution"); 78 86 $pubLabels = getLabels($czardb, "publishing"); 79 $updateLabels = getLabels($czardb, "update");80 87 81 88 if ($debug) { … … 86 93 } 87 94 95 $isUpdate = ($selectedMode == "update"); 96 $modeText = $isUpdate ? "Showing update processing" : "Showing standard processing"; 97 $modeLinkText = $isUpdate ? "standard" : "update"; 98 $modeLink = $isUpdate ? "stdscience" : "update"; 99 $link = "czartool_labels.php?pass=".$pass."&proj=".$proj."&mode=".$modeLink."&label=all&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotType"; 88 100 89 101 // set up the form … … 98 110 99 111 echo "<tr>"; 100 echo "<td colspan=\" 2\" style=\"background-color:#0080c0;\">";112 echo "<td colspan=\"3\" style=\"background-color:#0080c0;\">"; 101 113 echo "<h1 align=\"middle\">Czartool</h1>"; 114 echo "<h4 align=\"middle\">$modeText (change to <a href=\"$link\"><font color=\"blue\">$modeLinkText</font></a>)</h4>"; 102 115 echo "</td>"; 103 116 echo "</tr>"; 104 117 105 118 echo "<tr valign=\"top\">"; 106 echo "<td style= \"background-color:#EEEEEE;width:100px;text-align:top;\">";119 echo "<td style=width:100px;text-align:top;\">"; 107 120 # time series plot 108 echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>"; 121 echo "<br>"; 122 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>"; 109 123 # rate time series plot 110 echo "<img src=\"czartool_getplot.php?type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>"; 124 echo "<br>"; 125 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>"; 111 126 # rate stacked histo plot 112 echo "<img src=\"czartool_getplot.php?type=rh&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";127 #echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rh&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>"; 113 128 # histogram plot 114 echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>"; 129 #echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>"; 130 # storage plot 131 echo "<br>"; 132 echo "<img src=\"czartool_getplot.php?type=s\"><br>"; 115 133 # storage timeseries 116 echo "<img src=\"czartool_getplot.php?type=st\"><br>"; 117 # storage plot 118 echo "<img src=\"czartool_getplot.php?type=s\"><br>"; 134 echo "<br>"; 135 echo "<img src=\"czartool_getplot.php?type=st\"><br>"; 119 136 # pantasks server status, if requested 137 echo "<br>"; 120 138 if ($selectedServer && !$serverCmd) showServerStatus($selectedServer); 121 139 echo "</td>"; 122 echo "<td style=\"background-color:#EEEEEE;height:200px;width:400px;text-align:top;\">"; 123 124 echo "<br><br>"; 140 echo "<td style=height:200px;width:10px;text-align:top;\">"; 141 echo "<td style=height:200px;width:400px;text-align:top;\">"; 142 143 #echo "<br>"; 125 144 126 145 // status table at top … … 128 147 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; 129 148 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 130 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 149 echo "<br>"; 150 echo $table; 151 #"<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 152 createTableTitle("Status and links", 3); 131 153 echo "<tr>\n"; 132 154 echo "<tr><td>Time of last update</td><td>$lastUpdateTime</td></tr>"; … … 136 158 echo "<tr><td>Documentation</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\"><font color=\"blue\">here</font></a></td></tr>"; 137 159 echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&hc=6&c=IPP%2520Production\"><font color=\"blue\">here</font></a></td></tr>"; 138 echo "<tr><td>Who's using the cluster?</td><td><a href=\"http://ipp 004.ifa.hawaii.edu/clusterMonitor/top.html\"><font color=\"blue\">here</font></a></td></tr>";139 echo "<tr><td>IPP metrics</td><td><a href=\"http://ipp00 4.ifa.hawaii.edu/ippMetrics\"><font color=\"blue\">here</font></a></td></tr>";160 echo "<tr><td>Who's using the cluster?</td><td><a href=\"http://ippdb01.ifa.hawaii.edu/clusterMonitor/top.html\"><font color=\"blue\">here</font></a></td></tr>"; 161 echo "<tr><td>IPP metrics</td><td><a href=\"http://ipp0022.ifa.hawaii.edu/ps1sc/ippMetrics\"><font color=\"blue\">here</font></a></td></tr>"; 140 162 echo "<tr><td>Czar log pages</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\"><font color=\"blue\">here</font></a></td></tr>"; 141 163 echo "<tr><td>Exposure summary</td><td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\"><font color=\"blue\">here</font></a></td></tr>"; 164 165 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; 166 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 167 168 142 169 echo "</table>\n"; 143 170 144 echo "<br> <br>";171 echo "<br>"; 145 172 146 173 createLabelsTable($pass, 147 174 $proj, 148 175 $czardb, 149 "stdscience",150 $ stdsLabels,176 $selectedMode, 177 $labels, 151 178 $distLabels, 152 179 $pubLabels, … … 158 185 $plotType); 159 186 160 echo "<br><br>"; 161 createLabelsTable($pass, 162 $proj, 163 $czardb, 164 "update", 165 $updateLabels, 166 $distLabels, 167 $pubLabels, 168 $stages, 169 $states, 170 "new", 171 $selectedLabel, 172 $selectedStage, 173 $plotType); 174 echo "<br><br>"; 175 createServersTable($pass, $proj,$czardb, $servers, $selectedLabel, $selectedStage, $plotType); 176 echo "<br><br>"; 187 if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();} 188 echo "<br>"; 189 createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType); 190 echo "<br>"; 177 191 createSummitDataTable($gpc1db); 178 echo "<br> <br>";192 echo "<br>"; 179 193 createDatesTable($czardb); 180 echo "<br><br>"; 181 createPStampDataTable(); 182 echo "<br><br>"; 194 echo "<br>"; 183 195 # This is awful 184 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";196 echo $table; 185 197 echo "<tr>"; 186 echo "<th colspan=\"2\">Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)</th>"; 198 createTableTitle("Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2); 199 # echo "<th colspan=\"2\"><h2>Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)</h2></th>"; 187 200 echo "<tr>"; 188 echo "<th>Database</th>";189 echo "<th>Status</th>";201 createTableColumnHeader("Database"); 202 createTableColumnHeader("Status"); 190 203 showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1); 191 204 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS); … … 217 230 218 231 // set up the table 219 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 232 global $table; 233 echo $table; 234 235 #echo "<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 220 236 echo "<tr>"; 221 echo "<th colspan=\"3\">Postage stamp requests</th>";237 createTableTitle("Postage stamp requests", 3); 222 238 echo "<tr>"; 223 echo "<th>Label</th>";224 echo "<th>Unfinished jobs</th>";225 echo "<th>Priority</th>";239 createTableColumnHeader("Label"); 240 createTableColumnHeader("Unfinished jobs"); 241 createTableColumnHeader("Priority"); 226 242 227 243 // list the results … … 259 275 260 276 // set up the table 261 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 277 global $table; 278 echo $table; 262 279 echo "<tr>"; 263 echo "<th colspan=\"3\">Status of last night's data</th>";280 createTableTitle("Status of last night's data", 3); 264 281 echo "<tr>"; 265 echo "<th>Exposure type</th>";266 echo "<th>At summit</th>";267 echo "<th>Registered at MHPCC</th>";282 createTableColumnHeader("Exposure type"); 283 createTableColumnHeader("At summit"); 284 createTableColumnHeader("Registered at MHPCC"); 268 285 269 286 $msg = "No science images taken since $date"; … … 281 298 echo "<tr>"; 282 299 283 if ($summit[0] == $mhpcc[0]) { 284 285 if ($expType[0] == "OBJECT") $msg = "All science exposures taken since $date<br>have been registered at MHPCC"; 286 $error = 0; 287 } 288 else { 289 if ($expType[0] == "OBJECT") $msg = "<font color=\"red\">Warning: Not all science exposures taken since $date<br>have been registered at MHPCC</a>"; 290 $error = 1; 291 } 300 if ($summit[0] == $mhpcc[0]) $error = 0; 301 else $error = 1; 292 302 293 303 echo "<td>$expType[0]</td>"; 294 304 echo "<td>$summit[0]</td>"; 295 305 296 297 298 #echo "<td bgcolor=\"$color\">$mhpcc[0]</td>"; 299 createFormattedTableCell("", "", $mhpcc[0], $error); 306 createFormattedTableCell("", "", $mhpcc[0], $error, 0); 300 307 301 308 echo "</tr>"; 302 309 } 303 310 304 echo "<td colspan=\"3\">$msg</td>";305 311 echo "</table>\n"; 306 312 … … 337 343 $proj, 338 344 $db, 339 $se rver,345 $selectedMode, 340 346 $labels, 341 347 $distLabels, … … 346 352 $selectedLabel, $selectedStage, $plotType) { 347 353 354 $isUpdate = ($selectedMode == "update"); 355 global $headerColor; 356 global $columnHeaderColor; 357 348 358 // setup table 349 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 359 global $table; 360 echo $table; 361 createTableTitle("Label status", 13); 362 350 363 echo "<tr>\n"; 351 echo "<th colspan=\"13\">";352 353 364 $link = "czartool_labels.php?pass=".$pass 354 365 ."&proj=".$proj 366 ."&mode=".$selectedMode 355 367 ."&label=".$selectedLabel 356 368 ."&stage=all_stages" 357 369 ."&plottype=".$plotType; 358 if ($selectedStage != "all_stages") echo "<a href=\"$link\"><font color=\"blue\">"; 359 else echo "<a><font color=\"black\">"; 360 echo "Plot all stages</font></a> | "; 361 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType; 362 echo "<a "; 363 if ($selectedLabel != "all_".$server."_labels") echo "<a href=\"$link\"><font color=\"blue\">"; 364 else echo "<a><font color=\"black\">"; 365 echo "Plot all ".$server."_labels</a> | "; 366 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; 367 $plotTypeText = ($plotType == "linear") ? "Use log plots" : "Use linear plots"; 368 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 369 echo "<a href=\"$link\"><font color=\"blue\">$plotTypeText</font></a>"; 370 371 372 echo "</th>"; 373 echo "</tr>\n"; 374 375 echo "<tr>\n"; 376 //echo "<th></th>"; 377 echo "<th colspan=\"2\">$server server</th>"; 378 echo "<th>Reverts:</th>"; 379 380 foreach ($stages as &$stage) { 381 382 if ($stage == "burntool") continue; 383 $reverting = getRevertStatus($db, $stage); 384 $link = 385 "czartool_labels.php?pass=".$pass 386 ."&proj=".$proj 387 ."&label=".$selectedLabel 388 ."&stage=".$selectedStage 389 ."&plottype=".$plotType 390 ."&revertstage=".$stage 391 ."&revertmode="; 392 393 if(!$reverting) {$label = "Start";$link = $link . "on";} 394 if($reverting) {$label = "Stop";$link = $link . "off";} 395 unset($reverting); 396 echo "<td><a href=\"$link\"><font color=\"blue\">$label</font></td>"; 397 398 } 399 400 echo "</tr>\n"; 401 echo "<tr>\n"; 402 //echo "<th> </th>"; 403 echo "<th colspan=\"2\">Label (in order of priority)</th>"; 370 createFormattedTableCell(($selectedStage != "all_stages"), $link, "All stages", 0, "$columnHeaderColor"); 371 372 #echo "<th>Label (in order of priority)</th>"; 404 373 foreach ($stages as &$stage) { 405 374 … … 409 378 "czartool_labels.php?pass=".$pass 410 379 ."&proj=".$proj 380 ."&mode=" .$selectedMode 411 381 ."&label=".$selectedLabel 412 382 ."&stage=".$stage 413 383 ."&plottype=".$plotType; 414 384 415 createFormattedTableCell($showLink, $link, $stage, 0 );416 } 417 385 createFormattedTableCell($showLink, $link, $stage, 0, "$columnHeaderColor"); 386 # createTableColumnHeader("Dates"); 387 } 418 388 419 389 // setup default link … … 421 391 "czartool_labels.php?pass=".$pass 422 392 ."&proj=".$proj 393 ."&mode=" .$selectedMode 423 394 ."&label=".$selectedLabel 424 395 ."&stage=".$selectedStage … … 426 397 427 398 $searchState = "new"; 428 if ($se rver== "update") $searchState = "update";399 if ($selectedMode == "update") $searchState = "update"; 429 400 430 401 // write rows … … 444 415 // show distribution/publishing status 445 416 echo "<tr>\n"; 446 $distPub = " ";447 if ($distributing) $distPub = "D";448 if ($publishing) $distPub = $distPub . "P";449 echo "<td>$distPub</td>";450 417 451 418 // create link to label summary page for each label … … 455 422 "czartool_labels.php?pass=".$pass 456 423 ."&proj=".$proj 424 ."&mode=" .$selectedMode 457 425 ."&label=".$thisLabel 458 426 ."&stage=".$selectedStage 459 427 ."&plottype=".$plotType; 460 createFormattedTableCell($showLink, $link, $thisLabel, 0 );428 createFormattedTableCell($showLink, $link, $thisLabel, 0, null); 461 429 462 430 $str = ""; … … 465 433 $link = $defaultlink; 466 434 getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults); 467 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );435 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 468 436 469 437 $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState; 470 438 getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults); 471 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );439 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 472 440 473 441 $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel . "&camRun.state=".$searchState; 474 442 getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults); 475 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );443 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 476 444 477 445 $link = "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState; 478 446 getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults); 479 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );447 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 480 448 481 449 $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel . "&warpRun.state=".$searchState; 482 450 getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults); 483 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );451 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 484 452 485 453 $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState; 486 454 getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults); 487 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );455 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 488 456 489 457 $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState; 490 458 getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults); 491 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );459 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0); 492 460 493 461 $link = $defaultlink; 494 462 getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults); 495 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );463 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null); 496 464 497 465 $link = $defaultlink; 498 466 getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults); 499 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );467 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null); 500 468 501 469 $link = $defaultlink; 502 470 getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults); 503 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );471 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null); 504 472 505 473 $link = "publishDone.php?pass=" . $pass . "&proj=" . $proj . "&publishRun.label=" . $thisLabel . "&publishRun.state=".$searchState; 506 474 getStateAndFaults($db, $thisLabel, $selectedState, "pub", $str, $anyFaults); 507 createFormattedTableCell($anyFaults, $link, $str, $anyFaults );475 createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$publishing) ? "gray" : null); 508 476 509 477 echo "</tr>\n"; 510 478 } 511 479 512 if ($selectedLabel == "all_".$server."_labels") $showLink = 0; 480 echo "<tr>\n"; 481 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . "&label=all&stage=".$selectedStage."&plottype=".$plotType; 482 createFormattedTableCell(($selectedLabel != "all"), $link, "All labels", 0, null); 483 484 createFormattedTableCell(0, null, "Reverts:", 0, "$columnHeaderColor"); 485 486 foreach ($stages as &$stage) { 487 488 if ($stage == "burntool") continue; 489 $reverting = getRevertStatus($db, $stage); 490 $link = 491 "czartool_labels.php?pass=".$pass 492 ."&proj=".$proj 493 ."&mode=" .$selectedMode 494 ."&label=".$selectedLabel 495 ."&stage=".$selectedStage 496 ."&plottype=".$plotType 497 ."&revertstage=".$stage 498 ."&revertmode="; 499 500 if(!$reverting) {$label = "Start";$link = $link . "on";} 501 if($reverting) {$label = "Stop";$link = $link . "off";} 502 unset($reverting); 503 createFormattedTableCell(1, $link, $label, 0, "$columnHeaderColor"); 504 #echo "<td><a href=\"$link\"><font color=\"blue\">$label</font></td>"; 505 506 } 507 508 echo "</tr>\n"; 509 if ($selectedLabel == "all") $showLink = 0; 513 510 else $showLink = 1; 514 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType;511 $link = "czartool_labels.php?pass=".$pass."&proj=".$proj."&mode=".$selectedMode."&label=all&stage=".$selectedStage."&plottype=".$plotType; 515 512 516 513 echo "</tr>\n"; … … 521 518 ########################################################################### 522 519 # 520 # Creates a table title 521 # 522 ########################################################################### 523 function createTableTitle($str, $colSpan) { 524 525 global $headerColor; 526 echo "<th colspan=\"$colSpan\"bgcolor=\"$headerColor\"><h2>$str</h2></th>"; 527 } 528 529 ########################################################################### 530 # 531 # Creates a table header cell 532 # 533 ########################################################################### 534 function createTableColumnHeader($str) { 535 536 global $columnHeaderColor; 537 echo "<th bgcolor=\"$columnHeaderColor\"><h3>$str</h3></th>"; 538 } 539 540 ########################################################################### 541 # 523 542 # Creates table cell with a red background if an error 524 543 # 525 544 ########################################################################### 526 function createFormattedTableCell($showLink, $link, $str, $error ) {545 function createFormattedTableCell($showLink, $link, $str, $error, $color) { 527 546 528 547 $fontColor = $error ? "black" : "blue"; 529 548 530 549 if ($error) echo "<td bgcolor=\"red\">"; 550 else if ($color) echo "<td bgcolor=\"$color\">"; 531 551 else echo "<td>"; 532 552 if ($showLink) echo "<a href=\"$link\"><font color=\"$fontColor\">$str</font></td>"; … … 640 660 function createDatesTable($db) { 641 661 642 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 662 global $table; 663 echo $table; 643 664 echo "<tr>\n"; 644 echo "<th colspan=\"3\">Current dates for selected pantasks servers</th>";665 createTableTitle("Current dates for selected pantasks servers", 3); 645 666 echo "<tr>\n"; 646 echo "<th>Server</th>";647 echo "<th>Dates</th>";667 createTableColumnHeader("Server"); 668 createTableColumnHeader("Dates"); 648 669 echo "</tr>\n"; 649 670 … … 691 712 # 692 713 ########################################################################### 693 function createServersTable($pass, $proj, $ db, $servers, $selectedLabel, $selectedStage, $plotType) {714 function createServersTable($pass, $proj, $selectedMode, $db, $servers, $selectedLabel, $selectedStage, $plotType) { 694 715 695 716 // set up table columns 696 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 717 global $table; 718 echo $table; 697 719 echo "<tr>"; 698 echo "<th colspan=\"3\">Pantasks server status</th>";720 createTableTitle("Pantasks server status", 3); 699 721 echo "<tr>"; 700 echo "<th>Server</th>";701 echo "<th>Alive?</th>";702 echo "<th>Running?</th>";722 createTableColumnHeader("Server"); 723 createTableColumnHeader("Alive?"); 724 createTableColumnHeader("Running?"); 703 725 704 726 //write_header_cell($class, "Server"); … … 731 753 $link = "czartool_labels.php?pass=".$pass 732 754 ."&proj=".$proj 755 ."&mode=".$selectedMode 733 756 ."&server=".$server 734 757 ."&label=".$selectedLabel … … 740 763 //write_table_cell($class, '%s', "", $alive ? "yes" : "NO"); 741 764 //echo "<td>$server</td>"; 742 createFormattedTableCell(1, $link, $server, 0 );743 createFormattedTableCell(0, "", $alive ? "yes" : "NO", !$alive );744 createFormattedTableCell(0, "", $running ? "yes" : "NO", !$running );765 createFormattedTableCell(1, $link, $server, 0, 0); 766 createFormattedTableCell(0, "", $alive ? "yes" : "NO", !$alive, 0); 767 createFormattedTableCell(0, "", $running ? "yes" : "NO", !$running, 0); 745 768 746 769 //if ($alive) {
Note:
See TracChangeset
for help on using the changeset viewer.
