|
2 | 2 | <html lang="en">
|
3 | 3 | <head>
|
4 | 4 | <meta charset="UTF-8">
|
5 |
| - <title>DB Endpoint Latency Checker</title> |
| 5 | + <title>DB Latency Minimalist SaaS</title> |
6 | 6 | <link rel="stylesheet" href="/static/style.css"/>
|
7 | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
8 | 8 | <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
17 | 17 | .latency-table th, .latency-table td { border:1px solid #dde1ec; padding:0.56em 0.9em;}
|
18 | 18 | .summary-label { font-weight:700; }
|
19 | 19 | .summary-value { font-weight:400; }
|
| 20 | + .clear-btn-active { background: #ea1616!important; color:#fff!important; border:1.3px solid #e34434!important; } |
| 21 | + .clear-btn-active:hover { background: #e32e2e!important; color:#fff!important; } |
20 | 22 | </style>
|
21 | 23 | </head>
|
22 | 24 | <body>
|
@@ -70,17 +72,16 @@ <h2 class="minimal-title">DB Endpoint Latency Checker</h2>
|
70 | 72 | <label for="interval">Delay Between Tests (seconds)</label>
|
71 | 73 | <input type="number" id="interval" name="interval" value="{{ interval|default(1) }}" min="0.1" step="0.1">
|
72 | 74 | </div>
|
73 |
| - <footer class="minimal-footer"> |
| 75 | + <footer class="minimal-footer" id="footer-btns"> |
74 | 76 | <button type="submit" class="minimal-btn">Run Test</button>
|
75 |
| - <button type="reset" class="minimal-btn minimal-btn-secondary" onclick="formReset(); return false;">Clear</button> |
| 77 | + <button type="button" id="clear-btn" class="minimal-btn minimal-btn-secondary{% if result %} clear-btn-active{% endif %}" onclick="hardClear(); return false;">Clear</button> |
76 | 78 | </footer>
|
77 | 79 | <div id="loading-indicator" style="display:none; text-align:center; margin-top:1em;">
|
78 | 80 | <div class="loader"></div>
|
79 | 81 | <div id="prog-label" style="margin:0.8em 0; color:#455;"></div>
|
80 | 82 | <progress id="progress-bar" max="100" value="1" style="width: 90%;"></progress>
|
81 | 83 | </div>
|
82 | 84 | </form>
|
83 |
| - |
84 | 85 | {% if result %}
|
85 | 86 | <section class="result-card result-section printable centered-block" id="printable-result" style="margin:2em auto 1.2em auto;max-width:650px;">
|
86 | 87 | <h3 style="margin:2em 0 0.65em 0; text-align:center;">Latency Chart (ms over test time)</h3>
|
@@ -194,8 +195,16 @@ <h3 style="text-align:center;margin-bottom:0.5em;">Summary of Statistics</h3>
|
194 | 195 | document.getElementById('latency-form').reset();
|
195 | 196 | dbFields.style.display = '';
|
196 | 197 | urlFields.style.display = 'none';
|
| 198 | + removeResults(); |
| 199 | +} |
| 200 | +function hardClear() { |
| 201 | + // redirect to base URL, kill cache/results |
| 202 | + window.location.href = "/"; |
| 203 | +} |
| 204 | +function removeResults() { |
| 205 | + var r = document.getElementById('printable-result'); |
| 206 | + if (r) r.parentNode.removeChild(r); |
197 | 207 | }
|
198 |
| -// Loader/progress for test (progress based on Test Duration) |
199 | 208 | function runProgressBar() {
|
200 | 209 | const loader = document.getElementById('loading-indicator');
|
201 | 210 | loader.style.display = '';
|
|
0 commit comments