- Added drop-down selection for number of lines/rows to display per page

for all calls to fetchSplitArrayDB.
- Fixed formatting issue with drop down box.
This commit is contained in:
Frank Fegert 2009-05-24 17:45:08 +00:00
parent 73befaaa6e
commit e310e91542
2 changed files with 19 additions and 4 deletions

View File

@ -295,10 +295,9 @@ class TSMMonitor {
$linebox .= "</select></form>";
if ($end > 1) {
return '<div>'.$fp.'&nbsp;'.$pp.'&nbsp;'.$numbers.'&nbsp;'.$np.'&nbsp;'.$lp.'</div><div id="tnbox2">'.$linebox.'</div>';
} else {
return '<div id="tnbox2">'.$linebox.'</div>';
$navline = $fp.'&nbsp;'.$pp.'&nbsp;'.$numbers.'&nbsp;'.$np.'&nbsp;'.$lp;
}
return '<table width="100%" align="center" cellpadding="1" cellspacing="0" border=0><tr><td width="10%" align="left"></td><td width="80%" align="center">'.$navline.'</td><td width="10%" align="right">'.$linebox.'</td></tr></table>';
}
@ -1078,7 +1077,13 @@ class TSMMonitor {
$sql = "SELECT * from log_polldlog where timestamp > '".(time()-86400)."' order by timestamp desc";
$_SESSION["lastsql"] = $sql;
$rs = $this->fetchSplitArrayDB($sql,20);
if ($_SESSION["lines"][$this->GETVars['qq']] != "") {
$lpp = $_SESSION["lines"][$this->GETVars['qq']];
} else {
$lpp = 20;
}
$rs = $this->fetchSplitArrayDB($sql,$lpp);
foreach ($rs as $row) {
$modrow = array();
while(list($keycell, $valcell) = each($row)) {

View File

@ -95,6 +95,16 @@ include_once "includes/page_head.php";
// show polld status
} else if ($tsmmonitor->GETVars['qq'] == "polldstat") {
$lines = $_POST["lpp"];
if ($lines != "") {
if (!isset($_SESSION["lines"])){
$temp = array();
$temp[$tsmmonitor->GETVars['qq']] = $lines;
$_SESSION["lines"] = $temp;
} else {
$_SESSION["lines"][$tsmmonitor->GETVars['qq']] = $lines;
}
}
echo $tsmmonitor->getPollDStat();
// show serverlist