mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-29 03:14:17 +01:00
added code to set the refresh interval
This commit is contained in:
parent
18d3236586
commit
93b7220d5f
@ -104,6 +104,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="input-group mb-3">
|
||||
<input type="number" id="refreshRate" class="form-control" value="10">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">Seconds</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="results"></div>
|
||||
</div>
|
||||
|
||||
@ -131,6 +143,7 @@
|
||||
<script>
|
||||
let serviceStatuses = {};
|
||||
let timerHandler = 0;
|
||||
let refreshInterval = 0;
|
||||
let userClickedStatus = false;
|
||||
|
||||
function showTooltip(serviceName, index, element) {
|
||||
@ -291,10 +304,19 @@
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
refreshResults();
|
||||
setInterval(function() {
|
||||
function setRefreshInterval(i) {
|
||||
refreshResults();
|
||||
}, 30000);
|
||||
refreshInterval = setInterval(function() {
|
||||
refreshResults();
|
||||
}, i)
|
||||
}
|
||||
|
||||
$("#refreshRate").change(function() {
|
||||
clearInterval(refreshInterval);
|
||||
setRefreshInterval($(this).val() * 1000)
|
||||
});
|
||||
|
||||
setRefreshInterval(30000)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user