Changeset 224

Show
Ignore:
Timestamp:
09/02/04 11:19:57 (9 years ago)
Author:
benoitg
Message:

2004-09-02 Benoit Gr�goire <bock@…>

  • wifidog/node_list.php: Complete the status page
  • Add images
  • Add hotspot creation date
Location:
trunk/wifidog-auth
Files:
3 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/ChangeLog

    r223 r224  
    11# $Header$ 
     22004-09-02 Benoit Gr�goire  <bock@step.polymtl.ca> 
     3        * wifidog/node_list.php: Complete the status page 
     4        * Add images 
     5        * Add hotspot creation date 
     6         
    272004-08-31 Benoit Gr�goire  <bock@step.polymtl.ca> 
    38        * sql/: Update the postgres schemas and add scripts to ease maintaining it. 
  • trunk/wifidog-auth/sql/wifidog-postgres-schema.sql

    r223 r224  
    8585    rss_url text, 
    8686    last_heartbeat_ip character varying(16), 
    87     last_heartbeat_timestamp timestamp without time zone 
     87    last_heartbeat_timestamp timestamp without time zone DEFAULT now(), 
     88    creation_date date DEFAULT now() 
    8889); 
    8990 
  • trunk/wifidog-auth/wifidog/classes/AbstractDbPostgres.php

    r206 r224  
    360360                { 
    361361                        $sql = "SELECT EXTRACT (year FROM INTERVAL '$intervalstr') AS years, EXTRACT (month FROM INTERVAL '$intervalstr') AS months, EXTRACT (day FROM INTERVAL '$intervalstr') AS days, EXTRACT (hour FROM INTERVAL '$intervalstr') AS hours, EXTRACT (minutes FROM INTERVAL '$intervalstr') AS minutes, EXTRACT (seconds FROM INTERVAL '$intervalstr') AS seconds"; 
    362                         $this -> ExecuterSqlResUnique($sql, $retval, false); 
     362                        $this -> ExecSqlUniqueRes($sql, $retval, false); 
    363363                } 
    364364                return $retval; 
  • trunk/wifidog-auth/wifidog/index.php

    r216 r224  
    4646    echo "<ul>\n"; 
    4747    echo "<li><a href='node_list.php'>List network nodes</a></li>\n"; 
    48     echo "<li><a href='".BASE_SSL_PATH."login/index.php?gw_id=default&gw_address=127.0.0.1&gw_port=80'>Login (demo)</a></li>\n"; 
    49     echo "<li><a href='./portal/index.php?gw_id=default'>Portal (demo)</a></li>\n"; 
    5048    echo "<li><a href='./user_management/index.php'>Personal user management</a></li>\n"; 
    5149    echo "<li><a href='".BASE_SSL_PATH."admin/index.php'>Administration</a></li>\n"; 
  • trunk/wifidog-auth/wifidog/node_list.php

    r222 r224  
    2727require_once BASEPATH.'include/common.php'; 
    2828require_once BASEPATH.'classes/Style.php'; 
     29require_once (BASEPATH.'include/user_management_menu.php'); 
    2930 
    3031$style = new Style(); 
     
    3637    echo "<h1>". HOTSPOT_NETWORK_NAME ." node list</h1>\n"; 
    3738 
    38 $row = null; 
    39 $db->ExecSqlUniqueRes("SELECT node_id, name, NOW()-last_heartbeat_timestamp AS last_heartbeat, last_heartbeat_ip FROM nodes ORDER BY node_id",$row, true); 
     39 
     40$db->ExecSql("SELECT node_id, name, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, 
     41 CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up, creation_date FROM nodes ORDER BY node_id",$node_results, false); 
     42echo "<table class='spreadsheet'>\n"; 
     43        echo "<thead><tr class='spreadsheet'><th class='spreadsheet' colspan=5>Status of all nodes of the ".HOTSPOT_NETWORK_NAME." network</th></tr>\n"; 
     44        echo "<tr class='spreadsheet'><th class='spreadsheet'>Status</th>\n"; 
     45        echo "<th class='spreadsheet'>Id</th>\n"; 
     46        echo "<th class='spreadsheet'>Name</th>\n"; 
     47        echo "<th class='spreadsheet'>Local content demo</th>\n"; 
     48        echo "<th class='spreadsheet'>Opened on</th>\n"; 
     49        echo "</tr></thead\n"; 
     50        foreach($node_results as $node_row) 
     51        { 
     52                echo "<tr class='spreadsheet'>\n"; 
     53                echo "<td class='spreadsheet'>\n"; 
     54                if($node_row['is_up']=='t') 
     55                { 
     56                echo "<img src='".BASE_URL_PATH . "images/hotspot_status_up.png'>"; 
     57                } 
     58                else 
     59                { 
     60                echo "<img src='".BASE_URL_PATH . "images/hotspot_status_down.png'>"; 
     61                $duration = $db->GetDurationArrayFromIntervalStr($node_row['since_last_heartbeat']); 
     62                echo $duration['days'].'days '.$duration['hours'].'h '.$duration['minutes'].'min'; 
     63                } 
     64                echo "</td>\n"; 
     65                echo "<td class='spreadsheet'>$node_row[node_id]</td>\n"; 
     66                echo "<td class='spreadsheet'>$node_row[name]</td>\n"; 
     67                echo "<td class='spreadsheet'>\n"; 
     68                echo "<a href='".BASE_SSL_PATH."login/index.php?gw_id=$node_row[node_id]&gw_address=127.0.0.1&gw_port=80'>Login page</a><br />\n"; 
     69                echo "<a href='".BASE_URL_PATH."portal/index.php?gw_id=$node_row[node_id]'>Portal page</a>\n"; 
     70                echo "</td>\n"; 
     71                echo "<td class='spreadsheet'>$node_row[creation_date]</td>\n"; 
     72                echo "</tr>\n"; 
     73} 
     74echo "</table>\n"; 
    4075 
    4176    echo "</div>\n";     
    42  
     77echo "<div id='navLeft'>\n"; 
     78echo get_user_management_menu(); 
     79echo "</div>\n"; 
    4380echo $style->GetFooter(); 
    4481?>