|
1 | 1 | <script setup lang="ts"> |
2 | | -import {CollectorConfigAndWork, CollectorConfig} from "./data"; |
| 2 | +import {BenchmarkJob, CollectorInfo, CollectorConfig} from "./data"; |
3 | 3 |
|
4 | 4 | const props = defineProps<{ |
5 | | - collector: CollectorConfigAndWork; |
| 5 | + collector: CollectorInfo; |
| 6 | + jobMap: Dict<BenchmarkJob>; |
6 | 7 | }>(); |
7 | 8 |
|
8 | 9 | function statusClass(c: CollectorConfig): string { |
9 | 10 | return c.isActive ? "active" : "inactive"; |
10 | 11 | } |
| 12 | +
|
| 13 | +function getStartedAt(j: BenchmarkJob): string { |
| 14 | + return "startedAt" in j.status ? j.status.startedAt : ""; |
| 15 | +} |
11 | 16 | </script> |
12 | 17 |
|
13 | 18 | <template> |
@@ -55,59 +60,43 @@ function statusClass(c: CollectorConfig): string { |
55 | 60 | </div> |
56 | 61 | </div> |
57 | 62 |
|
58 | | - <div v-if="collector.request !== null"> |
59 | | - <div class="table-collector-wrapper"> |
60 | | - <table class="table-collector"> |
61 | | - <caption> |
62 | | - current benchmark request |
63 | | - </caption> |
64 | | - <thead> |
65 | | - <tr class="table-header-row"> |
66 | | - <th class="table-header-padding">Type</th> |
67 | | - <th class="table-header-padding">Created At</th> |
68 | | - <th class="table-header-padding">Sha / Tag</th> |
69 | | - </tr> |
70 | | - </thead> |
71 | | - <tbody> |
72 | | - <tr> |
73 | | - <td class="table-cell-padding">{{ collector.request.type }}</td> |
74 | | - <td class="table-cell-padding"> |
75 | | - {{ collector.request.createdAt }} |
76 | | - </td> |
77 | | - <td class="table-cell-padding">{{ collector.request.tag }}</td> |
78 | | - </tr> |
79 | | - </tbody> |
80 | | - </table> |
81 | | - </div> |
82 | | - |
83 | | - <div class="table-collector-wrapper"> |
84 | | - <table class="table-collector" style="border-collapse: collapse"> |
85 | | - <caption> |
86 | | - current benchmark jobs |
87 | | - </caption> |
88 | | - <thead> |
89 | | - <tr class="table-header-row"> |
90 | | - <th class="table-header-padding">State</th> |
91 | | - <th class="table-header-padding">Started At</th> |
92 | | - <th class="table-header-padding">Backend</th> |
93 | | - <th class="table-header-padding">Profile</th> |
94 | | - <th class="table-header-padding">Dequeue Counter</th> |
95 | | - </tr> |
96 | | - </thead> |
97 | | - <tbody> |
98 | | - <tr v-for="j in collector.jobs"> |
99 | | - <td class="table-cell-padding">{{ j.state }}</td> |
100 | | - <td class="table-cell-padding">{{ j.startedAt }}</td> |
101 | | - <td class="table-cell-padding">{{ j.backend }}</td> |
102 | | - <td class="table-cell-padding">{{ j.profile }}</td> |
103 | | - <td class="table-cell-padding">{{ j.dequeCounter }}</td> |
104 | | - </tr> |
105 | | - </tbody> |
106 | | - </table> |
107 | | - </div> |
| 63 | + <div class="table-collector-wrapper"> |
| 64 | + <table class="table-collector" style="border-collapse: collapse"> |
| 65 | + <caption> |
| 66 | + current benchmark jobs |
| 67 | + </caption> |
| 68 | + <thead> |
| 69 | + <tr class="table-header-row"> |
| 70 | + <th class="table-header-padding">Tag / Sha</th> |
| 71 | + <th class="table-header-padding">State</th> |
| 72 | + <th class="table-header-padding">Started At</th> |
| 73 | + <th class="table-header-padding">Backend</th> |
| 74 | + <th class="table-header-padding">Profile</th> |
| 75 | + <th class="table-header-padding">Dequeue Counter</th> |
| 76 | + </tr> |
| 77 | + </thead> |
| 78 | + <tbody> |
| 79 | + <tr v-for="id in collector.jobIds"> |
| 80 | + <td class="table-cell-padding"> |
| 81 | + {{ jobMap[id].requestTag }} |
| 82 | + </td> |
| 83 | + <td class="table-cell-padding"> |
| 84 | + {{ jobMap[id].status.state }} |
| 85 | + </td> |
| 86 | + <td class="table-cell-padding"> |
| 87 | + {{ getStartedAt(jobMap[id]) }} |
| 88 | + </td> |
| 89 | + <td class="table-cell-padding">{{ jobMap[id].backend }}</td> |
| 90 | + <td class="table-cell-padding">{{ jobMap[id].profile }}</td> |
| 91 | + <td class="table-cell-padding"> |
| 92 | + {{ jobMap[id].dequeCounter }} |
| 93 | + </td> |
| 94 | + </tr> |
| 95 | + </tbody> |
| 96 | + </table> |
108 | 97 | </div> |
109 | 98 |
|
110 | | - <div class="collector-no-work" v-if="collector.request === null"> |
| 99 | + <div class="collector-no-work" v-if="collector.jobIds.length === 0"> |
111 | 100 | <h3>no active benchmarks 🦦</h3> |
112 | 101 | </div> |
113 | 102 | </div> |
|
0 commit comments