Revert changes that were accidentally committed

This commit is contained in:
TwinProduction 2020-12-30 01:18:30 -05:00
parent 641c2029f7
commit d8cfcd04f1

View File

@ -109,7 +109,7 @@
</style> </style>
</head> </head>
<body> <body>
<div class="container my-3 rounded p-3 border shadow"> <div class="container my-3 rounded p-3 border shadow">
<div class="mb-2"> <div class="mb-2">
<div class="row"> <div class="row">
<div class="col-8 text-left my-auto"> <div class="col-8 text-left my-auto">
@ -121,9 +121,9 @@
</div> </div>
</div> </div>
<div id="results"></div> <div id="results"></div>
</div> </div>
<div id="tooltip" style="display: none"> <div id="tooltip" style="display: none">
<div class="tooltip-title">Timestamp:</div> <div class="tooltip-title">Timestamp:</div>
<code id="tooltip-timestamp">...</code> <code id="tooltip-timestamp">...</code>
<div class="tooltip-title">Response time:</div> <div class="tooltip-title">Response time:</div>
@ -134,17 +134,17 @@
<div class="tooltip-title">Errors:</div> <div class="tooltip-title">Errors:</div>
<code id="tooltip-errors">...</code> <code id="tooltip-errors">...</code>
</div> </div>
</div> </div>
<script src="./jquery.min.js"></script> <script src="./jquery.min.js"></script>
<div id="social"> <div id="social">
<a href="https://github.com/TwinProduction/gatus" target="_blank" title="Gatus on GitHub"> <a href="https://github.com/TwinProduction/gatus" target="_blank" title="Gatus on GitHub">
<img src="./github.png" alt="GitHub" width="32" height="auto" /> <img src="./github.png" alt="GitHub" width="32" height="auto" />
</a> </a>
</div> </div>
<div id="settings"> <div id="settings">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<div class="input-group-prepend"> <div class="input-group-prepend">
<div class="input-group-text">&#x21bb;</div> <div class="input-group-text">&#x21bb;</div>
@ -158,17 +158,16 @@
<option value="600">10m</option> <option value="600">10m</option>
</select> </select>
</div> </div>
</div> </div>
<script> <script>
let serviceStatuses = {}; let serviceStatuses = {};
let timerHandler = 0; let timerHandler = 0;
let refreshIntervalHandler = 0; let refreshIntervalHandler = 0;
let userClickedStatus = false; let userClickedStatus = false;
let showStatusOnHover = false;
function showTooltip(serviceName, index, element) { function showTooltip(serviceName, index, element) {
//userClickedStatus = false; userClickedStatus = false;
clearTimeout(timerHandler); clearTimeout(timerHandler);
let serviceResult = serviceStatuses[serviceName].results[index]; let serviceResult = serviceStatuses[serviceName].results[index];
$("#tooltip-timestamp").text(prettifyTimestamp(serviceResult.timestamp)); $("#tooltip-timestamp").text(prettifyTimestamp(serviceResult.timestamp));
@ -220,30 +219,11 @@
} }
} }
function toggleTooltip(serviceName, index, element) {
console.log("userClickedStatus="+userClickedStatus);
if (!userClickedStatus) {
showTooltip(serviceName, index, element);
userClickedStatus = true;
} else {
$("#tooltip").hide();
userClickedStatus = false;
}
}
function createStatusBadge(serviceStatusIndex, index, success) { function createStatusBadge(serviceStatusIndex, index, success) {
if (success) { if (success) {
if (showStatusOnHover) { return "<span class='status badge badge-success' style='width: 5%' onmouseenter='showTooltip(\""+serviceStatusIndex+"\", "+index+", this)' onmouseleave='fadeTooltip()' onclick='userClickedStatus = !userClickedStatus;'>&#10003;</span>";
return "<span class='status badge badge-success' style='width: 5%' onmouseenter='showTooltip(\"" + serviceStatusIndex + "\", " + index + ", this)' onmouseleave='fadeTooltip()' onclick='userClickedStatus = !userClickedStatus;'>&#10003;</span>";
} else {
return "<span class='status badge badge-success' style='width: 5%' onclick='toggleTooltip(\"" + serviceStatusIndex + "\", " + index + ", this)'>&#10003;</span>";
}
}
if (showStatusOnHover) {
return "<span class='status badge badge-danger' style='width: 5%' onmouseenter='showTooltip(\"" + serviceStatusIndex + "\", " + index + ", this)' onmouseleave='fadeTooltip()' onclick='userClickedStatus = !userClickedStatus;'>X</span>";
} else {
return "<span class='status badge badge-danger' style='width: 5%' onclick='toggleTooltip(\"" + serviceStatusIndex + "\", " + index + ", this)'>X</span>";
} }
return "<span class='status badge badge-danger' style='width: 5%' onmouseenter='showTooltip(\""+serviceStatusIndex+"\", "+index+", this)' onmouseleave='fadeTooltip()' onclick='userClickedStatus = !userClickedStatus;'>X</span>";
} }
function refreshStatuses() { function refreshStatuses() {
@ -407,6 +387,6 @@
}); });
setRefreshInterval(30); setRefreshInterval(30);
$("#refresh-rate").val(30); $("#refresh-rate").val(30);
</script> </script>
</body> </body>
</html> </html>