-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*add bans page + endpoint *update menu
- Loading branch information
Showing
6 changed files
with
266 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function addReasonOption(endpoint, reasons) { | ||
let content = ""; | ||
|
||
reasons.forEach((reason, id) => { | ||
content += `<button | ||
role="option" | ||
data-${endpoint}-setting-select-dropdown-btn="reason" | ||
value="${reason}" | ||
class="${ | ||
id === reasons.length - 1 ? "rounded-b" : "" | ||
} border-b border-l border-r border-gray-300 dark:hover:brightness-90 hover:brightness-90 bg-white text-gray-700 my-0 relative py-2 px-3 text-left align-middle transition-all rounded-none cursor-pointer leading-normal text-sm ease-in tracking-tight-rem dark:border-slate-600 dark:bg-slate-700 dark:text-gray-300" | ||
> | ||
${reason} | ||
</button>`; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
{% extends "base.html" %} {% block content %} {% set current_endpoint = | ||
url_for(request.endpoint)[1:].split("/")[-1].strip() %} | ||
<!-- info--> | ||
<div | ||
class="col-span-12 md:col-span-4 3xl:col-span-3 p-4 relative min-w-0 break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border" | ||
> | ||
<h5 class="mb-2 font-bold dark:text-white/90">INFO</h5> | ||
<div class="mx-1 flex items-center my-4"> | ||
<p | ||
class="transition duration-300 ease-in-out font-bold mb-0 font-sans text-sm leading-normal uppercase dark:text-gray-500 dark:opacity-80" | ||
> | ||
BANS TOTAL | ||
</p> | ||
<p | ||
class="transition duration-300 ease-in-out pl-2 col-span-1 mb-0 font-sans text-sm font-semibold leading-normal uppercase dark:text-white dark:opacity-80" | ||
> | ||
{{bans|length}} | ||
</p> | ||
</div> | ||
</div> | ||
<!-- end info --> | ||
|
||
<!-- filter --> | ||
<div | ||
data-{{current_endpoint}}-filter | ||
class="col-span-12 md:col-span-8 2xl:col-span-6 3xl:col-span-5 p-4 relative flex flex-col min-w-0 break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border" | ||
> | ||
<h5 class="mb-2 font-bold dark:text-white/90">FILTER</h5> | ||
<div class="mx-2 grid grid-cols-12 gap-x-4 gap-y-2"> | ||
<!-- search inpt--> | ||
<div class="flex flex-col relative col-span-12 md:col-span-6"> | ||
<h5 | ||
class="my-1 transition duration-300 ease-in-out dark:opacity-90 text-sm sm:text-md font-bold m-0 dark:text-gray-300" | ||
> | ||
Search | ||
</h5> | ||
<label for="keyword" class="sr-only">search</label> | ||
<input | ||
type="text" | ||
id="keyword" | ||
name="keyword" | ||
class="dark:border-slate-600 dark:bg-slate-700 dark:text-gray-300 disabled:opacity-75 focus:valid:border-green-500 focus:invalid:border-red-500 outline-none focus:border-primary text-sm leading-5.6 ease block w-full appearance-none rounded-lg border border-solid border-gray-300 bg-white bg-clip-padding px-3 py-1 font-normal text-gray-700 transition-all placeholder:text-gray-500" | ||
placeholder="keyword" | ||
pattern="(.*?)" | ||
required | ||
/> | ||
</div> | ||
<!-- end search inpt--> | ||
|
||
<!-- select reason --> | ||
<div class="flex flex-col relative col-span-12 md:col-span-6"> | ||
<h5 | ||
class="my-1 transition duration-300 ease-in-out dark:opacity-90 text-sm sm:text-md font-bold m-0 dark:text-gray-300" | ||
> | ||
Reason | ||
</h5> | ||
<button | ||
aria-controls="filter-state" | ||
data-{{current_endpoint}}-setting-select="reason" | ||
class="disabled:opacity-75 dark:disabled:text-gray-300 disabled:text-gray-700 disabled:bg-gray-400 disabled:border-gray-400 dark:disabled:bg-gray-800 dark:disabled:border-gray-800 duration-300 ease-in-out dark:opacity-90 dark:border-slate-600 dark:bg-slate-700 dark:text-gray-300 focus:border-green-500 flex justify-between align-middle items-center text-left text-sm leading-5.6 ease w-full rounded-lg border border-solid border-gray-300 bg-white bg-clip-padding px-1.5 py-1 md:px-3 font-normal text-gray-700 transition-all placeholder:text-gray-500" | ||
> | ||
<span | ||
aria-description="current filter state value" | ||
id="{{current_endpoint}}-reason" | ||
data-name="{{current_endpoint}}-reason" | ||
data-{{current_endpoint}}-setting-select-text="reason" | ||
>all</span | ||
> | ||
<!-- chevron --> | ||
<svg | ||
data-{{current_endpoint}}-setting-select="reason" | ||
class="transition-transform h-4 w-4 fill-gray-500" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 512 512" | ||
> | ||
<path | ||
d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" | ||
/> | ||
</svg> | ||
</button> | ||
<!-- end chevron --> | ||
<!-- dropdown--> | ||
<div | ||
id="filter-state" | ||
role="listbox" | ||
data-{{current_endpoint}}-setting-select-dropdown="reason" | ||
class="hidden z-100 absolute h-full flex-col w-full translate-y-16" | ||
> | ||
<button | ||
role="option" | ||
data-{{current_endpoint}}-setting-select-dropdown-btn="reason" | ||
value="all" | ||
class="border-t rounded-t border-b border-l border-r border-gray-300 dark:hover:brightness-90 hover:brightness-90 my-0 relative py-2 px-3 text-left align-middle transition-all rounded-none cursor-pointer leading-normal text-sm ease-in tracking-tight-rem dark:border-slate-600 dark:text-gray-300 dark:bg-primary bg-primary text-gray-300" | ||
> | ||
all | ||
</button> | ||
</div> | ||
<!-- end dropdown--> | ||
</div> | ||
<!-- end select success --> | ||
</div> | ||
</div> | ||
<!-- end filter --> | ||
|
||
<div | ||
class="w-full overflow-hidden overflow-y-auto overflow-x-auto max-h-100 sm:max-h-125 min-h-50-screen col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border" | ||
> | ||
<div data-{{current_endpoint}}-bans-list> | ||
<h5 class="mb-4 mt-2 font-bold dark:text-white/90 mx-2">BANS LIST</h5> | ||
<!-- list container--> | ||
<div class="min-w-[900px] w-full grid grid-cols-12 rounded p-2"> | ||
<!-- header--> | ||
<p | ||
class="dark:text-gray-300 h-8 text-sm font-bold col-span-3 m-0 pb-2 border-b border-gray-400" | ||
> | ||
Select | ||
</p> | ||
<p | ||
class="dark:text-gray-300 h-8 text-sm font-bold col-span-3 m-0 pb-2 border-b border-gray-400" | ||
> | ||
IP | ||
</p> | ||
<p | ||
class="dark:text-gray-300 h-8 text-sm font-bold col-span-1 m-0 pb-2 border-b border-gray-400" | ||
> | ||
Reason | ||
</p> | ||
<p | ||
class="dark:text-gray-300 h-8 text-sm font-bold col-span-1 m-0 pb-2 border-b border-gray-400" | ||
> | ||
Ban start | ||
</p> | ||
<p | ||
class="dark:text-gray-300 h-8 text-sm font-bold col-span-1 m-0 pb-2 border-b border-gray-400" | ||
> | ||
Ban end | ||
</p> | ||
<!-- end header--> | ||
<!-- list --> | ||
<ul class="col-span-12 w-full" data-{{current_endpoint}}-list> | ||
{% for request, value in bans.items() %} | ||
<li | ||
data-{{current_endpoint}}-list-item="{{request}}" | ||
data-{{current_endpoint}}-list-item-value="{{value}}" | ||
class="items-center grid grid-cols-12 border-b border-gray-300 py-2.5" | ||
> | ||
<p | ||
|
||
class="dark:text-gray-400 dark:opacity-80 text-sm col-span-3 m-0 my-1" | ||
data-{{current_endpoint}}-select | ||
> | ||
<input type="checkbox" name="{{request}}" value="{{request}}" class="" /> | ||
</p> | ||
<p | ||
|
||
class="dark:text-gray-400 dark:opacity-80 text-sm col-span-3 m-0 my-1" | ||
data-{{current_endpoint}}-ip | ||
> | ||
{{value['ip']}} | ||
</p> | ||
<p | ||
|
||
class="dark:text-gray-400 dark:opacity-80 text-sm col-span-1 m-0 my-1" | ||
data-{{current_endpoint}}-reason | ||
> | ||
{{value["reason"]}} | ||
</p> | ||
<p | ||
|
||
class="dark:text-gray-400 dark:opacity-80 text-sm col-span-1 m-0 my-1" | ||
data-{{current_endpoint}}-ban_start | ||
> | ||
{{value["ban_start"]}} | ||
</p> | ||
<p | ||
|
||
class="dark:text-gray-400 dark:opacity-80 text-sm col-span-1 m-0 my-1" | ||
data-{{current_endpoint}}-ban_end | ||
> | ||
{{value["ban_end"]}} | ||
</p> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<!-- end list--> | ||
</div> | ||
<!-- end list container--> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters