-
Notifications
You must be signed in to change notification settings - Fork 548
Update deployment server main page #4068
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
base: develop
Are you sure you want to change the base?
Conversation
ZenML CLI Performance Comparison (Threshold: 1.0s, Timeout: 60s, Slow: 5s)❌ Failed Commands on Current Branch (feature/update-deployment-server-main-page)
🚨 New Failures IntroducedThe following commands fail on your branch but worked on the target branch:
Performance Comparison
Summary
Environment Info
|
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.
- I couldnt find a
formelement. Maybe we should use that in combination with<button type="submit">, to get the "keyboard-enter" submission with html native elements
I haven't tested functionality yet, these are just my first findings going through the huge file
| <h2 class="deployment-title" id="deployment-title">{{ pipeline_name }}</h2> | ||
| <div class="status-badge" id="status-badge"> | ||
| <span class="status-dot"></span> | ||
| <span>Running</span> |
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.
Can this be hard-coded? I mean if you can access the html file, the thing needs to be reachable somehow, but there may be other states than running that it can be in no?
|
|
||
| <div class="panel-footer"> | ||
| <div class="panel-footer-content"> | ||
| <button class="btn-secondary" id="reset-btn">Reset</button> |
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.
The buttons do not align 100% with the design System I think. I cannot tell for sure how big of a deal this is though. Maybe @znegrin can.
It affects all the buttons
| template = template_path.read_text() | ||
|
|
||
| # Replace template variables | ||
| html_content = template.replace("{{ pipeline_name }}", info.pipeline.name) |
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.
Instead of doing replacements like this, could we use a layout-engine like handlebars or so?
This would maybe also allow for codesplitting, so we dont have a 1.7k line long file.
Not sure if this is feasible in this setup though
| const field = document.createElement('div'); | ||
| field.className = 'output-field'; | ||
| field.innerHTML = ` | ||
| <div class="output-field-key">${key}</div> |
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.
The inner html is set without sanitization.
If the endponit for some reason returns malicious html, this is straight injected here. e.g
<img src=x onerror=alert('XSS from pipeline output')>
| </div> | ||
| </main> | ||
|
|
||
| <script> |
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.
Same as for css applies here. Could this potentially be moved to a separate file to unclutter this giant html template?
| let lastResult = null; | ||
|
|
||
| function authHeaders() { | ||
| const token = localStorage.getItem('zenml_auth_token'); |
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.
The item here is read from local storage, but how does it get there? I couldnt find a setItem function
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.
If required the Key can also be abstracted to a constant, as it needs to be the same for get and set
| <div class="run-footer"> | ||
| <div class="run-status"> | ||
| <span class="run-status-completed">Completed</span> | ||
| <span> · 20s</span> |
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.
Some hard-coded time
| <h1 class="breadcrumb-title" id="pipeline-name">{{ pipeline_name }}</h1> | ||
| </div> | ||
| <div class="top-nav-right"> | ||
| <button class="nav-button" onclick="window.open('/docs', '_blank')">API Docs</button> |
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.
Instead of using buttons here, we should use regular anchor elements for links
| }); | ||
|
|
||
| document.getElementById('rerun-btn').addEventListener('click', runPipeline); | ||
| document.getElementById('delete-btn').addEventListener('click', () => { |
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.
Does the delete-btn actually perform a deletion?
Describe changes
I implemented/fixed _ to achieve _.
Pre-requisites
Please ensure you have done the following:
developand the open PR is targetingdevelop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes