Skip to content
Snippets Groups Projects
Commit 4a10bd3c authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added placeholders for dashboard display

parent ba597483
No related branches found
No related tags found
No related merge requests found
# OpenTrafficShaper webserver module: index page
# Copyright (C) 2007-2013, AllWorldIT
#
# Copyright (C) 2007-2014, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
......@@ -30,7 +30,10 @@ our (@ISA,@EXPORT,@EXPORT_OK);
);
use opentrafficshaper::plugins;
# Dashboard
sub _catchall
{
my ($kernel,$globals,$client_session_id,$request) = @_;
......@@ -39,11 +42,97 @@ sub _catchall
# Build content
my $content = "";
$content .= "Hi there: ".$request->uri->as_string();
if (!isPluginLoaded('statistics')) {
$content .= "No Statistics Plugin";
goto END;
}
my @leftGraphs;
my @rightGraphs;
for (my $i = 0; $i < 7; $i++) {
push(@leftGraphs,"Class $i");
}
for (my $i = 0; $i < 2; $i++) {
push(@rightGraphs,"Main $i");
}
# Loop while we have graphs to output
while (@leftGraphs || @rightGraphs) {
# Layout Begin
$content .= <<EOF;
<div class="row">
EOF
# LHS - Begin
$content .= <<EOF;
<div class="col-xs-8">
EOF
# Loop with 2 sets of normal graphs per row
for (my $row = 0; $row < 2; $row++) {
# LHS - Begin Row
$content .= <<EOF;
<div class="row">
<div class="col-xs-6">
EOF
# Graph 1
if (defined(my $graph = shift(@leftGraphs))) {
$content .= <<EOF;
<h4 style="color:#8f8f8f;">Latest Data For: $graph</h4>
<div id="flotCanvas" class="flotCanvas" style="width: 520px; height: 150px; border: 1px dashed black">
</div>
EOF
}
# LHS - Spacer
$content .= <<EOF;
</div>
<div class="col-xs-6">
EOF
# Graph 2
if (defined(my $graph = shift(@leftGraphs))) {
$content .= <<EOF;
<h4 style="color:#8f8f8f;">Latest Data For: $graph</h4>
<div id="flotCanvas" class="flotCanvas" style="width: 520px; height: 150px; border: 1px dashed black">
</div>
EOF
}
# LHS - End Row
$content .= <<EOF;
</div>
</div>
EOF
}
# LHS - End
$content .= <<EOF;
</div>
EOF
# RHS - Begin Row
$content .= <<EOF;
<div class="col-xs-4">
EOF
# Graph
if (defined(my $graph = shift(@rightGraphs))) {
$content .= <<EOF;
<h4 style="color:#8f8f8f;">Latest Data For: $graph</h4>
<div id="flotCanvas" class="flotCanvas" style="width: 520px; height: 340px; border: 1px dashed black"></div>
EOF
}
# RHS - End Row
$content .= <<EOF;
</div>
EOF
# Layout End
$content .= <<EOF;
</div>
EOF
}
END:
return (200,$content);
}
1;
# vim: ts=4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment