mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #17182 from mvdbeek/add_rerun_and_info_button_collection_operations
[23.2] Add rerun and show details buttons in expanded collection
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { useRouter } from "vue-router/composables";
|
||||
|
||||
import { HDCADetailed } from "@/api";
|
||||
import { getAppRoot } from "@/onload/loadConfig";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const props = defineProps<{
|
||||
dsc: HDCADetailed;
|
||||
}>();
|
||||
|
||||
const downloadUrl = computed(() => `${getAppRoot()}api/dataset_collections/${props.dsc.id}/download`);
|
||||
const rerunUrl = computed(() =>
|
||||
props.dsc.job_source_type == "Job" ? `/root?job_id=${props.dsc.job_source_id}` : null
|
||||
);
|
||||
const showCollectionDetailsUrl = computed(() =>
|
||||
props.dsc.job_source_type == "Job" ? `/jobs/${props.dsc.job_source_id}/view` : null
|
||||
);
|
||||
function onDownload() {
|
||||
window.location.href = downloadUrl.value;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<section>
|
||||
<nav class="content-operations d-flex justify-content-between bg-secondary">
|
||||
@@ -12,26 +36,29 @@
|
||||
<Icon class="mr-1" icon="download" />
|
||||
<span>Download</span>
|
||||
</b-button>
|
||||
<b-button
|
||||
v-if="showCollectionDetailsUrl"
|
||||
class="collection-job-details-btn px-1"
|
||||
title="Show Details"
|
||||
size="sm"
|
||||
variant="link"
|
||||
:href="showCollectionDetailsUrl"
|
||||
@click.prevent.stop="router.push(showCollectionDetailsUrl)">
|
||||
<icon icon="info-circle" />
|
||||
<span>Show Details</span>
|
||||
</b-button>
|
||||
<b-button
|
||||
v-if="rerunUrl"
|
||||
title="Rerun job"
|
||||
class="rounded-0 text-decoration-none"
|
||||
size="sm"
|
||||
variant="link"
|
||||
:href="rerunUrl"
|
||||
@click.prevent.stop="router.push(rerunUrl)">
|
||||
<Icon class="mr-1" icon="redo" />
|
||||
<span>Run Job Again</span>
|
||||
</b-button>
|
||||
</b-button-group>
|
||||
</nav>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
dsc: { type: Object, required: true },
|
||||
},
|
||||
computed: {
|
||||
/** @return {String} */
|
||||
downloadUrl() {
|
||||
return `${this.dsc.url}/download`;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onDownload() {
|
||||
window.location.href = this.downloadUrl;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user