add 5-second auto-refresh to all views except work and workmonth
Implements conditional auto-refresh using meta http-equiv tags in templates. Views with auto_refresh=True will reload every 5 seconds to show updated data. Work and workmonth views excluded to avoid disrupting focused work sessions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ def index(task=None):
|
||||
|
||||
print(rows)
|
||||
|
||||
return render_template("main.html", rows=rows, current_task_path=current_task_path, current_task_time=current_task_time)
|
||||
return render_template("main.html", rows=rows, current_task_path=current_task_path, current_task_time=current_task_time, auto_refresh=True)
|
||||
|
||||
|
||||
@dmbp.route("/day/<int:month>/<int:day>")
|
||||
@@ -57,7 +57,7 @@ def oneday(
|
||||
|
||||
rows = get_period_totals(start, end)
|
||||
|
||||
return render_template("pages.html", rows=rows)
|
||||
return render_template("pages.html", rows=rows, auto_refresh=True)
|
||||
|
||||
|
||||
@dmbp.route("/period/<start>/<end>")
|
||||
@@ -72,7 +72,7 @@ def period(start, end):
|
||||
|
||||
rows = get_period_totals(start, end)
|
||||
|
||||
return render_template("pages.html", rows=rows)
|
||||
return render_template("pages.html", rows=rows, auto_refresh=True)
|
||||
|
||||
|
||||
@dmbp.route("/work")
|
||||
@@ -86,7 +86,7 @@ def work():
|
||||
rows = get_work_period_totals(start, end)
|
||||
print(rows)
|
||||
|
||||
return render_template("main.html", rows=rows)
|
||||
return render_template("main.html", rows=rows, auto_refresh=False)
|
||||
|
||||
|
||||
@dmbp.route("/totals")
|
||||
@@ -104,4 +104,4 @@ def totals(task=None):
|
||||
|
||||
rows = get_period_totals(start, end)
|
||||
|
||||
return render_template("pages.html", rows=rows)
|
||||
return render_template("pages.html", rows=rows, auto_refresh=True)
|
||||
|
||||
Reference in New Issue
Block a user