Added the 'setup help' icons and changed the domain name

This commit is contained in:
ION606
2022-07-31 14:02:17 +03:00
parent e1c028789a
commit c49999071f
4 changed files with 39 additions and 22 deletions
+29 -13
View File
@@ -239,6 +239,17 @@
color: #ffffff;
background-color: #377aea;
}
.helpbtn {
margin-top: 30px;
margin-bottom: 30px;
font-size: 20px;
align-self: right;
padding: 0px;
border-radius: 50%;
border-style: solid;
}
</style>
<script>
@@ -246,9 +257,9 @@
window.onload = () => {
var serverSettings = JSON.parse(window.localStorage.getItem('serverInfo'));
//Load the channels serverSettings.Id
//Load the channels
var xhr = new XMLHttpRequest();
xhr.open('get', 'https://selmer-bot-website.herokuapp.com/getChannels/', true);
xhr.open('get', `http://selmerbot.com/getChannels/`, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverNumber', serverSettings.Id);
xhr.onloadend = (e) => {
@@ -304,6 +315,10 @@
}
xhr.send();
//Get serverId
// xhr2 = new XMLHttpRequest();
// xhr.open('get', 'http://localhost:53134/getCal', true);
// xhr.setRequestHeader('userId', serverSettings)
}
@@ -373,7 +388,7 @@
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://selmer-bot-website.herokuapp.com/sendData/', true);
xhr.open('post', 'http://selmerbot.com/sendData/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverSettings', JSON.stringify(serverSettings));
@@ -420,7 +435,6 @@
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">Hover over me!</button> -->
<div class="container" style="font-family: 'Rajdhani', sans-serif; color: white;"><h1>Selmer Bot Web Dashboard</h1></div>
<span class="ms-auto" style="margin-right: 1%;">
<!-- <button id="login" class="loginbtn" onclick="window.location = getAPIRedirect()">Log Into Dashboard</button> -->
<button onclick="logout()" id="logoutbtn" class="logoutbtn" style="display: none;"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log Out"></i></button>
<button onclick="window.location = getAPIRedirect()" id="loginbtn" class="loginbtn"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log In"></i></button>
</span>
@@ -436,39 +450,38 @@
<div id="buttons" class="buttonsmainbar">
<button onclick="divChange('welcome')" class="btnside">Welcome</button>
<button onclick="divChange('log')" class="btnside">Logging</button>
<!-- <button onclick="divChange('cal')" class="btnside">Calendar</button> -->
</div>
</div>
<!-- EVERYTHING NOT SIDEBAR -->
<div style="margin-left:15%">
<div id="inputs">
<div id="welcome", class="hide wc" style="margin-top: 20px;">
<button class="helpbtn" onclick="alert('Use {sn} to insert the server name, {un} to insert the user name, and {ut} to insert the user tag\nExample: Welcome to {sn} Sir {un}#{ut}')"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.downloadclipart.net%2Flarge%2F45627-icon-with-question-mark-clipart.png&f=1&nofb=1" style="width: 50px; border-radius: 50%; border-style: solid;"></button>
<form>
<label for="wc">Welcome Channel Name:</label>
<!-- <input type="text" id="wc" name="wc"><br><br> -->
<select id="welcomechanneldropdown" class="form-select mb-5" aria-label="Default select example">
<option selected=""></option>
</select>
<label for="wm">Welcome Message:</label>
<input type="text" id="wm" name="wm"><br><br>
<!-- <label for="welcomebanner">Last name:</label>
<input type="text" id="wb" name="wb"><br><br> -->
<input type="submit" value="Submit", class="submitButton" onclick="sendData(event, { 'inp': 'welcome' })">
</form>
</div>
<!-- <template> -->
<div id="log", class="hide lg">
<button style="margin-top: 30px; margin-bottom: 20px; font-size: 20px; align-self: right;" onclick="alert('When setting the log severity, setting the tier will also include all higher tiers\nFor example, using !setup log_severity none will log things from every severity')">Help</button>
<button class="helpbtn" onclick="alert('When setting the log severity, setting the tier will also include all higher tiers\nFor example, using !setup log_severity none will log things from every severity')"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.downloadclipart.net%2Flarge%2F45627-icon-with-question-mark-clipart.png&f=1&nofb=1" style="width: 50px; border-radius: 50%; border-style: solid;"></button>
<form>
<label for="kl">Keep Logs?</label>
<input type="checkbox" id="kl" name="kl"><br><br>
<label class="ps-1" for="lc">Log Channel Name:</label>
<!-- <input type="text" id="lc" name="lc"><br><br> -->
<select id="logchanneldropdown" class="form-select mb-5" aria-label="Default select example">
<option selected=""></option>
</select>
@@ -492,9 +505,12 @@
<input type="submit" value="Submit", class="submitButton" onclick="sendData(event, { 'inp': 'logs' })">
</form>
</div>
</div>
<!-- </template> -->
<div id="cal", class="hide wc" style="margin-top: 20px;">
<button class="helpbtn" onclick="alert('Use {sn} to insert the server name, {un} to insert the user name, and {ut} to insert the user tag\nExample: Welcome to {sn} Sir {un}#{ut}')"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.downloadclipart.net%2Flarge%2F45627-icon-with-question-mark-clipart.png&f=1&nofb=1" style="width: 50px; border-radius: 50%; border-style: solid;"></button>
</div>
</div>
</div>
</body>
+7 -5
View File
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<!-- MAKE SURE THE PERSON CAN'T CHANGE THE SERVER NUMBER AND ACCESS RANDOM SERVERS -->
<html>
<head>
<meta charset="UTF-8">
@@ -160,7 +161,7 @@
</style>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> (no github icon so...) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script>
function generateRandomString() {
@@ -241,12 +242,12 @@
// alert('Loading, please hold!\nps - You can close this alert :)');
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://selmer-bot-website.herokuapp.com/user/', true);
xhr.open('post', 'http://selmerbot.com/user/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('guilds', JSON.stringify(owned));
xhr.setRequestHeader('userId', window.localStorage.getItem('Id'));
xhr.onloadend = (e) => { window.localStorage.setItem('guilds', (JSON.stringify(xhr.response))); window.location = 'https://selmer-bot-website.herokuapp.com/myGuilds.html'; }
xhr.onloadend = (e) => { window.localStorage.setItem('guilds', (JSON.stringify(xhr.response))); window.location = 'http://selmerbot.com/myGuilds.html'; }
xhr.send(JSON.stringify(owned));
}).then((r) => {
@@ -257,12 +258,13 @@
</script>
<script>
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://selmer-bot-website.herokuapp.com -->
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! http://selmerbot.com/ -->
function getAPIRedirect() {
if (window.location.href.indexOf('localhost') != -1) {
return 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
return "https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmer-bot-website.herokuapp.com%2F&response_type=token&scope=identify%20guilds"
// return "https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmer-bot-website.herokuapp.com%2F&response_type=token&scope=identify%20guilds"
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=http%3A%2F%2Fselmerbot.com%2F&response_type=code&scope=identify%20guilds';
}
}
+1 -2
View File
@@ -84,7 +84,6 @@ app.post('/getServer', async (req, res) => {
connection.then((client) => {
const dbo = client.db(id).collection('SETUP');
dbo.find().toArray(async (err, docs) => {
if (err) { return console.error(err); }
const m = new Map();
m.set('Id', id);
@@ -167,7 +166,7 @@ app.get('/', async ({ query }, response) => {
client_secret: clientSecret,
code,
grant_type: 'authorization_code',
redirect_uri: `https://selmer-bot-website.herokuapp.com`,
redirect_uri: `http://selmerbot.com/`,
scope: 'identify',
}),
headers: {
+2 -2
View File
@@ -92,10 +92,10 @@
imagem.onclick = function() {
console.log('LOADING.....');
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://selmer-bot-website.herokuapp.com/getServer/', true);
xhr.open('post', 'http://selmerbot.com/getServer/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverNumber', guilds[i].id);
xhr.onloadend = (e) => { window.localStorage.setItem('serverInfo', (xhr.response)); window.location = 'https://selmer-bot-website.herokuapp.com/dashboard.html'; }
xhr.onloadend = (e) => { window.localStorage.setItem('serverInfo', (xhr.response)); window.location = 'http://selmerbot.com//dashboard.html'; }
xhr.send();
}
} else {