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