-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[ui] task logs in sidebar #14612
Merged
Merged
[ui] task logs in sidebar #14612
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5dc8ab4
button styles
philrenaud 331d434
Further styles including global toggle adjustment
philrenaud 53db81b
sidebar funcs and header
philrenaud 4ac1c4f
Functioning task logs in high-level sidebars
philrenaud fe8f070
same-lineify the show tasks toggle
philrenaud ce690d5
Changelog
philrenaud f190014
Full-height sidebar calc in css, plz drop soon container queries
philrenaud 9eb7098
Active status and query params for allocations page
philrenaud a950441
Reactive shouldShowLogs getter and added to client and task group pages
philrenaud 119456d
Higher order func passing, thanks @DingoEatingFuzz
philrenaud 3aaec14
Non-service job types get allocation params passed
philrenaud 97fd8d3
Keyframe animation for task log sidebar
philrenaud bfcc2eb
Acceptance test
philrenaud 38ec3a3
A few more sub-row tests
philrenaud 74ff4e6
Lintfix
philrenaud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: adds a sidebar to show in-page logs for a given task, accessible via job, client, or task group routes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ export default class StreamingFile extends Component.extend(WindowResizable) { | |
isStreaming = true; | ||
logger = null; | ||
follow = true; | ||
shouldFillHeight = true; | ||
|
||
// Internal bookkeeping to avoid multiple scroll events on one frame | ||
requestFrame = true; | ||
|
@@ -89,7 +90,9 @@ export default class StreamingFile extends Component.extend(WindowResizable) { | |
|
||
didInsertElement() { | ||
super.didInsertElement(...arguments); | ||
this.fillAvailableHeight(); | ||
if (this.shouldFillHeight) { | ||
this.fillAvailableHeight(); | ||
} | ||
Comment on lines
+93
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. conditionalizing |
||
|
||
this.set('_scrollHandler', this.scrollHandler.bind(this)); | ||
this.element.addEventListener('scroll', this._scrollHandler); | ||
|
@@ -105,7 +108,9 @@ export default class StreamingFile extends Component.extend(WindowResizable) { | |
} | ||
|
||
windowResizeHandler() { | ||
once(this, this.fillAvailableHeight); | ||
if (this.shouldFillHeight) { | ||
once(this, this.fillAvailableHeight); | ||
} | ||
} | ||
|
||
fillAvailableHeight() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<Portal @target="log-sidebar-portal"> | ||
<div | ||
class="sidebar task-context-sidebar has-subnav {{if this.isSideBarOpen "open"}}" | ||
{{on-click-outside | ||
@fns.closeSidebar | ||
capture=true | ||
}} | ||
> | ||
{{#if @task}} | ||
{{keyboard-commands this.keyCommands}} | ||
<header> | ||
<h1 class="title"> | ||
{{@task.name}} | ||
<span class="state {{@task.state}}"> | ||
{{@task.state}} | ||
</span> | ||
</h1> | ||
<LinkTo | ||
class="link" | ||
title={{@task.name}} | ||
@route="allocations.allocation.task" | ||
@models={{array @task.allocation @task}} | ||
> | ||
Go to Task page | ||
</LinkTo> | ||
<button | ||
class="button close is-borderless" | ||
type="button" | ||
{{on "click" @fns.closeSidebar}} | ||
> | ||
{{x-icon "cancel"}} | ||
</button> | ||
</header> | ||
|
||
<TaskLog | ||
@allocation={{@task.allocation}} | ||
@task={{@task.name}} | ||
@shouldFillHeight={{false}} | ||
/> | ||
|
||
|
||
{{/if}} | ||
</div> | ||
</Portal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @ts-check | ||
import Component from '@glimmer/component'; | ||
|
||
export default class TaskContextSidebarComponent extends Component { | ||
get isSideBarOpen() { | ||
return !!this.args.task; | ||
} | ||
|
||
keyCommands = [ | ||
{ | ||
label: 'Close Task Logs Sidebar', | ||
pattern: ['Escape'], | ||
action: () => this.args.fns.closeSidebar(), | ||
}, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,9 @@ | |
.is-padded { | ||
padding: 0em 0em 0em 1em; | ||
} | ||
.is-one-line { | ||
white-space: nowrap; | ||
} | ||
} | ||
|
||
.is-fixed-width { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Side-effect; adding correct name.