Adding line style UI
This commit is contained in:
Родитель
8b30bb8c05
Коммит
1b47d0c57a
|
@ -10,6 +10,7 @@ my $UNITS = lc($req->param('units'));
|
|||
my $TBOX = lc($req->param('tbox'));
|
||||
my $AUTOSCALE = lc($req->param('autoscale'));
|
||||
my $DAYS = lc($req->param('days'));
|
||||
my $LTYPE = lc($req->param('ltype'));
|
||||
|
||||
#
|
||||
# Testing only:
|
||||
|
@ -40,7 +41,7 @@ sub make_filenames_list {
|
|||
|
||||
# Print out a list of testnames in db directory
|
||||
sub print_testnames {
|
||||
my ($tbox, $autoscale, $days, $units) = @_;
|
||||
my ($tbox, $autoscale, $days, $units, $ltype) = @_;
|
||||
|
||||
# HTTP header
|
||||
print "Content-type: text/html\n\n<HTML>\n";
|
||||
|
@ -55,7 +56,7 @@ sub print_testnames {
|
|||
my $machines_string = join(" ", @machines);
|
||||
|
||||
foreach (@machines) {
|
||||
print "<li><a href=query.cgi?&testname=$_$testname&tbox=$tbox&autoscale=$autoscale&days=$days&units=$units>$_</a>\n";
|
||||
print "<li><a href=query.cgi?&testname=$_$testname&tbox=$tbox&autoscale=$autoscale&days=$days&units=$units<ype=$ltype>$_</a>\n";
|
||||
}
|
||||
print "</ul></td></tr></table></td></tr></table>";
|
||||
|
||||
|
@ -64,7 +65,7 @@ sub print_testnames {
|
|||
|
||||
# Print out a list of machines in db/<testname> directory, with links.
|
||||
sub print_machines {
|
||||
my ($testname, $autoscale, $days, $units) = @_;
|
||||
my ($testname, $autoscale, $days, $units, $ltype) = @_;
|
||||
|
||||
# HTTP header
|
||||
print "Content-type: text/html\n\n<HTML>\n";
|
||||
|
@ -79,7 +80,7 @@ sub print_machines {
|
|||
my $machines_string = join(" ", @machines);
|
||||
|
||||
foreach (@machines) {
|
||||
print "<li><a href=query.cgi?tbox=$_&testname=$testname&autoscale=$autoscale&days=$days&units=$units>$_</a>\n";
|
||||
print "<li><a href=query.cgi?tbox=$_&testname=$testname&autoscale=$autoscale&days=$days&units=$units<ype=$ltype>$_</a>\n";
|
||||
}
|
||||
print "</ul></td></tr></table></td></tr></table>";
|
||||
|
||||
|
@ -96,46 +97,71 @@ sub show_graph {
|
|||
print "<table cellspacing=10>\n";
|
||||
print "<tr>\n";
|
||||
|
||||
print "<td>\n";
|
||||
# Scale Y-axis
|
||||
my $neg_autoscale = !$AUTOSCALE;
|
||||
print "<td>\n";
|
||||
if($AUTOSCALE) {
|
||||
print "Y-axis: (<b>zoom</b>|";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$neg_autoscale&days=$DAYS&units=$UNITS\">100%</a>";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=0&days=$DAYS&units=$UNITS<ype=$LTYPE\">100%</a>";
|
||||
print ") \n";
|
||||
} else {
|
||||
print "Y-axis: (";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$neg_autoscale&days=$DAYS&units=$UNITS\">zoom</a>";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=1&days=$DAYS&units=$UNITS<ype=$LTYPE\">zoom</a>";
|
||||
print "|<b>100%</b>) \n";
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
print "<td>\n";
|
||||
# Days, Time-axis
|
||||
print "<form method=\"get\" action=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&units=$UNITS\">\n";
|
||||
print "<td>\n";
|
||||
print "<form method=\"get\" action=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&units=$UNITS<ype=$LTYPE\">\n";
|
||||
print "<input type=hidden name=\"tbox\" value=\"$TBOX\">";
|
||||
print "<input type=hidden name=\"testname\" value=\"$TESTNAME\">";
|
||||
print "<input type=hidden name=\"autoscale\" value=\"$AUTOSCALE\">";
|
||||
|
||||
print "Days:";
|
||||
if($DAYS) {
|
||||
print "(<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=0&units=$UNITS\">all data</a>|";
|
||||
print "<input type=text value=$DAYS name=\"days\" size=3 maxlength=10>\n";
|
||||
print ")";
|
||||
print "(<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=0&units=$UNITS<ype=$LTYPE\">all data</a>|";
|
||||
print "<input type=text value=$DAYS name=\"days\" size=3 maxlength=10>";
|
||||
print ")\n";
|
||||
} else {
|
||||
print "(<b>all data</b>|";
|
||||
print "<input type=text value=\"\" name=\"days\" size=3 maxlength=10>\n";
|
||||
print ")";
|
||||
print "<input type=text value=\"\" name=\"days\" size=3 maxlength=10>";
|
||||
print ")\n";
|
||||
}
|
||||
print "</form>\n";
|
||||
print "</td>\n";
|
||||
|
||||
# Line style (lines|steps|points)
|
||||
print "<td>\n";
|
||||
print "Style:";
|
||||
if($LTYPE eq "steps") {
|
||||
print "(";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=lines\">lines</a>";
|
||||
print "|<b>steps</b>|";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=points\">points</a>";
|
||||
print ")";
|
||||
} elsif($LTYPE eq "points") {
|
||||
print "(";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=lines\">lines</a>";
|
||||
print "|";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=steps\">steps</a>";
|
||||
print "|<b>points</b>)";
|
||||
} else {
|
||||
print "(<b>lines</b>|";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=steps\">steps</a>";
|
||||
print "|";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=points\">points</a>";
|
||||
print ")";
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
print "</table>\n";
|
||||
print "<br>\n";
|
||||
|
||||
# graph
|
||||
print "<img src=\"graph.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS\" alt=\"$TBOX $TESTNAME graph\">";
|
||||
print "<img src=\"graph.cgi?tbox=$TBOX&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=$LTYPE\" alt=\"$TBOX $TESTNAME graph\">";
|
||||
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
@ -143,11 +169,11 @@ sub show_graph {
|
|||
# Other machines
|
||||
print "<font size=\"-1\">";
|
||||
print "<li>\n";
|
||||
print "<a href=\"query.cgi?tbox=&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS\">Other machines running the $TESTNAME test</a>";
|
||||
print "<a href=\"query.cgi?tbox=&testname=$TESTNAME&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=$LTYPE\">Other machines running the $TESTNAME test</a>";
|
||||
print "</li>\n";
|
||||
|
||||
print "<li>\n";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS\">Other tests that $TBOX is running</a>";
|
||||
print "<a href=\"query.cgi?tbox=$TBOX&testname=&autoscale=$AUTOSCALE&days=$DAYS&units=$UNITS<ype=$LTYPE\">Other tests that $TBOX is running</a>";
|
||||
print "</li>\n";
|
||||
print "</font>";
|
||||
|
||||
|
@ -156,9 +182,9 @@ sub show_graph {
|
|||
}
|
||||
|
||||
if(!$TESTNAME) {
|
||||
print_testnames($TBOX, $AUTOSCALE, $DAYS, $UNITS);
|
||||
print_testnames($TBOX, $AUTOSCALE, $DAYS, $UNITS, $LTYPE);
|
||||
} elsif(!$TBOX) {
|
||||
print_machines($TESTNAME, $AUTOSCALE, $DAYS, $UNITS);
|
||||
print_machines($TESTNAME, $AUTOSCALE, $DAYS, $UNITS, $LTYPE);
|
||||
} else {
|
||||
show_graph();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче