revert 6f637968bdd5dea7f472e5a07517e072ed69715e
All checks were successful
Neutral/pipeline/head This commit looks good
All checks were successful
Neutral/pipeline/head This commit looks good
revert Version 1.0.0 - Basic Web Application
This commit is contained in:
68
public/javascripts/indexscript.js
Normal file
68
public/javascripts/indexscript.js
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
|
||||
|
||||
// User Request
|
||||
|
||||
loadUserInfo()
|
||||
|
||||
|
||||
function loadUserInfo() {
|
||||
|
||||
|
||||
const infoUsername = getID("infoUsername")
|
||||
const infoUserimage = getID("infoUserimage")
|
||||
const infoDisplayname = getID("infoDisplayname")
|
||||
const views = getID("views")
|
||||
const panelBox = getID("panel-box")
|
||||
|
||||
const REQ_user = get("USERINFO")
|
||||
|
||||
REQ_user.then((ANS_user) => {
|
||||
console.log(ANS_user)
|
||||
infoUserimage.src = ANS_user.picture
|
||||
infoUsername.innerHTML = ANS_user.username
|
||||
infoDisplayname.innerHTML = ANS_user.display_name
|
||||
|
||||
const permissions = ANS_user.permission
|
||||
|
||||
const AvailableViews = new Array()
|
||||
//
|
||||
permissions.forEach((permValue) => {
|
||||
|
||||
AllComponents.forEach((component) => {
|
||||
if(component.permission == permValue) {
|
||||
component.inject(AvailableViews)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
if(AvailableViews.join("") == "") {
|
||||
|
||||
AvailableViews.push("<p style='width: 100%;' class='yellow t-center'><i class='fa-solid fa-warning'></i> Aucune permission ne semble vous êtes accordée<br>Demandez à Raphix afin de résoudre ce problème</p>")
|
||||
views.classList.remove("views-box")
|
||||
panelBox.style.justifyContent = "unset"
|
||||
console.log(panelBox.style)
|
||||
} else {
|
||||
|
||||
views.classList.add("views-box")
|
||||
}
|
||||
|
||||
views.innerHTML = AvailableViews.join("")
|
||||
|
||||
// BindView
|
||||
|
||||
AllComponents.forEach((component) => {
|
||||
component.bindView()
|
||||
})
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user