Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0083801

Browse files
committed
Tested correlated job log view. Seems to work but the log chopping is still worse
1 parentb8a6922 commit0083801

File tree

3 files changed

+40
-9
lines changed

3 files changed

+40
-9
lines changed

‎frontend/client/views/pipeline/detail.vue‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,13 @@ export default {
350350
},
351351
352352
jobLog () {
353-
this.$router.push({path:'/pipeline/log', query: { pipelineid:this.pipelineID, runid:this.runID, jobid:this.job.internalID }})
353+
var jobid=null
354+
if (this.job) {
355+
jobid=this.job.intervalID
356+
}
357+
358+
// Route
359+
this.$router.push({path:'/pipeline/log', query: { pipelineid:this.pipelineID, runid:this.runID, jobid: jobid }})
354360
},
355361
356362
startPipeline (pipelineid) {

‎frontend/client/views/pipeline/log.vue‎

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,29 @@ export default {
6767
})
6868
.then(response=> {
6969
if (response.data) {
70-
// We add the received log
71-
this.logText+=response.data.log
72-
73-
// LF does not work for HTML. Replace with <br />
74-
this.logText=this.logText.replace(/\n/g,'<br />')
75-
76-
// Set the new start position defined by return value
77-
this.startPos=response.data.start
70+
// Check if we got multiple objects
71+
var finished=true
72+
for (let i=0, l=response.data.length; i< l; i++) {
73+
// We add the received log
74+
this.logText+=response.data[i].log
75+
76+
// LF does not work for HTML. Replace with <br />
77+
this.logText=this.logText.replace(/\n/g,'<br />')
78+
79+
// Set the new start position defined by return value
80+
this.startPos=response.data[i].start
81+
82+
// Job not finished?
83+
if (!response.data[i].finished) {
84+
finished=false
85+
}
86+
}
87+
88+
// All jobs finished. Stop interval.
89+
if (finished) {
90+
this.jobRunning=false
91+
clearInterval(this.intervalID)
92+
}
7893
}
7994
})
8095
.catch((error)=> {

‎handlers/pipeline_run.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ func GetJobLogs(c echo.Context) error {
126126
returnc.String(http.StatusBadRequest,err.Error())
127127
}
128128

129+
// Check if job is finished
130+
ifjob.Status==gaia.JobSuccess||job.Status==gaia.JobFailed {
131+
jL.Finished=true
132+
}
133+
129134
returnc.JSON(http.StatusOK,*jL)
130135
}
131136
}
@@ -148,6 +153,11 @@ func GetJobLogs(c echo.Context) error {
148153
returnc.String(http.StatusBadRequest,err.Error())
149154
}
150155

156+
// Check if job is finished
157+
ifjob.Status==gaia.JobSuccess||job.Status==gaia.JobFailed {
158+
jL.Finished=true
159+
}
160+
151161
jobs=append(jobs,*jL)
152162
}
153163

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp