mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 20:31:00 +02:00
GUI -- Adjusted link details display to suppress nonsensical line items for edge-links.
Change-Id: If272c783f4d471e30ac5342a6b12d2b66926d43d
This commit is contained in:
parent
08706ce97f
commit
e25c5a2d15
@ -49,12 +49,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addProp(tbody, label, value) {
|
function addProp(tbody, label, value) {
|
||||||
var tr = tbody.append('tr');
|
var tr = tbody.append('tr'),
|
||||||
|
lab = label.replace(/_/g, ' ');
|
||||||
|
|
||||||
function addCell(cls, txt) {
|
function addCell(cls, txt) {
|
||||||
tr.append('td').attr('class', cls).html(txt);
|
tr.append('td').attr('class', cls).html(txt);
|
||||||
}
|
}
|
||||||
addCell('label', label + ' :');
|
addCell('label', lab + ' :');
|
||||||
addCell('value', value);
|
addCell('value', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,27 +148,44 @@
|
|||||||
return d ? d.type + ' / ' + o : '-';
|
return d ? d.type + ' / ' + o : '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// provided to change presentation of internal type name
|
||||||
|
var linkTypePres = {
|
||||||
|
hostLink: 'edge link'
|
||||||
|
};
|
||||||
|
|
||||||
|
function linkType(d) {
|
||||||
|
return linkTypePres[d.type()] || d.type();
|
||||||
|
}
|
||||||
|
|
||||||
|
var coreOrder = [
|
||||||
|
'Type', '-',
|
||||||
|
'A_type', 'A_id', 'A_label', 'A_port', '-',
|
||||||
|
'B_type', 'B_id', 'B_label', 'B_port', '-'
|
||||||
|
],
|
||||||
|
edgeOrder = [
|
||||||
|
'Type', '-',
|
||||||
|
'A_type', 'A_id', 'A_label', '-',
|
||||||
|
'B_type', 'B_id', 'B_label', 'B_port'
|
||||||
|
];
|
||||||
|
|
||||||
function displayLink(data) {
|
function displayLink(data) {
|
||||||
detailPanel.empty();
|
detailPanel.empty();
|
||||||
|
|
||||||
var svg = dpa('svg'),
|
var svg = dpa('svg'),
|
||||||
title = dpa('h2'),
|
title = dpa('h2'),
|
||||||
table = dpa('table'),
|
table = dpa('table'),
|
||||||
tbody = table.append('tbody');
|
tbody = table.append('tbody'),
|
||||||
|
edgeLink = data.type() === 'hostLink',
|
||||||
|
order = edgeLink ? edgeOrder : coreOrder;
|
||||||
|
|
||||||
gs.addGlyph(svg, 'ports', 40);
|
gs.addGlyph(svg, 'ports', 40);
|
||||||
title.text('Link');
|
title.text('Link');
|
||||||
|
|
||||||
var order = [
|
|
||||||
'Type', '-',
|
|
||||||
'A_type', 'A_id', 'A_label', 'A_port', '-',
|
|
||||||
'B_type', 'B_id', 'B_label', 'B_port', '-'
|
|
||||||
];
|
|
||||||
|
|
||||||
listProps(tbody, {
|
listProps(tbody, {
|
||||||
propOrder: order,
|
propOrder: order,
|
||||||
props: {
|
props: {
|
||||||
Type: data.type(),
|
Type: linkType(data),
|
||||||
|
|
||||||
A_type: data.source.class,
|
A_type: data.source.class,
|
||||||
A_id: data.source.id,
|
A_id: data.source.id,
|
||||||
@ -181,8 +199,10 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addProp(tbody, 'A → B', linkSummary(data.fromSource));
|
if (!edgeLink) {
|
||||||
addProp(tbody, 'B → A', linkSummary(data.fromTarget));
|
addProp(tbody, 'A → B', linkSummary(data.fromSource));
|
||||||
|
addProp(tbody, 'B → A', linkSummary(data.fromTarget));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayNothing() {
|
function displayNothing() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user