summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets/gmirror_status.widget.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2009-04-05 15:03:39 -0400
committerjim-p <jim@pingle.org>2009-04-05 15:03:39 -0400
commit5aaccff5d3eb7124c2598ca8295213af5f4e6728 (patch)
tree2a8c67c2f0a1a0c6d9bbcacfa4f4818c4e0787e8 /usr/local/www/widgets/widgets/gmirror_status.widget.php
parent5579cecde32f82678c146faf71e27d1fc069a3c0 (diff)
downloadpfsense-5aaccff5d3eb7124c2598ca8295213af5f4e6728.zip
pfsense-5aaccff5d3eb7124c2598ca8295213af5f4e6728.tar.gz
New Widget: Gmirror Status
Diffstat (limited to 'usr/local/www/widgets/widgets/gmirror_status.widget.php')
-rw-r--r--usr/local/www/widgets/widgets/gmirror_status.widget.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/usr/local/www/widgets/widgets/gmirror_status.widget.php b/usr/local/www/widgets/widgets/gmirror_status.widget.php
new file mode 100644
index 0000000..2417128
--- /dev/null
+++ b/usr/local/www/widgets/widgets/gmirror_status.widget.php
@@ -0,0 +1,59 @@
+<?php
+/*
+ gmirror_status.widget.php
+ Copyright (C) 2009 Jim Pingle
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INClUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+$mirrors = get_gmirror_status();
+
+?>
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tbody>
+<?php if (count($mirrors) > 0) { ?>
+ <tr>
+ <td width="40%" class="vncellt">Name</td>
+ <td width="40%" class="vncellt">Status</td>
+ <td width="20%" class="vncellt">Component</td>
+ </tr>
+ <?php foreach ($mirrors as $mirror => $name) { ?>
+ <tr>
+ <td width="40%" rowspan="<?= count($name["components"]) ?>" class="listr"><?= $name["name"] ?></td>
+ <td width="40%" rowspan="<?= count($name["components"]) ?>" class="listr"><?= $name["status"] ?></td>
+ <td width="20%" class="listr"><?= $name["components"][0] ?></td>
+ </tr>
+ <?php
+ if (count($name["components"]) > 1) {
+ $morecomponents = array_slice($name["components"], 1);
+ foreach ($morecomponents as $component) { ?>
+ <tr>
+ <td width="20%" class="listr"><?= $component ?></td>
+ </tr>
+ <?php }
+ } ?>
+ <?php } ?>
+<?php } else { ?>
+ <tr><td colspan="3" class="listr">No Mirrors Found</td></tr>
+<?php } ?>
+ </tbody>
+</table>
OpenPOWER on IntegriCloud