diff --git a/locales/en/l10n-devopsProjects-pipeline-details.js b/locales/en/l10n-devopsProjects-pipeline-details.js index 0ac0e88be7e..34986d0275b 100644 --- a/locales/en/l10n-devopsProjects-pipeline-details.js +++ b/locales/en/l10n-devopsProjects-pipeline-details.js @@ -235,6 +235,7 @@ module.exports = { // detail page // run log // task status RUN_LOGS: 'Run Logs', VIEW_FULL_LOG: 'View Full Logs', + VIEW_REAL_TIME_LOG: 'View Real-time Logs', // detail page // run log // task status // pipeline log modal PIPELINE_LOG: 'Pipeline Logs', // detail page // Create Pipeline modal // add step modal diff --git a/locales/es/l10n-devopsProjects-pipeline-details.js b/locales/es/l10n-devopsProjects-pipeline-details.js index ddca12f9939..da40df14f3e 100644 --- a/locales/es/l10n-devopsProjects-pipeline-details.js +++ b/locales/es/l10n-devopsProjects-pipeline-details.js @@ -224,6 +224,7 @@ module.exports = { // detail page // run log // task status RUN_LOGS: 'Run Logs', VIEW_FULL_LOG: 'View Full Logs', + VIEW_REAL_TIME_LOG: 'View Real-time Logs', // detail page // run log // task status // pipeline log modal PIPELINE_LOG: 'Pipeline Logs', // detail page // Create Pipeline modal // add step modal diff --git a/locales/tc/l10n-devopsProjects-pipeline-details.js b/locales/tc/l10n-devopsProjects-pipeline-details.js index 77b7a16a380..f07ec30639c 100644 --- a/locales/tc/l10n-devopsProjects-pipeline-details.js +++ b/locales/tc/l10n-devopsProjects-pipeline-details.js @@ -220,6 +220,7 @@ module.exports = { // detail page // run log // task status RUN_LOGS: 'Run Logs', VIEW_FULL_LOG: 'View Full Logs', + VIEW_REAL_TIME_LOG: 'View Real-time Logs', // detail page // run log // task status // pipeline log modal PIPELINE_LOG: 'Pipeline Logs', // detail page // Create Pipeline modal // add step modal diff --git a/locales/zh/l10n-devopsProjects-pipeline-details.js b/locales/zh/l10n-devopsProjects-pipeline-details.js index f645c60f8e2..a7c0653a65b 100644 --- a/locales/zh/l10n-devopsProjects-pipeline-details.js +++ b/locales/zh/l10n-devopsProjects-pipeline-details.js @@ -219,6 +219,7 @@ module.exports = { // detail page // run log // task status RUN_LOGS: '运行日志', VIEW_FULL_LOG: '查看完整日志', + VIEW_REAL_TIME_LOG: '查看实时日志', // detail page // run log // task status // pipeline log modal PIPELINE_LOG: '流水线日志', // detail page // Create Pipeline modal // add step modal diff --git a/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx b/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx index 73b153bd66e..19b4fdcd6c6 100644 --- a/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx +++ b/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx @@ -40,6 +40,9 @@ export default class PipelineLog extends React.Component { * @type {RunStore} */ this.store = new RunStore() + this.state = { + isDownloading: false, + } this.reaction = reaction( () => this.isEmptySteps, @@ -126,6 +129,16 @@ export default class PipelineLog extends React.Component { // this.refreshFlag = !this.refreshFlag // }, 1000) + handleDownload = async () => { + this.setState({ isDownloading: true }) + await this.store.handleDownloadLogs(this.props.params) + this.setState({ isDownloading: false }) + } + + handleJumpFullLogs = () => { + this.store.handleJumpFullLogs(this.props.params) + } + renderLeftTab(stage, index) { if (Array.isArray(stage)) { return ( @@ -200,6 +213,28 @@ export default class PipelineLog extends React.Component { )) } + get isRunning() { + return this.activeStage?.result && this.activeStage?.result === 'UNKNOWN' + } + + renderLogButton = () => { + if (this.isRunning) { + return ( + + ) + } + return ( + + + + + ) + } + render() { const { nodes } = this.props const _nodes = toJS(nodes) @@ -234,9 +269,7 @@ export default class PipelineLog extends React.Component { } /> - + {this.renderLogButton()}