added code to set the refresh interval
</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>
<script>
let serviceStatuses = {};
let timerHandler = 0;
+ let refreshInterval = 0;
let userClickedStatus = false;
function showTooltip(serviceName, index, element) {
.replace(/'/g, '&apos;');
}
+ function setRefreshInterval(i) {
refreshResults();
- setInterval(function() {
+ refreshInterval = setInterval(function() {
refreshResults();
- }, 30000);
+ }, i)
+ }
+
+ $("#refreshRate").change(function() {
+ clearInterval(refreshInterval);
+ setRefreshInterval($(this).val() * 1000)
+ });
+
+ setRefreshInterval(30000)
</script>
</body>
</html>
