Sort IP addresses by ban time
This commit is contained in:
1016
svelte/package-lock.json
generated
1016
svelte/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ let navigate = (path, title) => {
|
|||||||
onMount(() => {
|
onMount(() => {
|
||||||
let newpage = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1)
|
let newpage = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1)
|
||||||
if (newpage === "admin") {
|
if (newpage === "admin") {
|
||||||
newpage = ""
|
newpage = "status"
|
||||||
}
|
}
|
||||||
page = newpage
|
page = newpage
|
||||||
})
|
})
|
||||||
@@ -27,8 +27,8 @@ onMount(() => {
|
|||||||
<div>
|
<div>
|
||||||
<a class="button"
|
<a class="button"
|
||||||
href="/admin"
|
href="/admin"
|
||||||
class:button_highlight={page === ""}
|
class:button_highlight={page === "status"}
|
||||||
on:click|preventDefault={() => {navigate("", "Status")}}>
|
on:click|preventDefault={() => {navigate("status", "Status")}}>
|
||||||
<i class="icon">home</i>
|
<i class="icon">home</i>
|
||||||
Status
|
Status
|
||||||
</a>
|
</a>
|
||||||
@@ -63,7 +63,7 @@ onMount(() => {
|
|||||||
</a>
|
</a>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
{#if page === ""}
|
{#if page === "status"}
|
||||||
<Home></Home>
|
<Home></Home>
|
||||||
{:else if page === "abuse_reports"}
|
{:else if page === "abuse_reports"}
|
||||||
<AbuseReports></AbuseReports>
|
<AbuseReports></AbuseReports>
|
||||||
|
@@ -17,7 +17,10 @@ const get_bans = async () => {
|
|||||||
if(resp.status >= 400) {
|
if(resp.status >= 400) {
|
||||||
throw new Error(resp.text());
|
throw new Error(resp.text());
|
||||||
}
|
}
|
||||||
rows = await resp.json();
|
rows = await resp.json()
|
||||||
|
rows.sort((a, b) => {
|
||||||
|
return b.ban_time.localeCompare(a.ban_time)
|
||||||
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(err);
|
alert(err);
|
||||||
} finally {
|
} finally {
|
||||||
|
Reference in New Issue
Block a user