-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathJobPanel.vue
More file actions
67 lines (56 loc) · 1.77 KB
/
Copy pathJobPanel.vue
File metadata and controls
67 lines (56 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script setup lang="ts">
import { faHdd, faWrench } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { computed } from "vue";
import { useRouter } from "vue-router/composables";
import type { JobBaseModel } from "@/api/jobs.js";
import { useHistoryStore } from "@/stores/historyStore.js";
import { useJobStore } from "@/stores/jobStore.js";
import GCard from "../Common/GCard.vue";
import JobState from "../JobStates/JobState.vue";
import ActivityPanel from "@/components/Panels/ActivityPanel.vue";
const jobsStore = useJobStore();
jobsStore.fetchAllJobs();
const filteredJobs = computed(() => {
return jobsStore.allJobs.filter((job) => job.tool_id != "__DATA_FETCH__")
})
const router = useRouter();
function historyName(historyId: string) {
const historyStore = useHistoryStore();
return historyStore.getHistoryNameById(historyId);
}
function cardClicked(job: JobBaseModel) {
// if (props.inPanel) {
// emit("invocation-clicked");
// }
router.push(`/jobs/${job.id}/view`);
}
</script>
<template>
<ActivityPanel
title="Running jobs"
go-to-all-title="Open Jobs List"
href="/workflows/jobs">
<GCard
v-for="job in filteredJobs"
:key="job.id"
clickable
:title="job.tool_id"
:title-icon="{icon: faWrench}"
:update-time="job.update_time"
@click="() => cardClicked(job)"
>
<template v-slot:description>
<Heading class="m-0" size="text">
<FontAwesomeIcon :icon="faHdd" fixed-width />
<small v-if="job.history_id" class="text-muted truncate-n-lines two-lines">
{{ historyName(job.history_id) }}
</small>
</Heading>
</template>
<template v-slot:badges>
<JobState :job="job" />
</template>
</GCard>
</ActivityPanel>
</template>