From 1da8308b81dfd55536dd6641a02d67c2064438db Mon Sep 17 00:00:00 2001 From: dlandon Date: Mon, 10 Jun 2024 12:47:32 -0500 Subject: [PATCH] Revert "Update DeviceInfo.page" This reverts commit 243b838d8043f4f6acebf4be5b9a0772042916a5. --- emhttp/plugins/dynamix/DeviceInfo.page | 29 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/emhttp/plugins/dynamix/DeviceInfo.page b/emhttp/plugins/dynamix/DeviceInfo.page index d2433d805..b8479d378 100755 --- a/emhttp/plugins/dynamix/DeviceInfo.page +++ b/emhttp/plugins/dynamix/DeviceInfo.page @@ -48,6 +48,15 @@ $text = isPool($name) ? _('This will ERASE content of ALL devices in the pool') function disabled_if($condition) { if ($condition !== false) echo ' disabled'; } +function btrfs_default() { + global $disk; + return (_var($disk,'fsProfile')=="") ? "selected" : ""; +} +function zfs_default($case) { + global $disk; + return (($case==1)&&(_var($disk,'slots',0) <= 2) || + ($case==2)&&(_var($disk,'slots',0) >= 3)) ? "selected" : ""; +} function sanitize(&$val) { $data = explode('.',str_replace([' ',','],['','.'],$val)); $last = array_pop($data); @@ -642,7 +651,7 @@ _(File system type)_: > =2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?> - - =3) echo mk_option(_var($disk,'fsProfile'),"raidz1", _('raidz'))?> + + =3) echo mk_option(_var($disk,'fsProfile'),"raidz1", _('raidz'), zfs_default(2))?> =3) echo mk_option(_var($disk,'fsProfile'),"raidz2", _('raidz2'))?> =4) echo mk_option(_var($disk,'fsProfile'),"raidz3", _('raidz3'))?> @@ -761,7 +770,7 @@ _(Critical disk utilization threshold)_ (%):
_(pool device stats)_: -: " . htmlspecialchars(shell_exec("/sbin/btrfs dev stats -T ".escapeshellarg("/mnt/$tag")), ENT_QUOTES, 'UTF-8') . ""; ?> +: " . htmlspecialchars(shell_exec("/sbin/btrfs dev stats -T /mnt/$tag"), ENT_QUOTES, 'UTF-8') . ""; ?> @@ -775,11 +784,11 @@ _(pool device stats)_:
_(Balance Status)_
- - + + _(btrfs filesystem usage)_: -: " . htmlspecialchars(shell_exec("/sbin/btrfs fi usage -T ".escapeshellarg("/mnt/$tag")), ENT_QUOTES, 'UTF-8') . ""; ?> +: " . htmlspecialchars(shell_exec("/sbin/btrfs fi usage -T /mnt/$tag"), ENT_QUOTES, 'UTF-8') . ""; ?> _(btrfs balance status)_: : ".implode("\n", $balance_status).""?> @@ -892,7 +901,7 @@ _(Block group usage)_ (%):
_(Scrub Status)_
- + _(btrfs scrub status)_: : ".implode("\n", $scrub_status).""?> @@ -1025,7 +1034,7 @@ _(btrfs check status)_:
_(Pool Status)_
- + _(zfs pool status)_: @@ -1059,7 +1068,7 @@ _(zfs pool status)_:
_(Pool Information)_
- + _(zfs pool information)_: :