Skip to content

Commit

Permalink
add terminal prop to workflow metrics for a running workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Dec 10, 2024
1 parent 9260b81 commit 8838d2c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { BButtonGroup, BCol, BContainer, BRow } from "bootstrap-vue";
import { BAlert, BButtonGroup, BCol, BContainer, BRow } from "bootstrap-vue";
import type { VisualizationSpec } from "vega-embed";
import { computed, ref, watch } from "vue";
import { type ComputedRef } from "vue";
Expand All @@ -8,16 +8,16 @@ import { type components, GalaxyApi } from "@/api";
import { getAppRoot } from "@/onload/loadConfig";
import { errorMessageAsString } from "@/utils/simple-error";
import LoadingSpan from "../LoadingSpan.vue";
import HelpText from "@/components/Help/HelpText.vue";
const VegaWrapper = () => import("./VegaWrapper.vue");
const props = defineProps({
invocationId: {
type: String,
required: true,
},
});
interface Props {
invocationId: string;
terminal?: boolean;
}
const props = defineProps<Props>();
const groupBy = ref<"tool_id" | "step_id">("tool_id");
const timing = ref<"seconds" | "minutes" | "hours">("seconds");
Expand All @@ -44,7 +44,11 @@ async function fetchMetrics() {
}
}
watch(props, () => fetchMetrics(), { immediate: true });
watch(
() => props.invocationId,
() => fetchMetrics(),
{ immediate: true }
);
function itemToX(item: components["schemas"]["WorkflowJobMetric"]) {
if (groupBy.value === "tool_id") {
Expand Down Expand Up @@ -380,6 +384,10 @@ const groupByInTitles = computed(() => {

<template>
<div>
<BAlert v-if="!props.terminal" variant="warning" show>
<LoadingSpan
message="The workflow might still be running. Metrics will update and change as the workflow progresses." />
</BAlert>
<BContainer>
<BRow align-h="end" class="mb-2">
<BButtonGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ async function onCancel() {
</BBadge>
</template>
<div v-if="invocationAndJobTerminal">
<WorkflowInvocationExportOptions :invocation-id="invocation.id" />
<WorkflowInvocationExportOptions
:invocation-id="invocation.id"
:terminal="invocationAndJobTerminal" />
</div>
<BAlert v-else variant="info" show>
<LoadingSpan message="Waiting to complete invocation" />
Expand Down

0 comments on commit 8838d2c

Please sign in to comment.