Skip to content

Commit e2715d5

Browse files
committed
WIP job log view
1 parent 703718f commit e2715d5

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

frontend/client/router/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default new Router({
2020
component: lazyLoading('pipelines/detail')
2121
},
2222
{
23-
name: 'Logs',
23+
name: 'Pipeline Logs',
2424
path: '/jobs/log',
2525
component: lazyLoading('jobs/log')
2626
}

frontend/client/views/jobs/log.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default {
6161
showProgressBar: false,
6262
params: {
6363
pipelineid: this.pipelineid,
64-
runid: this.runID,
64+
pipelinerunid: this.runID,
6565
jobid: this.jobid,
6666
start: this.startPos,
6767
maxbufferlen: bufferSize

frontend/client/views/pipelines/detail.vue

+14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
<div class="tile is-vertical is-parent is-12">
66
<article class="tile is-child notification content-article">
77
<div v-if="job">
8+
<a class="button is-primary" @click="jobLog">
9+
<span class="icon">
10+
<i class="fa fa-terminal"></i>
11+
</span>
12+
<span>Show Job log</span>
13+
</a>
814
<p>
915
Job: {{ job }}
1016
</p>
@@ -61,6 +67,7 @@ export default {
6167
data () {
6268
return {
6369
pipelineID: null,
70+
runID: null,
6471
nodes: null,
6572
edges: null,
6673
lastRedraw: false,
@@ -154,6 +161,9 @@ export default {
154161
155162
// If runid was set, look up this run
156163
if (runID) {
164+
// set run id
165+
this.runID = runID
166+
157167
// Run ID specified. Do concurrent request
158168
this.$http.all([this.getPipeline(pipelineID), this.getPipelineRun(pipelineID, runID), this.getPipelineRuns(pipelineID)])
159169
.then(this.$http.spread(function (pipeline, pipelineRun, pipelineRuns) {
@@ -333,6 +343,10 @@ export default {
333343
return diff + ' seconds'
334344
}
335345
return moment.duration(diff, 'seconds').humanize()
346+
},
347+
348+
jobLog () {
349+
this.$router.push({path: '/jobs/log', query: { pipelineid: this.pipelineID, runid: this.runID, jobid: this.job.internalID }})
336350
}
337351
}
338352

handlers/job.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func GetJobLogs(ctx iris.Context) {
4848

4949
// Lookup log file
5050
logFilePath := filepath.Join(gaia.Cfg.WorkspacePath, pipelineID, pipelineRunID, gaia.LogsFolderName, jobID)
51+
gaia.Cfg.Logger.Debug("logfilepath", "Path", logFilePath)
5152
if _, err := os.Stat(logFilePath); os.IsNotExist(err) {
52-
ctx.StatusCode(iris.StatusInternalServerError)
53+
ctx.StatusCode(iris.StatusNotFound)
5354
ctx.WriteString(errLogNotFound.Error())
5455
return
5556
}

0 commit comments

Comments
 (0)