1414 item-key =" eventId"
1515 :sort-by =" ['timestamp', 'eventId']"
1616 :sort-desc =" [true, true]"
17+ single-expand
18+ show-expand
1719 >
1820 <template #item .type =" { value } " >
1921 <EventType :type =" value" />
2426 value
2527 }}</router-link >
2628 </template >
29+
30+ <template #item .args =" { item , value } " >
31+ <span v-if =" isExpandable(item)" >
32+ {{ $t("events.eventName") }}{{ $t("separator")
33+ }}<code >{{ item.eventName }}</code >
34+ </span >
35+ <span v-else-if =" item.type === 'disconnection'" >
36+ {{ $t("events.reason") }}{{ $t("separator")
37+ }}<code >{{ value }}</code >
38+ </span >
39+ <span
40+ v-else-if =" item.type === 'room_joined' || item.type === 'room_left'"
41+ >
42+ {{ $t("events.room") }}{{ $t("separator") }}<code >{{ value }}</code >
43+ </span >
44+ <span v-else >
45+ {{ value }}
46+ </span >
47+ </template >
48+
49+ <template #item .data-table-expand =" { item , isExpanded , expand } " >
50+ <v-btn
51+ @click =" expand(true)"
52+ v-if =" isExpandable(item) && !isExpanded"
53+ icon
54+ >
55+ <v-icon >mdi-chevron-down</v-icon >
56+ </v-btn >
57+ <v-btn
58+ @click =" expand(false)"
59+ v-if =" isExpandable(item) && isExpanded"
60+ icon
61+ >
62+ <v-icon >mdi-chevron-up</v-icon >
63+ </v-btn >
64+ </template >
65+
66+ <template #expanded-item =" { headers , item } " >
67+ <td :colspan =" headers.length" >
68+ <div class =" ma-3" >
69+ {{ $t("events.eventArgs") }}{{ $t("separator") }}
70+ <pre ><code >{{ item.args }}</code ></pre >
71+ </div >
72+ </td >
73+ </template >
2774 </v-data-table >
2875 </v-card >
2976 </div >
@@ -42,7 +89,7 @@ export default {
4289 data () {
4390 return {
4491 footerProps: {
45- " items-per-page-options" : [20 , 100 , - 1 ],
92+ " items-per-page-options" : [- 1 ],
4693 },
4794 };
4895 },
@@ -73,10 +120,10 @@ export default {
73120 sortable: false ,
74121 },
75122 {
76- text: this .$t (" args" ),
77123 value: " args" ,
78124 sortable: false ,
79125 },
126+ { text: " " , value: " data-table-expand" },
80127 ];
81128 },
82129 ... mapGetters (" main" , [" events" ]),
@@ -92,6 +139,9 @@ export default {
92139 params: { nsp: this .selectedNamespace .name , id: sid },
93140 };
94141 },
142+ isExpandable (item ) {
143+ return [" event_received" , " event_sent" ].includes (item .type );
144+ },
95145 },
96146};
97147 </script >
0 commit comments