gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14537 - in gauger: . css images


From: gnunet
Subject: [GNUnet-SVN] r14537 - in gauger: . css images
Date: Fri, 25 Feb 2011 00:19:18 +0100

Author: bartpolot
Date: 2011-02-25 00:19:18 +0100 (Fri, 25 Feb 2011)
New Revision: 14537

Added:
   gauger/images/expand.png
Modified:
   gauger/css/style.css
   gauger/explore.php
   gauger/template.php
Log:
Added categorization to the metrics section


Modified: gauger/css/style.css
===================================================================
--- gauger/css/style.css        2011-02-24 20:51:15 UTC (rev 14536)
+++ gauger/css/style.css        2011-02-24 23:19:18 UTC (rev 14537)
@@ -124,15 +124,32 @@
 
 .menu {
     float:              left;
-    padding:            5px;
     width:              135px;
     margin-right:       5px;
 }
 
+.metric_category_header {
+    background:         #D3D3D3;
+    padding:            1px 1px 1px 5px;
+    font-size:          120%;
+    cursor:             pointer;
+}
+
 .menu ul {
-    padding-left:       16px;
+    padding-left:       6px;
+    margin:             0px;
+    list-style-type:    none;
 }
 
+.menu li {
+    padding:            2px 0px 2px 0px;
+}
+
+.menu .expand_arrow {
+    float:              right;
+    margin-right:       4px;
+}
+
 .content {
     margin:             10px;
     margin-left:        145px;
@@ -235,8 +252,6 @@
 
 .auto_min {
     float:              left;
-    background-color:   #D3D3D3;
-    padding:           0px 4px 4px 4px;
 }
 
 .auto_max {

Modified: gauger/explore.php
===================================================================
--- gauger/explore.php  2011-02-24 20:51:15 UTC (rev 14536)
+++ gauger/explore.php  2011-02-24 23:19:18 UTC (rev 14537)
@@ -91,6 +91,7 @@
 $d = dir($DATADIR);
 $hosts = array();
 $metrics = array();
+$metrics_c = array();
 while (false !== ($entry = $d->read())) {
     if (is_dir($DATADIR.$entry) && !($entry[0] == ".")) {
         $hosts[$entry] = array();
@@ -100,12 +101,17 @@
             if (preg_match("/(\.|~)/", $counter) === 0 && 
is_file("$DATADIR$entry/$counter.dat")) {
                 $hosts[$entry][] = $counter;
                 $metrics[$counter] = get_counter_name($counter);
+                $metrics_c[get_counter_category($counter)][$counter] = 
get_counter_name($counter);
             }
         }
     }
 }
 asort(&$metrics);
+asort(&$metrics_c);
+foreach($metrics_c as $id => $a) {
+    asort(&$metrics_c[$id]);
+}
 $d->close();
 // echo '<pre>';
-// print_r(parse_ini_file("gauger.conf"));
+// print_r($metrics_c);
 // die();

Added: gauger/images/expand.png
===================================================================
(Binary files differ)


Property changes on: gauger/images/expand.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: gauger/template.php
===================================================================
--- gauger/template.php 2011-02-24 20:51:15 UTC (rev 14536)
+++ gauger/template.php 2011-02-24 23:19:18 UTC (rev 14537)
@@ -202,6 +202,9 @@
                         this.src = this.src.replace(/&norm=[^&]+/g, 
'')+"&norm="+c.checked;
                     });
                 });
+                $( ".metric_category_header" ).click(function () {
+                    $(this).parents(".metric").find("ul").toggle();
+                });
         });
 
         function get_command(element) {
@@ -231,14 +234,24 @@
                     <li><a href="?host=<?php echo $host ?>"><?php echo $host 
?></a></li>
             <?php endforeach; ?>
             </ul>
+            <div id="metrics">
             <h2>Metrics</h2>
-            <ul>
-            <?php foreach ($metrics as $link => $name): ?>
+            <?php foreach ($metrics_c as $category => $counters): ?>
+                <div class="metric">
+                <div class="metric_category_header">
+                    <?php echo $category ? $category : 'Others' ?>
+                    <img class="expand_arrow" src="images/expand.png"></img>
+                </div>
+                <ul id="<?php echo $category ? $category : 'Others' ?>">
+                <?php foreach ($counters as $link => $name): ?>
                     <li><a href="?graph=<?php echo $link ?>">
                         <?php echo $name . (get_counter_unit($link) ? ' (' . 
get_counter_unit($link) . ')' : '') ?>
                     </a></li>
+                <?php endforeach; ?>
+                </ul>
+                </div>
             <?php endforeach; ?>
-            </ul>
+            </div>
         </div>
         <div class="content">
             <?php if($mode_host == 1): ?>
@@ -260,5 +273,10 @@
                 <a target="_blank" href="https://gnunet.org/svn/gauger";>SVN 
repository</a> |
             </p>
         </div>
+        <script>
+            <?php if(get_param('category')): ?>
+             $(" #metrics ul ").not("#<?php echo get_param('category') 
?>").hide();
+            <?php endif; ?>
+        </script>
     </body>
 </html>




reply via email to

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