Skip to content

Commit

Permalink
Events added to Workflow Modal
Browse files Browse the repository at this point in the history
  • Loading branch information
AileenCleary committed Dec 28, 2024
1 parent 3c14ef0 commit 2611e5a
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/ui/src/components/EventTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ watch(eventsData, (newVal: any, oldVal: any) => {
text-align: center;
min-width: 120px;
}
</style>
</style>
58 changes: 2 additions & 56 deletions src/ui/src/components/Experiments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,62 +20,7 @@
{{ selectedExperiment.experiment_id }}
</v-card-title>
<v-card-text>
<div>
<h3 class="title">Workflows:</h3>
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-title>
<h4>workflow table</h4>
</v-expansion-panel-title>
<v-expansion-panel-text>
<WorkflowTable :workflows="experimentWorkflows" :workcell_state="workcell_state"/>
</v-expansion-panel-text>
</v-expansion-panel>
<v-expansion-panel>
<v-expansion-panel-title>
<h4>workflow list</h4>
</v-expansion-panel-title>
<v-expansion-panel-text>
<v-list dense>
<v-list-item v-for="workflow in experimentWorkflows" :key="workflow.run_id">
<v-list-item-content>
<v-list-item-title>{{ workflow.name }}</v-list-item-title>
<v-list-item-subtitle>Status: {{ workflow.status }}</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
</div>
<div>
<h3 class="title">Events:</h3>
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-title>
<h4>event table</h4>
</v-expansion-panel-title>
<v-expansion-panel-text>
<EventTable :items="experimentEvents"/>
</v-expansion-panel-text>
</v-expansion-panel>
<v-expansion-panel>
<v-expansion-panel-title>
<h4>event list</h4>
</v-expansion-panel-title>
<v-expansion-panel-text>
<v-list dense>
<v-list-item v-for="event in experimentEvents" :key="event.event_id">
<v-list-item-content>
<v-list-item-title>{{ event.event_name.toLowerCase() }}</v-list-item-title>
<v-list-item-subtitle>Type: {{ event.event_type.toLowerCase() }}</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
</div>
<ShowEvents :filteredEvents="experimentEvents"/>
<div>
<h3>Details:</h3>
<vue-json-pretty v-if="selectedExperiment" :data="selectedExperiment" :deep="1"></vue-json-pretty>
Expand Down Expand Up @@ -141,6 +86,7 @@ import {
} from '@/store';
import EventTable from './EventTable.vue';
import ShowEvents from './ShowEvents.vue';
import WorkflowTable from './WorkflowTable.vue';
const sortBy: VDataTable['sortBy'] = [{ key: 'experiment_id', order: 'desc' }];
Expand Down
29 changes: 26 additions & 3 deletions src/ui/src/components/ModuleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</v-card-title>

<v-card-text class="subheading grey--text">
<ShowEvents :filteredEvents="moduleEvents"/>
<div>
<h3>Actions</h3>
<v-expansion-panels>
Expand Down Expand Up @@ -142,13 +143,23 @@
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { get_status } from '../store';
import 'vue-json-pretty/lib/styles.css';
import {
computed,
ref,
} from 'vue';
import VueJsonPretty from 'vue-json-pretty';
import 'vue-json-pretty/lib/styles.css';
import {
events,
get_status,
} from '../store';
import LockUnlockButton from './AdminButtons/LockUnlockButton.vue';
import ShutdownButton from './AdminButtons/ShutdownButton.vue';
import ShowEvents from './ShowEvents.vue';
const props = defineProps(['modal_title', 'modal_text', 'main_url', 'wc_state'])
const arg_headers = [
{ title: 'Name', key: 'name' },
Expand Down Expand Up @@ -291,6 +302,18 @@ function copyAction(test: any) {
navigator.clipboard.writeText(test)
alert("Copied!")
}
const moduleEvents = computed(() => {
return events.value.filter((event: any) => {
const eventName = event.event_name
? event.event_name === "STEP"
: true;
const moduleName = props.modal_title
? event.step.module === props.modal_title
: true;
return eventName && moduleName;
});
});
</script>

<style>
Expand Down
50 changes: 50 additions & 0 deletions src/ui/src/components/ShowEvents.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<div>
<h3 class="title">Events:</h3>
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-title>
<h4>event table</h4>
</v-expansion-panel-title>
<v-expansion-panel-text>
<EventTable :items="filteredEvents"/>
</v-expansion-panel-text>
</v-expansion-panel>
<v-expansion-panel>
<v-expansion-panel-title>
<h4>event list</h4>
</v-expansion-panel-title>
<v-expansion-panel-text>
<v-list dense>
<v-list-item v-for="event in filteredEvents" :key="event.event_id">
<v-list-item-content>
<v-list-item-title>{{ event.event_name.toLowerCase() }}</v-list-item-title>
<v-list-item-subtitle>Type: {{ event.event_type.toLowerCase() }}</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
</div>
</template>

<script setup lang="ts">
import {
computed,
PropType,
ref,
} from 'vue';
/// <reference path="../store.d.ts" />
import { events } from '@/store';
import EventTable from './EventTable.vue';
const props = defineProps({
filteredEvents: {
type: Array as PropType<Array<any>>,
required: true,
},
});
</script>
22 changes: 21 additions & 1 deletion src/ui/src/components/WorkflowModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<v-sheet class="pa-2 rounded-lg text-md-center text-white" :class="'wf_status_' + modal_text.status">{{ modal_text.status }}</v-sheet>
</v-card-title>
<v-card-text>
<ShowEvents :filteredEvents="workflowEvents"/>
<Workflow :steps="modal_text.steps" :wf="modal_text" />
</v-card-text>
<v-card-actions>
Expand All @@ -18,8 +19,27 @@
</template>

<script setup lang="ts">
import { ref } from 'vue';
import {
computed,
ref,
} from 'vue';
import { events } from '@/store';
import ShowEvents from './ShowEvents.vue';
const props = defineProps(['modal_title', 'modal_text'])
const flowdef = ref(false)
const workflowEvents = computed(() => {
return events.value.filter((event: any) => {
const eventType = event.event_type
? event.event_type === "WORKFLOW"
: true;
const matchWorkflow = props.modal_text?.run_id
? event.run_id === props.modal_text?.run_id
: true;
return eventType && matchWorkflow;
});
});
</script>

0 comments on commit 2611e5a

Please sign in to comment.