hook up periodic certificate update function

pull/34/head
Zlatin Balevsky 2019-12-10 12:47:56 +00:00
parent 37dcedb99b
commit 6946bff7f9
1 changed files with 12 additions and 1 deletions

View File

@ -245,8 +245,9 @@ class CertificateFetch {
var xmlhttp = new XMLHttpRequest()
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var response = new CertificateResponse(this.responseXML)
var block = document.getElementById("certificates-" + this.divId)
block.innerHTML = response.renderTable()
}
}
xmlhttp.open("GET", "/MuWire/Certificate", true)
@ -254,6 +255,12 @@ class CertificateFetch {
}
}
function refreshCertificates() {
for (var [ignored, fetch] of certificateFetches) {
fetch.updateTable()
}
}
var statusByUUID = new Map()
var currentSearchBySender = null
var currentSearchByFile = null
@ -696,6 +703,8 @@ function initGroupBySender() {
refreshType = "Sender"
setInterval(refreshStatus, 3000);
setTimeout(refreshStatus, 1);
setInterval(refreshCertificates, 3000)
setTimeout(refreshCertificates, 1)
}
function initGroupByFile() {
@ -703,4 +712,6 @@ function initGroupByFile() {
refreshType = "File"
setInterval ( refreshStatus, 3000);
setTimeout ( refreshStatus, 1);
setInterval(refreshCertificates, 3000)
setTimeout(refreshCertificates, 1)
}