freifunkmanager/js/route/aliases.js

36 lines
1.6 KiB
JavaScript

function routeAliases(){
fill = '<table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp nodes-table">'
+ '<thead>'
+ '<tr>'
+ '<th class="mdl-data-table__cell--non-numeric">Hostname</th>'
+ '<th>Freq</th>'
+ '<th>Channel</th>'
+ '<th>Power</th>'
+ '<th class="mdl-data-table__cell--non-numeric">Location</th>'
+ '<th class="mdl-data-table__cell--non-numeric">SSH</th>'
+ '</tr>'
+ '</thead>'
+ '<tbody>'
Object.keys(internal.aliases).map(function(key){
fill += '<tr>'
+ '<td class="mdl-data-table__cell--non-numeric" rowspan="2">'
+ internal.aliases[key].hostname
+ '<br/>'
+ '<small>'+key+'</small>'
+ '</td>'
+ '<td>2.4 Ghz</td>'
+ '<td>'+((internal.aliases[key].freq24 !== undefined)?internal.aliases[key].freq24.channel:'-')+ '</td>'
+ '<td>'+((internal.aliases[key].freq24 !== undefined)?internal.aliases[key].freq24.txpower:'-')+ '</td>'
+ '<td class="mdl-data-table__cell--non-numeric" rowspan="2">'+((internal.aliases[key].location)?'<i class="material-icons">place</i>':'')+'</td>'
+ '<td class="mdl-data-table__cell--non-numeric" rowspan="2">'+sshUrl(key)+'</td>'
+ '</tr>'
+ '<tr>'
+ '<td class="mdl-data-table__cell--non-numeric" style="padding-left:18px;">5Ghz</td>'
+ '<td>'+((internal.aliases[key].freq5 !== undefined)?internal.aliases[key].freq5.channel:'-')+ '</td>'
+ '<td style="padding-right:18px;">'+((internal.aliases[key].freq5 !== undefined)?internal.aliases[key].freq5.txpower:'-')+ '</td>'
+ '</tr>'
})
fill += '</tbody></table>'
container.innerHTML = fill
}