ice/public/admin.html
Deco Vander edfdeb5117 Initial commit: ICE Watch Michigan community safety tool
- Node.js/Express backend with SQLite database
- Interactive map with real-time location tracking
- MapBox API integration for fast geocoding
- Admin panel for content moderation
- 24-hour auto-expiring reports
- Deployment scripts for Debian 12 ARM64
- Caddy reverse proxy with automatic HTTPS
2025-07-02 23:27:22 -04:00

228 lines
6.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>ICE Watch Admin</title>
<link rel="stylesheet" href="style.css">
<style>
.admin-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.login-section {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
max-width: 400px;
margin: 50px auto;
}
.admin-section {
display: none;
}
.locations-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.locations-table th,
.locations-table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
.locations-table th {
background-color: #f8f9fa;
font-weight: bold;
}
.locations-table tr:hover {
background-color: #f5f5f5;
}
.action-buttons {
display: flex;
gap: 5px;
}
.btn {
padding: 5px 10px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
text-decoration: none;
display: inline-block;
}
.btn-edit {
background-color: #007bff;
color: white;
}
.btn-delete {
background-color: #dc3545;
color: white;
}
.btn-save {
background-color: #28a745;
color: white;
}
.btn-cancel {
background-color: #6c757d;
color: white;
}
.edit-row {
background-color: #fff3cd !important;
}
.edit-input {
width: 100%;
padding: 4px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 12px;
}
.status-indicator {
padding: 2px 6px;
border-radius: 12px;
font-size: 11px;
font-weight: bold;
}
.status-active {
background-color: #d4edda;
color: #155724;
}
.status-expired {
background-color: #f8d7da;
color: #721c24;
}
.admin-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.logout-btn {
background-color: #dc3545;
color: white;
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
}
.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 20px;
}
.stat-card {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
text-align: center;
}
.stat-number {
font-size: 2em;
font-weight: bold;
color: #007bff;
}
.address-cell {
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
</head>
<body>
<div class="admin-container">
<!-- Login Section -->
<div id="login-section" class="login-section">
<h2>🔐 Admin Login</h2>
<form id="login-form">
<div class="form-group">
<label for="password">Admin Password:</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit">Login</button>
</form>
<div id="login-message" class="message"></div>
</div>
<!-- Admin Section -->
<div id="admin-section" class="admin-section">
<div class="admin-header">
<h1>🚨 ICE Watch Admin Panel</h1>
<div>
<button id="refresh-btn" class="btn btn-edit">Refresh Data</button>
<button id="logout-btn" class="logout-btn">Logout</button>
</div>
</div>
<div class="stats">
<div class="stat-card">
<div class="stat-number" id="total-count">0</div>
<div>Total Reports</div>
</div>
<div class="stat-card">
<div class="stat-number" id="active-count">0</div>
<div>Active (24hrs)</div>
</div>
<div class="stat-card">
<div class="stat-number" id="expired-count">0</div>
<div>Expired</div>
</div>
</div>
<div class="form-section">
<h3>All Location Reports</h3>
<table class="locations-table">
<thead>
<tr>
<th>ID</th>
<th>Status</th>
<th>Address</th>
<th>Description</th>
<th>Reported</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="locations-tbody">
<tr>
<td colspan="6">Loading...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="admin.js"></script>
</body>
</html>