Device_list: add warning to disabled disk

This commit is contained in:
bergware
2023-11-01 21:46:13 +01:00
parent 2d39033930
commit 5686a8b5ae
+2 -1
View File
@@ -183,6 +183,7 @@ function my_diskio($data) {
function array_offline(&$disk, $pool='') {
global $var, $disks;
$echo = []; $warning = '';
$status = ['DISK_DSBL','DISK_INVALID','DISK_DSBL_NEW','DISK_NEW','DISK_WRONG'];
$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) {
if (_var($disk,'type')=='Cache') {
@@ -191,7 +192,7 @@ function array_offline(&$disk, $pool='') {
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_DSBL','DISK_INVALID','DISK_DSBL_NEW','DISK_NEW','DISK_WRONG'])) $warning = $text;
if (in_array(_var($disk,'status'),$status)) $warning = $text;
}
}
}