Skip to content

Commit

Permalink
Add link from queue to search view
Browse files Browse the repository at this point in the history
  • Loading branch information
tukiains committed Oct 4, 2024
1 parent a615a3a commit 48ac2ed
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion frontend/src/views/QueueView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
<td class="status">{{ task.status }}</td>
<td>{{ task.siteId }}</td>
<td>{{ task.measurementDate }}</td>
<td>{{ task.productId }}</td>
<td>
<router-link v-if="task.status === 'done'" :to="generateLink(task)">{{ task.productId }}</router-link>
<span v-else>{{ task.productId }}</span>
</td>
<td>{{ task.instrumentInfo?.name || task.model?.id }}</td>
<td>
{{ task.status === "created" ? timeDifference(task.scheduledAt) : "" }}
Expand Down Expand Up @@ -184,6 +187,22 @@ function timeDifference(scheduledAt: string): string {
return `${diffMins} min`;
}
}

function generateLink(task: AugmentedTask) {
const query: Record<string, string> = {
site: task.siteId,
product: task.productId,
dateFrom: task.measurementDate,
dateTo: task.measurementDate,
};
if (task.instrumentInfo?.pid) {
query.instrumentPid = task.instrumentInfo.pid;
}
return {
path: "/search/data/",
query: query,
};
}
</script>

<style scoped lang="scss">
Expand Down

0 comments on commit 48ac2ed

Please sign in to comment.