@@ -583,8 +583,9 @@ class="fa fa-clock-o title"></i>Notifications and scheduling</span>
583
583
$ volumes = "<b>No volumes - container will NOT being backed up!</b> " ;
584
584
} else {
585
585
foreach ($ volumes as $ index => $ volume ) {
586
- $ excluded = in_array ($ volume , $ containerSetting ['exclude ' ]) ? ' - <abbr style="color: red; font-weight: bold;" title="Will not being backed up! See exclusions list below!">EXCLUDED!</abbr> ' : '' ;
587
- $ volumes [$ index ] = '<span class="fa ' . (!ABHelper::isVolumeWithinAppdata ($ volume ) ? 'fa-external-link ' : 'fa-folder ' ) . '"></span> <code style="cursor:pointer;" data-container=" ' . $ container ['Name ' ] . '" onclick="addVolumeToExclude(this);"> ' . $ volume . '</code> ' . $ excluded . '<span style="display: none;" class="multiVolumeWarn"> - <a target="_blank" href="https://forums.unraid.net/topic/137710-plugin-appdatabackup/?do=findComment&comment=1250363">used in multiple containers!</a></span> ' ;
586
+ $ excluded = in_array ($ volume , $ containerSetting ['exclude ' ]) ? ' - <abbr style="color: red; font-weight: bold;" title="Will not being backed up! See exclusions list below!">EXCLUDED!</abbr> ' : false ;
587
+ $ internalVolume = ABHelper::isVolumeWithinAppdata ($ volume );
588
+ $ volumes [$ index ] = '<span class="fa ' . (!$ internalVolume ? 'fa-external-link ' : 'fa-folder ' ) . '"></span> <code style="cursor:pointer;" data-container=" ' . $ container ['Name ' ] . '" data-internal=" ' . ($ internalVolume ? 'true ' : 'false ' ) . '" data-excluded=" ' . ($ excluded ? 'true ' : 'false ' ) . '" onclick="addVolumeToExclude(this);"> ' . $ volume . '</code> ' . $ excluded . '<span style="display: none;" class="multiVolumeWarn"> - <a target="_blank" href="https://forums.unraid.net/topic/137710-plugin-appdatabackup/?do=findComment&comment=1250363">used in multiple containers!</a></span> ' ;
588
589
}
589
590
$ volumes = implode ('<br /> ' , $ volumes );
590
591
}
@@ -1014,8 +1015,21 @@ function checkVolumesForDuplicates() {
1014
1015
let container = $(this).data('container');
1015
1016
let mapping = $(this).text();
1016
1017
1018
+ if ($(this).data('excluded')) {
1019
+ console.debug('Ignore ' + mapping + ': Excluded!');
1020
+ return; // Ignore mapping, its excluded
1021
+ }
1022
+
1023
+ if (!$(this).data('internal') && $('#' + container + '_backupExtVolumes').val() == 'no') {
1024
+ console.debug('Ignore ' + mapping + ': Is external and external should not be backed up!');
1025
+ return;
1026
+ }
1027
+
1028
+ console.debug("CV: processing", container, mapping);
1029
+
1017
1030
if (volumeMatrix.includes(mapping)) {
1018
1031
affectedMappings.push(mapping);
1032
+ console.debug("CV: mapping affected!");
1019
1033
} else {
1020
1034
volumeMatrix.push(mapping);
1021
1035
}
@@ -1024,10 +1038,19 @@ function checkVolumesForDuplicates() {
1024
1038
console.debug("Volume dup check (affected/matrix): ", affectedMappings, volumeMatrix);
1025
1039
1026
1040
affectedMappings.forEach(function (element) {
1027
- let codeElems = $('code[data-container]:contains(' + element + ')');
1041
+ let codeElems = $('code[data-container]').filter(function () {
1042
+ return $(this).text() === element;
1043
+ });
1044
+ console.debug("Affected (filtered) code elems", codeElems);
1028
1045
codeElems.each(function () {
1029
- $('#containerMultiMappingIssue_' + $(this).data('container')).show();
1030
- $(this).next('.multiVolumeWarn').show();
1046
+ console.debug("Affected Warn display: element/container:", element, $(this).data('container'));
1047
+ let nextMultiWarnSpan = $(this).next('.multiVolumeWarn');
1048
+ if (nextMultiWarnSpan.length) {
1049
+ $('#containerMultiMappingIssue_' + $(this).data('container')).show();
1050
+ nextMultiWarnSpan.show();
1051
+ } else {
1052
+ console.error("MultiWarnSpan not found!");
1053
+ }
1031
1054
});
1032
1055
});
1033
1056
}
0 commit comments