mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 17:33:19 +01:00
Merge pull request #15 from hurnhu/refresh-interval
Close #1: Add support for refresh interval
This commit is contained in:
commit
ed490669b1
@ -90,6 +90,15 @@
|
|||||||
#social img:hover {
|
#social img:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
#settings {
|
||||||
|
position: fixed;
|
||||||
|
left: 5px;
|
||||||
|
bottom: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
#settings select:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -128,9 +137,26 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="settings">
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<div class="input-group-text">↻</div>
|
||||||
|
</div>
|
||||||
|
<select class="form-control form-control-sm" id="refresh-rate">
|
||||||
|
<option value="10">10s</option>
|
||||||
|
<option value="30" selected>30s</option>
|
||||||
|
<option value="60">1m</option>
|
||||||
|
<option value="120">2m</option>
|
||||||
|
<option value="300">5m</option>
|
||||||
|
<option value="600">10m</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let serviceStatuses = {};
|
let serviceStatuses = {};
|
||||||
let timerHandler = 0;
|
let timerHandler = 0;
|
||||||
|
let refreshIntervalHandler = 0;
|
||||||
let userClickedStatus = false;
|
let userClickedStatus = false;
|
||||||
|
|
||||||
function showTooltip(serviceName, index, element) {
|
function showTooltip(serviceName, index, element) {
|
||||||
@ -291,10 +317,19 @@
|
|||||||
.replace(/'/g, ''');
|
.replace(/'/g, ''');
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshResults();
|
function setRefreshInterval(seconds) {
|
||||||
setInterval(function() {
|
|
||||||
refreshResults();
|
refreshResults();
|
||||||
}, 30000);
|
refreshIntervalHandler = setInterval(function() {
|
||||||
|
refreshResults();
|
||||||
|
}, seconds * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#refresh-rate").change(function() {
|
||||||
|
clearInterval(refreshIntervalHandler);
|
||||||
|
setRefreshInterval($(this).val())
|
||||||
|
});
|
||||||
|
setRefreshInterval(30);
|
||||||
|
$("#refresh-rate").val(30);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user