File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ def manual_backup(repo_id):
233233@login_required  
234234def  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' ) 
239240def  health_check ():
Original file line number Diff line number Diff 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 %}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments