/[pdpsoft]/trunk/nl.nikhef.ndpf.tools/network-stats-mashup/index.php
ViewVC logotype

Diff of /trunk/nl.nikhef.ndpf.tools/network-stats-mashup/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1277 by aramv, Thu Dec 10 15:03:02 2009 UTC revision 1278 by aramv, Fri Dec 11 17:00:37 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2    $title = "Grid network summary";    $title = "Grid network summary";
3    $token = rand();    include('includes/class.cricket_spider.php');
4    include('includes/cricket_spider.php');    include('includes/class.trunk.php');
5      include('includes/ui_code.php');
6  ?>  ?>
7  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
8  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
# Line 12  Line 13 
13  <script type="text/javascript" src="javascripts/wz_jsgraphics.js"></script>  <script type="text/javascript" src="javascripts/wz_jsgraphics.js"></script>
14  <script type="text/javascript" src="javascripts/mapper.js"></script>  <script type="text/javascript" src="javascripts/mapper.js"></script>
15  <script type="text/javascript" src="javascripts/mapper_hacks.js"></script>  <script type="text/javascript" src="javascripts/mapper_hacks.js"></script>
 <?php  
 ?>  
   
16  <script type="text/javascript">  <script type="text/javascript">
17    /* associative arrays.    /* associative arrays.
18      daily_images_by_url     : url -> image_link      daily_images_by_url     : url -> image_link
# Line 30  Line 28 
28    var images = Array();    var images = Array();
29    
30  <?php  <?php
31    $page_urls = get_urls_from_html_file('image_map.html');    $cs = new CricketSpider('image_map.html');
32    $image_urls = get_images_from_absolute_and_relative_urls($page_urls[1]);    //print_r($cs->trunks);
33    //print_r($image_urls);    foreach($cs->trunks as $index => $trunk){
   foreach($image_urls as $url => $data){  
     if(is_array($data[0])){  
 ?>  
   snippets_by_url["<?=get_absolute_url()?><?=$url?>"] = '<?=make_html_snippets($data, $token)?>';  
 <?php  
       foreach($data as $index => $local_data){  
34  ?>  ?>
35    images.push('<?=$local_data[1] . $token ?>');  snippets_by_url["<?=$trunk->trunk_page_url?>"] = '<?=$trunk->to_html()?>';
   images.push('<?=$local_data[2] . $token ?>');  
36  <?php  <?php
37        }      if($trunk->weekly_image_url){
     } else {  
38  ?>  ?>
39    snippets_by_url["<?=$url?>"] = '<?=make_html_snippet($data, $token)?>';  images.push('<?=$trunk->weekly_image_url() ?>');
40    images.push('<?=$data[1] . $token ?>');  images.push('<?=$trunk->daily_image_url() ?>');
   images.push('<?=$data[2] . $token ?>');  
41  <?php  <?php
         
42      }      }
43    }    }
44  ?>  ?>
# Line 65  Line 53 
53    
54    /* callback for onmouseover event of areas */    /* callback for onmouseover event of areas */
55    function show_graph(url){    function show_graph(url){
56      //alert(url);      snippet = document.getElementById('graph_div');
     snippet = document.getElementById('graph_snippet');  
57      snippet.innerHTML = snippets_by_url[url];      snippet.innerHTML = snippets_by_url[url];
58    }    }
59    
# Line 91  Line 78 
78        ?>        ?>
79      </p>      </p>
80    </div>    </div>
81    <div class="graph_div">    <div class="info_div">
82      <noscript>      <noscript>
83        <p>        <p>
84          Please enable javascript to see graphs when hovering over trunks.          Please enable javascript to see graphs when hovering over trunks.
85        </p>        </p>
86      </noscript>      </noscript>
87      <div id="graph_snippet">      <div id="graph_div">
88      </div>      </div>
89    </div>    </div>
90    <div class="clear">&nbsp;</div>    <div class="clear">&nbsp;</div>
# Line 105  Line 92 
92      <h4>Trunks listed: </h4>      <h4>Trunks listed: </h4>
93      <ul>      <ul>
94      <?php      <?php
95        foreach($image_urls as $url => $data){      foreach($cs->trunks as $index => $trunk){
96          if(is_array($data[0])){      ?>
97            foreach($data as $index => $local_data){        <li><a href="<?=$trunk->trunk_page_url?>"><?=$trunk->name?></a></li>
98            ?>      <?php
99            <li><a href="<?=$local_data[0]?>"><?=$local_data[3]?></a></li>      }
           <?php  
           }  
         } else {  
         ?>  
         <li><a href="<?=$data[0]?>"><?=$data[3]?></a></li>  
         <?php  
         }  
       }  
100      ?>      ?>
101      </ul>      </ul>
102    </div>    </div>

Legend:
Removed from v.1277  
changed lines
  Added in v.1278

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28