sub showing results
This commit is contained in:
parent
02c88293d8
commit
03139848c6
@ -289,6 +289,7 @@ async function loadSubscriptions(guildId, page=1, pageSize=null) {
|
|||||||
const subscriptions = await getSubscriptions(guildId, page, pageSize);
|
const subscriptions = await getSubscriptions(guildId, page, pageSize);
|
||||||
subTable.rows.add(subscriptions.results).draw(false);
|
subTable.rows.add(subscriptions.results).draw(false);
|
||||||
handleSubPagination(page, pageSize, subscriptions.count, subscriptions.next, subscriptions.previous);
|
handleSubPagination(page, pageSize, subscriptions.count, subscriptions.next, subscriptions.previous);
|
||||||
|
handleSubPageInfo(subscriptions.results.length, subscriptions.count);
|
||||||
$("#subTable thead .table-select-all").prop("disabled", subscriptions.results.length === 0);
|
$("#subTable thead .table-select-all").prop("disabled", subscriptions.results.length === 0);
|
||||||
console.debug("loading subs, " + subscriptions.results.length + " found");
|
console.debug("loading subs, " + subscriptions.results.length + " found");
|
||||||
}
|
}
|
||||||
@ -305,6 +306,11 @@ $("#subTablePageSize").on("change", async function() {
|
|||||||
loadSubscriptions(getCurrentlyActiveServer().guild_id, page, pageSize);
|
loadSubscriptions(getCurrentlyActiveServer().guild_id, page, pageSize);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function handleSubPageInfo(showing, total) {
|
||||||
|
$("#subTablePageInfo .pageinfo-showing").text(showing);
|
||||||
|
$("#subTablePageInfo .pageinfo-total").text(total);
|
||||||
|
}
|
||||||
|
|
||||||
// Update the UI pagination options according to the passed data.
|
// Update the UI pagination options according to the passed data.
|
||||||
function handleSubPagination(currentPage, pageSize, totalItems, nextExists, prevExists) {
|
function handleSubPagination(currentPage, pageSize, totalItems, nextExists, prevExists) {
|
||||||
|
|
||||||
|
@ -104,10 +104,10 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div id="serverTabContent" class="tab-content">
|
<div id="serverTabContent" class="tab-content">
|
||||||
<div id="subscriptionsTabPane" class="tab-pane fade" role="tabpanel" aria-labelledby="subscriptionsTab" tabindex="0">
|
<div id="subscriptionsTabPane" class="tab-pane fade" role="tabpanel" aria-labelledby="subscriptionsTab" tabindex="0">
|
||||||
<div class="table-responsive my-3">
|
<div class="table-responsive my-3 px-3">
|
||||||
<table id="subTable" class="table table-hover align-middle"></table>
|
<table id="subTable" class="table table-hover align-middle"></table>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-controls d-flex mb-3">
|
<div class="table-controls d-flex mb-3 px-3">
|
||||||
<nav id="subPagination">
|
<nav id="subPagination">
|
||||||
<ul class="pagination mb-0">
|
<ul class="pagination mb-0">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
@ -118,7 +118,11 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="d-flex ms-auto">
|
<div id="subTablePageInfo" class="d-flex align-items-center mx-auto">
|
||||||
|
showing <span class="pageinfo-showing"></span>
|
||||||
|
of <span class="pageinfo-total"></span>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex">
|
||||||
<label for="subTablePageSize" class="form-label align-self-center mb-0 me-2">Per Page</label>
|
<label for="subTablePageSize" class="form-label align-self-center mb-0 me-2">Per Page</label>
|
||||||
<select name="subTablePageSize" id="subTablePageSize" class="select-2">
|
<select name="subTablePageSize" id="subTablePageSize" class="select-2">
|
||||||
<option value="10" selected>10 </option>
|
<option value="10" selected>10 </option>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user