-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templated UI #1476
base: main
Are you sure you want to change the base?
Templated UI #1476
Conversation
apps/predbat/web.py
Outdated
@@ -430,28 +431,36 @@ async def html_log(self, request): | |||
start_line = line[0:27] | |||
rest_line = line[27:] | |||
|
|||
if "error" in line_lower: | |||
text += "<tr><td>{}</td><td nowrap><font color=#ff3333>{}</font> {}</td></tr>\n".format(lineno, start_line, rest_line) | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@springfall2008 this bit is where lines are filtered in/out - lines that shouldn't be seen are simply not added to the list that's passed through to the template.
@springfall2008 I created a PR to make it easier to see the differences, and also to make discussing it easier - it was really hard to see the comments you'd made on the commit, there was no way to simply show all comments. Also, you flagged a couple of lines as having merge issues, I couldn't see any changes to them in the PR when I created it. Let me know in this PR if you think there's still an issue. Can you tag me in any comments please so I get notified, otherwise they're a bit hard to spot in the midst of everything else? |
@@ -17,6 +17,7 @@ | |||
from datetime import datetime, timedelta | |||
import hashlib | |||
import traceback | |||
from environment import is_appdaemon_environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to add environment.py to the file list for Predbat to download
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, sorry this has been stuck for a bit - been busy with other stuff @springfall2008
I don't spot any obvious errors apart from the one comment I made about the file list |
CURRENTLY DRAFT, DO NOT MERGE
This PR moves all the HTML templates, plus the simpler HTML page content generation, out into HTML template files. These files are then filled out by Jinja2 (a templating library).
web.py
will ultimately just be responsible for gathering the data that's needed for each web page, and passing that data to the templating engine so it can build out the HTML that's required for each page.However, for now, some pages still have logic in
web.py
which generates HTML, but now this is just for filling thecontent
block in the middle of each template. Over time, these will transition out.