-
{{run.name}}
+
+
+
+
{{run.name}}
Still running
-
+
{{run.annotations.message.split(/\r?\n/)[0]}}
+
+
+
+
+
+ {{ duration(run) }}
+
+
+
+ {{ endTimeHuman(run) }}
+
+
+
+
-
-
{{run.annotations.message}}
-
-
@@ -134,6 +144,11 @@ import { cancelRun, stopRun, restartRun } from "@/util/data.js";
import { userDirectRunLink, projectRunLink } from "@/util/link.js";
import { runStatus, runResultClass } from "@/util/run.js";
+import * as moment from "moment";
+import momentDurationFormatSetup from "moment-duration-format";
+
+momentDurationFormatSetup(moment);
+
export default {
name: "rundetail",
directives: {
@@ -147,6 +162,7 @@ export default {
},
data() {
return {
+ now: moment(),
stopRunError: null,
cancelRunError: null,
restartRunError: null,
@@ -213,7 +229,42 @@ export default {
runLink = userDirectRunLink(this.ownername, data.id);
}
this.$router.push(runLink);
+ },
+ duration(run) {
+ let formatString = "h:mm:ss[s]";
+ let start = moment(run.start_time);
+ let end = moment(run.end_time);
+
+ if (run.start_time === null) {
+ return moment.duration(0).format(formatString);
+ }
+ if (run.end_time === null) {
+ return moment.duration(this.now.diff(start)).format(formatString);
+ }
+ return moment.duration(end.diff(start)).format(formatString);
+ },
+ endTime(run) {
+ let formatString = "lll";
+ let end = moment(run.end_time);
+
+ if (run.end_time === null) {
+ return "";
+ }
+ return "Finished " + end.format(formatString);
+ },
+ endTimeHuman(run) {
+ let end = moment(run.end_time);
+
+ if (run.end_time === null) {
+ return "";
+ }
+ return end.fromNow();
}
+ },
+ created: function() {
+ window.setInterval(() => {
+ this.now = moment();
+ }, 500);
}
};