Skip to content

Commit 9c6a750

Browse files
committed
Add eventType filtering
1 parent bcf4582 commit 9c6a750

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

client/routes/execution/history.vue

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@
2323
<table v-if="format === 'grid' && showTable" :class="{ compact: compactDetails }">
2424
<thead ref="thead">
2525
<th>ID</th>
26-
<th>Type</th>
26+
<th>Type <v-select
27+
class="eventType"
28+
value="--"
29+
:options="eventTypes"
30+
:on-change="setEventType"
31+
:searchable="false"
32+
/>
33+
34+
</th>
2735
<th>
2836
<a class="elapsed" :href="tsFormat === 'elapsed' ? null : '#'" @click.prevent="setTsFormat('elapsed')">Elapsed</a> /
2937
<a class="ts" :href="tsFormat === 'elapsed' ? '#' : null" @click.prevent="setTsFormat('ts')">Time</a>
@@ -35,7 +43,7 @@
3543
</thead>
3644
<div class="spacer"></div>
3745
<tbody>
38-
<tr v-for="(he, i) in $parent.results"
46+
<tr v-for="(he, i) in filteredEvents"
3947
:key="he.eventId"
4048
:data-event-type="he.eventType"
4149
:data-event-id="he.eventId"
@@ -100,6 +108,14 @@ export default {
100108
tsFormat: localStorage.getItem(`${this.$route.params.domain}:history-ts-col-format`) || 'elapsed',
101109
compactDetails: localStorage.getItem(`${this.$route.params.domain}:history-compact-details`) === 'true',
102110
splitEnabled: false,
111+
eventType: "",
112+
eventTypes: [
113+
{ value: 'Decision', label: 'Decision' },
114+
{ value: 'Activity', label: 'Activity' },
115+
{ value: 'Signal', label: 'Signal' },
116+
{ value: 'Child Workflow', label: 'Child Workflow' },
117+
{ value: 'Others', label: 'Others' },
118+
],
103119
splitSizes: [20, 80]
104120
}
105121
},
@@ -108,6 +124,7 @@ export default {
108124
this.$watch('format', this.scrollEventIntoView.bind(this, true))
109125
this.$watch('eventId', this.scrollEventIntoView.bind(this, false))
110126
127+
this.eventType = ""
111128
this.recalcThWidths = debounce(() => {
112129
if (!this.$refs.thead) return
113130
var ths = Array.from(this.$refs.thead.querySelectorAll('th'))
@@ -155,9 +172,22 @@ export default {
155172
},
156173
exportFilename() {
157174
return `${this.$route.params.workflowId.replace(/[\\~#%&*{}\/:<>?|\"-]/g, ' ')} - ${this.$route.params.runId}.json`
158-
}
175+
},
176+
filteredEvents(){
177+
return this.$parent.results.filter(function(u) {
178+
if (this.eventType && this.eventType != "--"){
179+
return u.eventType.startsWith(this.eventType)
180+
}else{
181+
return true
182+
}
183+
})
184+
},
185+
159186
},
160187
methods: {
188+
setEventType(et){
189+
this.eventType = et
190+
},
161191
setFormat(format) {
162192
this.$router.replace({
163193
query: Object.assign({}, this.$route.query, { format })

0 commit comments

Comments
 (0)