From 2a6c09f9c99e067cc14b08e6d7da57754a3fd4c5 Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Mon, 22 Apr 2024 11:51:07 -0700 Subject: [PATCH 1/2] better handling of marking form fields 'disabled' --- emhttp/plugins/dynamix/DeviceInfo.page | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/emhttp/plugins/dynamix/DeviceInfo.page b/emhttp/plugins/dynamix/DeviceInfo.page index 5d0a43802..85c2cc576 100755 --- a/emhttp/plugins/dynamix/DeviceInfo.page +++ b/emhttp/plugins/dynamix/DeviceInfo.page @@ -45,6 +45,9 @@ $prev = $i>0 ? $sheets[$i-1] : $sheets[$end]; $next = $i<$end ? $sheets[$i+1] : $sheets[0]; $text = isPool($name) ? _('This will ERASE content of ALL devices in the pool') : _('This will ERASE ALL device content'); +function disabled_if($condition) { + if ($condition !== false) echo ' disabled'; +} function sanitize(&$val) { $data = explode('.',str_replace([' ',','],['','.'],$val)); $last = array_pop($data); @@ -610,10 +613,10 @@ _(Spin down delay)_: _(File system status)_: :   - + _(File system type)_: -: > @@ -629,14 +632,14 @@ _(File system type)_: 1):?> _(File system type)_: -: > - > =2) echo mk_option(_var($disk,'fsProfile'),"raid0", _('raid0'))?> =2) echo mk_option(_var($disk,'fsProfile'),"raid1", _('raid1'))?> @@ -646,7 +649,7 @@ _(File system type)_: =3) echo mk_option(_var($disk,'fsProfile'),"raid5", _('raid5'))?> =4) echo mk_option(_var($disk,'fsProfile'),"raid6", _('raid6'))?> - > =2) echo mk_option(_var($disk,'fsProfile'),"", _('raid0'))?> @@ -654,34 +657,34 @@ _(File system type)_: =3) echo mk_option(_var($disk,'fsProfile'),"raidz2", _('raidz2'))?> =4) echo mk_option(_var($disk,'fsProfile'),"raidz3", _('raidz3'))?> - > _(File system type)_: -: > - > =2) echo mk_option(_var($disk,'fsProfile'),"", _('raid0'))?> - > _(File system type)_: -: > - > =2) echo mk_option(_var($disk,'fsProfile'),"", _('raid0'))?> - > _(File system type)_: -: > @@ -689,8 +692,7 @@ _(File system type)_: