mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-17 20:05:58 +00:00
Refactor: Remove multi-run option from UI and logic
This commit is contained in:
25
index.html
25
index.html
@@ -63,22 +63,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="form-label">Number of Runs</label>
|
|
||||||
<select id="run-count" class="form-input">
|
|
||||||
<option value="1">1 run (fastest)</option>
|
|
||||||
<option value="3" selected>3 runs (recommended)</option>
|
|
||||||
<option value="5">5 runs (good reliability)</option>
|
|
||||||
<option value="10">10 runs (best reliability)</option>
|
|
||||||
</select>
|
|
||||||
<p style="font-size: 0.85rem; color: var(--color-text-secondary); margin-top: 0.5rem;">
|
|
||||||
Multiple runs provide more reliable median results
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group" style="margin-top: 1rem;">
|
<div class="form-group" style="margin-top: 1rem;">
|
||||||
<label class="checkbox-container">
|
<label class="checkbox-container">
|
||||||
<input type="checkbox" id="capture-filmstrip" checked>
|
<input type="checkbox" id="capture-filmstrip" checked>
|
||||||
@@ -91,14 +75,7 @@
|
|||||||
<span>Run Test</span>
|
<span>Run Test</span>
|
||||||
<div id="loading-spinner" class="loading-spinner" style="display: none;"></div>
|
<div id="loading-spinner" class="loading-spinner" style="display: none;"></div>
|
||||||
</button>
|
</button>
|
||||||
<p id="error-msg" style="color: var(--color-accent-danger); display: none;"></p>
|
<p id="error-msg" style="color: var(--color-accent-danger); display: none;"></p> </div>
|
||||||
|
|
||||||
<!-- Multi-Run Progress -->
|
|
||||||
<div id="multi-run-progress" style="display: none; margin-top: 1.5rem;">
|
|
||||||
<h4 style="color: var(--color-text-primary);">Running Tests...</h4>
|
|
||||||
<div style="background: var(--color-bg-tertiary); border-radius: 8px; overflow: hidden; height: 30px; margin: 1rem 0;">
|
|
||||||
<div id="progress-fill" style="height: 100%; background: var(--color-accent); width: 0%; transition: width 0.3s ease;"></div>
|
|
||||||
</div>
|
|
||||||
<p id="progress-text" style="text-align: center; color: var(--color-text-secondary);"></p>
|
<p id="progress-text" style="text-align: center; color: var(--color-text-secondary);"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
13
main.js
13
main.js
@@ -69,7 +69,7 @@ async function runTest() {
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
url: url,
|
url: url,
|
||||||
isMobile: currentDevice === 'mobile',
|
isMobile: currentDevice === 'mobile',
|
||||||
runs: parseInt(document.getElementById('run-count').value),
|
runs: 1,
|
||||||
captureFilmstrip: captureFilmstrip
|
captureFilmstrip: captureFilmstrip
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -77,16 +77,7 @@ async function runTest() {
|
|||||||
if (!response.ok) throw new Error('Test failed to start');
|
if (!response.ok) throw new Error('Test failed to start');
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
// Handle multi-run immediate response
|
displayResults(data);
|
||||||
if (data.status === 'running' && data.suiteId) {
|
|
||||||
// Show progress for multi-run
|
|
||||||
document.getElementById('multi-run-progress').style.display = 'block';
|
|
||||||
pollSuiteStatus(data.suiteId, data.runs);
|
|
||||||
// Clear previous single result if any
|
|
||||||
document.getElementById('results-area').classList.remove('visible');
|
|
||||||
} else {
|
|
||||||
displayResults(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
loadHistory(); // Refresh history
|
loadHistory(); // Refresh history
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user