recognize interfaces with . turned into _ too
authorivan <ivan>
Tue, 1 Mar 2011 00:09:39 +0000 (00:09 +0000)
committerivan <ivan>
Tue, 1 Mar 2011 00:09:39 +0000 (00:09 +0000)
torrus/perllib/Torrus/Renderer/HTML.pm
torrus/templates/default-dir.html

index df0c65b..6eec86d 100644 (file)
@@ -14,7 +14,7 @@
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 
-# $Id: HTML.pm,v 1.13 2011-02-27 19:20:37 ivan Exp $
+# $Id: HTML.pm,v 1.14 2011-03-01 00:09:39 ivan Exp $
 # Stanislav Sinyagin <ssinyagin@yahoo.com>
 
 package Torrus::Renderer::HTML;
@@ -120,7 +120,7 @@ sub render_html
         'freesideComponent' => sub { return $self->freesideComponent(@_); },
         'uri_escape'        => sub { return uri_escape(@_); },
         'matches'        => sub { return $_[0] =~ $_[1]; },
-        'slash2underscore' => sub { $_[0] =~ s/\//_/g; return $_[0]; },
+        'iface_underscore' => sub { $_[0] =~ s/[\/\.]/_/g; return $_[0]; },
         'load_nms'       => sub { return $self->load_nms; },
         'get_serviceids'    => sub { my $nms = shift; 
                                   my $router = shift;
index bcdc001..c87b561 100644 (file)
@@ -17,7 +17,7 @@
     serviceids = get_serviceids(nms,router);
 
     # HACK! this doesn't do what you think it does...
-    popup_link('nms-add_iface.html',router,uri_escape(slash2underscore(nodeName(token))),nms,serviceids);
+    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');
@@ -63,7 +63,7 @@
          thisIsAlias ? '</EM>':''; %]
       [% IF matches(thepath,'Interface_Counters/$') %]
        <FONT SIZE="-1">
-        [% popup_link('nms-add_iface.html',router,uri_escape(slash2underscore(nodeName(child))),nms,serviceids) %]
+        [% popup_link('nms-add_iface.html',router,uri_escape(iface_underscore(nodeName(child))),nms,serviceids) %]
        </FONT>
       [% END %]
     </SPAN>