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