Files
wt 155c259ea9
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 9s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 14s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Failing after 8s
added web and fix some problems
2025-08-27 17:00:57 +07:00

28 lines
1.0 KiB
JavaScript

document.addEventListener("DOMContentLoaded", () => {
var theme = localStorage.getItem('bs-theme')
if (theme) {
document.documentElement.setAttribute('data-bs-theme', theme)
if (theme === 'dark') {
themecheckbox.checked = true
}
}
if (localStorage.getItem('token')) {
fetch(routes.access(), {
method: 'POST',
body: `{"token": "${localStorage.getItem('token')}"}`
}).then(data => data.json()).then(jsondata => {
if (jsondata.valid) {
document.querySelector('.loginform').classList.remove('active')
get_all_users()
} else {
document.querySelector('.loginform').classList.add('active')
}
}).catch((error) => {
notification(`Ошибка на сервере: ${error}`, "error")
})
usernameheader.innerHTML = JSON.parse(localStorage.getItem('userdata')).username
} else {
document.querySelector('.loginform').classList.add('active')
}
})