Developing lightweight computation at the DSG edge

Commit 853cdaf9 authored by p4u's avatar p4u
Browse files

Improved some mesh nodes view style

parent 0acf83d2
......@@ -23,7 +23,7 @@
td.innerHTML += '<em><%: Please perform a manually cache flush from a terminal: bmx6 -c --flushAll %></em>'
return 1;
}
if ( originators && descriptions && tb)
{
/* clear all rows */
......@@ -35,9 +35,9 @@
var tr = tb.insertRow(-1);
var nodename = descriptions[i].DESC_ADV.globalId.replace(/\.[^\.]+$/,"");
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
tr.insertCell(-1).innerHTML = '<a onclick="displayExtraInfo(\'ip-'+i+'\')"><img src=\"/luci-static/resources/cbi/help.gif\" /></a>';
tr.insertCell(-1).innerHTML = '<a onclick="displayExtraInfo(\'ip-'+i+'\')"><img src=\"<%=resource%>/cbi/help.gif\" /></a>';
tr.insertCell(-1).innerHTML = nodename;
var extensions = descriptions[i].DESC_ADV.extensions;
//Looking for the extensions
......@@ -55,15 +55,17 @@
tun4in6 = extensions[e].TUN4IN6_NET_EXTENSION;
}
}
var gateways = '<ul>';
for ( var t = 0; t < tun4in6.length; t++)
{
gateways += "<li>"+tun4in6[t].network+'/'+tun4in6[t].networklen + ' | ';
gateways += tun4in6[t].bandwidth+'</li>';
if ( tun4in6[t].networklen == "32" )
gateways += '<li><a href="http://' + tun4in6[t].network + '">' + tun4in6[t].network + '</a></li>';
else
gateways += "<li>"+tun4in6[t].network+'/'+tun4in6[t].networklen + ' | ' + tun4in6[t].bandwidth+'</li>';
}
gateways += '</ul>';
//Adding HNAs with prefix=128 as main address
var ipstxt = '';
var address;
......@@ -77,42 +79,38 @@
prefix = hna6[e].prefixlen;
if ( prefix == '128' )
{
if (first)
if (first)
{
ipstxt += address;
ipstxt_hidden += '<li><a href="http://['+address+']" >'+address+"</a></li>";
first = 0;
}
}
else {
ipstxt_hidden += '<li><a href="http://['+address+']" >'+address+"</a></li>";
ipstxt_hidden += '<li><a href="http://['+address+']" >'+address+"</a></li>";
}
}
else {
hna6list += '<li>'+address+'/'+prefix+'</li>';
hna6list += '<li>'+address+'/'+prefix+'</li>';
}
}
hna6list += '</ul>';
ipstxt_hidden += '</ul>';
tr.insertCell(-1).innerHTML = ipstxt;
tr.insertCell(-1).innerHTML = originators[i].viaDev;
tr.insertCell(-1).innerHTML = originators[i].metric;
tr.insertCell(-1).innerHTML = originators[i].lastDesc;
tr.insertCell(-1).innerHTML = originators[i].lastRef;
tr.insertCell(-1).innerHTML = originators[i].blocked;
//tr.onclick = displayExtraInfo("ip-"+i);
extrainfo = '<div id="ip-'+ i +'" class="hideme">';
extrainfo += "<div class='inforow'><br /><br /><h4>"+nodename+'</h4></div>\n';
extrainfo += "<div class='inforow'><h5>Available IPs</h5>\n<p>" + ipstxt_hidden + "</p></div>\n";
extrainfo += "<div class='inforow'><h5>Gateways announced</h5>\n<p>" + gateways + "</p></div>\n";
extrainfo += "<div class='inforow'><h5>Networks announced</h5>\n<p>" + hna6list + "</p></div>\n";
extrainfo = '<div id="ip-'+ i +'" class="hideme">' + "<div class='inforow'><br /><br /><h4>" + nodename + '</h4></div>\n' + "<div class='inforow'><h5>Available IPs</h5>\n<p>" + ipstxt_hidden + "</p></div>\n" + "<div class='inforow'><h5>Gateways announced</h5>\n<p>" + gateways + "</p></div>\n" + "<div class='inforow'><h5>Networks announced</h5>\n<p>" + hna6list + "</p></div>\n";
extrainfo += "\n</div>";
tr.insertCell(-1).innerHTML = extrainfo;
}
if( tb.rows.length == 1 )
......@@ -134,22 +132,22 @@
div.hideme{
display: none;
}
div.info{
background: #FFF;
border: solid 1px;
height: 80px;
display: block;
overflow: auto;
text-align: center;
}
div.inforow{
text-align:left;
text-align:center;
display:inline-block;
width:20%;
margin:5px;
vertical-align:top;
}
#extra-info ul { list-style: none outside none; margin-left: 0em; }
......@@ -161,7 +159,7 @@
<div class="cbi-map-descr"></div>
<div id="extra-info" class="info">
<br />
Click to the icon <img src="/luci-static/resources/cbi/help.gif" /> to see individual node information
Click to the icon <img src="<%=resource%>/cbi/help.gif" /> to see individual node information
</div>
<fieldset class="cbi-section">
<legend><%:Mesh nodes%></legend>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment