"; }
return join("\n",@head)."\n";
}
######################################################################
#
# insert complete HTML footer
#
sub create_footer {
my $MODNAME=shift || "";
my $PATH=".";
if ($MODNAME ne "") { $PATH=".."; }
my @foot=(
"
",
" ",
" ",
" ",
" ",
" HTML overview to System and Network Information Center",
"
",
" ",
""
);
return join("\n",@foot)."\n";
}
######################################################################
#
# insert complete table entry for a module time index page
#
sub create_table_entry {
my $IMAGEFORMAT=shift || "";
my $PAGENAME=shift || "";
my $TIME=shift || "";
my $NAME=shift || "";
my $DESCRIPTION=shift || "";
my $COMPACT=shift || 1;
if ($DESCRIPTION ne "") { $DESCRIPTION="
$DESCRIPTION"; }
my $LV1=" " x 8;
my $LV2=" " x 10;
my $LV3=" " x 12;
my @items=("$LV1
";
return join("\n",@items)."\n";
}
######################################################################
#
# insert complete table header for the overview page
#
sub create_overview_table_header {
my $MODNAME=shift || "";
my $TIMES=shift || "";
my $COLS=shift || 1;
my $LV1=" " x 10;
my $LV2=" " x 12;
my @items=("$COLS","0##$LV1
");
return join("\n",@items)."\n";
}
######################################################################
#
# insert complete table entry for the overview page
#
sub create_overview_table_entry {
my $MODNAME=shift || "";
my $IMAGEFORMAT=shift || "";
my $NUM=shift || 1;
my $PAGENAME=shift || "";
my $NAME=shift || "";
my $DESCRIPTION=shift || "";
my $COMPACT=shift || 1;
if ($DESCRIPTION ne "") { $DESCRIPTION=" $DESCRIPTION"; }
my $LV1=" " x 10;
my $LV2=" " x 12;
my @items=();
my @block=(
"$NUM##$LV1
"
);
if ($COMPACT != 1) { push @items,$block[0],"$NUM##$LV2".$block[1],"$NUM##$LV1".$block[2]; }
else { push @items,join ("",@block); }
return join("\n",@items)."\n";
}
######################################################################
#
# insert a number of empty table entries for the overview page
#
# $num row number
#
# $count how many cols shall be added
#
sub create_overview_table_entry_empty {
my $NUM=shift || 1;
my $COUNT=shift || 0;
my $LV1=" " x 10;
my $value="";
if ($COUNT > 0) {
if ($NUM >= 0) { $value="$NUM##$LV1
\n" x $COUNT; }
else { $value="$LV1
\n" x $COUNT; }
}
return $value;
}
######################################################################
#
# generate a .html file containing the detailed device overview
#
# HotSaNIChtml::make_device_page($MODNAME,$WEBDIR,$IMAGEFORMAT,$file,description,@times);
#
# $MODNAME name of the module
#
# $WEBDIR the directory where the file shall be written
#
# $IMAGEFORMAT gif or png
#
# $file name of the file (without ".html" suffix)
#
# $description description tag that will be included on top of the page
#
# @times array containing the timespans for which diagrams shall
# be inseerted
#
sub make_device_page {
my $MODNAME=shift;
my $WEBDIR=shift;
my $IMAGEFORMAT=shift;
my $file=shift;
my $description=shift;
open (FILE,">$WEBDIR/$file.html");
print FILE HotSaNIChtml::create_header($MODNAME,$REFRESH,$description);
foreach my $time (@_) { print FILE "\n"; }
print FILE HotSaNIChtml::create_footer($MODNAME);
close FILE;
}
1;
WebSVN
- hotsanic
- Blame
- Rev 36
- /branches/HotSaNIC-0.5.0-pre6/lib/HotSaNIChtml.pm