-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0305c9
commit 642a12b
Showing
45 changed files
with
713 additions
and
235 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ serverkt/build | |
serverkt/out | ||
serverkt/.kotlin | ||
serverkt/*.jar | ||
serverkt/blocklist.txt |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,171 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Administrator Tools | Floofi Voice Generator</title> | ||
<link rel="stylesheet" href="https://fella.floo.fi/0.3.3/fella.min.css" integrity="sha384-1Im8AmCEPI7+gL0sQFNekjJ/RE5oo3q2Up8muPiUO5Ho6QKmdx74KgECaEx4yWqV" crossorigin="anonymous"> | ||
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml"> | ||
<!--suppress JSUnusedGlobalSymbols --> | ||
<script> | ||
let FF_FOUC_FIX; | ||
</script> | ||
<script src="/assets/src/config.js"></script> | ||
</head> | ||
<body> | ||
<br><br> | ||
|
||
<main> | ||
<div id="loader" class="fella-loader-container"> | ||
<svg class="fella-loader" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="shape-rendering: auto; display: block; background: transparent;"> | ||
<g><g transform="rotate(0 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.9166666666666666s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(30 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.8333333333333334s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(60 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.75s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(90 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.6666666666666666s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(120 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.5833333333333334s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(150 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.5s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(180 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.4166666666666667s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(210 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.3333333333333333s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(240 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.25s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(270 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.16666666666666666s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(300 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="-0.08333333333333333s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g transform="rotate(330 50 50)"> | ||
<rect fill="#8f8f8f" height="16" width="5" ry="2.56" rx="2.5" y="22" x="47.5"> | ||
<animate repeatCount="indefinite" begin="0s" dur="1s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate> | ||
</rect> | ||
</g><g></g></g> | ||
</svg> | ||
</div> | ||
|
||
<div id="prompt" style="display: none;"> | ||
<div id="navbar-placeholder"></div> | ||
|
||
<section class="fella-section fella-container fella-section-linked"> | ||
<h2 class="fella-title">Administrator Tools</h2> | ||
|
||
<div style="margin-top: 20px;" id="list-outer"> | ||
<div id="list" class="fella-list-container" style="display: none;"></div> | ||
<div id="list-message" style="font-style: italic;">Loading generations to review...</div> | ||
<div id="list-message2">There are no more generations that need review.</div> | ||
</div> | ||
</section> | ||
</div> | ||
|
||
<script src="/assets/src/navbar.js"></script> | ||
<script> | ||
(async () => { | ||
let code = (await (await fetch(window.SERVER + "/api/v2/status", { | ||
credentials: "include", | ||
headers: { | ||
"Authorization": localStorage.getItem('token') ? "PrivateToken " + localStorage.getItem('token') : '' | ||
} | ||
})).json()).error?.code; | ||
|
||
if (code === 401) { | ||
location.href = "/"; | ||
} else if (code === 403) { | ||
location.href = "/banned"; | ||
} else { | ||
let allowed = (await (await fetch(window.SERVER + "/api/v2/admin/available", { | ||
credentials: "include", | ||
headers: { | ||
"Authorization": localStorage.getItem('token') ? "PrivateToken " + localStorage.getItem('token') : '' | ||
} | ||
})).json()).output['available']; | ||
|
||
if (allowed) { | ||
await prepareNavbar(); | ||
await load(); | ||
document.getElementById("loader").style.display = "none"; | ||
document.getElementById("prompt").style.display = ""; | ||
} else { | ||
location.href = "/app"; | ||
} | ||
} | ||
})(); | ||
|
||
async function completeReview(id) { | ||
document.getElementById("list").style.display = "none"; | ||
document.getElementById("list-message").style.display = ""; | ||
document.getElementById("list-message2").style.display = "none"; | ||
|
||
await fetch(window.SERVER + "/api/v2/admin/history/" + id, { | ||
method: "DELETE", | ||
credentials: "include", | ||
headers: { | ||
"Authorization": localStorage.getItem('token') ? "PrivateToken " + localStorage.getItem('token') : '' | ||
} | ||
}); | ||
|
||
await load(); | ||
} | ||
|
||
async function load() { | ||
window.generations = (await (await fetch(window.SERVER + "/api/v2/admin/history", { | ||
credentials: "include", | ||
headers: { | ||
"Authorization": localStorage.getItem('token') ? "PrivateToken " + localStorage.getItem('token') : '' | ||
} | ||
})).json()).output.history; | ||
|
||
document.getElementById("list").innerHTML = window.generations.map(i => ` | ||
<div class="fella-list-item fella-list-item-padded" style="display: grid; grid-template-columns: 1fr 2.5fr .5fr; grid-gap: 30px;"> | ||
<span><b>${i['authorName']}</b><br>${i.status}<br>${i['model']}</span> | ||
<span>${i['input']}</span> | ||
<span> | ||
<a href="#" onclick="completeReview('${i.id}');">Review</a> / <a target="_blank" href="${i['audioUrl']}">View</a><br> | ||
<a href="#" onclick="navigator.clipboard.writeText('${i['authorId']}');">Copy user ID</a><br> | ||
<a href="#" onclick="navigator.clipboard.writeText('${i.id}');">Copy job ID</a> | ||
</span> | ||
</div> | ||
`).join(""); | ||
|
||
if (window.generations.length > 0) { | ||
document.getElementById("list").style.display = ""; | ||
document.getElementById("list-message").style.display = "none"; | ||
document.getElementById("list-message2").style.display = "none"; | ||
} else { | ||
document.getElementById("list").style.display = "none"; | ||
document.getElementById("list-message").style.display = "none"; | ||
document.getElementById("list-message2").style.display = ""; | ||
} | ||
} | ||
</script> | ||
</main> | ||
|
||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
window.SERVER = "http://127.0.0.1:8080"; | ||
if (location.hostname === 'localhost' || location.hostname === '127.0.0.1') { | ||
window.SERVER = "http://127.0.0.1:8080"; | ||
} else { | ||
window.SERVER = "https://voice-api.floo.fi"; | ||
} |
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
Oops, something went wrong.