1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

add list download progress indicator

This commit is contained in:
billz 2020-03-31 00:04:52 +00:00
parent 3552a4b101
commit ff14e64bf9
5 changed files with 38 additions and 3 deletions

View File

@ -230,3 +230,8 @@ canvas#divDBChartBandwidthhourly {
opacity: 0;
color: #1cc88a;
}
.check-progress {
color: #999;
}

View File

@ -245,3 +245,17 @@ canvas#divDBChartBandwidthhourly {
.table {
margin-bottom: 0rem;
}
.check-hidden {
visibility: hidden;
}
.check-updated {
opacity: 0;
color: #1cc88a;
}
.check-progress {
color: #999;
}

View File

@ -434,3 +434,17 @@ canvas#divDBChartBandwidthhourly {
.figure, .authors {
filter: brightness(70%) !important;
}
.check-hidden {
visibility: hidden;
}
.check-updated {
opacity: 0;
color: #1cc88a;
}
.check-progress {
color: #999;
}

View File

@ -298,16 +298,19 @@ function loadChannelSelect(selected) {
function updateBlocklist() {
var blocklist_id = $('#cbxblocklist').val();
if (blocklist_id == '') { return; }
$('#cbxblocklist-status').find('i').removeClass('fas fa-check').addClass('fas fa-cog fa-spin');
$('#cbxblocklist-status').removeClass('check-hidden').addClass('check-progress');
$.post('ajax/adblock/update_blocklist.php',{ 'blocklist_id':blocklist_id },function(data){
var jsonData = JSON.parse(data);
if (jsonData['return'] == '0') {
$('#cbxblocklist-status').removeClass('check-hidden').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700);
$('#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);
}
})
}
function clearBlocklistStatus() {
$('#cbxblocklist-status').addClass('check-hidden');
$('#cbxblocklist-status').removeClass('check-updated').addClass('check-hidden');
}
// Static Array method
Array.range = (start, end) => Array.from({length: (end - start)}, (v, k) => k + start);

View File

@ -32,7 +32,6 @@
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active" id="clienttab" href="#adblocklistsettings" data-toggle="tab"><?php echo _("Blocklist settings"); ?></a></li>
<li class="nav-item"><a class="nav-link" id="clienttab" href="#adblockstats" data-toggle="tab"><?php echo _("Statistics"); ?></a></li>
<li class="nav-item"><a class="nav-link" id="logoutputtab" href="#adblocklogfileoutput" data-toggle="tab"><?php echo _("Logging"); ?></a></li>
</ul>