From d9db63d82fce670cc3c21f86e577dd99c3d14028 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Fri, 27 Mar 2015 14:20:48 -0500 Subject: RT#18834: Cacti integration [real graph import] --- httemplate/misc/cacti_graphs.html | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 httemplate/misc/cacti_graphs.html (limited to 'httemplate/misc/cacti_graphs.html') diff --git a/httemplate/misc/cacti_graphs.html b/httemplate/misc/cacti_graphs.html new file mode 100644 index 000000000..9cc5e2494 --- /dev/null +++ b/httemplate/misc/cacti_graphs.html @@ -0,0 +1,53 @@ +<% include( '/elements/header.html', 'Cacti Graphs' ) %> + +% if ($load) { + +
+ +
+<% include( '/elements/progress-init.html', + 'CactiGraphForm', + [ 'svcnum' ], + $p.'misc/process/cacti_graphs.cgi', + { url => 'javascript:window.location.replace("'.popurl(2).'misc/cacti_graphs.html?svcnum='.$svcnum.'")' }, +) %> + +

Loading graphs, please wait...

+ + +% } else { +% if ($error) { + +

<% $error %>

+ +% } else { + +<% slurp($htmlfile) %> + +% } +% } + +<%init> +use File::Slurp qw( slurp ); + +my $svcnum = $cgi->param('svcnum') or die 'Illegal svcnum'; +my $load = $cgi->param('load'); +my $graphnum = $cgi->param('graphnum'); + +my $htmlfile = $FS::UID::cache_dir + . '/cacti-graphs/' + . 'svc_' + . $svcnum; +$htmlfile .= '_graph_' . $graphnum + if $graphnum; +$htmlfile .= '.html'; + +my $error = (-e $htmlfile) ? '' : 'File not found'; + + -- cgit v1.2.1