Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
46e54e8d0a | ||
|
1fe95e2df4 |
@@ -117,7 +117,44 @@ Title="Unraid-Kernel-Helper"
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Pool List:</td>
|
<td>Pool List:</td>
|
||||||
<td><b><?=`zpool list -o name,size | column -t -o ' ' | sed 's/$/<br>/'`?></b></td>
|
<td>
|
||||||
|
<?
|
||||||
|
$output = "NAME SIZE\nabc 10";
|
||||||
|
// check for error message
|
||||||
|
if(strpos($output, "no pools available") !== false) {
|
||||||
|
?>
|
||||||
|
<b><?=$output?></b>
|
||||||
|
<?
|
||||||
|
} elseif (strpos($output, "config:") !== false) {
|
||||||
|
// TODO display data for zpool status without any options (?)
|
||||||
|
// parse output table
|
||||||
|
} else {
|
||||||
|
// create array with lines; splits on \n
|
||||||
|
$rows = explode("\n", $output);
|
||||||
|
?>
|
||||||
|
<table>
|
||||||
|
<?
|
||||||
|
foreach($rows as $row) {
|
||||||
|
// create array with columns from line; splits on \t
|
||||||
|
$columns = explode("\t", $row);
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<?
|
||||||
|
foreach($columns as $column) {
|
||||||
|
?>
|
||||||
|
<td><?=$column?></td>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tr>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user