Fix for TTL status refresh after setting TTL

Added a function to sleep for 1 second, and then a fetch to get_ttl to refresh the status
This commit is contained in:
RouteTable
2024-04-19 02:15:37 -05:00
committed by GitHub
parent 10d291151f
commit c646ce8945

View File

@@ -118,17 +118,28 @@
this.ttldata = data
});
},
setTTL() {
setTTL() {
fetch('/cgi-bin/set_ttl?' + new URLSearchParams({
ttlvalue: this.newTTL,
}))
.then((res) => res.json())
.then((data) => {
this.ttldata = data
})
}
}
}
</script>
ttlvalue: this.newTTL,
}))
.then((res) => res.json())
.then((data) => {
this.ttldata = data
})
sleep(1000)
fetch('/cgi-bin/get_ttl_status')
.then((res) => res.json())
.then((data) => {
this.ttldata = data
});
}
}
function sleep(miliseconds) {
var currentTime = new Date().getTime();
while (currentTime + miliseconds >= new Date().getTime()) {
}
}
}
</script>
</body>
</html>