Discord bot built with Pycord that offers AI chat and image generation inside of Discord. Image generations are saved in cloudinary and hosted online for all to download.
This PR introduces a new feature to display the last 20 lines of the application log on the dashboard using HTMX. The log section is updated dynamically every 30 seconds without requiring a full page refresh. This improves the real-time monitoring of logs while maintaining the efficiency of the Raspberry Pi hosting the Flask app.
Changes:
Added a /logs route to serve the last 20 lines of the log file.
Integrated HTMX to poll the log lines every 30 seconds, loading only the log section without refreshing the entire page.
Optimized the polling interval to reduce the load on the server and the Raspberry Pi’s limited resources.
Added TailwindCSS styling for the log section to ensure consistent aesthetics with the rest of the dashboard.
Type of change
[x] New feature (non-breaking change which adds functionality)
Checklist
[x] My code follows the style guidelines of this project.
[x] I have performed a self-review of my code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have made corresponding changes to the documentation.
[x] My changes generate no new warnings.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.
[x] Any dependent changes have been merged and published in downstream modules.
Description
This PR introduces a new feature to display the last 20 lines of the application log on the dashboard using HTMX. The log section is updated dynamically every 30 seconds without requiring a full page refresh. This improves the real-time monitoring of logs while maintaining the efficiency of the Raspberry Pi hosting the Flask app.
Changes:
/logs
route to serve the last 20 lines of the log file.Type of change
Checklist