diff --git a/plugins/dynamix/DeviceInfo.page b/plugins/dynamix/DeviceInfo.page
index 5ab7a6d7a..af9c36c28 100644
--- a/plugins/dynamix/DeviceInfo.page
+++ b/plugins/dynamix/DeviceInfo.page
@@ -23,15 +23,6 @@ function displayTemp($temp) {
global $display;
return $display['unit']=='F' ? round($temp*9/5)+32 : $temp;
}
-function luks_status($luksState) {
- switch ($luksState) {
- case 0: return 'Not encrypted'; break;
- case 1: return 'Encrypted'; break;
- case 2: return 'Missing encryption key'; break;
- case 3: return 'Wrong encryption key'; break;
- default: return 'Unknown error'; break;
- }
-}
function maintenance_mode() {
global $var, $disk;
return ($var['fsState']=="Started" && $var['startMode']=="Maintenance" && $disk['luksState']<=1);
@@ -102,7 +93,7 @@ Name:
: =htmlspecialchars(my_disk($name))?>
Partition size:
-: =my_number($disk['size'])?> KB (K=1024)
+: =my_number($disk['sizeSb'])?> KB (K=1024)
Partition format:
: =$disk['format']?>
diff --git a/plugins/dynamix/include/DeviceList.php b/plugins/dynamix/include/DeviceList.php
index 02110dabd..5aba6a776 100644
--- a/plugins/dynamix/include/DeviceList.php
+++ b/plugins/dynamix/include/DeviceList.php
@@ -57,7 +57,7 @@ function device_info(&$disk,$online) {
case 'grey-off': $help = 'Device not present'; break;
}
$status = "$ctrl$help";
- $link = (strpos($disk['status'], 'DISK_NP')===false || $disk['name']=="cache") ? "".$fancyname."" : $fancyname;
+ $link = (strcmp($disk['status'], 'DISK_NP')!=0 || $disk['name']=="cache") ? "".$fancyname."" : $fancyname;
switch ($disk['luksState']) {
case 0: $luks = ""; break;
case 1: $luks = ""; break;
@@ -123,8 +123,25 @@ function fs_info(&$disk) {
function my_diskio($data) {
return my_scale($data,$unit,1)." $unit/s";
}
-function array_offline(&$disk,$w) {
- $warning = $w ? 'ALL DATA ON THIS DISK WILL BE ERASED WHEN ARRAY IS STARTED' : '';
+function array_offline(&$disk) {
+ global $var, $disks;
+ if (strpos($var['mdState'],"ERROR:")===false) {
+ $w = 'All existing data on this device will be OVERWRITTEN when array is Started';
+ if ($disk['type']=="Cache") {
+ if (!empty($disks['cache']['uuid']) && $disk['status']=="DISK_NEW") $warning = $w;
+ }
+ else {
+ if ($var['mdState']=="NEW_ARRAY") {
+ if ($disk['type']=="Parity") $warning = $w;
+ }
+ else {
+ if ($disk['status']=="DISK_INVALID" ||
+ $disk['status']=="DISK_DSBL_NEW" ||
+ $disk['status']=="DISK_WRONG" ||
+ $disk['status']=="DISK_NEW") $warning = $w;
+ }
+ }
+ }
echo "
Slots:
Slots: