Merge pull request #168 from toreanderson/hnetd-add-ip4mode
[feed/routing.git] / luci-app-bmx7 / files / usr / lib / lua / luci / view / bmx7 / nodes_j.htm
1 <%#
2 Copyright © 2011 Pau Escrich <pau@dabax.net>
3 Contributors Lluis Esquerda <eskerda@gmail.com>
4 Roger Pueyo Centelles <roger.pueyo@guifi.net>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20 The full GNU General Public License is included in this distribution in
21 the file called "COPYING".
22 -%>
23
24 <%+header%>
25 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
26 <script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
27
28
29 <style>
30
31 div.hideme{
32 display: none;
33 }
34
35 div.info{
36 background: #FFF;
37 border: solid 0px;
38 height: 90px;
39 display: block;
40 overflow: auto;
41 }
42
43 div.inforow{
44 text-align:left;
45 display:inline-block;
46 margin:10px;
47 vertical-align:top;
48 float: left;
49 white-space:nowrap;
50 }
51
52 div.inforow.newline{
53 clear: both;
54 }
55
56 u {
57 text-decoration: underline;
58 }
59
60 #extra-info ul { list-style: none outside none; margin-left: 0em; }
61
62 </style>
63 <div class="cbi-map">
64
65 <h2>Mesh nodes</h2>
66 <div class="cbi-map-descr"></div>
67 <div id="extra-info" class="info">
68 <br />
69 <center>
70 Tip: click the <img src="<%=resource%>/bmx7/world.png" /> icon to see individual node information.
71 </center>
72 </div>
73 <fieldset class="cbi-section">
74 <legend><%:Originators%></legend>
75 <table class="cbi-section-table" id="descriptions_table">
76 <tr class="cbi-section-table-titles">
77 <th class="cbi-section-table-cell"></th>
78 <th class="cbi-section-table-cell"><%:Name%></th>
79 <th class="cbi-section-table-cell"><%:Short ID%></th>
80 <th class="cbi-section-table-cell"><%:S/s/T/t%></th>
81 <th class="cbi-section-table-cell"><%:Primary IPv6 address%></th>
82 <th class="cbi-section-table-cell"><%:Via neighbour%></th>
83 <th class="cbi-section-table-cell"><%:Metric%></th>
84 <th class="cbi-section-table-cell"><%:Last desc.%></th>
85 <th class="cbi-section-table-cell"><%:Last ref.%></th>
86 <th class="cbi-section-table-cell"><%: %></th>
87 </tr>
88 <tr class="cbi-section-table-row">
89 <td colspan="11"><br /><center><em><%:Collecting data...%></em></center></td>
90 </tr>
91 </table>
92 </fieldset>
93
94 </div>
95
96 <script type="text/javascript">//<![CDATA[
97 var displayExtraInfo = function ( id ) {
98 console.log('aaa'+id)
99 document.getElementById('extra-info').innerHTML = document.getElementById(id).innerHTML;
100 }
101
102 new TablePooler(5,"/cgi-bin/bmx7-info", {'$originators':''}, "descriptions_table", function(st){
103 var infoicon = "<%=resource%>/bmx7/world_small.png";
104 var originators = st.originators;
105 var res = Array();
106
107 originators.forEach(function(originator,i){
108 var name = originator.name;
109 var shortId = originator.shortId;
110 var nodeId = originator.nodeId;
111 var extensions = originator.name;
112 var SsTt = originator.S+'/'+originator.s+'/'+originator.T+'/'+originator.t;
113 var nodeKey = originator.nodeKey;
114 var descSize = originator.descSize;
115 var primaryIp = originator.primaryIp;
116 var nbName = originator.nbName;
117 var dev = originator.dev;
118 var nbLocalIp = originator.nbLocalIp;
119 var metric = originator.metric;
120 var lastDesc = originator.lastDesc;
121 var lastRef = originator.lastRef;
122
123 var extrainfo = '<a onclick="displayExtraInfo(\'ip-' + i + '\')"><img src="' + infoicon + '" / ></a>';
124 var extrainfo_link = '<a onclick="displayExtraInfo(\'ip-' + i + '\')">' + '<img src="' + infoicon + '" />' + '</a>';
125
126 extrainfo = '<div id="ip-'+ i +'" class="hideme">'
127
128 + "<div class='inforow'>"
129 + "<h4><u>" + name + '</u></h4>\n'
130 + 'Node ID: ' + nodeId + "</div>"
131
132 + "<div class='inforow'>"
133 + "<h5>Primary IPv6 address</h5>\n"
134 + primaryIp + "</div>\n"
135
136 + "<div class='inforow'>"
137 + "<h5>Support & Trust</h5>\n"
138 + SsTt + "</div>\n"
139
140 + "<div class='inforow'>"
141 + "<h5>Node key</h5>\n"
142 + nodeKey + "</div>\n"
143
144 + "<div class='inforow newline'>"
145 + "<h5>Via neighbour</h5>\n"
146 + nbName + "</div>\n"
147
148 + "<div class='inforow'>"
149 + "<h5>Via device</h5>\n"
150 + dev + "</div>\n"
151
152 + "<div class='inforow'>"
153 + "<h5>Via remote link-local IPv6 address</h5>\n"
154 + nbLocalIp + "</div>\n"
155
156 + "<div class='inforow'>"
157 + "<h5>Route metric</h5>\n"
158 + metric + "</div>\n"
159
160 + "<div class='inforow'>"
161 + "<h5>Desc. size</h5>\n"
162 + descSize + "</div>\n"
163
164 + "\n</div>";
165
166 res.push([extrainfo_link, name, shortId, SsTt, primaryIp,
167 nbName, metric, lastDesc, lastRef, extrainfo]);
168
169 });
170 return res;
171 });
172 //]]></script>
173
174 <%+footer%>
175