Device_list: add warning to disabled disk

This commit is contained in:
bergware
2023-11-01 21:43:57 +01:00
parent 01fea8a0f0
commit 2d39033930
+2 -2
View File
@@ -183,15 +183,15 @@ function my_diskio($data) {
function array_offline(&$disk, $pool='') {
global $var, $disks;
$echo = []; $warning = '';
$text = "<span class='red-text'><em>"._('All existing data on this device will be OVERWRITTEN when array is Started')."</em></span>";
if (strpos(_var($var,'mdState'),'ERROR:')===false) {
$text = "<span class='red-text'><em>"._('All existing data on this device will be OVERWRITTEN when array is Started')."</em></span>";
if (_var($disk,'type')=='Cache') {
if (_var($disks[$pool],'uuid') && _var($disk,'status')=='DISK_NEW') $warning = $text;
} else {
if (_var($var,'mdState')=='NEW_ARRAY') {
if (_var($disk,'type')=='Parity') $warning = $text;
} elseif (_var($var,'mdNumInvalid',0)<=1) {
if (in_array(_var($disk,'status'),['DISK_INVALID','DISK_DSBL_NEW','DISK_WRONG','DISK_NEW'])) $warning = $text;
if (in_array(_var($disk,'status'),['DISK_DSBL','DISK_INVALID','DISK_DSBL_NEW','DISK_NEW','DISK_WRONG'])) $warning = $text;
}
}
}