gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14386 - gauger


From: gnunet
Subject: [GNUnet-SVN] r14386 - gauger
Date: Thu, 10 Feb 2011 23:37:35 +0100

Author: bartpolot
Date: 2011-02-10 23:37:35 +0100 (Thu, 10 Feb 2011)
New Revision: 14386

Added:
   gauger/explore.php
   gauger/f.png
   gauger/h.png
   gauger/index.php
   gauger/l.png
   gauger/style.css
   gauger/template.php
Log:
Added basic dynamic page generation


Added: gauger/explore.php
===================================================================
--- gauger/explore.php                          (rev 0)
+++ gauger/explore.php  2011-02-10 22:37:35 UTC (rev 14386)
@@ -0,0 +1,15 @@
+<?php
+$d = dir(".");
+$hosts = array();
+while (false !== ($entry = $d->read())) {
+    if (is_dir($entry) && !($entry[0] == ".")) {
+        $hosts[$entry] = array();
+        $d2 = dir($entry);
+        while (false !== ($counter = $d2->read())) {
+            if (!($counter[0] == ".") && preg_match("/.*\.png/", $counter)) {
+                $hosts[$entry][] = $counter;
+            }
+        }
+    }
+}
+$d->close();
\ No newline at end of file

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


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

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


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

Added: gauger/index.php
===================================================================
--- gauger/index.php                            (rev 0)
+++ gauger/index.php    2011-02-10 22:37:35 UTC (rev 14386)
@@ -0,0 +1,21 @@
+<?php
+session_start();
+
+if (array_key_exists('host', $_REQUEST)) {
+    $_SESSION['host'] = $_REQUEST['host'];
+    $current = $_REQUEST['host'];
+} else {
+    if (array_key_exists('host', $_SESSION)){
+        $current = $_SESSION['host'];
+    } else {
+        $current = "";
+    }
+}
+
+if (array_key_exists('logout', $_REQUEST)) {
+    session_unset();
+    header("Location: " . preg_replace("/\?.*/", "", $_SERVER["REQUEST_URI"]));
+}
+
+include "explore.php"; // Gather all existing hosts and counters
+include "template.php"; // Display info
\ No newline at end of file

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


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

Added: gauger/style.css
===================================================================
--- gauger/style.css                            (rev 0)
+++ gauger/style.css    2011-02-10 22:37:35 UTC (rev 14386)
@@ -0,0 +1,109 @@
+body {
+    font-size:          75%;
+    font-family:        'Helvetica','Verdana','Arial','sans serif'; 
+    background-color:   #D3D3D3;
+    color:              #404040;
+    margin:             0px;
+}
+
+h1 {
+    font-size:          140%;
+}
+
+h2 {
+    font-size:          120%;
+}
+
+h3 {
+    font-size:          110%;
+}
+
+table {
+    border:             2px;
+    border-style:       solid;
+    border-color:       #D3D3D3;
+}
+
+tr {
+    
+}
+
+th {
+    background-color:   #D3D3D3;
+}
+
+td {
+    background-color:   white;
+    border:             1px;
+    border-style:       solid;
+    border-color:       #D3D3D3; 
+}
+
+a:link {
+    color:              #404040;
+    text-decoration:    none;
+}
+
+a:visited {
+    color:              #404040;
+    text-decoration:    none;
+}
+
+a:hover {
+    color:              #606060;
+    font-weight:        bold;
+    text-decoration:    none;
+}
+
+.header {
+    margin:             0px;
+    padding-top:        5px;
+}
+
+.header p {
+    font-size:          20px;
+    font-weight:        bold;
+    margin:             10px 0 0 0;
+}
+
+.header img {
+    margin:             4px 10px 4px 10px;
+    float:              left;
+}
+
+.header-shadow {
+    height:             50px;
+    background-image:   url("h.png");
+    clear:              both;
+}
+
+.container {
+    background-color:   white;
+    padding:            10px;
+}
+
+.menu {
+    float:              left;
+    padding:            5px;
+    width:              135px;
+}
+
+.menu ul {
+    padding-left:       16px;
+}
+
+.content {
+    margin:             10px;
+    margin-left:        145px;
+}
+
+.advanced_menu {
+    float:              right;
+    margin:             5px;
+}
+
+.footer-shadow {
+    height:             50px;
+    background-image:   url("f.png");
+    clear:              both;
+}
\ No newline at end of file

Added: gauger/template.php
===================================================================
--- gauger/template.php                         (rev 0)
+++ gauger/template.php 2011-02-10 22:37:35 UTC (rev 14386)
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+   "http://www.w3.org/TR/html4/strict.dtd";>
+<html lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=utf-8">
+        <title>Gauger [<?php echo $current ?>]</title>
+        <link href="style.css" type="text/css" rel="stylesheet">
+    </head>
+    <body>
+        <div class="header">
+            <div class="advanced_menu">[AVANCED MENUS AND CONTROLS WILL GO 
HERE] | <a href="?logout=1">Log out</a></div>
+            <img src="l.png" /><p>Gauger, performance recording tool<p>
+        </div>
+        <div class="header-shadow"></div>
+        <div class="container">
+        <div class="menu">
+            <h2>Hosts</h2>
+            <ul>
+            <?php foreach ($hosts as $host => $counters): ?>
+                    <li><a href="?host=<?php echo $host ?>"><?php echo $host 
?></a></li>
+            <?php endforeach; ?>
+            </ul>
+            <h2>Options</h2>
+            <ul>
+                <li>Option1</li>
+                <li>Option2</li>
+                <li>etc</li>
+            </ul>
+        </div>
+        <div class="content">
+            <?php if (isset($hosts[$current])): ?>
+                <h1>SHOWING HOST: <?php echo $current ?></h1>
+                <?php if (!empty($hosts[$current])): ?>
+                <table>
+                    <tr>
+                        <th>Counter</th>
+                        <th>Graph</th>
+                        <th>Controls</th>
+                    </tr>
+                    <?php foreach ($hosts[$current] as $counter): ?>
+                    <tr>
+                        <th><?php echo $counter ?></th>
+                        <td><img src="<?php echo $current . '/' . $counter ?>" 
alt="PNG not found :("/></td>
+                        <td>TODO<br/>Range<br/>Add counter<br/>Colors</td>
+                    </tr>
+                    <?php endforeach; ?>
+                </table>
+                <?php else: ?>
+                <h1>The host "<?php echo $current ?>" has no counters</h1>
+                <?php endif; ?>
+            <?php else: ?>
+                <h1>Please select a host from the hosts menu.</h1>
+                <p>Some very useful data / overview will go here</p>
+            <?php endif; ?>
+        </div>
+        <div style="clear:both"></div>
+        </div>
+        <div class="footer-shadow"></div>
+        Copyright notice and so on
+    </body>
+</html>




reply via email to

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