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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user