This commit is contained in:
BIG2EYEZ 2024-01-01 15:18:26 +08:00
parent 234906ada5
commit e538a5fb6e
5 changed files with 49 additions and 216 deletions

View File

@ -1,35 +0,0 @@
// models/User.js
const { Sequelize, DataTypes } = require('sequelize');
const sequelize = new Sequelize(process.env.database, process.env.user, process.env.password, {
host: process.env.host,
dialect: 'mysql',
timezone: 'Z', // Set the timezone to UTC
});
const User = sequelize.define('User', {
name: {
type: DataTypes.STRING,
allowNull: false,
},
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
email: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
jobTitle: {
type: DataTypes.STRING,
allowNull: false,
},
});
module.exports = User;

View File

@ -14,84 +14,41 @@
font-family: 'Arial', sans-serif; font-family: 'Arial', sans-serif;
} }
#sidebar { #navbar {
height: 100%;
width: 250px;
position: fixed;
background-color: #333; background-color: #333;
padding-top: 60px; overflow: hidden;
transition: 0.5s; text-align: center;
} }
#sidebar img { #navbar h1 {
width: 100%; color: white;
margin-bottom: 20px; padding: 14px 16px;
margin: 0;
font-size: 24px;
} }
#sidebar a { #navbar a {
padding: 10px 15px; display: inline-block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none; text-decoration: none;
font-size: 18px; font-size: 18px;
color: white;
display: block;
transition: 0.3s;
} }
#sidebar a:hover { #navbar a:hover {
background-color: #555; background-color: #555;
} }
#content { #content {
margin-left: 250px;
padding: 16px; padding: 16px;
} text-align: center;
@media screen and (max-width: 600px) {
#sidebar {
width: 0;
overflow-x: hidden;
}
#content {
margin-left: 0;
}
}
#sidebarCollapse {
width: 40px;
height: 40px;
position: absolute;
top: 10px;
left: 10px;
cursor: pointer;
z-index: 1;
}
#sidebarCollapse span {
display: block;
background: white;
height: 5px;
width: 30px;
margin: 6px auto;
transition: 0.3s;
}
#sidebarCollapse:hover span:nth-child(1) {
transform: rotate(-45deg) translate(-5px, 6px);
}
#sidebarCollapse:hover span:nth-child(2) {
opacity: 0;
}
#sidebarCollapse:hover span:nth-child(3) {
transform: rotate(45deg) translate(-5px, -6px);
} }
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 80%; width: 80%;
margin: 20px 0; margin: 20px auto;
font-size: 16px; font-size: 16px;
} }
@ -117,13 +74,8 @@
<body> <body>
<div id="sidebar"> <div id="navbar">
<img src="LOGO.PNG" alt="Custom Image"> <h1>Eco Saver</h1>
<div id="sidebarCollapse">
<span></span>
<span></span>
<span></span>
</div>
<a href="/inusers">In-House Users</a> <a href="/inusers">In-House Users</a>
<a href="#">Users</a> <a href="#">Users</a>
<a href="#">Data Analysis</a> <a href="#">Data Analysis</a>
@ -149,12 +101,6 @@
<% }); %> <% }); %>
</tbody> </tbody>
</table> </table>
<script>
document.getElementById('sidebarCollapse').addEventListener('click', function () {
document.getElementById('sidebar').style.width = (document.getElementById('sidebar').style.width === '250px') ? '0' : '250px';
});
</script>
</div> </div>
</body> </body>

View File

@ -17,13 +17,8 @@
<body> <body>
<div id="sidebar"> <div id="navbar">
<img src="LOGO.PNG" alt="Custom Image"> <h1>Eco Saver</h1>
<div id="sidebarCollapse">
<span></span>
<span></span>
<span></span>
</div>
<a href="#" id="userDataLink">User Data</a> <a href="#" id="userDataLink">User Data</a>
<a href="#" id="addUserLink">Add User</a> <a href="#" id="addUserLink">Add User</a>
<a href="#" id="deleteUserLink">Delete User</a> <a href="#" id="deleteUserLink">Delete User</a>

10
Sean/views/setup-mfa.ejs Normal file
View File

@ -0,0 +1,10 @@
<!-- setup-mfa.ejs (or your template engine's file) -->
<h2>Setup Multi-Factor Authentication</h2>
<p>Scan the QR code below with your authenticator app:</p>
<img src="<%= qrCodeDataUri %>" alt="QR Code">
<form action="/setup-mfa" method="post">
<label for="mfaCode">Enter MFA Code:</label>
<input type="text" id="mfaCode" name="mfaCode" required>
<button type="submit">Verify and Save</button>
</form>

View File

@ -1,98 +1,49 @@
/* style.css */ /* style.css */
/* Sidebar Styles */
body { body {
margin: 0; margin: 0;
font-family: 'Arial', sans-serif; font-family: 'Arial', sans-serif;
} }
#sidebar { #navbar {
height: 100%;
width: 250px;
position: fixed;
background-color: #333; background-color: #333;
padding-top: 60px; overflow: hidden;
transition: 0.5s; text-align: center;
} }
#sidebar img { #navbar h1 {
width: 100%; color: white;
margin-bottom: 20px; padding: 14px 16px;
margin: 0;
font-size: 24px;
} }
#sidebar a { #navbar a {
padding: 10px 15px; display: inline-block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none; text-decoration: none;
font-size: 18px; font-size: 18px;
color: white;
display: block;
transition: 0.3s;
} }
#sidebar a:hover { #navbar a:hover {
background-color: #555; background-color: #555;
} }
#content { #content {
margin-left: 250px;
padding: 16px; padding: 16px;
text-align: center;
} }
@media screen and (max-width: 600px) {
#sidebar {
width: 0;
overflow-x: hidden;
}
#content {
margin-left: 0;
}
}
#sidebarCollapse {
width: 40px;
height: 40px;
position: absolute;
top: 10px;
left: 10px;
cursor: pointer;
z-index: 1;
}
#sidebarCollapse span {
display: block;
background: white;
height: 5px;
width: 30px;
margin: 6px auto;
transition: 0.3s;
}
#sidebarCollapse:hover span:nth-child(1) {
transform: rotate(-45deg) translate(-5px, 6px);
}
#sidebarCollapse:hover span:nth-child(2) {
opacity: 0;
}
#sidebarCollapse:hover span:nth-child(3) {
transform: rotate(45deg) translate(-5px, -6px);
}
#userDataContainer {
margin-top: 20px;
}
/* Table Styles */
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 80%;
margin-top: 20px; margin: 20px auto;
font-size: 16px;
} }
th, th, td {
td {
border: 1px solid #dddddd; border: 1px solid #dddddd;
text-align: left; text-align: left;
padding: 12px; padding: 12px;
@ -110,40 +61,6 @@ body {
white-space: nowrap; white-space: nowrap;
} }
/* Dropdown Styles */
.dropdown {
display: block;
margin-top: 20px;
}
.dropdown-toggle {
color: white;
background-color: #333;
border: 1px solid #555;
padding: 10px 15px;
text-decoration: none;
font-size: 18px;
display: block;
width: 100%;
text-align: left;
}
.dropdown-toggle:hover {
background-color: #555;
}
.dropdown-menu {
background-color: #333;
}
.dropdown-item {
color: white;
}
.dropdown-item:hover {
background-color: #555;
}
/* Additional styles for Bootstrap form */ /* Additional styles for Bootstrap form */
form { form {
max-width: 400px; max-width: 400px;