Flow improvements.
This commit is contained in:
@@ -109,7 +109,7 @@
|
||||
<strong class="text-primary" id="statusPhase">Initializing...</strong>
|
||||
</div>
|
||||
<h5 class="card-title mb-3" id="statusMessage">Preparing environment...</h5>
|
||||
<div class="progress" style="height: 10px;">
|
||||
<div class="progress" style="height: 20px;">
|
||||
<div id="progressBar" class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
<small class="text-muted mt-2 d-block" id="statusTime"></small>
|
||||
@@ -164,8 +164,8 @@
|
||||
</td>
|
||||
<td>${{ "%.4f"|format(r.cost) }}</td>
|
||||
<td>
|
||||
<a href="/project/{{ project.id }}/run/{{ r.id }}" class="btn btn-sm btn-outline-primary">
|
||||
{{ 'View Active' if active_run and r.id == active_run.id else 'View' }}
|
||||
<a href="{{ url_for('view_run', id=r.id) }}" class="btn btn-sm btn-outline-primary">
|
||||
{{ 'View Active' if active_run and r.id == active_run.id and active_run.status in ['running', 'queued'] else 'View' }}
|
||||
</a>
|
||||
{% if r.status in ['failed', 'cancelled', 'interrupted'] %}
|
||||
<form action="/run/{{ r.id }}/restart" method="POST" class="d-inline ms-1">
|
||||
@@ -562,6 +562,18 @@
|
||||
const progBar = document.getElementById('progressBar');
|
||||
if (progBar && data.percent !== undefined) {
|
||||
progBar.style.width = data.percent + "%";
|
||||
|
||||
let label = data.percent + "%";
|
||||
if (data.status === 'running' && data.percent > 2 && data.start_time) {
|
||||
const elapsed = (Date.now() / 1000) - data.start_time;
|
||||
if (elapsed > 5) {
|
||||
const remaining = (elapsed / (data.percent / 100)) - elapsed;
|
||||
const m = Math.floor(remaining / 60);
|
||||
const s = Math.floor(remaining % 60);
|
||||
if (remaining > 0 && remaining < 86400) label += ` (~${m}m ${s}s)`;
|
||||
}
|
||||
}
|
||||
progBar.innerText = label;
|
||||
}
|
||||
|
||||
// Update Status Bar
|
||||
|
||||
Reference in New Issue
Block a user