From 312d166b02d1b2acb656b7daca256b30b2e05033 Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 27 Feb 2010 20:45:03 -0500 Subject: AJAX-ify the gmirror status widget. Add license header while I'm here. --- usr/local/www/widgets/include/gmirror_status.inc | 63 +++++++++++++++++++++- .../www/widgets/widgets/gmirror_status.widget.php | 44 ++++++--------- 2 files changed, 76 insertions(+), 31 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/widgets/include/gmirror_status.inc b/usr/local/www/widgets/include/gmirror_status.inc index 677be85..414c394 100644 --- a/usr/local/www/widgets/include/gmirror_status.inc +++ b/usr/local/www/widgets/include/gmirror_status.inc @@ -1,5 +1,31 @@ \ No newline at end of file +} + +function gmirror_html_status() { + $mirrors = gmirror_get_status(); + $output = ""; + if (count($mirrors) > 0) { + $output .= "\n"; + $output .= "Name\n"; + $output .= "Status\n"; + $output .= "Component\n"; + $output .= "\n"; + foreach ($mirrors as $mirror => $name) { + $components = count($name["components"]); + $output .= "\n"; + $output .= "{$name['name']}\n"; + $output .= "{$name['status']}\n"; + $output .= "{$name['components'][0]}\n"; + $output .= "\n"; + if (count($name["components"]) > 1) { + $morecomponents = array_slice($name["components"], 1); + foreach ($morecomponents as $component) { + $output .= "\n"; + $output .= "{$component}\n"; + $output .= "\n"; + } + } + } + } else { + $output .= "No Mirrors Found\n"; + } + // $output .= "Updated at " . date("F j, Y, g:i:s a") . "\n"; + return $output; +} +?> \ No newline at end of file diff --git a/usr/local/www/widgets/widgets/gmirror_status.widget.php b/usr/local/www/widgets/widgets/gmirror_status.widget.php index dcbcbc4..cd73a0f 100644 --- a/usr/local/www/widgets/widgets/gmirror_status.widget.php +++ b/usr/local/www/widgets/widgets/gmirror_status.widget.php @@ -1,7 +1,7 @@ - - 0) { ?> - - - - - - $name) { ?> - - - - - - 1) { - $morecomponents = array_slice($name["components"], 1); - foreach ($morecomponents as $component) { ?> - - - - - - - - + +
NameStatusComponent
" class="listr">" class="listr">
No Mirrors Found
+ + -- cgit v1.1