blob: 4f6d0c1aa99963e114f2f4b705c2fe1f16c35277 [file] [log] [blame]
Paul Greysonbcd3c772013-03-21 13:16:44 -07001function parseURLParameters() {
2 var parameters = {};
3
4 var search = location.href.split('?')[1];
5 if (search) {
6 search.split('&').forEach(function (param) {
7 var key = param.split('=')[0];
8 var value = param.split('=')[1];
9 parameters[key] = decodeURIComponent(value);
10 });
11 }
12
13 return parameters;
Paul Greyson5cc35f02013-03-28 10:07:36 -070014}
15
16function findLink(model, dpid) {
17 var links = [];
18 model.links.forEach(function (link) {
19 if (link['src-switch'] == dpid || link['dst-switch'] == dpid) {
20 links.push(link);
21 }
22 });
23 return links;
Paul Greysonbcd3c772013-03-21 13:16:44 -070024}