From 1e37402a96397fe344c32e0abf7434b4b595ea49 Mon Sep 17 00:00:00 2001 From: levinse Date: Fri, 28 Jan 2011 02:49:15 +0000 Subject: torrus, RT10574 --- torrus/perllib/Torrus/Renderer/HTML.pm | 19 ++++++++++++++++++- torrus/templates/default-dir.html | 8 ++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'torrus') diff --git a/torrus/perllib/Torrus/Renderer/HTML.pm b/torrus/perllib/Torrus/Renderer/HTML.pm index 4dde8e008..d4a2a1380 100644 --- a/torrus/perllib/Torrus/Renderer/HTML.pm +++ b/torrus/perllib/Torrus/Renderer/HTML.pm @@ -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.4 2011-01-25 03:15:03 ivan Exp $ +# $Id: HTML.pm,v 1.5 2011-01-28 02:49:15 levinse Exp $ # Stanislav Sinyagin package Torrus::Renderer::HTML; @@ -119,6 +119,23 @@ sub render_html 'freesideFooter' => sub { return $self->freesideFooter(); }, 'freesideComponent' => sub { return $self->freesideComponent(@_); }, 'uri_escape' => sub { return uri_escape(@_); }, + 'matches' => sub { return $_[0] =~ $_[1]; }, + 'popup_link' => sub { + my $type = shift; + + if($type eq 'nms-add_iface.html') { + my $host = shift; + my $iface = shift; + return + $self->freesideComponent('/elements/popup_link.html', + 'action' => "/freeside/misc/". + $type."?host=$host;iface=$iface", + 'label' => 'Monitor for billing', + 'actionlabel' => 'Monitor interface', + ); + } + ''; + }, }; diff --git a/torrus/templates/default-dir.html b/torrus/templates/default-dir.html index 4b653be17..fe13a9bbe 100644 --- a/torrus/templates/default-dir.html +++ b/torrus/templates/default-dir.html @@ -1,8 +1,13 @@ [% PROCESS 'html-incblocks.txt' %] +[% thepath=path(token) %] [% INCLUDE htmlstart title=xmlnorm(nodeParam(token,'comment')) printpath=1 %] [% INCLUDE legend %] +[% IF matches(thepath,'Interface_Counters/$') %] + [% freesideComponent('/elements/init_overlib.html') %] +[% END %] +

Directories you can jump to:

[% hasLeaves = 0; hasSubtrees = 0; @@ -39,6 +44,9 @@ [% nodeName(child) %] [% hidden ? '':''; thisIsAlias ? '':''; %] + [% IF matches(thepath,'Interface_Counters/$') %] + [% popup_link('nms-add_iface.html',nodeName(parent(token)),uri_escape(nodeName(child))) %] + [% END %] [% IF comment %] -- cgit v1.2.1