Skip to content

Commit dae053d

Browse files
committed
feat: add detail modal to log view
1 parent 277d9f3 commit dae053d

3 files changed

Lines changed: 45 additions & 5 deletions

File tree

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-logs/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Component.register('frosh-tools-tab-logs', {
1818
totalLogEntries: 0,
1919
limit: 25,
2020
page: 1,
21-
isLoading: true
21+
isLoading: true,
22+
displayedLog: null
2223
};
2324
},
2425

@@ -84,6 +85,14 @@ Component.register('frosh-tools-tab-logs', {
8485
this.page = page.page;
8586
this.limit = page.limit;
8687
await this.onFileSelected();
87-
}
88+
},
89+
90+
showInfoModal(entryContents) {
91+
this.displayedLog = entryContents;
92+
},
93+
94+
closeInfoModal() {
95+
this.displayedLog = null;
96+
},
8897
}
8998
});

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-logs/template.twig

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<template slot="column-date" slot-scope="{ item }">
2323
{{ item.date | date({hour: '2-digit', minute: '2-digit', second: '2-digit'}) }}
2424
</template>
25+
<template slot="column-message" slot-scope="{ item }">
26+
<a @click="showInfoModal(item)">{{ item.message | raw }}</a>
27+
</template>
2528
</sw-data-grid>
2629

2730
<sw-pagination
@@ -31,4 +34,34 @@
3134
@page-change="onPageChange"
3235
></sw-pagination>
3336
</sw-card>
37+
38+
<sw-modal v-if="displayedLog"
39+
variant="large">
40+
41+
<template slot="modal-header">
42+
<div class="sw-modal__titles">
43+
<h4 class="sw-modal__title">
44+
{{ displayedLog.channel }} - {{ displayedLog.level }}
45+
</h4>
46+
47+
<h5 class="sw-modal__subtitle">
48+
{{ displayedLog.date | date({hour: '2-digit', minute: '2-digit', second: '2-digit'}) }}
49+
</h5>
50+
</div>
51+
52+
<button
53+
class="sw-modal__close"
54+
:title="$tc('global.sw-modal.labelClose')"
55+
:aria-label="$tc('global.sw-modal.labelClose')"
56+
@click="closeInfoModal"
57+
>
58+
<sw-icon
59+
name="regular-times-s"
60+
small
61+
/>
62+
</button>
63+
</template>
64+
65+
<div v-html="displayedLog.message"></div>
66+
</sw-modal>
3467
</sw-card-view>

src/Resources/public/administration/js/frosh-tools.js

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)