Repository navigation
Expand file tree
/
Copy pathadmin.html
More file actions
312 lines (284 loc) · 16.6 KB
/
Copy pathadmin.html
File metadata and controls
312 lines (284 loc) · 16.6 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>Share247 — Admin Content Safety & Moderation Console</title>
<meta name="description" content="Share247 Admin Console for automated AI content moderation, policy enforcement, and vault management.">
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z'/%3E%3C/svg%3E">
<link rel="alternate icon" type="image/svg+xml" href="assets/favicon.svg?v=20261124-v15">
<link rel="stylesheet" href="css/admin.css?v=20261128-resp-v22">
</head>
<body>
<!-- Master Passcode Auth Gate -->
<div id="auth-overlay" class="auth-overlay">
<div class="auth-card">
<div class="auth-icon-wrap">
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
</svg>
</div>
<h2 class="auth-title">Admin Console</h2>
<p class="auth-subtitle">Enter your master passcode to access file controls and AI content moderation.</p>
<form id="auth-form" class="auth-form">
<input type="password" id="auth-passcode" class="auth-input" placeholder="Enter master passcode" required autocomplete="current-password" autofocus>
<button type="submit" class="auth-btn-submit">Unlock Console →</button>
<p id="auth-error" class="auth-error" hidden>Incorrect passcode. Please try again.</p>
</form>
<p class="auth-hint">Protected zone • Authorized administrator access only</p>
</div>
</div>
<!-- Main Admin Shell -->
<div class="admin-shell">
<!-- Top Bar -->
<header class="admin-header">
<div class="header-brand">
<div class="brand-icon-shield">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
</svg>
</div>
<div class="brand-meta">
<h1>Share247 <span class="badge-admin-tag">Admin • Trust & Safety</span></h1>
<p>AI Moderation, Prohibited Content Removal & Vault Supervision</p>
</div>
</div>
<div class="header-actions">
<a href="./" class="btn-header" title="Go to public vault page">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="19" y1="12" x2="5" y2="12"></line>
<polyline points="12 19 5 12 12 5"></polyline>
</svg>
<span>Public Vault</span>
</a>
<button type="button" id="btn-refresh" class="btn-header" title="Reload vault items">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M23 4v6h-6"></path>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
</svg>
<span>Refresh</span>
</button>
<button type="button" id="btn-open-settings" class="btn-header" title="Configure Gemini API & Alerts">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
<span>AI Settings</span>
</button>
<button type="button" id="btn-logout" class="btn-header btn-header-danger" title="Lock admin session">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline>
<line x1="21" y1="12" x2="9" y2="12"></line>
</svg>
<span>Lock</span>
</button>
</div>
</header>
<!-- Content Container -->
<main class="admin-container">
<!-- Metrics Grid -->
<!-- Metrics Grid -->
<section class="metrics-grid">
<div class="metric-card">
<div class="metric-info">
<p>Total Items in Vault</p>
<div id="metric-total-items" class="metric-val">0</div>
</div>
<div class="metric-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
</svg>
</div>
</div>
<div class="metric-card">
<div class="metric-info">
<p>Active Storage Used</p>
<div id="metric-storage-used" class="metric-val">0 B</div>
</div>
<div class="metric-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect>
<rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect>
<line x1="6" y1="6" x2="6.01" y2="6"></line>
<line x1="6" y1="18" x2="6.01" y2="18"></line>
</svg>
</div>
</div>
<div class="metric-card">
<div class="metric-info">
<p>AI Content Safety</p>
<div class="metric-val" style="color: #38bdf8; font-size: 1.4rem; display: flex; align-items: center; gap: 0.5rem;">
<span style="display:inline-block;width:9px;height:9px;border-radius:50%;background:#34d399;box-shadow:0 0 8px rgba(52,211,153,0.6);"></span>
<span>Active</span>
</div>
</div>
<div class="metric-icon" style="color: #38bdf8;">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
<polyline points="9 12 11 14 15 10"></polyline>
</svg>
</div>
</div>
</section>
<!-- Toolbar & Filters -->
<section class="toolbar-section">
<div class="filter-tabs">
<button class="tab-btn active" data-filter="all" type="button">
<span>All Items</span>
<span class="tab-count" id="tab-all-count">0</span>
</button>
<button class="tab-btn" data-filter="files" type="button">
<span>Files</span>
<span class="tab-count" id="tab-files-count">0</span>
</button>
<button class="tab-btn" data-filter="links" type="button">
<span>Links</span>
<span class="tab-count" id="tab-links-count">0</span>
</button>
</div>
<div class="toolbar-right">
<div class="search-box">
<svg class="search-icon-svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" id="admin-search-input" placeholder="Filter by name, URL, or ID...">
</div>
<button type="button" id="btn-scan-all" class="btn-tool btn-tool-scan" title="Run Gemini AI content moderation scan across all files">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2">
<path d="M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83"></path>
</svg>
<span>AI Scan All</span>
</button>
<button type="button" id="btn-clear-entire-vault" class="btn-tool btn-tool-danger" title="Purge and clear all items currently in the vault">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 6h18"></path>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
<line x1="10" y1="11" x2="10" y2="17"></line>
<line x1="14" y1="11" x2="14" y2="17"></line>
</svg>
<span>Clear Entire Vault</span>
</button>
</div>
</section>
<!-- Table Section -->
<section class="table-wrap" tabindex="0" role="region" aria-label="Vault moderation table">
<table class="admin-table">
<thead>
<tr>
<th style="width: 38%;">Item Name / Destination</th>
<th style="width: 18%;">Safety Status • AI Decision</th>
<th style="width: 14%;">Size / Type</th>
<th style="width: 8%;">Views</th>
<th style="width: 11%;">Expires In</th>
<th style="width: 11%;">Controls</th>
</tr>
</thead>
<tbody id="admin-table-body">
<!-- Dynamic rows injected by admin.js -->
</tbody>
</table>
<!-- Empty State -->
<div id="admin-empty-state" class="admin-empty" hidden>
<h3>No items found</h3>
<p>There are no active files or links matching the selected filter.</p>
</div>
</section>
</main>
</div>
<!-- Settings & Gemini API Modal -->
<dialog id="settings-modal" class="admin-modal">
<div class="modal-header">
<h3>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
<span>AI Moderation & Admin Settings</span>
</h3>
<button type="button" id="btn-close-settings-x" class="modal-close" aria-label="Close dialog">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<form id="settings-form">
<!-- Gemini API Key -->
<div class="modal-field">
<label for="setting-gemini-key">Google Gemini API Key (Multimodal AI Safety)</label>
<div style="display: flex; gap: 0.5rem;">
<input type="password" id="setting-gemini-key" placeholder="Pre-configured Gemini API Key active" autocomplete="off">
<button type="button" id="btn-test-gemini-key" class="btn-tool" style="flex-shrink: 0; padding: 0.65rem 1rem;">Test Key</button>
</div>
<p id="test-key-status" class="modal-hint"></p>
<p class="modal-hint">Used for automated multimodal content safety analysis. Get a free key at <a href="https://aistudio.google.com/app/apikey" target="_blank" rel="noopener noreferrer" style="color: #38bdf8;">Google AI Studio</a>.</p>
</div>
<!-- Owner Alert Email -->
<div class="modal-field">
<label for="setting-admin-email">Owner Notification Email</label>
<input type="email" id="setting-admin-email" placeholder="owner@example.com" required>
<p class="modal-hint">Automated alert emails and warning reports will be addressed to this mailbox.</p>
</div>
<!-- Alert Webhook -->
<div class="modal-field">
<label for="setting-webhook-url">Optional Alert Webhook URL</label>
<input type="url" id="setting-webhook-url" placeholder="https://webhook.site/... or Discord/Slack Webhook">
<p class="modal-hint">Dispatches an instant JSON payload when illegal or adult files are flagged.</p>
</div>
<!-- Change Master Passcode -->
<div class="modal-field">
<label for="setting-new-passcode">Change Master Passcode</label>
<input type="password" id="setting-new-passcode" placeholder="Leave blank to keep current passcode">
<p class="modal-hint">Leave blank to keep existing master passcode, or enter a new one to update.</p>
</div>
<div class="modal-actions">
<button type="button" id="btn-cancel-settings" class="btn-modal-cancel">Cancel</button>
<button type="submit" class="btn-modal-save">Save Settings</button>
</div>
</form>
</dialog>
<!-- Classic Confirmation Dialog (Custom Modal, No Native Alerts) -->
<dialog id="confirm-modal" class="admin-modal">
<div class="modal-header">
<h3>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
<line x1="12" y1="9" x2="12" y2="13"></line>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
<span id="confirm-modal-title">Clear Entire Vault</span>
</h3>
<button type="button" id="btn-confirm-close-x" class="modal-close" aria-label="Close dialog">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="confirm-content">
<p id="confirm-modal-msg" style="color: #cbd5e1; font-size: 0.875rem; margin-bottom: 1.25rem; line-height: 1.5;">
This action will permanently delete all files and database records. This cannot be undone.
</p>
<div id="confirm-input-container" class="modal-field" style="margin-bottom: 1.5rem;">
<label for="confirm-input" id="confirm-input-label" style="display: block; font-size: 0.8125rem; font-weight: 600; color: #94a3b8; margin-bottom: 0.4rem;">Type <strong>CLEAR</strong> to confirm:</label>
<input type="text" id="confirm-input" placeholder="CLEAR" autocomplete="off" style="width: 100%; padding: 0.65rem 0.85rem; background: #0b0f19; border: 1px solid #334155; border-radius: 8px; color: #fff; font-size: 0.875rem;">
</div>
<div class="modal-actions" style="display: flex; justify-content: flex-end; gap: 0.75rem;">
<button type="button" id="btn-confirm-cancel" class="btn-modal-cancel">Cancel</button>
<button type="button" id="btn-confirm-ok" class="btn-tool btn-tool-danger" style="padding: 0.65rem 1.25rem;">Confirm & Delete</button>
</div>
</div>
</dialog>
<!-- Toast Container -->
<div id="admin-toast-container" class="admin-toast-container"></div>
<!-- Admin Controller -->
<script type="module" src="js/admin.js?v=20261128-pin-v23"></script>
</body>
</html>