Added splashscreen
This commit is contained in:
@@ -26,6 +26,11 @@ socket.on('score', (message) => {
|
||||
// ######################################################################################################################################################
|
||||
// General functions
|
||||
// ######################################################################################################################################################
|
||||
// Update DOM timer elements from passed values
|
||||
function updateEtcFrontend(values) {
|
||||
console.log(values);
|
||||
document.getElementById("etcSwitchEnable").checked = values.splashscreenEnabled;// Set switch status to received score enabled value
|
||||
}
|
||||
|
||||
// Update DOM timer elements from passed values
|
||||
function updateTimerFrontend(values) {
|
||||
@@ -137,7 +142,26 @@ async function openBrowser() {
|
||||
}
|
||||
|
||||
async function killBrowser() {
|
||||
const response = await fetch("/admin/killBrowser"); // Call API Endpoint /admin/killBrowser
|
||||
const response = await fetch("/admin/killBrowser"); // Call API Endpoint /admin/killBrowser
|
||||
}
|
||||
|
||||
// ######################################################################################################################################################
|
||||
// Etc endpoints
|
||||
// ######################################################################################################################################################
|
||||
|
||||
// Request important values for etc stuff
|
||||
async function etcGetValues() {
|
||||
const response = await fetch("/admin/etcGetValues"); // Call API Endpoint /admin/etcGetValues
|
||||
const data = await response.json(); // Wait for asynchronous transfer to complete
|
||||
updateEtcFrontend(data); // Update admin frontend
|
||||
}
|
||||
|
||||
// Toggle index page to also show scoreboard
|
||||
async function etcToggleSplashscreen() {
|
||||
const response = await fetch("/admin/etcToggleSplashscreen");// Call API Endpoint /admin/etcToggleSplashscreen
|
||||
const data = await response.json(); // Wait for asyncronous transfer to complete
|
||||
updateEtcFrontend(data); // Update admin frontend
|
||||
refreshMonitor(); // Refresh main monitor to display new frontend
|
||||
}
|
||||
|
||||
// ######################################################################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user