IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30908


Ignore:
Timestamp:
Mar 15, 2011, 9:23:17 AM (15 years ago)
Author:
rhenders
Message:

A facelift for the czartool web page

File:
1 edited

Legend:

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

    r30760 r30908  
    5858if ($plotType == "") { $plotType = "linear"; }
    5959
     60
     61// header block
     62echo "<head>";
     63echo "<h1 align=\"middle\">Czartool</h1>";
     64echo "</head>";
     65
     66// status table at top
    6067$nsStatus = getNightlyScienceStatus($czardb);
    6168$plotTypeLink = ($plotType == "linear") ? "log" : "linear";
    6269$link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
    63 echo "<p>Current ippMonitor SVN version: ";
    64 include 'version.php';
    65 echo "</p>";
    66 echo "<p  align=\"center\"> Current status of the IPP as of $lastUpdateTime (faults are shown in parentheses). <br>Documentation can be found <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\">here</a> and cluster load monitored <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\">here</a><br>Current nightly science status: $nsStatus<br>Use <a href=\"$link\"> $plotTypeLink</a> plots <br/><a href=\"http://ipp004.ifa.hawaii.edu/clusterMonitor/top.html\">Who uses the cluster?</a><br><a href=\"http://ipp004.ifa.hawaii.edu/ippMetrics\">IPP Metrics</a><br/><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\">Czar log pages</a><br><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\">Exposure summary</a></p>";
     70echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     71echo "<tr>\n";
     72echo "<tr><td>Time of last update</td><td>$lastUpdateTime</td></tr>";
     73echo "<tr><td>ippMonitor SVN version</td><td>"; include 'version.php'; echo "</td></tr>";
     74echo "<tr><td>Current nightly science status</td><td>$nsStatus</td></tr>";
     75echo "<tr><td>Documentation</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\">here</a></td></tr>";
     76echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\">here</a></td></tr>";
     77echo "<tr><td>Who's using the cluster?</td><td><a href=\"http://ipp004.ifa.hawaii.edu/clusterMonitor/top.html\">here</a></td></tr>";
     78echo "<tr><td>IPP metrics</td><td><a href=\"http://ipp004.ifa.hawaii.edu/ippMetrics\">here</a></td></tr>";
     79echo "<tr><td>Czar log pages</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\">here</a></td></tr>";
     80echo "<tr><td>Exposure summary</td><td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\">here</a></td></tr>";
     81echo "</table>\n";
    6782
    6883// deal with reverts: turn on or off if requested and pass current revert state for this stage onto labels table later
     
    102117echo "</form>\n";
    103118
    104   echo "<table>\n";
    105 
    106 
    107   # 1st row
    108     echo "<tr>\n";
     119echo "<table>\n";
     120
     121 # 1st row
     122  echo "<tr>\n";
     123   echo "<td> \n";
     124    echo "<table>\n";
     125     echo "<tr valign=center>\n";
    109126      echo "<td> \n";
    110         echo "<table>\n";
    111           echo "<tr valign=center>\n";
    112             echo "<td> \n";
    113               # timeseries plot
    114               echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
    115             echo "</td>\n";
    116             echo "<td>\n";
    117               createLabelsTable($pass,
    118                       $proj,
    119                       $czardb,
    120                       "stdscience",
    121                       $stdsLabels,
    122                       $distLabels,
    123                       $pubLabels,
    124                       $stages,
    125                       $states,
    126                       "new",
    127                       $selectedLabel,
    128                       $selectedStage,
    129                       $plotType);
    130             echo "</td>\n";
    131           echo "</tr>\n";
    132         echo "</table>\n";
    133       echo "</td> \n";
    134     echo "</tr>\n";
    135 
    136 
    137 
    138     # 2nd row
    139     echo "<tr>\n";
    140       echo "<td> \n";
    141         echo "<table>\n";
    142           echo "<tr valign=center>\n";
    143             echo "<td> \n";
    144               # rate plot
    145               echo "<img src=\"czartool_getplot.php?type=r&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
    146             echo "</td>\n";
    147             echo "<td>\n";
    148             createLabelsTable($pass,
    149                     $proj,
    150                     $czardb,
    151                     "update",
    152                     $updateLabels,
    153                     $distLabels,
    154                     $pubLabels,
    155                     $stages,
    156                     $states,
    157                     "new",
    158                     $selectedLabel,
    159                     $selectedStage,
    160                     $plotType);
    161             echo "</td>\n";
    162           echo "</tr>\n";
    163         echo "</table>\n";
    164       echo "</td> \n";
    165     echo "</tr>\n";
    166 
    167 
    168     # 3rd row
    169     echo "<tr>\n";
    170       echo "<td> \n";
    171         echo "<table>\n";
    172           echo "<tr valign=top>\n";
    173             echo "<td> \n";
    174               # histogram plot
    175               echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
    176             echo "</td>\n";
    177             echo "<td>\n";
    178               createServersTable($pass, $proj,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
    179             echo "</td>\n";
    180 
    181             echo "<td> \n";
    182               $today = date("Y-m-d");
    183               createSummitDataTable($gpc1db, $today);
    184             echo "</td>\n";
    185           echo "</tr>\n";
    186         echo "</table>\n";
    187       echo "</td> \n";
    188     echo "</tr>\n";
    189 
    190     # 4th row
    191     echo "<tr>\n";
    192       echo "<td> \n";
    193         echo "<table>\n";
    194           echo "<tr valign=top>\n";
    195             echo "<td> \n";
    196               # storage plot
    197               echo "<img src=\"czartool_getplot.php?type=s\"><br>";
    198             echo "</td>\n";
    199             echo "<td>\n";
    200               createDatesTable($czardb);
    201             echo "</td>\n";
    202           echo "</tr>\n";
    203         echo "</table>\n";
    204       echo "</td> \n";
    205     echo "</tr>\n";
    206 
    207     # 5th row
    208     echo "<tr>\n";
     127       # timeseries plot
     128       echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
     129      echo "</td>\n";
    209130      echo "<td>\n";
    210         echo "<table>\n";
    211           echo "<tr valign=top>\n";
    212             echo "<td> \n";
    213               if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
    214             echo "</td>\n";
    215             echo "<td>\n";
    216             # This is awful
    217               echo "<table border=\"1\"><tr><td colspan=\"2\"><b>Databases Replication Status</b></td></tr>";
    218                 echo "<tr><td colspan=\"2\">Update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a></td></tr>";
    219                 echo "<tr><td>Database</td><td>Replication Status</td></tr>";
    220                 showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    221                 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
    222                 showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
    223               echo "</table>";
    224             echo "</td>\n";
    225           echo "</tr>\n";
    226         echo "</table>\n";
    227       echo "</td> \n";
    228     echo "</tr>\n";
    229 
    230   echo "</table>\n";
     131       createLabelsTable($pass,
     132         $proj,
     133         $czardb,
     134         "stdscience",
     135         $stdsLabels,
     136         $distLabels,
     137         $pubLabels,
     138         $stages,
     139         $states,
     140         "new",
     141         $selectedLabel,
     142         $selectedStage,
     143         $plotType);
     144      echo "</td>\n";
     145    echo "</tr>\n";
     146   echo "</table>\n";
     147  echo "</td> \n";
     148 echo "</tr>\n";
     149
     150 # 2nd row
     151 echo "<tr>\n";
     152  echo "<td> \n";
     153   echo "<table>\n";
     154    echo "<tr valign=center>\n";
     155     echo "<td> \n";
     156      # rate plot
     157      echo "<img src=\"czartool_getplot.php?type=r&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     158     echo "</td>\n";
     159     echo "<td>\n";
     160      createLabelsTable($pass,
     161         $proj,
     162         $czardb,
     163         "update",
     164         $updateLabels,
     165         $distLabels,
     166         $pubLabels,
     167         $stages,
     168         $states,
     169         "new",
     170         $selectedLabel,
     171         $selectedStage,
     172         $plotType);
     173     echo "</td>\n";
     174    echo "</tr>\n";
     175   echo "</table>\n";
     176  echo "</td> \n";
     177 echo "</tr>\n";
     178 
     179
     180 # 3rd row
     181 echo "<tr>\n";
     182  echo "<td> \n";
     183   echo "<table>\n";
     184    echo "<tr valign=top>\n";
     185     echo "<td> \n";
     186      # histogram plot
     187      echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     188     echo "</td>\n";
     189     echo "<td>\n";
     190      createServersTable($pass, $proj,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
     191     echo "</td>\n";
     192 
     193     echo "<td> \n";
     194      $today = date("Y-m-d");
     195      createSummitDataTable($gpc1db, $today);
     196     echo "</td>\n";
     197    echo "</tr>\n";
     198   echo "</table>\n";
     199  echo "</td> \n";
     200 echo "</tr>\n";
     201
     202 # 4th row
     203 echo "<tr>\n";
     204  echo "<td> \n";
     205   echo "<table>\n";
     206    echo "<tr valign=top>\n";
     207     echo "<td> \n";
     208      # storage plot
     209      echo "<img src=\"czartool_getplot.php?type=s\"><br>";
     210     echo "</td>\n";
     211     echo "<td>\n";
     212      createDatesTable($czardb);
     213     echo "</td>\n";
     214    echo "</tr>\n";
     215   echo "</table>\n";
     216  echo "</td> \n";
     217 echo "</tr>\n";
     218
     219 # 5th row
     220 echo "<tr>\n";
     221  echo "<td>\n";
     222   echo "<table>\n";
     223    echo "<tr valign=top>\n";
     224     echo "<td> \n";
     225      if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
     226     echo "</td>\n";
     227     echo "<td>\n";
     228      # This is awful
     229      echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     230      echo "<tr>";
     231      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>";
     232      echo "<tr>";
     233      echo "<th>Database</th>";
     234      echo "<th>Status</th>";
     235      showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
     236      showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
     237      showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
     238      echo "</table>";
     239     echo "</td>\n";
     240    echo "</tr>\n";
     241   echo "</table>\n";
     242  echo "</td> \n";
     243 echo "</tr>\n";
     244
     245echo "</table>\n";
    231246
    232247menu_end();
     
    250265
    251266    // set up the table
    252     echo "<table class=list>\n";
    253     echo "<tr><td></td>\n";
    254     write_header_cell ("list", "Exposure type");
    255     write_header_cell ("list", "At summit");
    256     write_header_cell ("list", "Registered at MHPCC");
     267    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     268    echo "<tr>";
     269    echo "<th colspan=\"3\">Status of last night's data</th>";
     270    echo "<tr>";
     271    echo "<th>Exposure type</th>";
     272    echo "<th>At summit</th>";
     273    echo "<th>Registered at MHPCC</th>";
    257274
    258275    $msg = "No science images taken since $date";
     
    268285        $qry2->fetchInto($mhpcc);
    269286
    270         $class = "list";
    271         echo "<tr><td></td>\n";
    272 
    273         if ($expType[0] == "OBJECT") {
    274           if ($summit[0] == $mhpcc[0]) {
    275             $msg = "All science exposures taken since $date<br>have been registered at MHPCC";
    276           }
    277           else {
    278             $msg = "<font color=\"orange\">Warning: Not all science exposures taken since $date<br>have been registered at MHPCC</a>";
    279           }
     287        echo "<tr>";
     288
     289        if ($summit[0] == $mhpcc[0]) {
     290
     291            if ($expType[0] == "OBJECT") $msg = "All science exposures taken since $date<br>have been registered at MHPCC";
     292            $color = "";
    280293        }
    281 
    282         write_table_cell ($class, '%s', "", $expType[0]);
    283         write_table_cell ($class, '%d', "", $summit[0]);
    284         write_table_cell ($class, '%d', $link, $mhpcc[0]);
    285         echo "</tr>\n";
    286     }
    287 
     294        else {
     295            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        }
     298
     299        echo "<td>$expType[0]</td>";
     300        echo "<td>$summit[0]</td>";
     301       
     302        echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
     303
     304        echo "</tr>";
     305    }
     306
     307    echo "<td colspan=\"3\">$msg</td>";
    288308    echo "</table>\n";
    289 
    290     echo "<p> $msg </p>";
    291309
    292310}
     
    331349        $selectedLabel, $selectedStage, $plotType) {
    332350
    333     // set up table columns
    334     $class = "list";
    335     echo "<table class=$class >\n";
    336     echo "<tr><td></td>\n";
    337 
    338     echo "<p  align=\"center\"> Current labels for $server server (D=distributing, P=publishing)</p>";
    339 
    340     write_header_cell($class, "");
    341     write_header_cell($class, "");
    342     write_header_cell($class, "Reverts:");
     351    // setup table
     352    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     353    echo "<tr>\n";
     354    echo "<th colspan=\"12\">";
     355   
     356    $link = "czartool_labels.php?pass=".$pass
     357        ."&proj=".$proj
     358        ."&label=".$selectedLabel
     359        ."&stage=all_stages"
     360        ."&plottype=".$plotType;
     361    if ($selectedStage != "all_stages") echo "<a href=\"$link\">";
     362    else echo "<a>";
     363    echo "Plot all stages</a> | ";
     364    $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType;
     365    echo "<a ";
     366    if ($selectedLabel != "all_".$server."_labels") echo "<a href=\"$link\">";
     367    else echo "<a>";
     368    echo "Plot all ".$server."_labels</a> | ";
     369    $plotTypeLink = ($plotType == "linear") ? "log" : "linear";
     370    $plotTypeText = ($plotType == "linear") ? "Use log plots" : "Use linear plots";
     371    $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
     372    echo "<a href=\"$link\">$plotTypeText</a>";
     373
     374
     375    echo "</th>";
     376    echo "</tr>\n";
     377
     378    echo "<tr>\n";
     379    //echo "<th></th>";
     380    echo "<th colspan=\"2\">$server server</th>";
     381    echo "<th>Reverts:</th>";
     382
    343383    foreach ($stages as &$stage) {
    344384
     
    357397        if($reverting) {$label = "Stop";$link = $link . "off";}
    358398        unset($reverting);
    359         write_table_cell($class, '%s', $link, $label);
    360     }
    361     write_header_cell($class, "");
    362 
    363     echo "</tr>\n";
    364     echo "<tr><td></td>\n";
    365     write_header_cell($class, " ");
    366     write_header_cell($class, "Label (in order of priority)");
     399        echo "<td><a href=\"$link\"> $label</td>";
     400
     401    }
     402
     403    echo "</tr>\n";
     404    echo "<tr>\n";
     405    //echo "<th> </th>";
     406    echo "<th colspan=\"2\">Label (in order of priority)</th>";
    367407    foreach ($stages as &$stage) {
    368408
    369         if ($stage == $selectedStage) $link = "";
    370         else $link =
     409        if ($stage == $selectedStage) $showLink = 0;
     410        else $showLink = 1;
     411        $link =
    371412            "czartool_labels.php?pass=".$pass
    372                 ."&proj=".$proj
    373                 ."&label=".$selectedLabel
    374                 ."&stage=".$stage
    375                 ."&plottype=".$plotType;
    376 
    377         write_table_cell($class, '%s', $link, $stage);
    378     }
    379 
    380     if ($selectedStage=="all_stages") $link = "";
    381     else $link =
    382         "czartool_labels.php?pass=".$pass
    383             ."&proj=".$proj
     413            ."&proj=".$proj
    384414            ."&label=".$selectedLabel
    385             ."&stage=all_stages"
     415            ."&stage=".$stage
    386416            ."&plottype=".$plotType;
    387417
    388     write_table_cell($class, '%s', $link, "All stages");
    389 
    390     echo "</tr>\n";
    391     echo "<tr><td></td>\n";
    392 
     418        createLabelTableCell($showLink, $link, $stage);
     419    }
     420
     421
     422    // setup default link
    393423    $defaultlink =
    394424        "czartool_labels.php?pass=".$pass
     
    415445        }
    416446
    417         // create link to label summary page for each label
    418         if ($thisLabel == $selectedLabel) $link = "";
    419         else $link =
    420             "czartool_labels.php?pass=".$pass
    421                 ."&proj=".$proj
    422                 ."&label=".$thisLabel
    423                 ."&stage=".$selectedStage
    424                 ."&plottype=".$plotType;
    425 
    426         echo "<tr><td></td>\n";
    427         $distPub = " ";
     447        // show distribution/publishing status
     448        echo "<tr>\n";
     449        $distPub = "&nbsp;";
    428450        if ($distributing) $distPub = "D";
    429451        if ($publishing) $distPub = $distPub . "P";
    430         write_table_cell($class, '%s', "", $distPub);
    431 
    432         write_table_cell($class, '%s', $link, $thisLabel);
     452        echo "<td>$distPub</td>";
     453
     454        // create link to label summary page for each label
     455        if ($thisLabel == $selectedLabel) $showLink = 0;
     456        else $showLink = 1;
     457        $link =
     458            "czartool_labels.php?pass=".$pass
     459            ."&proj=".$proj
     460            ."&label=".$thisLabel
     461            ."&stage=".$selectedStage
     462            ."&plottype=".$plotType;
     463        createLabelTableCell($showLink, $link, $thisLabel);
    433464
    434465        $str = "";
     
    437468        $link = $defaultlink;
    438469        getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults);
    439         write_table_cell($class, '%s', $anyFaults ? $link : "", $str);
     470        createLabelTableCell($anyFaults, $link, $str);
    440471
    441472        $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState;
    442473        getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
    443         write_table_cell($class, '%s', $anyFaults ? $link : "", $str);
     474        createLabelTableCell($anyFaults, $link, $str);
    444475
    445476        $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel . "&camRun.state=".$searchState;
    446477        getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults);
    447         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     478        createLabelTableCell($anyFaults, $link, $str);
    448479
    449480        $link =  "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState;
    450481        getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults);
    451         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     482        createLabelTableCell($anyFaults, $link, $str);
    452483
    453484        $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel . "&warpRun.state=".$searchState;
    454485        getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults);
    455         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     486        createLabelTableCell($anyFaults, $link, $str);
    456487
    457488        $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState;
    458489        getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults);
    459         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     490        createLabelTableCell($anyFaults, $link, $str);
    460491
    461492        $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
    462493        getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
    463         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     494        createLabelTableCell($anyFaults, $link, $str);
    464495
    465496        $link = $defaultlink;
    466497        getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults);
    467         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     498        createLabelTableCell($anyFaults, $link, $str);
    468499
    469500        $link = $defaultlink;
    470501        getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults);
    471         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     502        createLabelTableCell($anyFaults, $link, $str);
    472503
    473504        $link = $defaultlink;
    474505        getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
    475         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
     506        createLabelTableCell($anyFaults, $link, $str);
    476507
    477508        echo "</tr>\n";
    478509    }
    479510
    480     if ($selectedLabel == "all_".$server."_labels") $link = "";
    481     else  $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType;
    482 
    483     echo "<tr><td></td>\n";
    484     write_table_cell($class, '%s', "", " ");
    485     write_table_cell($class, '%s', $link, "All $server labels");
     511    if ($selectedLabel == "all_".$server."_labels") $showLink = 0;
     512    else  $showLink = 1;
     513    $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType;
    486514
    487515    echo "</tr>\n";
    488516    echo "</table>\n";
     517}
     518
     519
     520###########################################################################
     521#
     522# Creates table cell for lable table
     523#
     524###########################################################################
     525function createLabelTableCell($showLink, $link, $str) {
     526
     527    if ($showLink) echo "<td><a href=\"$link\">$str</td>";
     528    else if ($str) echo "<td>$str</td>";
     529    else echo "<td>&nbsp;</td>";
    489530}
    490531
     
    594635function createDatesTable($db) {
    595636
    596     $class = "list";
    597     echo "<table class=$class>\n";
    598     echo "<tr><td></td>\n";
    599     write_header_cell($class, "Server");
    600     write_header_cell($class, "Dates");
     637    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     638    echo "<tr>\n";
     639    echo "<th colspan=\"3\">Current dates for selected pantasks servers</th>";
     640    echo "<tr>\n";
     641    echo "<th>Server</th>";
     642    echo "<th>Dates</th>";
    601643    echo "</tr>\n";
    602644
     
    632674    }
    633675
    634     $class = "list";
    635     echo "<tr><td></td>\n";
    636     write_table_cell($class, '%s', "", $server);
    637     write_table_cell($class, '%s', "", $dates);
    638     echo "</tr>\n";
     676    echo "<tr>";
     677    echo "<td>$server</td>";
     678    echo "<td>$dates</td>";
     679    echo "</tr>";
    639680
    640681}
     
    648689
    649690    // set up table columns
    650     $class = "list";
    651     echo "<table class=$class>\n";
    652     echo "<tr><td></td>\n";
    653     write_header_cell($class, "Server");
    654     write_header_cell($class, "Alive?");
    655     $link = "czartool_labels.php?pass=".$pass
    656         ."&proj=".$proj
    657         ."&label=".$selectedLabel
    658         ."&stage=".$selectedStage
    659         ."&plottype=".$plotType
    660         ."&allservercmd=stop";
    661 
    662     $link = ""; # TODO removed links temporarily
    663         write_table_cell($class, '%s', $link, "Stop all");
    664     $link = "czartool_labels.php?pass=".$pass
    665         ."&proj=".$proj
    666         ."&label=".$selectedLabel
    667         ."&stage=".$selectedStage
    668         ."&plottype=".$plotType
    669         ."&allservercmd=run";
    670 
    671     $link = ""; # TODO removed links temporarily
    672         write_table_cell($class, '%s', $link, "Run all");
     691    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     692    echo "<tr>";
     693    echo "<th colspan=\"3\">Pantasks server status</th>";
     694    echo "<tr>";
     695    echo "<th>Server</th>";
     696    echo "<th>Alive?</th>";
     697    echo "<th>Running?</th>";
     698
     699    //write_header_cell($class, "Server");
     700    //write_header_cell($class, "Alive?");
     701    //$link = "czartool_labels.php?pass=".$pass
     702    //    ."&proj=".$proj
     703    //    ."&label=".$selectedLabel
     704    //    ."&stage=".$selectedStage
     705    //    ."&plottype=".$plotType
     706    //    ."&allservercmd=stop";
     707
     708    //$link = ""; # TODO removed links temporarily
     709    //    write_table_cell($class, '%s', $link, "Stop all");
     710    //$link = "czartool_labels.php?pass=".$pass
     711    //    ."&proj=".$proj
     712    //    ."&label=".$selectedLabel
     713    //    ."&stage=".$selectedStage
     714    //    ."&plottype=".$plotType
     715    //    ."&allservercmd=run";
     716
     717    //$link = ""; # TODO removed links temporarily
     718    //    write_table_cell($class, '%s', $link, "Run all");
    673719    echo "</tr>\n";
    674720
     
    677723        getServerStatus($db, $server, $alive, $running);
    678724
    679         echo "<tr><td></td>\n";
     725        echo "<tr>\n";
    680726        $link = "czartool_labels.php?pass=".$pass
    681727            ."&proj=".$proj
     
    686732
    687733        #$link = ""; # TODO removed links temporarily
    688         write_table_cell($class, '%s', $link, $server);
    689         write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
    690 
    691         if ($alive) {
    692 
    693             $link = "czartool_labels.php?pass=".$pass
    694                 ."&proj=".$proj
    695                 ."&label=".$selectedLabel
    696                 ."&stage=".$selectedStage
    697                 ."&plottype=".$plotType
    698                 ."&server=".$server
    699                 ."&servercmd=";
    700 
    701             if ($running)  {
    702 
    703                 $link = $link . "stop";
    704                 $link = ""; # TODO removed links temporarily
    705                     write_table_cell($class, '%s', $link, "stop");
    706                 write_table_cell($class, '%s', "", "");
    707             }
    708             else {
    709 
    710                 $link = $link . "run";
    711                 write_table_cell($class, '%s', "", "");
    712                 $link = ""; # TODO removed links temporarily
    713                     write_table_cell($class, '%s', $link, "run");
    714             }
    715         }
    716         else {
    717 
    718             write_table_cell($class, '%s', "", "");
    719             write_table_cell($class, '%s', "", "");
    720         }
     734        //write_table_cell($class, '%s', $link, $server);
     735        //write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
     736        echo "<td>$server</td>";
     737        $yesNo = $alive ? "yes" : "NO";
     738        $color = $alive ? "" : "red";
     739        echo  "<td bgcolor=\"$color\">$yesNo</td>";
     740        $yesNo = $running ? "yes" : "NO";
     741        $color = $running ? "" : "red";
     742        echo  "<td bgcolor=\"$color\">$yesNo</td>";
     743
     744        //if ($alive) {
     745
     746          //  $link = "czartool_labels.php?pass=".$pass
     747            //    ."&proj=".$proj
     748              //  ."&label=".$selectedLabel
     749              //  ."&stage=".$selectedStage
     750              //  ."&plottype=".$plotType
     751              //  ."&server=".$server
     752              //  ."&servercmd=";
     753
     754            //if ($running)  {
     755
     756              //  $link = $link . "stop";
     757              //  $link = ""; # TODO removed links temporarily
     758              //      write_table_cell($class, '%s', $link, "stop");
     759              //  write_table_cell($class, '%s', "", "");
     760           // }
     761           // else {
     762
     763             //   $link = $link . "run";
     764              //  write_table_cell($class, '%s', "", "");
     765              //  $link = ""; # TODO removed links temporarily
     766               //     write_table_cell($class, '%s', $link, "run");
     767           // }
     768       // }
     769       // else {
     770
     771         //   write_table_cell($class, '%s', "", "");
     772         //   write_table_cell($class, '%s', "", "");
     773       // }
    721774        echo "</tr>\n";
    722775    }
     
    822875    $dbRepl = DB::connect("mysql://$replUser:$replPassword@$replHost");
    823876    if (PEAR::isError($dbRepl)) {
    824         die("MySQL DB connection error: Check the configuration for $replDatabaseName");
     877        echo "<tr><td>$replDatabaseName</td><td bgcolor=\"red\">MySQL DB connection error - check configuration</td></tr>";
     878        //die("MySQL DB connection error: Check the configuration for $replDatabaseName");
     879        die("");
     880        return;
     881
    825882    }
    826883    $res = $dbRepl->query('SHOW SLAVE STATUS');
Note: See TracChangeset for help on using the changeset viewer.