Skip to content

Commit 9d8d377

Browse files
backup page fixed
1 parent 1ac8701 commit 9d8d377

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ def manual_backup(repo_id):
233233
@login_required
234234
def backup_jobs():
235235
jobs = BackupJob.query.filter_by(user_id=current_user.id).order_by(BackupJob.created_at.desc()).all()
236-
return render_template('backup_jobs.html', jobs=jobs)
236+
has_running = any(job.status == 'running' for job in jobs)
237+
return render_template('backup_jobs.html', jobs=jobs, has_running=has_running)
237238

238239
@app.route('/health')
239240
def health_check():

templates/backup_jobs.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,10 @@ <h3 class="text-muted">No Backup Jobs</h3>
189189
{% endblock %}
190190

191191
{% block scripts %}
192+
{% if has_running %}
192193
<script>
193-
// Auto-refresh every 30 seconds for running jobs
194-
{% for job in jobs %}
195-
{% if job.status == 'running' %}
196-
setTimeout(function() {
197-
location.reload();
198-
}, 30000);
199-
{% break %}
200-
{% endif %}
201-
{% endfor %}
194+
// Auto-refresh every 30 seconds while at least one job is running
195+
setTimeout(function(){ location.reload(); }, 30000);
202196
</script>
197+
{% endif %}
203198
{% endblock %}

0 commit comments

Comments
 (0)