deux pages master et slave distinctes

This commit is contained in:
2023-11-10 15:43:49 +01:00
parent d44570f2e1
commit d78731df11
4 changed files with 41 additions and 1 deletions

3
app.js
View File

@@ -142,7 +142,8 @@ app.post("/auth/check-login", (req, res) => {
//res.cookie("authorization", userId, { maxAge: 900000, httpOnly: true }); //res.cookie("authorization", userId, { maxAge: 900000, httpOnly: true });
return res.render('index') let cible = (role == 'P') ? 'master' : 'slave';
return res.render(cible);
} }
else { else {
return res.render('login', { return res.render('login', {

View File

@@ -32,3 +32,10 @@ nav li a:hover {
background-color: #0d6efd !important; background-color: #0d6efd !important;
color: white !important; color: white !important;
} }
.boutons {
display: flex;
}
.bouton {
}

32
views/master.hbs Normal file
View File

@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/styles.css">
<link href="/css/bootstrap.min.css" rel="stylesheet">
</head>
</head>
<body>
{{!-- Navigation links --}}
<nav>
<a href="/"><h4>Projet MIA</h4></a>
</nav>
{{!-- Body --}}
<div class="container mt-4">
<div class="mt-4 p-5 bg-primary text-white rounded">
<h1>Bravo : connexion réussie</h1>
<p>Bienvenue sur le projet MIA...</p>
</div>
</div>
<br>
<div class="container boutons">
<div class="bouton"><a href="/master" class="btn btn-primary">Demander l'accès aux caméras</a></div>
<div class="bouton"><a href="/slave" class="btn btn-secondary">Démarrer la session</a></div>
</div>
</body>
</html>