Refresh jobs table via /jobs endpoint instead of full page reload #11

Merged
DasPoschi merged 1 commits from codex/add-proxy-list-import-function-3g187r into main 2026-01-01 21:23:09 +00:00
DasPoschi commented 2026-01-01 21:22:42 +00:00 (Migrated from github.com)

Motivation

  • Avoid reloading the entire downloads page every poll interval and instead update only the jobs table to reduce flicker and improve responsiveness.
  • Provide a small, focused endpoint that can supply just the table rows for efficient partial updates.
  • Keep the server-side rendering logic for job rows reusable and separate from the full page template.
  • Surface proxy export/save state in the UI and add a success style for feedback.

Description

  • Extracted the job-row HTML construction into render_job_rows() and added a new endpoint @app.get("/jobs") that returns those rows as HTML.
  • Replaced the previous window.location.reload() polling with an async refreshJobs() function in render_page() that fetch()es /jobs and replaces the tbody with id jobs-body.
  • Kept/added proxy export helpers build_jdproxies_payload() and save_proxy_export() and the @app.post("/proxies/save") endpoint, and updated the proxies page to show export_path and a success message.
  • Added a .success CSS rule to static/style.css for visible save feedback.

Testing

  • No automated tests were executed for these changes.
  • No CI or automated startup checks were run in this environment.

Codex Task

### Motivation - Avoid reloading the entire downloads page every poll interval and instead update only the jobs table to reduce flicker and improve responsiveness. - Provide a small, focused endpoint that can supply just the table rows for efficient partial updates. - Keep the server-side rendering logic for job rows reusable and separate from the full page template. - Surface proxy export/save state in the UI and add a success style for feedback. ### Description - Extracted the job-row HTML construction into `render_job_rows()` and added a new endpoint `@app.get("/jobs")` that returns those rows as HTML. - Replaced the previous `window.location.reload()` polling with an async `refreshJobs()` function in `render_page()` that `fetch()`es `/jobs` and replaces the `tbody` with id `jobs-body`. - Kept/added proxy export helpers `build_jdproxies_payload()` and `save_proxy_export()` and the `@app.post("/proxies/save")` endpoint, and updated the proxies page to show `export_path` and a success message. - Added a `.success` CSS rule to `static/style.css` for visible save feedback. ### Testing - No automated tests were executed for these changes. - No CI or automated startup checks were run in this environment. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_6956d0cecb448327a0e08df8a3137175)
Sign in to join this conversation.