summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/gmirror.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/inc/gmirror.inc')
-rw-r--r--src/etc/inc/gmirror.inc58
1 files changed, 32 insertions, 26 deletions
diff --git a/src/etc/inc/gmirror.inc b/src/etc/inc/gmirror.inc
index 9e26dfb..24508e9 100644
--- a/src/etc/inc/gmirror.inc
+++ b/src/etc/inc/gmirror.inc
@@ -68,33 +68,39 @@ function gmirror_get_status_single($mirror) {
function gmirror_html_status() {
$mirrors = gmirror_get_status();
$output = "";
- if (count($mirrors) > 0) {
- $output .= "<tr>\n";
- $output .= "<td width=\"40%\" class=\"vncellt\">Name</td>\n";
- $output .= "<td width=\"40%\" class=\"vncellt\">Status</td>\n";
- $output .= "<td width=\"20%\" class=\"vncellt\">Component</td>\n";
- $output .= "</tr>\n";
- foreach ($mirrors as $mirror => $name) {
- $components = count($name["components"]);
- $output .= "<tr>\n";
- $output .= "<td width=\"40%\" rowspan=\"{$components}\" class=\"listr\">{$name['name']}</td>\n";
- $output .= "<td width=\"40%\" rowspan=\"{$components}\" class=\"listr\">{$name['status']}</td>\n";
- $output .= "<td width=\"20%\" class=\"listr\">{$name['components'][0]}</td>\n";
- $output .= "</tr>\n";
- if (count($name["components"]) > 1) {
- $morecomponents = array_slice($name["components"], 1);
- foreach ($morecomponents as $component) {
- $output .= "<tr>\n";
- $output .= "<td width=\"20%\" class=\"listr\">{$component}</td>\n";
- $output .= "</tr>\n";
- }
- }
- }
- } else {
- $output .= "<tr><td colspan=\"3\" class=\"listr\">No Mirrors Found</td></tr>\n";
+ if (count($mirrors) < 1) {
+?>
+<div class="alert">
+ <p>No Mirrors Found</p>
+</div>
+<?php
+ return;
}
- // $output .= "<tr><td colspan=\"3\" class=\"listr\">Updated at " . date("F j, Y, g:i:s a") . "</td></tr>\n";
- return $output;
+
+?>
+<table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th>Name</td>
+ <th>Status</td>
+ <th>Component</td>
+ </tr>
+ </thead>
+ <tbody>
+<?php foreach ($mirrors as $mirror => $name): ?>
+ <tr>
+ <td rowspan="<?=count($name["components"])?>"><?=$name['name']?></td>
+ <td rowspan="<?=count($name["components"])?>"><?=$name['status']?></td>
+ <td><?=$name['components'][0]?></td>
+ </tr>
+<?php if (count($name["components"]) > 1): ?>
+ <?php foreach (array_slice($name["components"], 1) as $component): ?>
+ <tr>
+ <td><?=$component?></td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+<?php endforeach;
}
/* List all disks in the system (potential gmirror targets) */
OpenPOWER on IntegriCloud