-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): display and download execution inputs and outputs (#39)
close #29
- Loading branch information
1 parent
335d496
commit 1010f83
Showing
5 changed files
with
184 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<template> | ||
<div v-if="execution && outputs"> | ||
<hr /> | ||
<h2>{{$t('outputs') | cap}}</h2> | ||
<b-table | ||
responsive="xl" | ||
striped | ||
hover | ||
bordered | ||
:fields="fields" | ||
:items="outputs" | ||
class="mb-0" | ||
> | ||
<template v-slot:cell(value)="row"> | ||
<b-link | ||
class="btn btn-primary" | ||
v-if="row.item.download" | ||
target="_blank" | ||
:href="itemUrl({uri: row.item.value})" | ||
>{{$t('download') | cap}}</b-link> | ||
<span v-else>{{row.item.value}}</span> | ||
</template> | ||
</b-table> | ||
</div> | ||
</template> | ||
<script> | ||
import { mapState } from "vuex"; | ||
import { apiRoot } from "../../http"; | ||
export default { | ||
methods: { | ||
itemUrl(value) { | ||
return `${apiRoot}executions/${this.execution.id}/file?filePath=${value.uri}&type=${value.type}`; | ||
} | ||
}, | ||
computed: { | ||
...mapState("execution", ["execution"]), | ||
fields() { | ||
return [ | ||
{ | ||
key: "key", | ||
label: this.$t("name") | ||
}, | ||
{ | ||
key: "task", | ||
label: this.$t("task") | ||
}, | ||
{ | ||
key: "value", | ||
label: this.$t("value") | ||
} | ||
]; | ||
}, | ||
outputs() { | ||
const outputs = []; | ||
for (const task of this.execution.taskRunList) { | ||
for (const key in task.outputs) { | ||
const item = { key, value: task.outputs[key], task: task.id }; | ||
if (task.outputs[key].startsWith("kestra:///")) { | ||
item.download = true; | ||
} | ||
outputs.push(item); | ||
} | ||
} | ||
return outputs; | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters