From f29745246141e66bd4010a2053719bcdc67887f3 Mon Sep 17 00:00:00 2001 From: I062783 Date: Wed, 10 Mar 2021 13:59:37 +0800 Subject: [PATCH 1/3] add rerun single (failed) job button in UI --- src/dashboard-client/src/components/job/JobDetail.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dashboard-client/src/components/job/JobDetail.vue b/src/dashboard-client/src/components/job/JobDetail.vue index 27bea10e9..f24428a58 100644 --- a/src/dashboard-client/src/components/job/JobDetail.vue +++ b/src/dashboard-client/src/components/job/JobDetail.vue @@ -73,6 +73,10 @@ replayRestart Job Restart Job + + replayRerun Single Job + Rerun Single Job + delete_sweepClear Cache Clear Job @@ -115,6 +119,12 @@ Restart Job +
+ + replay + Rerun Single Job + +
delete_sweep From 47883e404c06e6cf4a595e253e05d62ba67a5c62 Mon Sep 17 00:00:00 2001 From: I062783 Date: Wed, 10 Mar 2021 13:59:37 +0800 Subject: [PATCH 2/3] add rerun single (failed) job button in UI --- src/dashboard-client/src/components/job/JobDetail.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dashboard-client/src/components/job/JobDetail.vue b/src/dashboard-client/src/components/job/JobDetail.vue index 27bea10e9..f24428a58 100644 --- a/src/dashboard-client/src/components/job/JobDetail.vue +++ b/src/dashboard-client/src/components/job/JobDetail.vue @@ -73,6 +73,10 @@ replayRestart Job Restart Job + + replayRerun Single Job + Rerun Single Job + delete_sweepClear Cache Clear Job @@ -115,6 +119,12 @@ Restart Job
+
+ + replay + Rerun Single Job + +
delete_sweep From 9c6e02005f623427dd1b7e5578be404d66779a4f Mon Sep 17 00:00:00 2001 From: I062783 Date: Thu, 11 Mar 2021 16:00:50 +0800 Subject: [PATCH 3/3] add rerun failed job button in dashboard UI --- src/dashboard-client/src/models/Job.js | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/dashboard-client/src/models/Job.js b/src/dashboard-client/src/models/Job.js index c58eaccbf..19532e360 100644 --- a/src/dashboard-client/src/models/Job.js +++ b/src/dashboard-client/src/models/Job.js @@ -380,6 +380,35 @@ export default class Job { }) } + rerun () { + return NewAPIService.get(`projects/${this.project.id}/jobs/${this.id}/rerun`) + .then((message) => { + NotificationService.$emit('NOTIFICATION', new Notification(message, 'done')) + return this.project._loadBuild(this.build.number, this.build.restartCounter) + }).then((build) => { + let a = this.name.split('.') + let name = a[0] + '.' + + if (a.length > 1) { + name += (parseInt(a[1]) + 1).toString() + } else { + name += '1' + } + router.push({ + name: 'JobDetail', + params: { + projectName: encodeURIComponent(this.project.name), + buildNumber: this.build.number, + buildRestartCounter: this.build.restartCounter, + jobName: name + } + }) + }) + .catch((err) => { + NotificationService.$emit('NOTIFICATION', new Notification(err)) + }) + } + clearCache () { return NewAPIService.get(`projects/${this.project.id}/jobs/${this.id}/cache/clear`) .then((message) => {