Skip to content

Commit ef7433b

Browse files
committed
[systemlogs] Update audit logs table row
- Add click handler for row expansion - Add utility class to change row cursor to pointer
1 parent 55ef3f0 commit ef7433b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

plugins/systemlogs/frontend/public/javascripts/countly.views.js

+9
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@
210210
return x < y ? -1 : x > y ? 1 : 0;
211211
});
212212
return arr;
213+
},
214+
handleTableRowClick: function(row) {
215+
// Only expand row if text inside of it are not highlighted
216+
if (window.getSelection().toString().length === 0) {
217+
this.$refs.table.$refs.elTable.toggleRowExpansion(row);
218+
}
219+
},
220+
tableRowClassName: function() {
221+
return 'bu-is-clickable';
213222
}
214223
}
215224
});

plugins/systemlogs/frontend/public/templates/logs.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h2> {{i18n('systemlogs.title')}} </h2>
1010
<cly-main>
1111
<cly-date-picker-g class="bu-mb-4"></cly-date-picker-g>
1212
<cly-section class="bu-mt-4">
13-
<cly-datatable-n :data-source="remoteTableDataSource" :export-api="getExportAPI" :default-sort="{prop: 'ts', order: 'descending'}">
13+
<cly-datatable-n :data-source="remoteTableDataSource" :export-api="getExportAPI" :default-sort="{prop: 'ts', order: 'descending'}" @row-click="handleTableRowClick" ref="table" :row-class-name="tableRowClassName">
1414
<template v-slot="scope">
1515
<el-table-column type="expand">
1616
<template slot-scope="rowScope">
@@ -43,14 +43,14 @@ <h2> {{i18n('systemlogs.title')}} </h2>
4343
<template v-slot:header-left>
4444
<cly-select-x
4545
:search-placeholder="i18n('common.search')"
46-
placeholder=""
46+
placeholder=""
4747
v-model="selectAction"
4848
v-on:change="changeAction"
4949
:options="allActions">
5050
</cly-select-x>
5151
<cly-select-x
5252
:search-placeholder="i18n('common.search')"
53-
placeholder=""
53+
placeholder=""
5454
v-model="selectUser"
5555
v-on:change="changeUser"
5656
:options="allUsers" class="bu-ml-4">

0 commit comments

Comments
 (0)