[ 
https://issues.apache.org/jira/browse/VCL-354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Thompson resolved VCL-354.
-------------------------------

    Resolution: Fixed
    
> View Computers Table - State Coloring
> -------------------------------------
>
>                 Key: VCL-354
>                 URL: https://issues.apache.org/jira/browse/VCL-354
>             Project: VCL
>          Issue Type: Improvement
>          Components: web gui (frontend)
>    Affects Versions: 2.1
>         Environment: VCL 2.1 Management Node
>            Reporter: Clifton B. Wood
>            Assignee: Josh Thompson
>            Priority: Trivial
>             Fix For: 2.3
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> I found that having the "failed" state being the only thing colored made 
> getting the status of our VM images a little hard to see at a glance. I spent 
> a couple of minutes putting this patch together which makes a cleaner use of 
> that feature but also includes the coloring of the "available" (green) and 
> "reloading" (orange, because yellow is unreadable on the white background) 
> states. 
> This improves at-a-glance readability of computer status and the code is 
> extensible to allow more states.
> Patch follows.
> Index: computers.php
> ===================================================================
> --- computers.php       (revision 942866)
> +++ computers.php       (working copy)
> @@ -2095,7 +2095,16 @@
>         print "    <TH>Notes</TH>\n";
>         print "  </TR>\n";
>         $count = 0;
> +
> +       $statecolor = array(
> +               "available"     => "green",
> +               "reloading"     => "orange",
> +               "failed"        => "red",
> +       );
> +
>         foreach(array_keys($computers) as $id) {
> +               $compstate = $computers[$id]['state'];
> +
>                 if($bygroups) {
>                         if(! array_key_exists($id, $compidlist))
>                                 continue;
> @@ -2111,8 +2120,8 @@
>                 print "id=comp$count 
> onclick=\"toggleRowSelect('compid$count');\"></TD>\n";
>                 print "    <TD>" . $computers[$id]["hostname"] . "</TD>\n";
>                 print "    <TD>" . $computers[$id]["IPaddress"] . "</TD>\n";
> -               if($computers[$id]['state'] == 'failed')
> -                       print "    <TD><font 
> color=red>{$computers[$id]["state"]}</font></TD>\n";
> +               if (isset($statecolor[$computers[$id]['state']]))
> +                       print "    <TD><font 
> color={$statecolor[$compstate]}>{$compstate}</font></TD>\n";
>                 else
>                         print "    <TD>" . $computers[$id]["state"] . 
> "</TD>\n";
>                 print "    <TD>" . $computers[$id]["owner"] . "</TD>\n";

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to