diff --git a/accounts/profile.js b/accounts/profile.js index 76949c3..2cd7f7c 100755 --- a/accounts/profile.js +++ b/accounts/profile.js @@ -322,6 +322,7 @@ async function generateAccountPage(name, cookie, admin) { modifiedHTML = modifiedHTML.replaceAll("{{ url_gen }}", `https://selenite.cc/u/${userData.username}`); modifiedHTML = modifiedHTML.replaceAll("{{ online_time }}", dayjs(userData.last_login).fromNow()); modifiedHTML = modifiedHTML.replaceAll("{{ css_edit }}", (userData.badges ? userData.badges.length : 0) > 0 ? '' : ""); + modifiedHTML = modifiedHTML.replaceAll("{{ staff_buttons }}", await isAdmin(cookie) ? "admin panel" : ""); if(songData) { modifiedHTML = modifiedHTML.replaceAll("{{ song_title }}", sanitizeHtml(songData.name, allowNone)); modifiedHTML = modifiedHTML.replaceAll("{{ song_artist }}", sanitizeHtml(songData.artist, allowNone)); @@ -329,6 +330,8 @@ async function generateAccountPage(name, cookie, admin) { modifiedHTML = modifiedHTML.replaceAll("{{ is_music }}", "true"); } else { modifiedHTML = modifiedHTML.replaceAll("{{ is_music }}", "false"); + modifiedHTML = modifiedHTML.replaceAll("{{ song_title }}", "no song selected..."); + modifiedHTML = modifiedHTML.replaceAll("{{ song_artist }}", ""); } let badges_html = ""; diff --git a/html/admin.html b/html/admin.html index 8202531..8973eb3 100755 --- a/html/admin.html +++ b/html/admin.html @@ -5,92 +5,67 @@ https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff --> - - + + + + + + + + + + + - + - - + + + - Profile + Selenite - - - -
- Home - Bookmarklets - Games - Apps - Settings - Open Blank - -
+ -
- - - - -
- + + + +

admin page

+ + + diff --git a/html/profile_edit.html b/html/profile_edit.html index 0fb07e3..d6cccee 100755 --- a/html/profile_edit.html +++ b/html/profile_edit.html @@ -406,13 +406,13 @@
- - + +

{{ name }}'s profile

-

click on one of the following areas to edit

-

profile picture, name, song, and about me

+

click on an area to edit

share your profile at {{ url_gen }}

+ {{ staff_buttons }}
diff --git a/html/stats.html b/html/stats.html index e69de29..40359c6 100755 --- a/html/stats.html +++ b/html/stats.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Selenite + + + + + +

stats

+ + diff --git a/index.js b/index.js index f40c4e3..f592736 100755 --- a/index.js +++ b/index.js @@ -64,6 +64,13 @@ wss.on("connection", function connection(ws, req, res) { const updateAccount = accs.query(`UPDATE accounts SET last_login = $login WHERE username = $user`) updateAccount.get({ $login: new Date().toUTCString(), $user: ws.id }); } + } else if (message.startsWith("annc")) { + let splitMessage = message.split(";;"); + if(await isAdmin(splitMessage[1])) { + wss.clients.forEach(client => { + client.send(`annc;;${splitMessage[2]};;${splitMessage[3]}`); + }) + } } });