From 0e4eefc67dc0240ba47034e1d5822f0993bbddc1 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 24 Jul 2013 09:10:20 -0300 Subject: Implement ajax call for routing limit and filter --- config/openbgpd/openbgpd_status.php | 54 +++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) (limited to 'config/openbgpd') diff --git a/config/openbgpd/openbgpd_status.php b/config/openbgpd/openbgpd_status.php index 6570213d..7ce6e19a 100644 --- a/config/openbgpd/openbgpd_status.php +++ b/config/openbgpd/openbgpd_status.php @@ -78,12 +78,37 @@ function doCmdT($command, $limit = "all", $filter = "") { return $result; } +function countCmdT($command) { + $fd = popen("{$command} 2>&1", "r"); + $c = 0; + while (fgets($fd) !== FALSE) + $c++; + + return $c; +} + function showCmdT($idx, $title, $command) { echo "

\n"; echo " \n"; echo "\n"; - echo "\n"; - echo "\n"; + + if ($idx == "routing") { + $limit_options = array("10", "50", "100", "200", "500", "1000", "all"); + $limit_default = "100"; + + echo "\n"; + echo "\n"; + } + + echo "\n"; echo "
" . $title . "
";		/* no newline after pre */
+	echo "
" . $title . "
\n"; + echo "Display of " . countCmdT($command) . " routesFilter expression: \n"; + echo "\n"; + echo "\n"; + echo "
";	/* no newline after pre */
 	echo doCmdT($command);
 	echo "
\n"; @@ -157,6 +182,31 @@ function execCmds() { + + -- cgit v1.2.3