add filters tab stuff
This commit is contained in:
parent
1a4694421b
commit
303a40a840
@ -4,6 +4,7 @@ $(document).ready(async function() {
|
||||
// await initContentTable();
|
||||
|
||||
initSubscriptionsModule();
|
||||
initFiltersModule();
|
||||
initContentModule();
|
||||
initMessageStylesModule();
|
||||
|
||||
|
@ -0,0 +1,52 @@
|
||||
const filterTableId = "#filterTable";
|
||||
|
||||
|
||||
// region Init Module
|
||||
|
||||
function initFiltersModule() {
|
||||
initializeDataTable(
|
||||
filterTableId,
|
||||
[
|
||||
{
|
||||
title: "Name",
|
||||
data: "name"
|
||||
},
|
||||
{
|
||||
title: "Match",
|
||||
data: "match"
|
||||
},
|
||||
{
|
||||
title: "Algorithm",
|
||||
data: "matching_algorithm"
|
||||
},
|
||||
{
|
||||
title: "Case Insensitive",
|
||||
data: "is_insensitive"
|
||||
},
|
||||
{
|
||||
title: "Type",
|
||||
data: "is_whitelist"
|
||||
}
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// region Load Data
|
||||
|
||||
$(document).on("selectedServerChange", async function() {
|
||||
await loadFilterData();
|
||||
});
|
||||
|
||||
$(filterTableId).on("doDataLoad", async function() {
|
||||
await loadFilterData();
|
||||
});
|
||||
|
||||
async function loadFilterData() {
|
||||
if (!selectedServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTableFilter(filterTableId, "server", selectedServer.id);
|
||||
await loadTableData(filterTableId, "/api/filters/", "GET");
|
||||
}
|
@ -1 +1,80 @@
|
||||
filters
|
||||
<div class="js-tableFilters row mt-4 mb-3 px-sm-3">
|
||||
<div class="col-md-6 col-lg-5 col-xl-4 col-xxl-3">
|
||||
<div class="table-search-group mb-lg-0 mb-3">
|
||||
<label for="searchForFilter" class="table-search-label">
|
||||
<i class="bi bi-search"></i>
|
||||
</label>
|
||||
<input type="search" id="searchForFilter" class="table-search-input disable-while-loading" placeholder="search">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-7 col-xl-8 col-xxl-9 text-md-end table-search-buttons">
|
||||
<div class="d-inline-block">
|
||||
<button type="button" class="table-new-btn btn btn-primary rounded-1">
|
||||
<i class="bi bi-plus-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-inline-block">
|
||||
<div class="dropdown table-sort-dropdown">
|
||||
<button type="button" class="btn btn-secondary rounded-1" data-bs-toggle="dropdown" data-bs-auto-close="outside">
|
||||
<i class="bi bi-sort-alpha-up"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><h6 class="dropdown-header">Sort By</h6></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-inline-block">
|
||||
<div class="dropdown table-filter-dropdown">
|
||||
<button type="button" class="btn btn-secondary rounded-1" data-bs-toggle="dropdown" data-bs-auto-close="outside">
|
||||
<i class="bi bi-funnel"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><h6 class="dropdown-header">Filter By</h6></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-inline-block">
|
||||
<button type="button" class="table-refresh-btn btn btn-outline-secondary rounded-1 disable-while-loading">
|
||||
<i class="bi bi-arrow-clockwise"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-inline-block">
|
||||
<button type="button" class="table-del-btn btn btn-danger rounded-1" disabled>
|
||||
<i class="bi bi-trash3"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="js-tableBody table-responsive my-3 px-sm-3">
|
||||
<table id="filterTable" class="table table-hover align-middle"></table>
|
||||
</div>
|
||||
<div class="js-tableControls row px-sm-3 mb-4">
|
||||
<div class="col-lg-6">
|
||||
<nav class="table-pagination mb-4 mb-lg-0 table-pagination-group"> <!-- TODO: continue here -->
|
||||
<ul class="pagination mb-0">
|
||||
<li class="page-item">
|
||||
<button type="button" class="page-link page-prev rounded-start-1">
|
||||
<i class="bi bi-chevron-left"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<button type="button" class="page-link page-next rounded-end-1">
|
||||
<i class="bi bi-chevron-right"></i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-lg-6 d-flex align-items-center justify-content-lg-end">
|
||||
<label for="filterTablePageSizer" class="form-label align-self-center mb-0 me-2">Show</label>
|
||||
<select name="filterTablePageSizer" id="filterTablePageSizer" class="select-2 table-page-sizer disable-while-loading">
|
||||
<option value="1">1 </option>
|
||||
<option value="10" selected>10 </option>
|
||||
<option value="15">15 </option>
|
||||
<option value="20">20 </option>
|
||||
<option value="25">25 </option>
|
||||
</select>
|
||||
<span class="ms-2">of </span>
|
||||
<span class="pageinfo-total text-nowrap">10</span>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user