Skip to content

Commit

Permalink
Click on volume path add it to exclusion list
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed May 9, 2023
1 parent a780f63 commit e48f6d0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/pages/content/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class="fa fa-clock-o title"></i>Notifications, scheduling and retention</span>
$volumes = "<b>No volumes - container will NOT being backed up!</b>";
} else {
foreach ($volumes as $index => $volume) {
$volumes[$index] = '<span class="fa ' . (!ABHelper::isVolumeWithinAppdata($volume) ? 'fa-external-link' : 'fa-folder') . '"> <code>' . $volume . '</code></span>';
$volumes[$index] = '<span class="fa ' . (!ABHelper::isVolumeWithinAppdata($volume) ? 'fa-external-link' : 'fa-folder') . '"> <code style="cursor:pointer;" data-container="' . $container['Name'] . '" onclick="addVolumeToExclude(this);">' . $volume . '</code></span>';
}
$volumes = implode('<br />', $volumes);
}
Expand All @@ -484,7 +484,7 @@ class="fa fa-clock-o title"></i>Notifications, scheduling and retention</span>
<blockquote class='inline_help'>
<dl>
<dt>Configured volumes<br /><small><abbr style="cursor:help;" title="For info, open the 'Appdata source(s)' help"><i class="fa fa-folder"></i> Internal volume | <i class="fa fa-external-link"></i> External volume</abbr></small></dt>
<dt>Configured volumes <small>(Click to exclude)</small><br /><small><abbr style="cursor:help;" title="For info, open the 'Appdata source(s)' help"><i class="fa fa-folder"></i> Internal volume | <i class="fa fa-external-link"></i> External volume</abbr></small></dt>
<dd><div style="display: table">$volumes</div></dd>
<br />
Expand Down Expand Up @@ -737,4 +737,19 @@ function addSelectionToList(element) {
$el.prop('checked', false);
});
}

function addVolumeToExclude(element) {
$path = $(element).text();
$excludeTextarea = $('#' + $(element).data('container') + '_exclude');

if ($excludeTextarea.val().indexOf($path) !== -1) { // If existing inside textarea
return;
}

if ($excludeTextarea.val() === "") {
$excludeTextarea.val($path);
} else {
$excludeTextarea.val($excludeTextarea.val() + "\n" + $path);
}
}
</script>

0 comments on commit e48f6d0

Please sign in to comment.