-[% IF matches(thepath,'Interface_Counters/$') %]
- [% freesideComponent('/elements/init_overlib.html') %]
-[% END %]
+[%
+ IF matches(thepath,'Interface_Counters/$');
+ freesideComponent('/elements/init_overlib.html');
+ nms = load_nms();
+ router = nodeName(parent(token));
+ serviceids = get_serviceids(nms,router);
+ END;
+ IF matches(thepath,'Interface_Counters/.*?/$');
+ nms = load_nms();
+ router = nodeName(parent(parent(token)));
+ serviceids = get_serviceids(nms,router);
+
+ # this displays the link on the port detail page
+ popup_link('nms-add_iface.html',router,uri_escape(iface_underscore(nodeName(token))),nms,serviceids);
+ END;
+ IF matches(thepath,'Routers/$');
+ freesideComponent('/elements/init_overlib.html');
+ popup_link('nms-add_router.html');
+ END;
+%]