Skip to content

Commit 8a864df

Browse files
authored
Merge pull request #8684 from ProcessMaker/task/FOUR-28750
Task/FOUR-28750: Show events logs details for each log session
2 parents 7ea2dc3 + 8b3993e commit 8a864df

7 files changed

Lines changed: 1068 additions & 9 deletions

File tree

resources/js/admin/logs/components/Logs/AgentSessionDetail/AgentSessionDetail.vue

Lines changed: 929 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import AgentSessionDetail from "./AgentSessionDetail.vue";
2+
3+
export { AgentSessionDetail };
4+
export default AgentSessionDetail;
5+

resources/js/admin/logs/components/Logs/BaseTable/BaseTable.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
<tr
2121
v-for="(item, idx) in data"
2222
:key="idx"
23-
class="tw-border-t tw-border-zinc-200"
23+
class="tw-border-t tw-border-zinc-200 tw-transition-colors"
24+
:class="[
25+
clickable ? 'tw-cursor-pointer hover:tw-bg-blue-50' : '',
26+
isSelected(item) ? 'tw-bg-blue-50' : ''
27+
]"
28+
@click="handleRowClick(item, idx)"
2429
>
2530
<td
2631
v-for="column in columns"
@@ -47,6 +52,9 @@ export default {
4752
props: {
4853
columns: { type: Array, required: true },
4954
data: { type: Array, required: true },
55+
clickable: { type: Boolean, default: false },
56+
selectedItem: { type: Object, default: null },
57+
itemKey: { type: String, default: 'id' },
5058
},
5159
methods: {
5260
getRawValue(item, column) {
@@ -65,6 +73,15 @@ export default {
6573
6674
return value;
6775
},
76+
handleRowClick(item, index) {
77+
if (this.clickable) {
78+
this.$emit('row-click', item, index);
79+
}
80+
},
81+
isSelected(item) {
82+
if (!this.selectedItem) return false;
83+
return item[this.itemKey] === this.selectedItem[this.itemKey];
84+
},
6885
},
6986
};
7087
</script>

resources/js/admin/logs/components/Logs/HeaderBar/HeaderBar.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
class="tw-rounded-lg tw-px-3 tw-py-2 tw-text-base"
3939
:class="tabClasses('design')"
4040
>
41-
{{ $t('Design Mode Logs') }}
41+
{{ $t('FlowGenie Studio Logs') }}
4242
</RouterLink>
4343
<RouterLink
4444
to="/agents/execution"
4545
class="tw-rounded-lg tw-px-3 tw-py-2 tw-text-base"
4646
:class="tabClasses('execution')"
4747
>
48-
{{ $t('Execution Logs') }}
48+
{{ $t('Runtime Logs') }}
4949
</RouterLink>
5050
</div>
5151

@@ -83,6 +83,11 @@ export default {
8383
props: {
8484
value: { type: String, default: '' },
8585
},
86+
data() {
87+
return {
88+
debounceTimer: null,
89+
};
90+
},
8691
computed: {
8792
isEmailCategory() {
8893
return this.$route.path.startsWith('/email');
@@ -100,6 +105,12 @@ export default {
100105
immediate: true,
101106
},
102107
},
108+
beforeDestroy() {
109+
// Clear debounce timer when component is destroyed
110+
if (this.debounceTimer) {
111+
clearTimeout(this.debounceTimer);
112+
}
113+
},
103114
methods: {
104115
tabClasses(tab) {
105116
const currentRoute = this.$route.params.logType;
@@ -110,9 +121,24 @@ export default {
110121
},
111122
onInput(event) {
112123
this.$emit('input', event.target.value);
124+
this.debouncedSearch();
125+
},
126+
debouncedSearch() {
127+
// Clear existing timer
128+
if (this.debounceTimer) {
129+
clearTimeout(this.debounceTimer);
130+
}
131+
// Set new timer - wait 300ms after user stops typing
132+
this.debounceTimer = setTimeout(() => {
133+
this.$emit('search');
134+
}, 300);
113135
},
114136
onKeypress(event) {
137+
// Allow immediate search on Enter key
115138
if (event.charCode === 13) {
139+
if (this.debounceTimer) {
140+
clearTimeout(this.debounceTimer);
141+
}
116142
this.$emit('search');
117143
}
118144
},

resources/js/admin/logs/components/Logs/LogContainer/LogContainer.vue

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<div class="tw-flex tw-gap-3 tw-px-4 tw-h-full tw-min-h-0 tw-overflow-hidden">
33
<sidebar class="tw-shrink-0" />
44

5-
<section class="tw-flex-1 tw-min-w-0 tw-min-h-0 tw-overflow-hidden">
5+
<section
6+
class="tw-min-w-0 tw-min-h-0 tw-overflow-hidden tw-transition-all tw-duration-300"
7+
:class="selectedSession ? 'tw-w-1/2' : 'tw-flex-1'"
8+
>
69
<div class="tw-flex tw-flex-col tw-rounded-xl tw-border tw-border-zinc-200 tw-p-4 tw-bg-white tw-h-full">
710
<header-bar
811
v-model="search"
@@ -37,25 +40,47 @@
3740
</div>
3841
</div>
3942

40-
<RouterView ref="routerView" class="tw-flex tw-flex-col tw-flex-1 tw-min-h-0" />
43+
<RouterView
44+
ref="routerView"
45+
class="tw-flex tw-flex-col tw-flex-1 tw-min-h-0"
46+
@session-selected="onSessionSelected"
47+
/>
4148
</div>
4249
</div>
4350
</section>
51+
52+
<!-- Session Detail Panel -->
53+
<transition name="slide-fade">
54+
<section
55+
v-if="selectedSession"
56+
class="tw-w-1/2 tw-min-h-0 tw-overflow-hidden tw-min-w-[680px]"
57+
>
58+
<div class="tw-rounded-xl tw-border tw-border-zinc-200 tw-bg-white tw-h-full tw-overflow-hidden">
59+
<agent-session-detail
60+
:session="selectedSession"
61+
@close="onCloseDetail"
62+
/>
63+
</div>
64+
</section>
65+
</transition>
4466
</div>
4567
</template>
4668

4769
<script>
4870
import { Sidebar } from '../Sidebar';
4971
import { HeaderBar } from '../HeaderBar';
72+
import { AgentSessionDetail } from '../AgentSessionDetail';
5073
5174
export default {
5275
components: {
5376
Sidebar,
5477
HeaderBar,
78+
AgentSessionDetail,
5579
},
5680
data() {
5781
return {
5882
search: '',
83+
selectedSession: null,
5984
};
6085
},
6186
computed: {
@@ -71,8 +96,8 @@ export default {
7196
title() {
7297
if (this.isAgentsCategory) {
7398
const agentTitles = {
74-
design: 'Design Mode Logs',
75-
execution: 'Execution Logs',
99+
design: 'FlowGenie Studio Logs',
100+
execution: 'Runtime Logs',
76101
};
77102
return agentTitles[this.logType] ?? 'FlowGenie Agents Logs';
78103
}
@@ -92,13 +117,43 @@ export default {
92117
return `/admin/logs/export/csv?type=${this.logType}&search=${this.search}`;
93118
},
94119
},
120+
watch: {
121+
// Clear selection when navigating to different log type
122+
'$route.path': {
123+
handler() {
124+
this.selectedSession = null;
125+
},
126+
},
127+
},
95128
methods: {
96129
onHandleSearch() {
97130
if (this.$refs.routerView) {
98131
this.$refs.routerView.refresh({ search: this.search });
99132
}
100133
},
134+
onSessionSelected(session) {
135+
this.selectedSession = session;
136+
},
137+
onCloseDetail() {
138+
this.selectedSession = null;
139+
// Also clear selection in the table
140+
if (this.$refs.routerView?.clearSelection) {
141+
this.$refs.routerView.clearSelection();
142+
}
143+
},
101144
},
102145
};
103146
</script>
104147
148+
<style scoped>
149+
.slide-fade-enter-active,
150+
.slide-fade-leave-active {
151+
transition: all 0.3s ease;
152+
}
153+
154+
.slide-fade-enter,
155+
.slide-fade-leave-to {
156+
transform: translateX(20px);
157+
opacity: 0;
158+
}
159+
</style>

resources/js/admin/logs/components/Logs/LogTable/LogTable.vue

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
v-else
3636
:columns="columns"
3737
:data="data"
38+
:clickable="isAgentCategory"
39+
:selected-item="selectedSession"
40+
item-key="session_id"
41+
@row-click="handleRowClick"
3842
>
3943
<!-- Custom case_number cell with link to case -->
4044
<template #cell-case_number="{ value }">
@@ -131,6 +135,8 @@ export default {
131135
totalPages: 1,
132136
perPage: 15,
133137
loading: false,
138+
selectedSession: null,
139+
currentSearch: '',
134140
};
135141
},
136142
computed: {
@@ -215,15 +221,20 @@ export default {
215221
}
216222
return `/api/1.1/email-start-event/logs/${this.logType}`;
217223
},
224+
isAgentCategory() {
225+
return this.category === 'agents';
226+
},
218227
},
219228
watch: {
220229
category: {
221230
handler() {
231+
this.clearSelection();
222232
this.resetAndFetch();
223233
},
224234
},
225235
logType: {
226236
handler() {
237+
this.clearSelection();
227238
this.resetAndFetch();
228239
},
229240
immediate: true,
@@ -234,6 +245,7 @@ export default {
234245
this.page = 1;
235246
this.perPage = 15;
236247
this.totalPages = 1;
248+
this.currentSearch = '';
237249
this.fetchData();
238250
},
239251
async fetchData(params = {}) {
@@ -263,10 +275,14 @@ export default {
263275
},
264276
handlePageChange(newPage) {
265277
this.page = newPage;
266-
this.fetchData();
278+
this.fetchData({ search: this.currentSearch });
267279
},
268280
refresh(params = {}) {
269281
this.page = 1;
282+
// Store search for pagination
283+
if (params.search !== undefined) {
284+
this.currentSearch = params.search;
285+
}
270286
this.fetchData(params);
271287
},
272288
getStatusClasses(status) {
@@ -285,6 +301,16 @@ export default {
285301
};
286302
return statusLabels[status] || status;
287303
},
304+
handleRowClick(item) {
305+
if (this.isAgentCategory) {
306+
this.selectedSession = item;
307+
this.$emit('session-selected', item);
308+
}
309+
},
310+
clearSelection() {
311+
this.selectedSession = null;
312+
this.$emit('session-selected', null);
313+
},
288314
},
289315
};
290316
</script>

resources/lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,8 @@
908908
"Event": "Event",
909909
"Exclusive Gateway": "Exclusive Gateway",
910910
"Execution Error": "Execution Error",
911-
"Execution Logs": "Execution Logs",
911+
"Runtime Logs": "Runtime Logs",
912+
"FlowGenie Studio Logs": "FlowGenie Studio Logs",
912913
"Execution Log": "Execution Log",
913914
"Executor Successfully Built. You can now close this window. ": "Executor Successfully Built. You can now close this window. ",
914915
"Existing Array": "Existing Array",

0 commit comments

Comments
 (0)