diff --git a/src/components/rundetail.vue b/src/components/rundetail.vue index 6981b6e..cb66783 100644 --- a/src/components/rundetail.vue +++ b/src/components/rundetail.vue @@ -131,8 +131,8 @@ import vClickOutside from "v-click-outside"; import { cancelRun, stopRun, restartRun } from "@/util/data.js"; - import { userLocalRunLink, projectRunLink } from "@/util/link.js"; +import { runStatus, runResultClass } from "@/util/run.js"; export default { name: "RunDetail", @@ -154,6 +154,8 @@ export default { }; }, methods: { + runStatus: runStatus, + runResultClass: runResultClass, resetErrors() { this.stopRunError = null; this.cancelRunError = null; @@ -162,26 +164,6 @@ export default { stillRunning(run) { return run.result != "unknown" && run.phase == "running"; }, - runStatus(run) { - if (run.phase != "finished") return run.phase; - if (run.result != "unknown") return run.result; - if (run.stopping) return "stopping"; - - return run.result; - }, - runResultClass(run) { - let status = this.runStatus(run); - - if (status == "setuperror") return "setuperror"; - if (status == "queued") return "unknown"; - if (status == "cancelled") return "failed"; - if (status == "running") return "running"; - if (status == "stopping") return "failed"; - if (status == "stopped") return "failed"; - if (status == "success") return "success"; - if (status == "failed") return "failed"; - return "unknown"; - }, taskClass(task) { if (task.status == "success") return "success"; if (task.status == "failed") return "failed"; diff --git a/src/components/runs.vue b/src/components/runs.vue index bc0e892..4fd715c 100644 --- a/src/components/runs.vue +++ b/src/components/runs.vue @@ -81,6 +81,7 @@