lifeline-nexus / admin.html
a2007b's picture
change the title to ResQnav instead of "lifeline nexus command center" in the starting, dont ask for access code, instead ask for admin and victim login alone. the website should also run in offline mode. add a live map (gps api) to see the safe, risky, flooded, medical and etc areas. using colours. allow the admin to access all thhe dashboard information. dont change the victim page
60a6762 verified
Raw History Blame Contribute Delete
11.1 kB
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ResQnav Command Center</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: {
50: '#fef2f2',
100: '#fee2e2',
200: '#fecaca',
300: '#fca5a5',
400: '#f87171',
500: '#ef4444',
600: '#dc2626',
700: '#b91c1c',
800: '#991b1b',
900: '#7f1d1d',
},
secondary: {
50: '#fff7ed',
100: '#ffedd5',
200: '#fed7aa',
300: '#fdba74',
400: '#fb923c',
500: '#f97316',
600: '#ea580c',
700: '#c2410c',
800: '#9a3412',
900: '#7c2d12',
}
}
}
}
}
</script>
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#dc2626">
</head>
<body class="bg-gray-50 dark:bg-gray-900">
<!-- Login Overlay -->
<div id="login-overlay" class="fixed inset-0 bg-gray-900 z-50 flex items-center justify-center">
<div class="bg-white dark:bg-gray-800 rounded-2xl p-8 max-w-md w-full mx-4 shadow-2xl">
<div class="text-center mb-8">
<div class="w-20 h-20 rounded-full bg-gradient-to-br from-primary-500 to-secondary-500 flex items-center justify-center mx-auto mb-4">
<i data-feather="shield" class="w-10 h-10 text-white"></i>
</div>
<h1 class="text-2xl font-bold text-gray-800 dark:text-white">ResQnav Command Center</h1>
<p class="text-gray-600 dark:text-gray-400">Disaster Response Platform</p>
</div>
<div class="space-y-4">
<button onclick="loginAs('admin')" class="w-full py-4 bg-gradient-to-r from-primary-600 to-secondary-600 hover:from-primary-700 hover:to-secondary-700 text-white rounded-xl font-bold transition-all flex items-center justify-center gap-3">
<i data-feather="shield" class="w-6 h-6"></i>
Admin Login
</button>
<button onclick="loginAs('victim')" class="w-full py-4 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-2 border-gray-200 dark:border-gray-600 hover:border-primary-500 dark:hover:border-primary-500 rounded-xl font-bold transition-all flex items-center justify-center gap-3">
<i data-feather="user" class="w-6 h-6"></i>
Victim / Reporter Login
</button>
</div>
<p class="text-center text-sm text-gray-500 dark:text-gray-500 mt-6">
Select your role to continue
</p>
</div>
</div>
<!-- Main Dashboard (Hidden until login) -->
<div id="dashboard" class="hidden">
<custom-navbar></custom-navbar>
<div class="dashboard-grid pt-16">
<!-- Sidebar -->
<aside class="bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700 overflow-y-auto">
<div class="p-4">
<div class="flex items-center gap-3 mb-6 p-3 rounded-xl bg-primary-50 dark:bg-primary-900/20">
<div class="w-12 h-12 rounded-full bg-primary-500 flex items-center justify-center">
<i data-feather="user" class="w-6 h-6 text-white"></i>
</div>
<div>
<p class="font-semibold text-gray-800 dark:text-white" id="user-name">Admin</p>
<p class="text-sm text-primary-600 dark:text-primary-400" id="user-role-display">Full Access</p>
</div>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-2 gap-3 mb-6">
<div class="p-3 rounded-xl bg-red-50 dark:bg-red-900/20">
<p class="text-2xl font-bold text-red-600 dark:text-red-400" id="stat-critical">3</p>
<p class="text-xs text-red-600 dark:text-red-400">Critical</p>
</div>
<div class="p-3 rounded-xl bg-orange-50 dark:bg-orange-900/20">
<p class="text-2xl font-bold text-orange-600 dark:text-orange-400" id="stat-high">7</p>
<p class="text-xs text-orange-600 dark:text-orange-400">High Priority</p>
</div>
<div class="p-3 rounded-xl bg-blue-50 dark:bg-blue-900/20">
<p class="text-2xl font-bold text-blue-600 dark:text-blue-400" id="stat-active">12</p>
<p class="text-xs text-blue-600 dark:text-blue-400">Active Teams</p>
</div>
<div class="p-3 rounded-xl bg-green-50 dark:bg-green-900/20">
<p class="text-2xl font-bold text-green-600 dark:text-green-400" id="stat-resolved">89</p>
<p class="text-xs text-green-600 dark:text-green-400">Today Resolved</p>
</div>
</div>
<!-- Map Legend -->
<h3 class="font-semibold text-gray-800 dark:text-white mb-3 flex items-center gap-2">
<i data-feather="map" class="w-4 h-4"></i>
Map Legend
</h3>
<div class="space-y-2 mb-6">
<div class="flex items-center gap-2 p-2 rounded-lg bg-green-50 dark:bg-green-900/20">
<div class="w-4 h-4 rounded-full bg-green-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Safe Zone</span>
</div>
<div class="flex items-center gap-2 p-2 rounded-lg bg-yellow-50 dark:bg-yellow-900/20">
<div class="w-4 h-4 rounded-full bg-yellow-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Caution Zone</span>
</div>
<div class="flex items-center gap-2 p-2 rounded-lg bg-orange-50 dark:bg-orange-900/20">
<div class="w-4 h-4 rounded-full bg-orange-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Risky Area</span>
</div>
<div class="flex items-center gap-2 p-2 rounded-lg bg-red-50 dark:bg-red-900/20">
<div class="w-4 h-4 rounded-full bg-red-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Danger Zone</span>
</div>
<div class="flex items-center gap-2 p-2 rounded-lg bg-blue-50 dark:bg-blue-900/20">
<div class="w-4 h-4 rounded-full bg-blue-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Flooded</span>
</div>
<div class="flex items-center gap-2 p-2 rounded-lg bg-purple-50 dark:bg-purple-900/20">
<div class="w-4 h-4 rounded-full bg-purple-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Medical Emergency</span>
</div>
<div class="flex items-center gap-2 p-2 rounded-lg bg-gray-100 dark:bg-gray-700">
<div class="w-4 h-4 rounded-full bg-gray-500"></div>
<span class="text-sm text-gray-700 dark:text-gray-300">Collapsed/Trapped</span>
</div>
</div>
<!-- Emergency Queue -->
<h3 class="font-semibold text-gray-800 dark:text-white mb-3 flex items-center gap-2">
<i data-feather="list" class="w-4 h-4"></i>
Emergency Queue
</h3>
<div id="emergency-queue" class="space-y-2">
<!-- Populated by JS -->
</div>
</div>
</aside>
<!-- Main Content -->
<main class="p-4 overflow-y-auto">
<!-- Top Bar -->
<div class="flex items-center justify-between mb-4">
<div class="flex items-center gap-4">
<h2 class="text-2xl font-bold text-gray-800 dark:text-white">Live Operations Map</h2>
<span class="px-3 py-1 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 text-sm font-medium flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-green-500 animate-pulse"></span>
Live GPS
</span>
</div>
<div class="flex items-center gap-3">
<button onclick="refreshData()" class="p-2 rounded-lg bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
<i data-feather="refresh-cw" class="w-5 h-5 text-gray-600 dark:text-gray-400"></i>
</button>
<button onclick="centerOnUser()" class="p-2 rounded-lg bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
<i data-feather="crosshair" class="w-5 h-5 text-gray-600 dark:text-gray-400"></i>
</button>
<button class="px-4 py-2 rounded-lg bg-primary-600 hover:bg-primary-700 text-white font-medium transition-colors flex{"ok":false,"message":"terminated"}