simpleadmin-web 0.1.0: web panel for CS2-SimpleAdmin
This commit is contained in:
commit
4f38daf0e6
31 changed files with 6870 additions and 0 deletions
13
internal/web/assets/signin.js
Normal file
13
internal/web/assets/signin.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Explains why someone landed on the sign-in page: a failed Steam sign-in, or an account without a
|
||||
// staff rank.
|
||||
const err = new URLSearchParams(location.search).get("signin");
|
||||
if (err) {
|
||||
const box = $("#signin-error");
|
||||
box.textContent = `Steam sign-in didn't work: ${err.replace(/^steam: /, "")}`;
|
||||
box.hidden = false;
|
||||
}
|
||||
api("/api/me").then((me) => {
|
||||
if (me.signedIn && !me.staff) {
|
||||
$("#signin-msg").textContent = `You're signed in as ${me.steamid}, but that account has no staff rank on this server. Sign in with a different Steam account, or ask an admin to add you.`;
|
||||
}
|
||||
}).catch(() => {});
|
||||
Loading…
Add table
Add a link
Reference in a new issue