gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15000 - in gauger: . css


From: gnunet
Subject: [GNUnet-SVN] r15000 - in gauger: . css
Date: Fri, 15 Apr 2011 16:04:48 +0200

Author: bartpolot
Date: 2011-04-15 16:04:48 +0200 (Fri, 15 Apr 2011)
New Revision: 15000

Modified:
   gauger/css/style.css
   gauger/template.php
   gauger/template_host.php
Log:
Improved host view usability: same unit matrics marked in green, option removed 
from select after addition


Modified: gauger/css/style.css
===================================================================
--- gauger/css/style.css        2011-04-15 14:02:08 UTC (rev 14999)
+++ gauger/css/style.css        2011-04-15 14:04:48 UTC (rev 15000)
@@ -349,8 +349,24 @@
 .select-metric {
     width:              95px;
     font-size:          90%;
+    margin:             5px 0px 5px 0px;
 }
 
+.same-unit-metric {
+    background:         #0F0;
+    color:              #000;
+}
+
+.second-unit-metric {
+    background:         #8F0;
+    color:              #000;
+}
+
+.incompatible-unit-metric {
+    background:         #F00;
+    color:              #000;
+}
+
 .footer-shadow {
     height:             50px;
     background-image:   url("images/f.png");

Modified: gauger/template.php
===================================================================
--- gauger/template.php 2011-04-15 14:02:08 UTC (rev 14999)
+++ gauger/template.php 2011-04-15 14:04:48 UTC (rev 15000)
@@ -386,12 +386,22 @@
                 });
                 $(".add-metric").click(function(){
                     x = 
$(this).parents(".control-column").find(".select-metric").val();
+                    added = 
$(this).parents(".control-column").find(".added-metric").parents("li").find("a").get();
+                    for(i in added) {
+                        a = "" + added[i];
+                        a = a.replace(/.*graph=([^&]+).*/g, "$1");
+                        a = a.replace(/%20/g, " ");
+                        if (x == a) {
+                            return;
+                        }
+                    }
                     
$(this).parents(".control-column").find(".added-metrics").append(
                         '<li>\
                             <input type="checkbox" checked="checked" 
class="added-metric" onclick="rescan_added_hosts(this)">\
                             <a href="index.php?graph=' + x + '" title="[' + 
get_category(x) + '] ' + get_name(x) + '">' + get_name(x) + '</a>\
                         </li>'
                     );
+                    $(this).parents("tr").find("option[value=" + x + 
"]").remove();
                     $(this).parents("tr").find(".plot").each(function() {
                         this.src = this.src.replace(/(g=[^&]+)/g, '$1,'+x);
                     });

Modified: gauger/template_host.php
===================================================================
--- gauger/template_host.php    2011-04-15 14:02:08 UTC (rev 14999)
+++ gauger/template_host.php    2011-04-15 14:04:48 UTC (rev 15000)
@@ -82,7 +82,15 @@
                 Compare with:
                 <select class="select-metric">
                 <?php foreach ($hosts[$current] as $graph): ?>
-                    <option value="<?php echo $graph?>"><?php echo 
get_counter_name($graph) ?></option>
+                    <?php if($graph != $counter): ?>
+                    <option value="<?php echo $graph?>"
+                            <?php if(get_counter_unit($graph) == 
get_counter_unit($counter)): ?>
+                                <?php echo ' class="same-unit-metric"' ?>
+                            <?php endif; ?>
+                    >
+                        <?php echo get_counter_name($graph) ?>
+                    </option>
+                    <?php endif; ?>
                 <?php endforeach; ?>
                 </select>
                 <input type="button" value="Add" class="add-metric"></input>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]