blob: 4f6d0c1aa99963e114f2f4b705c2fe1f16c35277 [file] [log] [blame]
function parseURLParameters() {
var parameters = {};
var search = location.href.split('?')[1];
if (search) {
search.split('&').forEach(function (param) {
var key = param.split('=')[0];
var value = param.split('=')[1];
parameters[key] = decodeURIComponent(value);
});
}
return parameters;
}
function findLink(model, dpid) {
var links = [];
model.links.forEach(function (link) {
if (link['src-switch'] == dpid || link['dst-switch'] == dpid) {
links.push(link);
}
});
return links;
}