-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(ui): v3 UI tweaks #4933
fix(ui): v3 UI tweaks #4933
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,7 +176,13 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< | |
const retryWatch = new RetryWatch<Workflow>( | ||
() => services.workflows.watch({name, namespace}), | ||
() => setError(null), | ||
e => setWorkflow(e.object), | ||
e => { | ||
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. |
||
if (e.type === 'DELETED') { | ||
setError(new Error('Workflow deleted')); | ||
} else { | ||
setWorkflow(e.object); | ||
} | ||
}, | ||
setError | ||
); | ||
retryWatch.start(); | ||
|
@@ -250,6 +256,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< | |
workflow={workflow} | ||
links={links} | ||
onShowContainerLogs={(_, container) => setSidePanel(`logs:${nodeId}:${container}`)} | ||
onShowEvents={() => setSidePanel(`events:${nodeId}`)} | ||
onShowYaml={() => setSidePanel(`yaml:${nodeId}`)} | ||
archived={false} | ||
/> | ||
|
@@ -263,6 +270,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< | |
{parsedSidePanel.type === 'logs' && ( | ||
<WorkflowLogsViewer workflow={workflow} nodeId={parsedSidePanel.nodeId} container={parsedSidePanel.container} archived={false} /> | ||
)} | ||
{parsedSidePanel.type === 'events' && <EventsPanel namespace={namespace} kind='Pod' name={parsedSidePanel.nodeId} />} | ||
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. |
||
{parsedSidePanel.type === 'share' && <WidgetGallery namespace={namespace} name={name} />} | ||
{parsedSidePanel.type === 'yaml' && <WorkflowYamlViewer workflow={workflow} selectedNode={selectedNode} />} | ||
{!parsedSidePanel} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ import {Timestamp} from '../../../shared/components/timestamp'; | |
import {ResourcesDuration} from '../../../shared/resources-duration'; | ||
import {services} from '../../../shared/services'; | ||
import {getResolvedTemplates} from '../../../shared/template-resolution'; | ||
import {EventsPanel} from '../events-panel'; | ||
|
||
require('./workflow-node-info.scss'); | ||
|
||
|
@@ -39,6 +38,7 @@ interface Props { | |
links: models.Link[]; | ||
archived: boolean; | ||
onShowContainerLogs: (nodeId: string, container: string) => any; | ||
onShowEvents?: () => void; | ||
onShowYaml?: (nodeId: string) => any; | ||
} | ||
|
||
|
@@ -142,6 +142,11 @@ const WorkflowNodeSummary = (props: Props) => { | |
<i className='fa fa-bars' /> main logs | ||
</DropDownButton> | ||
)}{' '} | ||
{props.node.type === 'Pod' && props.onShowEvents && ( | ||
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. |
||
<Button icon='bell' onClick={() => props.onShowEvents()}> | ||
EVENTS | ||
</Button> | ||
)}{' '} | ||
<Links | ||
object={{ | ||
metadata: { | ||
|
@@ -218,6 +223,7 @@ const WorkflowNodeContainer = (props: { | |
nodeId: string; | ||
container: models.kubernetes.Container | models.Sidecar | models.Script; | ||
onShowContainerLogs: (nodeId: string, container: string) => any; | ||
onShowEvents: () => void; | ||
}) => { | ||
const container = {name: 'main', args: Array<string>(), source: '', ...props.container}; | ||
const maybeQuote = (v: string) => (v.includes(' ') ? `'${v}'` : v); | ||
|
@@ -281,7 +287,12 @@ class WorkflowNodeContainers extends React.Component<Props, {selectedSidecar: st | |
return ( | ||
<div className='workflow-node-info__containers'> | ||
{this.state.selectedSidecar && <i className='fa fa-angle-left workflow-node-info__sidecar-back' onClick={() => this.setState({selectedSidecar: null})} />} | ||
<WorkflowNodeContainer nodeId={this.props.node.id} container={container} onShowContainerLogs={this.props.onShowContainerLogs} /> | ||
<WorkflowNodeContainer | ||
nodeId={this.props.node.id} | ||
container={container} | ||
onShowContainerLogs={this.props.onShowContainerLogs} | ||
onShowEvents={this.props.onShowEvents} | ||
/> | ||
{!this.state.selectedSidecar && template.sidecars && template.sidecars.length > 0 && ( | ||
<div> | ||
<p>SIDECARS:</p> | ||
|
@@ -366,11 +377,6 @@ export const WorkflowNodeInfo = (props: Props) => ( | |
</div> | ||
) | ||
}, | ||
props.node.type === 'Pod' && { | ||
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. removed this tab |
||
title: 'EVENTS', | ||
key: 'events', | ||
content: <EventsPanel namespace={props.workflow.metadata.namespace} kind='Pod' name={props.node.id} /> | ||
}, | ||
{ | ||
title: 'CONTAINERS', | ||
key: 'containers', | ||
|
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.
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.
changed for consistency