-_(Delete)_
+
+
:
-
-
-:
-
@@ -633,7 +632,7 @@ function updateScreen(cache, slow) {
const moverNoActionText = "= addslashes(_('Mover takes no action')) ?>";
const moverAction1Text = "= addslashes(_('Mover transfers files from Primary storage to Secondary storage')) ?>";
const moverAction2Text = "= addslashes(_('Mover transfers files from Secondary storage to Primary storage')) ?>";
-
+
switch (cache) {
case 'no':
$('#primary option:eq(' + z(0) + ')').prop('selected', true);
@@ -762,9 +761,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 +1086,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 +1139,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;
@@ -1297,13 +1305,24 @@ function handleDeleteClick(button) {
$(function() {
+
+ $tooltip_enabled = _('Share is empty and is safe to delete');
+ $tooltip_disabled = _('Share must be empty to be deleted');
+ ?>
+
$.post('/webGui/include/ShareList.php', { scan: "=$name?>" }, function(e) {
if (e == 1) {
$('.empty').show();
$('.full').hide();
+ /* Enable delete checkbox and update tooltip. */
+ $('input[name="confirmDelete"]').prop('disabled', false).attr('title', '= $tooltip_enabled ?>');
+ $('#deleteLabel').attr('title', '= $tooltip_enabled ?>');
} else {
$('.full1').hide();
$('.full2').show();
+ /* Disable delete checkbox and update tooltip. */
+ $('input[name="confirmDelete"]').prop('disabled', true).attr('title', '= $tooltip_disabled ?>');
+ $('#deleteLabel').attr('title', '= $tooltip_disabled ?>');
}
});
diff --git a/emhttp/plugins/dynamix/include/ShareList.php b/emhttp/plugins/dynamix/include/ShareList.php
index 20b64fb85..c6c1e9f03 100644
--- a/emhttp/plugins/dynamix/include/ShareList.php
+++ b/emhttp/plugins/dynamix/include/ShareList.php
@@ -188,6 +188,11 @@ define('LUKS_STATUS_UNENCRYPTED', 2);
// Build table
$row = 0;
foreach ($shares as $name => $share) {
+ /* Correct a situation in previous Unraid versions where an array only share has a useCache defined. */
+ if ((!$poolsOnly) && ($share['useCache'] == "no")) {
+ $share['cachePool'] = "";
+ }
+
/* Is cachePool2 defined? If it is we need to show the cache pool 2 device name instead of 'Array'. */
if ($share['cachePool2']) {
$array = compress(my_disk($share['cachePool2'],$display['raw']));