2022-02-08 18:58:19 +00:00
|
|
|
<html>
|
|
|
|
<style>
|
|
|
|
[v-cloak] { display: none; }
|
|
|
|
html {
|
|
|
|
background-color: #333;
|
|
|
|
color: #fff;
|
|
|
|
font-family: monospace;
|
|
|
|
}
|
|
|
|
span.event {
|
|
|
|
background-color: #e3e3ff3f;
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
display: inline-block;
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
margin-right: 5px;
|
|
|
|
padding: 0.1rem 0.5rem;
|
|
|
|
white-space: pre;
|
|
|
|
}
|
|
|
|
table {
|
|
|
|
border-spacing: 10px;
|
|
|
|
margin: 0 auto;
|
|
|
|
max-width: 1200px;
|
|
|
|
}
|
|
|
|
td {
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
th {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<table>
|
2023-12-25 12:29:16 +00:00
|
|
|
<tr><th>Time</th><th>Reason</th><th>Event</th><th>Fields</th></tr>
|
2022-02-08 18:58:19 +00:00
|
|
|
<tr v-for="event in events">
|
|
|
|
<td>{{ moment(event.time).format('YYYY-MM-DD HH:mm:ss') }}</td>
|
2023-12-25 12:29:16 +00:00
|
|
|
<td>{{ event.reason }}</td>
|
2022-02-08 18:58:19 +00:00
|
|
|
<td>{{ event.event }}</td>
|
|
|
|
<td>
|
|
|
|
<span
|
|
|
|
class="event"
|
|
|
|
v-for="field in formattedFields(event.fields)"
|
|
|
|
>{{ field }}</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/combine/npm/vue@2,npm/moment@2"></script>
|
|
|
|
<script type="module">
|
2023-08-14 13:44:23 +00:00
|
|
|
import EventClient from './eventclient.js'
|
2022-02-08 18:58:19 +00:00
|
|
|
|
|
|
|
new Vue({
|
|
|
|
computed: {
|
|
|
|
maxEventLen() {
|
|
|
|
return this.events
|
|
|
|
.map(evt => evt.event.length)
|
|
|
|
.reduce((ml, cl) => cl > ml ? cl : ml, 0)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data: {
|
|
|
|
events: [],
|
|
|
|
},
|
|
|
|
|
|
|
|
el: '#app',
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
formattedFields(fields) {
|
|
|
|
return Object.entries(fields).map(el => `${el[0]}="${el[1]}"`).sort()
|
|
|
|
},
|
|
|
|
moment,
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2022-02-20 12:52:40 +00:00
|
|
|
window.botClient = new EventClient({
|
2022-02-08 18:58:19 +00:00
|
|
|
handlers: {
|
2023-12-25 12:29:16 +00:00
|
|
|
_: ({ fields, reason, time, type }) => {
|
|
|
|
if (window.botClient.paramOptionFallback('hide', '').split(',').includes(type)) {
|
2022-10-23 11:17:41 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-02-08 18:58:19 +00:00
|
|
|
this.events = [
|
2023-12-25 12:29:16 +00:00
|
|
|
{ event: type, fields, reason, time },
|
2022-02-08 18:58:19 +00:00
|
|
|
...this.events,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
replay: true,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</html>
|