Added the channel selection menu

This commit is contained in:
ION606
2022-07-27 15:34:38 +03:00
parent 60f5e5626c
commit d5583231df
4 changed files with 37 additions and 9 deletions
+1
View File
@@ -3,3 +3,4 @@ config.json
node_modules
index - old.html
makefile
temp.html
+32 -5
View File
@@ -133,6 +133,12 @@
letter-spacing: 1px;
}
.form-select {
width: 200px;
background-color:rgb(187, 183, 183);
border-color: #000000;
}
</style>
<!-- Buttons -->
@@ -246,8 +252,22 @@
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverNumber', serverSettings.Id);
xhr.onloadend = (e) => {
window.localStorage.setItem('channels', (xhr.response));
document.getElementById('body').classList.replace('hide', 'show');
//Channel Section
const channels = JSON.parse(xhr.response);
// console.log(channels.text);
// window.localStorage.setItem('channels', (xhr.response));
for (let i = 0; i < channels.text.length; i ++) {
var channel = channels.text[i];
if (channel.name && channel.id) {
var opt = document.createElement('option');
opt.value = channel.id;
opt.innerHTML = channel.name;
document.getElementById('logchanneldropdown').appendChild(opt);
}
}
// document.getElementById('body').classList.replace('hide', 'show');
//Welcome section
let wc = serverSettings.WELCOME.welcomechannel || '';
@@ -306,6 +326,10 @@
function sendData(event, inp) {
event.preventDefault();
var values=Array.from($(".logchanneldropdown").find(':selected')).map(function(item){
return $(item).text();
});
//Change saving status
var b = document.getElementById('savstat');
b.classList.replace('saved', 'saving');
@@ -322,7 +346,7 @@
const sevlist = ['none', 'low', 'meduim', 'high']
serverSettings.LOG.severity = sevlist.indexOf(sevname);
serverSettings.LOG.logchannel = document.getElementById('lc').value || null;
serverSettings.LOG.logchannel = document.getElementById('logchanneldropdown').value || null;
let kl = false;
if (document.getElementById('kl').checked) {
@@ -430,8 +454,11 @@
<label for="kl">Keep Logs?</label>
<input type="checkbox" id="kl" name="kl"><br><br>
<label for="lc">Logging Channel Name:</label>
<input type="text" id="lc" name="lc"><br><br>
<!-- <label for="lc">Logging 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>
<div id="sevradio">
<p style="margin-bottom: 0px; text-underline-offset: 2px;"><u>Log Severity</u></p>
+1 -1
View File
@@ -323,7 +323,7 @@
<!-- Header Begin -->
<!-- https://livewire.thewire.in/wp-content/uploads/2018/09/ekg-line-ekg-monitor-ekg-machine-heart-health-blue-ecg-monitor-shows-the-heart-beat-the-heart-stops-for-three-seconds-and-starts-again_nelyjny6x__F0000.png -->
<div class="row w-100 h-100" style="background-image: url('https://www.pgsindia.co.in/wp-content/uploads/2016/01/animated-web-design-slideshow-background.gif'); background-size: cover; background-repeat: no-repeat;">
<div class="row w-100 h-100" style="background-image: url('https://github.com/ION606/selmer-bot-website/blob/main/assets/Header%20BK.gif?raw=true'); background-size: cover; background-repeat: no-repeat;">
<div class="row w-100" style="color: rgb(10, 169, 243); text-align: center">
<h1 style="margin-top: 100px; -webkit-text-stroke: 2px rgb(255, 255, 255);">WELCOME TO THE SELMER BOT DASHBOARD</h1>
</div>
+1 -1
View File
@@ -112,7 +112,7 @@ app.get('/getChannels', async (req, res) => {
}
})
res.send(JSON.stringify(arr));
res.send(arr);
});