IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30939


Ignore:
Timestamp:
Mar 17, 2011, 12:12:26 PM (15 years ago)
Author:
rhenders
Message:

added link to pstamp server status page; improved table cell formatting, mainly for consistancy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_labels.php

    r30937 r30939  
    7373echo "<tr><td>ippMonitor SVN version</td><td>"; include 'version.php'; echo "</td></tr>";
    7474echo "<tr><td>Current nightly science status</td><td>$nsStatus</td></tr>";
     75echo "<tr><td>Postage stamp server status</td><td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\"><font color=\"blue\">here</font></a></td></tr>";
    7576echo "<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>";
    7677echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\"><font color=\"blue\">here</font></a></td></tr>";
     
    290291
    291292            if ($expType[0] == "OBJECT") $msg = "All science exposures taken since $date<br>have been registered at MHPCC";
    292             $color = "";
     293            $error = 0;
    293294        }
    294295        else {
    295296            if ($expType[0] == "OBJECT") $msg = "<font color=\"red\">Warning: Not all science exposures taken since $date<br>have been registered at MHPCC</a>";
    296             $color = "red";
     297            $error = 1;
    297298        }
    298299
     
    300301        echo "<td>$summit[0]</td>";
    301302       
    302         echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
     303
     304
     305        #echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
     306        createFormattedTableCell("", "", $mhpcc[0], $error);
    303307
    304308        echo "</tr>";
     
    416420            ."&plottype=".$plotType;
    417421
    418         createLabelTableCell($showLink, $link, $stage, "blue");
     422        createFormattedTableCell($showLink, $link, $stage, 0);
    419423    }
    420424
     
    461465            ."&stage=".$selectedStage
    462466            ."&plottype=".$plotType;
    463         createLabelTableCell($showLink, $link, $thisLabel, "blue");
     467        createFormattedTableCell($showLink, $link, $thisLabel, 0);
    464468
    465469        $str = "";
     
    468472        $link = $defaultlink;
    469473        getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults);
    470         createLabelTableCell($anyFaults, $link, $str, "red");
     474        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    471475
    472476        $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState;
    473477        getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
    474         createLabelTableCell($anyFaults, $link, $str, "red");
     478        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    475479
    476480        $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel . "&camRun.state=".$searchState;
    477481        getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults);
    478         createLabelTableCell($anyFaults, $link, $str, "red");
     482        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    479483
    480484        $link =  "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState;
    481485        getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults);
    482         createLabelTableCell($anyFaults, $link, $str, "red");
     486        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    483487
    484488        $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel . "&warpRun.state=".$searchState;
    485489        getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults);
    486         createLabelTableCell($anyFaults, $link, $str, "red");
     490        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    487491
    488492        $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState;
    489493        getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults);
    490         createLabelTableCell($anyFaults, $link, $str, "red");
     494        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    491495
    492496        $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
    493497        getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
    494         createLabelTableCell($anyFaults, $link, $str, "red");
     498        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    495499
    496500        $link = $defaultlink;
    497501        getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults);
    498         createLabelTableCell($anyFaults, $link, $str, "red");
     502        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    499503
    500504        $link = $defaultlink;
    501505        getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults);
    502         createLabelTableCell($anyFaults, $link, $str, "red");
     506        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    503507
    504508        $link = $defaultlink;
    505509        getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
    506         createLabelTableCell($anyFaults, $link, $str, "red");
     510        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    507511
    508512        $link = "publishDone.php?pass=" . $pass . "&proj=" . $proj . "&publishRun.label=" . $thisLabel . "&publishRun.state=".$searchState;
    509513        getStateAndFaults($db, $thisLabel, $selectedState, "pub", $str, $anyFaults);
    510         createLabelTableCell($anyFaults, $link, $str, "red");
     514        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
    511515
    512516        echo "</tr>\n";
     
    524528###########################################################################
    525529#
    526 # Creates table cell for lable table
    527 #
    528 ###########################################################################
    529 function createLabelTableCell($showLink, $link, $str, $color) {
    530 
    531     if ($showLink) echo "<td><a href=\"$link\"><font color=\"$color\">$str</font></td>";
    532     else if ($str) echo "<td>$str</td>";
    533     else echo "<td>&nbsp;</td>";
     530# Creates table cell with a red background if an error
     531#
     532###########################################################################
     533function createFormattedTableCell($showLink, $link, $str, $error) {
     534
     535    $fontColor = $error ? "black" : "blue";
     536
     537    if ($error) echo "<td bgcolor=\"red\">";
     538    else  echo "<td>";
     539    if ($showLink) echo "<a href=\"$link\"><font color=\"$fontColor\">$str</font></td>";
     540    else if ($str) echo "$str</td>";
     541    else echo "&nbsp;</td>";
    534542}
    535543
     
    739747        //write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
    740748        echo "<td>$server</td>";
    741         $yesNo = $alive ? "yes" : "NO";
    742         $color = $alive ? "" : "red";
    743         echo  "<td bgcolor=\"$color\">$yesNo</td>";
    744         $yesNo = $running ? "yes" : "NO";
    745         $color = $running ? "" : "red";
    746         echo  "<td bgcolor=\"$color\">$yesNo</td>";
     749        createFormattedTableCell(0, "", $alive ? "yes" : "NO", !$alive);
     750        createFormattedTableCell(0, "", $running ? "yes" : "NO", !$running);
    747751
    748752        //if ($alive) {
Note: See TracChangeset for help on using the changeset viewer.