Update template blocklist ids + cbxblocklist option val

This commit is contained in:
billz 2023-10-06 14:41:55 +02:00
parent 104b8c340c
commit 911a6a3145
2 changed files with 5 additions and 4 deletions

View File

@ -441,7 +441,8 @@ function setHardwareModeTooltip() {
* Interface elements are updated to indicate current progress, status. * Interface elements are updated to indicate current progress, status.
*/ */
function updateBlocklist() { function updateBlocklist() {
var blocklist_id = $('#cbxblocklist').val(); var opt = $('#cbxblocklist option:selected');
var blocklist_id = opt.val();
var csrfToken = $('meta[name=csrf_token]').attr('content'); var csrfToken = $('meta[name=csrf_token]').attr('content');
if (blocklist_id == '') { return; } if (blocklist_id == '') { return; }
$('#cbxblocklist-status').find('i').removeClass('fas fa-check').addClass('fas fa-cog fa-spin'); $('#cbxblocklist-status').find('i').removeClass('fas fa-check').addClass('fas fa-cog fa-spin');
@ -451,7 +452,7 @@ function updateBlocklist() {
if (jsonData['return'] == '0') { if (jsonData['return'] == '0') {
$('#cbxblocklist-status').find('i').removeClass('fas fa-cog fa-spin').addClass('fas fa-check'); $('#cbxblocklist-status').find('i').removeClass('fas fa-cog fa-spin').addClass('fas fa-check');
$('#cbxblocklist-status').removeClass('check-progress').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700); $('#cbxblocklist-status').removeClass('check-progress').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700);
$('#'+blocklist_id).text("Just now"); $('#blocklist-'+jsonData['list']).text("Just now");
} }
}) })
} }

View File

@ -19,9 +19,9 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p id="blocklist-updated"> <p id="blocklist-updated">
<div><small><?php echo _("Hostnames blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-hostnames"> <div><small><?php echo _("Hostnames blocklist last updated") ?>: <span class="font-weight-bold" id="blocklist-hostnames">
<?php echo blocklistUpdated('hostnames.txt') ?></span></small></div> <?php echo blocklistUpdated('hostnames.txt') ?></span></small></div>
<div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-domains"> <div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="blocklist-domains">
<?php echo blocklistUpdated('domains.txt') ?></b></small></div> <?php echo blocklistUpdated('domains.txt') ?></b></small></div>
</p> </p>
<div class="input-group col-md-12 mb-4"> <div class="input-group col-md-12 mb-4">