155 lines
4.2 KiB
HTML
155 lines
4.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Dashboard Admin - Monitoring Parkir</title>
|
|
<link rel="stylesheet" href="style.css" />
|
|
<script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
|
|
<script type="module" src="script.js"></script>
|
|
<style>
|
|
.back-btn {
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
margin-bottom: 25px;
|
|
transition: background-color 0.3s ease;
|
|
box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
|
|
display: inline-block;
|
|
}
|
|
.back-btn:hover {
|
|
background-color: #388E3C;
|
|
box-shadow: 0 6px 12px rgba(56, 142, 60, 0.6);
|
|
transform: translateY(-2px);
|
|
}
|
|
.parking-history {
|
|
background-color: #fff;
|
|
border-radius: 10px;
|
|
padding: 25px 30px;
|
|
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
|
|
max-width: 480px;
|
|
margin: 0 auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 450px;
|
|
}
|
|
.parking-history h3 {
|
|
margin-top: 0;
|
|
margin-bottom: 20px;
|
|
color: #4CAF50;
|
|
font-weight: 700;
|
|
font-size: 1.7em;
|
|
border-bottom: 3px solid #4CAF50;
|
|
padding-bottom: 8px;
|
|
text-align: center;
|
|
}
|
|
#history-container {
|
|
flex-grow: 1;
|
|
overflow-y: auto;
|
|
padding-right: 10px;
|
|
}
|
|
.history-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
.history-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 14px 18px;
|
|
margin-bottom: 12px;
|
|
border-radius: 8px;
|
|
border-left: 6px solid;
|
|
background-color: #f9f9f9;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
.history-item:hover {
|
|
background-color: #e6f7e6;
|
|
}
|
|
.history-item.entry {
|
|
border-left-color: #f44336;
|
|
}
|
|
.history-item.exit {
|
|
border-left-color: #4CAF50;
|
|
}
|
|
.history-info {
|
|
font-weight: 600;
|
|
font-size: 1.1em;
|
|
color: #333;
|
|
}
|
|
.history-info small {
|
|
display: block;
|
|
font-weight: normal;
|
|
color: #666;
|
|
font-size: 0.8em;
|
|
margin-top: 2px;
|
|
}
|
|
.history-time {
|
|
color: #666;
|
|
font-size: 0.9em;
|
|
font-style: italic;
|
|
white-space: nowrap;
|
|
}
|
|
.loading-message {
|
|
text-align: center;
|
|
color: #666;
|
|
font-style: italic;
|
|
padding: 20px;
|
|
}
|
|
/* Scrollbar custom */
|
|
#history-container::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
#history-container::-webkit-scrollbar-track {
|
|
background: #eee;
|
|
border-radius: 10px;
|
|
}
|
|
#history-container::-webkit-scrollbar-thumb {
|
|
background-color: #4CAF50;
|
|
border-radius: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="admin-view">
|
|
<div class="admin-header">
|
|
<h1>Dashboard Admin - Monitoring Parkir</h1>
|
|
</div>
|
|
<a href="index.html"><button class="back-btn">Kembali ke Mode Pengguna</button></a>
|
|
<div class="admin-content">
|
|
<div class="parking-status">
|
|
<h2>Status Parkir Saat Ini</h2>
|
|
<div id="sensor_1" class="sensor">
|
|
<img src="images/suv-car.png" alt="Logo Kendaraan">
|
|
<h3>Parkir Slot 1</h3>
|
|
<p id="status_1" class="status">Tersedia</p>
|
|
</div>
|
|
<div id="sensor_2" class="sensor">
|
|
<img src="images/suv-car.png" alt="Logo Kendaraan">
|
|
<h3>Parkir Slot 2</h3>
|
|
<p id="status_2" class="status">Tersedia</p>
|
|
</div>
|
|
<div id="sensor_3" class="sensor">
|
|
<img src="images/suv-car.png" alt="Logo Kendaraan">
|
|
<h3>Parkir Slot 3</h3>
|
|
<p id="status_3" class="status">Tersedia</p>
|
|
</div>
|
|
</div>
|
|
<div class="parking-history">
|
|
<h3>Riwayat Parkir Realtime</h3>
|
|
<div id="history-container">
|
|
<div class="loading-message">
|
|
🔄 Memuat riwayat parkir...
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |