diff --git a/src/pages/content/settings.php b/src/pages/content/settings.php
index b1ec281..e529ba8 100644
--- a/src/pages/content/settings.php
+++ b/src/pages/content/settings.php
@@ -583,8 +583,9 @@ class="fa fa-clock-o title">Notifications and scheduling
$volumes = "No volumes - container will NOT being backed up!";
} else {
foreach ($volumes as $index => $volume) {
- $excluded = in_array($volume, $containerSetting['exclude']) ? ' - EXCLUDED! ' : '';
- $volumes[$index] = ' ' . $volume . '
' . $excluded . ' - used in multiple containers!';
+ $excluded = in_array($volume, $containerSetting['exclude']) ? ' - EXCLUDED! ' : false;
+ $internalVolume = ABHelper::isVolumeWithinAppdata($volume);
+ $volumes[$index] = ' ' . $volume . '
' . $excluded . ' - used in multiple containers!';
}
$volumes = implode('
', $volumes);
}
@@ -1014,8 +1015,21 @@ function checkVolumesForDuplicates() {
let container = $(this).data('container');
let mapping = $(this).text();
+ if ($(this).data('excluded')) {
+ console.debug('Ignore ' + mapping + ': Excluded!');
+ return; // Ignore mapping, its excluded
+ }
+
+ if (!$(this).data('internal') && $('#' + container + '_backupExtVolumes').val() == 'no') {
+ console.debug('Ignore ' + mapping + ': Is external and external should not be backed up!');
+ return;
+ }
+
+ console.debug("CV: processing", container, mapping);
+
if (volumeMatrix.includes(mapping)) {
affectedMappings.push(mapping);
+ console.debug("CV: mapping affected!");
} else {
volumeMatrix.push(mapping);
}
@@ -1024,10 +1038,19 @@ function checkVolumesForDuplicates() {
console.debug("Volume dup check (affected/matrix): ", affectedMappings, volumeMatrix);
affectedMappings.forEach(function (element) {
- let codeElems = $('code[data-container]:contains(' + element + ')');
+ let codeElems = $('code[data-container]').filter(function () {
+ return $(this).text() === element;
+ });
+ console.debug("Affected (filtered) code elems", codeElems);
codeElems.each(function () {
- $('#containerMultiMappingIssue_' + $(this).data('container')).show();
- $(this).next('.multiVolumeWarn').show();
+ console.debug("Affected Warn display: element/container:", element, $(this).data('container'));
+ let nextMultiWarnSpan = $(this).next('.multiVolumeWarn');
+ if (nextMultiWarnSpan.length) {
+ $('#containerMultiMappingIssue_' + $(this).data('container')).show();
+ nextMultiWarnSpan.show();
+ } else {
+ console.error("MultiWarnSpan not found!");
+ }
});
});
}