From 3d8f75cd342c95cebba136bb6a83d43bbda68204 Mon Sep 17 00:00:00 2001 From: dlandon Date: Thu, 12 Dec 2024 16:26:33 -0600 Subject: [PATCH] Don't show secondary dropdown and mover action when primary is array; show warning when no array and primary is array. --- emhttp/plugins/dynamix/ShareEdit.page | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/emhttp/plugins/dynamix/ShareEdit.page b/emhttp/plugins/dynamix/ShareEdit.page index 093ad9ff6..f4532c15a 100644 --- a/emhttp/plugins/dynamix/ShareEdit.page +++ b/emhttp/plugins/dynamix/ShareEdit.page @@ -57,7 +57,7 @@ if ((! $share['cachePool']) && ($share['cachePool2'])) { } /* Check for non existent pool device. */ -if ($share['cachePool'] && !in_array($share['cachePool'], $pools)) { +if (($share['cachePool'] && !in_array($share['cachePool'], $pools)) || ($poolsOnly && !$share['cachePool'])) { $poolDefined = false; $share['useCache'] = $share['cachePool2'] ? "yes" : ($poolsOnly ? "no" : "yes"); } else { @@ -457,7 +457,7 @@ _(Excluded disk(s))_: -
+
_(Secondary storage)_: : @@ -633,7 +633,7 @@ function updateScreen(cache, slow) { const moverNoActionText = ""; const moverAction1Text = ""; const moverAction2Text = ""; - + switch (cache) { case 'no': $('#primary option:eq(' + z(0) + ')').prop('selected', true); @@ -762,9 +762,18 @@ function updateScreen(cache, slow) { break; } + /* If primary is "Array", remove secondary storage selection as it does not apply when primary is array. */ + if (primaryDropdown.selectedIndex === 0) { + $('#secondaryStorage').hide(slow); + $('#moverAction').hide(slow); + } else { + $('#secondaryStorage').show(slow); + $('#moverAction').show(slow); + } + /* Check secondary dropdown index and show/hide moreSettings2 */ if (secondaryDropdown.selectedIndex === 1) { - $('#moreSettings2').show('slow'); + $('#moreSettings2').show(slow); } else { $('#moreSettings2').hide(slow); } @@ -1078,7 +1087,7 @@ function writeShare(data, n, i) { } }); toggleButton('writeshare', true); - $('div.spinner.fixed').show('slow'); + $('div.spinner.fixed').show(slow); writeShare(newData, 0, i); } } @@ -1131,7 +1140,7 @@ document.addEventListener('DOMContentLoaded', function() { let cachePoolOption = document.getElementById('cachePoolOption'); let messageSpan = document.getElementById('cachePoolMessage'); - messageSpan.textContent = `${_('Warning: Configured Pool')} '${cachePoolCapitalized}' ${_('is missing')}.`; + messageSpan.textContent = `${_('Warning: Configured Pool')} '${cachePoolCapitalized || _('Array')}' ${_('is missing')}.`; messageSpan.style.display = 'inline'; cachePoolOption.selected = true;