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
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) => {