IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 6, 2011, 11:00:22 AM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20110710/ippMonitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/ippMonitor

  • branches/eam_branches/ipp-20110710/ippMonitor/raw/czartool_labels.php

    r31834 r32337  
    3131$servers=array(
    3232        "addstar",
     33        "addstarlap",
    3334        "cleanup",
    3435        "detrend",
     
    3940        "registration",
    4041        "replication",
     42        "stack",
    4143        "stdscience",
    4244        "summitcopy");
     
    4648$menu = $ID['menu'];
    4749
     50$selectedMode = $_GET[mode];
    4851$selectedStage = $_GET[stage];
    4952$selectedLabel = $_GET[label];
     
    5558$allServerCmd = $_GET[allservercmd];
    5659
    57 if ($selectedLabel == "") { $selectedLabel = "all_stdscience_labels"; }
     60$headerColor = "#0080c0";
     61$columnHeaderColor = "lavender";
     62
     63if ($selectedMode == "") { $selectedMode = "stdscience"; }
     64if ($selectedLabel == "") { $selectedLabel = "all"; }
    5865if ($selectedStage == "") { $selectedStage = "all_stages"; }
    5966if ($plotType == "") { $plotType = "linear"; }
     
    7380
    7481$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);
    7785$distLabels = getLabels($czardb, "distribution");
    7886$pubLabels = getLabels($czardb, "publishing");
    79 $updateLabels = getLabels($czardb, "update");
    8087
    8188if ($debug) {
     
    8693}
    8794
     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";
    88100
    89101// set up the form
     
    98110
    99111echo "<tr>";
    100 echo "<td colspan=\"2\" style=\"background-color:#0080c0;\">";
     112echo "<td colspan=\"3\" style=\"background-color:#0080c0;\">";
    101113echo "<h1 align=\"middle\">Czartool</h1>";
     114echo "<h4 align=\"middle\">$modeText (change to <a href=\"$link\"><font color=\"blue\">$modeLinkText</font></a>)</h4>";
    102115echo "</td>";
    103116echo "</tr>";
    104117
    105118echo "<tr valign=\"top\">";
    106 echo "<td style=\"background-color:#EEEEEE;width:100px;text-align:top;\">";
     119echo "<td style=width:100px;text-align:top;\">";
    107120 # time series plot
    108  echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
     121echo "<br>";
     122 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
    109123 # rate time series plot
    110  echo "<img src=\"czartool_getplot.php?type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     124echo "<br>";
     125 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
    111126 # 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>";
    113128 # 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
     131echo "<br>";
     132 echo "<img src=\"czartool_getplot.php?type=s\"><br>";
    115133 # 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>";
     134echo "<br>";
     135echo "<img src=\"czartool_getplot.php?type=st\"><br>";
    119136 # pantasks server status, if requested
     137echo "<br>";
    120138 if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
    121139echo "</td>";
    122 echo "<td style=\"background-color:#EEEEEE;height:200px;width:400px;text-align:top;\">";
    123 
    124 echo "<br><br>";
     140echo "<td style=height:200px;width:10px;text-align:top;\">";
     141echo "<td style=height:200px;width:400px;text-align:top;\">";
     142
     143#echo "<br>";
    125144
    126145// status table at top
     
    128147$plotTypeLink = ($plotType == "linear") ? "log" : "linear";
    129148$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";
     149echo "<br>";
     150echo $table;
     151#"<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     152createTableTitle("Status and links", 3);
    131153echo "<tr>\n";
    132154echo "<tr><td>Time of last update</td><td>$lastUpdateTime</td></tr>";
     
    136158echo "<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>";
    137159echo "<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://ipp004.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://ipp004.ifa.hawaii.edu/ippMetrics\"><font color=\"blue\">here</font></a></td></tr>";
     160echo "<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>";
     161echo "<tr><td>IPP metrics</td><td><a href=\"http://ipp0022.ifa.hawaii.edu/ps1sc/ippMetrics\"><font color=\"blue\">here</font></a></td></tr>";
    140162echo "<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>";
    141163echo "<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
    142169echo "</table>\n";
    143170
    144 echo "<br><br>";
     171echo "<br>";
    145172
    146173       createLabelsTable($pass,
    147174         $proj,
    148175         $czardb,
    149          "stdscience",
    150          $stdsLabels,
     176         $selectedMode,
     177         $labels,
    151178         $distLabels,
    152179         $pubLabels,
     
    158185         $plotType);
    159186
    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>";
     187if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();}
     188echo "<br>";
     189      createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
     190echo "<br>";
    177191      createSummitDataTable($gpc1db);
    178 echo "<br><br>";
     192echo "<br>";
    179193      createDatesTable($czardb);
    180 echo "<br><br>";
    181       createPStampDataTable();
    182 echo "<br><br>";
     194echo "<br>";
    183195      # This is awful
    184       echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     196      echo $table;
    185197      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>";
    187200      echo "<tr>";
    188       echo "<th>Database</th>";
    189       echo "<th>Status</th>";
     201      createTableColumnHeader("Database");
     202      createTableColumnHeader("Status");
    190203      showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    191204      showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
     
    217230
    218231    // 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";
    220236    echo "<tr>";
    221     echo "<th colspan=\"3\">Postage stamp requests</th>";
     237    createTableTitle("Postage stamp requests", 3);
    222238    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");
    226242
    227243    // list the results
     
    259275
    260276    // 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;
    262279    echo "<tr>";
    263     echo "<th colspan=\"3\">Status of last night's data</th>";
     280    createTableTitle("Status of last night's data", 3);
    264281    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");
    268285
    269286    $msg = "No science images taken since $date";
     
    281298        echo "<tr>";
    282299
    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;
    292302
    293303        echo "<td>$expType[0]</td>";
    294304        echo "<td>$summit[0]</td>";
    295305       
    296 
    297 
    298         #echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
    299         createFormattedTableCell("", "", $mhpcc[0], $error);
     306        createFormattedTableCell("", "", $mhpcc[0], $error, 0);
    300307
    301308        echo "</tr>";
    302309    }
    303310
    304     echo "<td colspan=\"3\">$msg</td>";
    305311    echo "</table>\n";
    306312
     
    337343        $proj,
    338344        $db,
    339         $server,
     345        $selectedMode,
    340346        $labels,
    341347        $distLabels,
     
    346352        $selectedLabel, $selectedStage, $plotType) {
    347353
     354    $isUpdate = ($selectedMode == "update");
     355    global $headerColor;
     356    global $columnHeaderColor;
     357
    348358    // 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
    350363    echo "<tr>\n";
    351     echo "<th colspan=\"13\">";
    352    
    353364    $link = "czartool_labels.php?pass=".$pass
    354365        ."&proj=".$proj
     366        ."&mode=".$selectedMode
    355367        ."&label=".$selectedLabel
    356368        ."&stage=all_stages"
    357369        ."&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>";
    404373    foreach ($stages as &$stage) {
    405374
     
    409378            "czartool_labels.php?pass=".$pass
    410379            ."&proj=".$proj
     380            ."&mode=" .$selectedMode
    411381            ."&label=".$selectedLabel
    412382            ."&stage=".$stage
    413383            ."&plottype=".$plotType;
    414384
    415         createFormattedTableCell($showLink, $link, $stage, 0);
    416     }
    417 
     385        createFormattedTableCell($showLink, $link, $stage, 0, "$columnHeaderColor");
     386#        createTableColumnHeader("Dates");
     387    }
    418388
    419389    // setup default link
     
    421391        "czartool_labels.php?pass=".$pass
    422392        ."&proj=".$proj
     393        ."&mode=" .$selectedMode
    423394        ."&label=".$selectedLabel
    424395        ."&stage=".$selectedStage
     
    426397
    427398    $searchState = "new";
    428     if ($server == "update") $searchState = "update";
     399    if ($selectedMode == "update") $searchState = "update";
    429400
    430401    // write rows
     
    444415        // show distribution/publishing status
    445416        echo "<tr>\n";
    446         $distPub = "&nbsp;";
    447         if ($distributing) $distPub = "D";
    448         if ($publishing) $distPub = $distPub . "P";
    449         echo "<td>$distPub</td>";
    450417
    451418        // create link to label summary page for each label
     
    455422            "czartool_labels.php?pass=".$pass
    456423            ."&proj=".$proj
     424            ."&mode=" .$selectedMode
    457425            ."&label=".$thisLabel
    458426            ."&stage=".$selectedStage
    459427            ."&plottype=".$plotType;
    460         createFormattedTableCell($showLink, $link, $thisLabel, 0);
     428        createFormattedTableCell($showLink, $link, $thisLabel, 0, null);
    461429
    462430        $str = "";
     
    465433        $link = $defaultlink;
    466434        getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults);
    467         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     435        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    468436
    469437        $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState;
    470438        getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
    471         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     439        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    472440
    473441        $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel . "&camRun.state=".$searchState;
    474442        getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults);
    475         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     443        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    476444
    477445        $link =  "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState;
    478446        getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults);
    479         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     447        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    480448
    481449        $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel . "&warpRun.state=".$searchState;
    482450        getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults);
    483         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     451        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    484452
    485453        $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState;
    486454        getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults);
    487         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     455        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    488456
    489457        $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
    490458        getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
    491         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     459        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    492460
    493461        $link = $defaultlink;
    494462        getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults);
    495         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     463        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    496464
    497465        $link = $defaultlink;
    498466        getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults);
    499         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     467        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    500468
    501469        $link = $defaultlink;
    502470        getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
    503         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     471        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    504472
    505473        $link = "publishDone.php?pass=" . $pass . "&proj=" . $proj . "&publishRun.label=" . $thisLabel . "&publishRun.state=".$searchState;
    506474        getStateAndFaults($db, $thisLabel, $selectedState, "pub", $str, $anyFaults);
    507         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     475        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$publishing) ? "gray" : null);
    508476
    509477        echo "</tr>\n";
    510478    }
    511479
    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;
    513510    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;
    515512
    516513    echo "</tr>\n";
     
    521518###########################################################################
    522519#
     520# Creates a table title
     521#
     522###########################################################################
     523function 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###########################################################################
     534function createTableColumnHeader($str) {
     535
     536    global $columnHeaderColor;
     537    echo "<th bgcolor=\"$columnHeaderColor\"><h3>$str</h3></th>";
     538}
     539
     540###########################################################################
     541#
    523542# Creates table cell with a red background if an error
    524543#
    525544###########################################################################
    526 function createFormattedTableCell($showLink, $link, $str, $error) {
     545function createFormattedTableCell($showLink, $link, $str, $error, $color) {
    527546
    528547    $fontColor = $error ? "black" : "blue";
    529548
    530549    if ($error) echo "<td bgcolor=\"red\">";
     550    else if ($color) echo "<td bgcolor=\"$color\">";
    531551    else  echo "<td>";
    532552    if ($showLink) echo "<a href=\"$link\"><font color=\"$fontColor\">$str</font></td>";
     
    640660function createDatesTable($db) {
    641661
    642     echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     662    global $table;
     663    echo $table;
    643664    echo "<tr>\n";
    644     echo "<th colspan=\"3\">Current dates for selected pantasks servers</th>";
     665    createTableTitle("Current dates for selected pantasks servers", 3);
    645666    echo "<tr>\n";
    646     echo "<th>Server</th>";
    647     echo "<th>Dates</th>";
     667    createTableColumnHeader("Server");
     668    createTableColumnHeader("Dates");
    648669    echo "</tr>\n";
    649670
     
    691712#
    692713###########################################################################
    693 function createServersTable($pass, $proj, $db, $servers, $selectedLabel, $selectedStage, $plotType) {
     714function createServersTable($pass, $proj, $selectedMode, $db, $servers, $selectedLabel, $selectedStage, $plotType) {
    694715
    695716    // 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;
    697719    echo "<tr>";
    698     echo "<th colspan=\"3\">Pantasks server status</th>";
     720    createTableTitle("Pantasks server status", 3);
    699721    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?");
    703725
    704726    //write_header_cell($class, "Server");
     
    731753        $link = "czartool_labels.php?pass=".$pass
    732754            ."&proj=".$proj
     755            ."&mode=".$selectedMode
    733756            ."&server=".$server
    734757            ."&label=".$selectedLabel
     
    740763        //write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
    741764        //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);
    745768
    746769        //if ($alive) {
Note: See TracChangeset for help on using the changeset viewer.