-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmissions.html
More file actions
49 lines (47 loc) · 1.48 KB
/
Copy pathsubmissions.html
File metadata and controls
49 lines (47 loc) · 1.48 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 lang="en">
<head>
<meta charset="UTF-8">
<title>Submissions</title>
<style>
body { font-family: sans-serif; padding: 2em; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #ccc; padding: 0.5em; text-align: left; }
</style>
</head>
<body>
<h1>Form Submissions</h1>
<table id="submissionTable">
<thead>
<tr><th>Name</th><th>Email</th><th>Message</th><th>Timestamp</th></tr>
</thead>
<tbody></tbody>
</table>
<script>
const supabaseUrl = 'https://ienunlowghmdhccrkqxo.supabase.co';
const supabaseKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImllbnVubG93Z2htZGhjY3JrcXhvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTQ2Mzg1NjgsImV4cCI6MjA3MDIxNDU2OH0.ioTQ0hU2wGvs202GKi89KaU9wiOqYg3vbU4fw7qumXk';
fetch(`${supabaseUrl}/rest/v1/submissions`, {
method: 'GET',
headers: {
apikey: supabaseKey,
Authorization: `Bearer ${supabaseKey}`
}
})
.then(res => res.json())
.then(data => {
const tbody = document.querySelector('#submissionTable tbody');
data.forEach(row => {
const tr = document.createElement('tr');
tr.innerHTML = `
<td>${row.name || ''}</td>
<td>${row.email || ''}</td>
<td>${row.message || ''}</td>
<td>${row.created_at || ''}</td>
`;
tbody.appendChild(tr);
});
})
.catch(err => console.error('載入失敗:', err));
</script>
</body>
</html>