Fix manual override plan display, web interface download plan/apps use text format#3453
Fix manual override plan display, web interface download plan/apps use text format#3453springfall2008 merged 2 commits intomainfrom
Conversation
Fix logfile and apps downloader to return text
There was a problem hiding this comment.
Pull request overview
Improves the Predbat web UI by fixing manual override highlighting for plan rows that fall on the next day, and adjusts debug/download endpoints to deliver files in a more user-friendly “text” download format.
Changes:
- Update plan renderer JS to compute absolute minutes-from-midnight across day boundaries (so next-day slots compare correctly with override minute lists).
- Serve debug downloads (apps.yaml / debug yaml / logs) with
.txtfilenames and support merging multiple log files into one download. - Add a favicon link to the HTML header.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
apps/predbat/web_helper.py |
Fixes override time comparison for next-day plan slots by computing absolute minutes using a plan “midnight reference”; adds favicon link. |
apps/predbat/web.py |
Updates debug download endpoints to use .txt filenames; enhances file download helper to optionally merge two files (used for logs). |
|
|
||
| async def html_debug_log(self, request): | ||
| return await self.html_file_load("predbat.log") | ||
| return await self.html_file_load("predbat.1.log", also_file="predbat.log", as_file="predbat.log.txt") |
There was a problem hiding this comment.
html_debug_log() currently loads predbat.1.log as the primary file and then prepends predbat.log via also_file, which produces a combined download with the newest log first and the rotated (older) log last. This is the reverse of the ordering used in html_api_get_log() (which prepends predbat.1.log before predbat.log) and makes the merged log non-chronological. Swap the arguments (load predbat.log and also_file="predbat.1.log") or adjust the concatenation order so older entries come first.
| return await self.html_file_load("predbat.1.log", also_file="predbat.log", as_file="predbat.log.txt") | |
| return await self.html_file_load("predbat.log", also_file="predbat.1.log", as_file="predbat.log.txt") |
No description provided.