mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-08-18 13:44:55 +02:00
🔨 periodically checking update for local snapshots list
This commit is contained in:
parent
a2c93646a6
commit
b28796a66c
@ -346,6 +346,7 @@
|
|||||||
<script src="./js/index.js"></script>
|
<script src="./js/index.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var last_status = "";
|
var last_status = "";
|
||||||
|
var last_local_snap = "";
|
||||||
|
|
||||||
var loadingModal = null;
|
var loadingModal = null;
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
@ -357,12 +358,16 @@
|
|||||||
M.Dropdown.init(drops, { constrainWidth: false, coverTrigger: false, alignment: 'right', onOpenStart: () => $('#setting-trigger').addClass('active'), onCloseEnd: () => $('#setting-trigger').removeClass('active') });
|
M.Dropdown.init(drops, { constrainWidth: false, coverTrigger: false, alignment: 'right', onOpenStart: () => $('#setting-trigger').addClass('active'), onCloseEnd: () => $('#setting-trigger').removeClass('active') });
|
||||||
|
|
||||||
setInterval(update_status, 500);
|
setInterval(update_status, 500);
|
||||||
|
setInterval(updateLocalSnaps, 2000);
|
||||||
listeners();
|
listeners();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateLocalSnaps() {
|
function updateLocalSnaps() {
|
||||||
$.get('./api/formated-local-snap', (data) => {
|
$.get('./api/formated-local-snap', (data) => {
|
||||||
|
if (JSON.stringify(data) === last_local_snap)
|
||||||
|
return;
|
||||||
|
last_local_snap = JSON.stringify(data);
|
||||||
$('#local_snaps').empty();
|
$('#local_snaps').empty();
|
||||||
$('#local_snaps').html(data);
|
$('#local_snaps').html(data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user