update counters when downloads initiate from search page

This commit is contained in:
huangjx
2022-04-26 17:49:24 +08:00
parent c82594d99e
commit c42be35566
5 changed files with 27 additions and 6 deletions

View File

@@ -139,6 +139,13 @@ const helper = {
counter.innerHTML = '<div class="number">' + data[key] + '</div>';
}
},
getCounters() {
let url = helper.generateUrl("apps/ncdownloader/counters");
Http.getInstance(url).setMethod("GET").setHandler(function (data) {
if (data["counter"])
helper.updateCounter(data["counter"]);
}).send();
},
html2DOM: function (htmlString) {
const parser = new window.DOMParser();
let doc = parser.parseFromString(htmlString, "text/html")