Show RAID status in more detail

This commit is contained in:
Jamie Cameron
2014-09-18 11:25:23 -07:00
parent b6c0d87498
commit 86e0cfaf27
2 changed files with 3 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ else {
$conf = &get_raidtab();
if (@$conf) {
print &ui_columns_start([ $text{'index_name'},
$text{'index_active'},
$raid_mode eq "raidtools" ? $text{'index_active'} : $text{'index_status'},
$text{'index_level'},
$text{'index_size'},
$text{'index_members'} ]);
@@ -44,14 +44,9 @@ if (@$conf) {
push(@mems, $d->{'value'});
}
}
my @errors = grep { $_ ne "U" } @{$c->{'errors'}};
print &ui_columns_row([
&ui_link("view_raid.cgi?idx=$c->{'index'}",&html_escape($c->{'value'})),
!$c->{'active'} ?
"<font color=#ff0000>$text{'no'}</font>" :
@errors ?
"<font color=#ff8800>$text{'index_errors'}</font>" :
"<font color=#00aa00>$text{'yes'}</font>",
$raid_mode eq "raidtools" ? $c->{'active'} ? "<font color=#00aa00>$text{'yes'}</font>" : "<font color=#ff0000>$text{'no'}</font>" : $c->{'state'} =~ /resyncing/ || $c->{'state'} =~ /recovering/ || $c->{'state'} =~ /reshaping/ || $c->{'state'} =~ /degraded/ || $c->{'state'} =~ /FAILED/ ? $c->{'rebuild'} ne '' ? "<font color=#ff0000>".$c->{'state'}."(".$c->{'rebuild'}."%, ".int($c->{'remain'})."min)</font>" : "<font color=#ff0000>".$c->{'state'}."</font>" : "<font color=#00aa00>".$c->{'state'}."</font>",
$lvl eq 'linear' ? $text{'linear'} : $text{'raid'.$lvl},
$c->{'size'} ? &nice_size($c->{'size'}*1024) : "",
&ui_links_row(\@mems),

View File

@@ -8,7 +8,7 @@ index_mdadm=Using MDADM version $1
index_raidtools=Using RaidTools
index_name=Device name
index_active=Active?
index_errors=Errors
index_status=Status
index_level=RAID level
index_size=Usable size
index_members=Member disk devices