feat(webpanel): enable searching by user note
This commit is contained in:
@ -311,7 +311,8 @@ $(function () {
|
|||||||
const searchText = $("#searchInput").val().toLowerCase();
|
const searchText = $("#searchInput").val().toLowerCase();
|
||||||
$("#userTable tbody tr.user-main-row").each(function () {
|
$("#userTable tbody tr.user-main-row").each(function () {
|
||||||
const username = $(this).find("td:eq(2)").text().toLowerCase();
|
const username = $(this).find("td:eq(2)").text().toLowerCase();
|
||||||
const isVisible = username.includes(searchText);
|
const note = $(this).data("note").toLowerCase();
|
||||||
|
const isVisible = username.includes(searchText) || note.includes(searchText);
|
||||||
$(this).toggle(isVisible);
|
$(this).toggle(isVisible);
|
||||||
if (!isVisible) {
|
if (!isVisible) {
|
||||||
$(this).next('tr.user-details-row').hide();
|
$(this).next('tr.user-details-row').hide();
|
||||||
|
|||||||
@ -144,7 +144,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for user in users|sort(attribute='username', case_sensitive=false) %}
|
{% for user in users|sort(attribute='username', case_sensitive=false) %}
|
||||||
<tr class="user-main-row">
|
<tr class="user-main-row" data-note="{{ user.note or '' }}">
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" class="user-checkbox" value="{{ user.username }}">
|
<input type="checkbox" class="user-checkbox" value="{{ user.username }}">
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user