[freeside-commits] freeside/httemplate/view svc_port.cgi,1.3,1.4
Erik Levinson
levinse at wavetail.420.am
Mon Feb 7 15:22:36 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv30791/httemplate/view
Modified Files:
svc_port.cgi
Log Message:
torrus, UI, RT10574
Index: svc_port.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_port.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- svc_port.cgi 3 Feb 2011 06:18:41 -0000 1.3
+++ svc_port.cgi 7 Feb 2011 23:22:34 -0000 1.4
@@ -20,16 +20,6 @@
} keys %$fields;
my @fields = keys %$fields;
-my $svcnum;
-if ( $cgi->param('svcnum') ) {
- $cgi->param('svcnum') =~ /^(\d+)$/ or die "unparsable svcnum";
- $svcnum = $1;
-} else {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/ or die "no svcnum";
- $svcnum = $1;
-}
-
my $start = $cgi->param('start');
my $end = $cgi->param('end');
@@ -42,10 +32,15 @@
}
my $html_foot = sub {
+ my $svc_port = shift;
+ my $svcnum = $svc_port->svcnum;
my $default_end = time;
my $default_start = $default_end-86400;
my $graph = '';
+ my $nms = new FS::NetworkMonitoringSystem;
+ my $link = $nms->port_graphs_link($svc_port->serviceid);
+
if($start && $end) {
$graph = "<BR><BR><IMG SRC=${p}/view/port_graph.html?svcnum=$svcnum;".
"start=".str2time("$start 00:00:00").";end=".str2time("$end 23:59:59").">";
@@ -60,6 +55,7 @@
</script>
<FORM ACTION=? METHOD="GET">
<INPUT TYPE="HIDDEN" NAME="svcnum" VALUE="'.$svcnum.'">
+ <A HREF="'.$link.'">Torrus Graphs</A><BR><BR>
<B>Bandwidth Graph</B><BR>
'.preset_range($default_start,$default_end,'Last Day',$date_format)
.' | '.preset_range($default_end-86400*7,$default_end,'Last Week',$date_format)
More information about the freeside-commits
mailing list