diff --git a/web-console/src/components/show-log/__snapshots__/show-log.spec.tsx.snap b/web-console/src/components/show-log/__snapshots__/show-log.spec.tsx.snap index c287d66c3dc..aba2116f149 100644 --- a/web-console/src/components/show-log/__snapshots__/show-log.spec.tsx.snap +++ b/web-console/src/components/show-log/__snapshots__/show-log.spec.tsx.snap @@ -11,6 +11,7 @@ exports[`show log describe show log 1`] = ` class="bp3-control bp3-checkbox" > { it('describe show log', () => { const showLog = ; diff --git a/web-console/src/components/show-log/show-log.tsx b/web-console/src/components/show-log/show-log.tsx index 1db9c8b29fa..1b0f95a3c8f 100644 --- a/web-console/src/components/show-log/show-log.tsx +++ b/web-console/src/components/show-log/show-log.tsx @@ -39,6 +39,7 @@ export interface ShowLogProps extends React.Props { endpoint: string; downloadFilename?: string; tailOffset?: number; + status: string | null; } export interface ShowLogState { @@ -53,11 +54,17 @@ export class ShowLog extends React.PureComponent { super(props, context); this.state = { logValue: '', - tail: false + tail: true }; this.getLogInfo(); } + componentDidMount(): void { + if (this.props.status === 'RUNNING') { + this.tail(); + } + } + private getLogInfo = async (): Promise => { const { endpoint, tailOffset } = this.props; try { @@ -97,16 +104,19 @@ export class ShowLog extends React.PureComponent { render() { - const { endpoint, downloadFilename } = this.props; + const { endpoint, downloadFilename, status } = this.props; const { logValue } = this.state; return
+ { + status === 'RUNNING' && + } { downloadFilename && diff --git a/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.spec.tsx b/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.spec.tsx index 30a3654ef39..771cacddfef 100644 --- a/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.spec.tsx +++ b/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.spec.tsx @@ -26,6 +26,7 @@ describe('task table action dialog', () => { it('matches snapshot', () => { const taskTableActionDialog = null} diff --git a/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.tsx b/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.tsx index c7f52dfe2f3..19525641029 100644 --- a/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.tsx +++ b/web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.tsx @@ -28,6 +28,7 @@ interface TaskTableActionDialogProps extends IDialogProps { taskId: string; actions: BasicAction[]; onClose: () => void; + status: string | null ; } interface TaskTableActionDialogState { @@ -43,7 +44,7 @@ export class TaskTableActionDialog extends React.PureComponent this.setState({ taskTableActionDialogId: id, + taskTableActionDialogStatus: status, taskTableActionDialogActions: taskActions })} actions={taskActions} @@ -707,7 +710,7 @@ ORDER BY "rank" DESC, "created_time" DESC`); render() { const { goToSql, goToLoadDataView, noSqlMode } = this.props; - const { groupTasksBy, supervisorSpecDialogOpen, taskSpecDialogOpen, alertErrorMsg, taskTableActionDialogId, taskTableActionDialogActions, supervisorTableActionDialogId, supervisorTableActionDialogActions } = this.state; + const { groupTasksBy, supervisorSpecDialogOpen, taskSpecDialogOpen, alertErrorMsg, taskTableActionDialogId, taskTableActionDialogActions, supervisorTableActionDialogId, supervisorTableActionDialogActions, taskTableActionDialogStatus } = this.state; const { supervisorTableColumnSelectionHandler, taskTableColumnSelectionHandler } = this; const submitTaskMenu = this.setState({taskTableActionDialogId: null})}