Skip to content

Commit

Permalink
fix link rc selection
Browse files Browse the repository at this point in the history
  • Loading branch information
afourmy committed Nov 1, 2019
1 parent dd3f899 commit d9ad60f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
10 changes: 0 additions & 10 deletions eNMS/static/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,3 @@ function showDeviceResultsPanel(device) {
initTable("result", device);
});
}

Object.assign(action, {
"Device properties": (d) => {
console.log(d)
showTypePanel("device", d.id)
},
"Link properties": (l) => showTypePanel("link", l.id),
Connect: (d) => showPanel("device_connection", d.id),
Configuration: (d) => showDeviceConfiguration(d),
});
11 changes: 8 additions & 3 deletions eNMS/static/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function createLink(link) {
const pointList = [pointA, pointB];
const polyline = new L.Polyline(pointList, {
color: link.color,
weight: 3,
weight: 2,
opacity: 1,
smoothFactor: 1,
});
Expand All @@ -121,10 +121,9 @@ function createLink(link) {
showTypePanel("link", this.link_id);
});
polyline.on("contextmenu", function(e) {
console.log("test")
$(".menu").hide();
$(".rc-link-menu").show();
selectedObject = this.link; // eslint-disable-line no-undef
selectedObject = link; // eslint-disable-line no-undef
});
polyline.bindTooltip(link.name, {
permanent: false,
Expand Down Expand Up @@ -225,6 +224,12 @@ function showViewFilteringPanel(type) {
showFilteringPanel(`${type}_filtering`);
}

Object.assign(action, {
"Properties": (o) => showTypePanel(o.icon ? "device" : "link", o.id),
Connect: (d) => showPanel("device_connection", d.id),
Configuration: (d) => showDeviceConfiguration(d),
});

(function() {
markerType = config.view.marker;
map = L.map("map", { preferCanvas: true }).setView(
Expand Down
7 changes: 2 additions & 5 deletions eNMS/templates/pages/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,13 @@
</ul>
</li>
<li class="menu rc-site-menu"><a tabindex="-1" href="#">Enter site</a></li>
<li class="menu rc-device-menu">
<a tabindex="-1" href="#">Device properties</a>
<li class="menu rc-device-menu rc-link-menu">
<a tabindex="-1" href="#">Properties</a>
</li>
<li class="menu rc-device-menu"><a tabindex="-1" href="#">Connect</a></li>
<li class="menu rc-device-menu">
<a tabindex="-1" href="#">Configuration</a>
</li>
<li class="menu rc-link-menu">
<a tabindex="-1" href="#">Link properties</a>
</li>
</ul>
<div class="right_col" role="main">
<div class="row">
Expand Down

0 comments on commit d9ad60f

Please sign in to comment.