Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DB Endpoint Latency Checker</title>
<title>DB Latency Minimalist SaaS</title>
<link rel="stylesheet" href="/static/style.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
Expand All @@ -17,6 +17,8 @@
.latency-table th, .latency-table td { border:1px solid #dde1ec; padding:0.56em 0.9em;}
.summary-label { font-weight:700; }
.summary-value { font-weight:400; }
.clear-btn-active { background: #ea1616!important; color:#fff!important; border:1.3px solid #e34434!important; }
.clear-btn-active:hover { background: #e32e2e!important; color:#fff!important; }
</style>
</head>
<body>
Expand Down Expand Up @@ -70,17 +72,16 @@ <h2 class="minimal-title">DB Endpoint Latency Checker</h2>
<label for="interval">Delay Between Tests (seconds)</label>
<input type="number" id="interval" name="interval" value="{{ interval|default(1) }}" min="0.1" step="0.1">
</div>
<footer class="minimal-footer">
<footer class="minimal-footer" id="footer-btns">
<button type="submit" class="minimal-btn">Run Test</button>
<button type="reset" class="minimal-btn minimal-btn-secondary" onclick="formReset(); return false;">Clear</button>
<button type="button" id="clear-btn" class="minimal-btn minimal-btn-secondary{% if result %} clear-btn-active{% endif %}" onclick="hardClear(); return false;">Clear</button>
</footer>
<div id="loading-indicator" style="display:none; text-align:center; margin-top:1em;">
<div class="loader"></div>
<div id="prog-label" style="margin:0.8em 0; color:#455;"></div>
<progress id="progress-bar" max="100" value="1" style="width: 90%;"></progress>
</div>
</form>

{% if result %}
<section class="result-card result-section printable centered-block" id="printable-result" style="margin:2em auto 1.2em auto;max-width:650px;">
<h3 style="margin:2em 0 0.65em 0; text-align:center;">Latency Chart (ms over test time)</h3>
Expand Down Expand Up @@ -194,8 +195,16 @@ <h3 style="text-align:center;margin-bottom:0.5em;">Summary of Statistics</h3>
document.getElementById('latency-form').reset();
dbFields.style.display = '';
urlFields.style.display = 'none';
removeResults();
}
function hardClear() {
// redirect to base URL, kill cache/results
window.location.href = "/";
}
function removeResults() {
var r = document.getElementById('printable-result');
if (r) r.parentNode.removeChild(r);
}
// Loader/progress for test (progress based on Test Duration)
function runProgressBar() {
const loader = document.getElementById('loading-indicator');
loader.style.display = '';
Expand Down