-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
115 lines (109 loc) · 4.4 KB
/
admin.html
File metadata and controls
115 lines (109 loc) · 4.4 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
<!doctype html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>ListoAPP — Admin</title>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Security-Policy" content="
default-src 'self';
script-src 'self';
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob:;
font-src 'self' data:;
connect-src 'self' https://api.github.com https://raw.githubusercontent.com;
frame-src 'self';
worker-src 'self' blob:;
manifest-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
">
<meta name="theme-color" content="#111827" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="#f4f6fb" media="(prefers-color-scheme: light)">
<link rel="icon" type="image/svg+xml" href="icon.svg">
<link rel="stylesheet" href="assets/styles.css">
</head>
<body>
<header class="app-header">
<div class="row">
<span class="brand">
<img src="icon.svg" alt="" aria-hidden="true">
<span>ListoAPP · Admin</span>
</span>
<span class="spacer"></span>
<a class="meta" href="index.html">↩ App utente</a>
</div>
</header>
<main>
<div class="card">
<h2>Configurazione GitHub</h2>
<p class="muted">Le credenziali restano nel browser (IndexedDB). Il PAT non viene mai re-iniettato nei campi al ricarico.</p>
<div class="admin-form">
<div>
<label for="cfg-owner">Owner / username</label>
<input type="text" id="cfg-owner" placeholder="pezzaliapp">
</div>
<div>
<label for="cfg-repo">Repo</label>
<input type="text" id="cfg-repo" placeholder="ListoAPP">
</div>
<div>
<label for="cfg-branch">Branch</label>
<input type="text" id="cfg-branch" placeholder="main">
</div>
<div>
<label for="cfg-promo-path">Path promo.json</label>
<input type="text" id="cfg-promo-path" placeholder="promo/promo.json">
</div>
<div>
<label for="cfg-version-path">Path version.json</label>
<input type="text" id="cfg-version-path" placeholder="version.json">
</div>
<div>
<label for="cfg-token">Personal Access Token (scope: repo)</label>
<input type="password" id="cfg-token" autocomplete="off" spellcheck="false">
</div>
<div class="full row-flex">
<button type="button" id="cfg-save" class="primary">Salva configurazione</button>
<button type="button" id="cfg-test">Test connessione</button>
<button type="button" id="cfg-clear-token" class="danger">Elimina token</button>
</div>
<div class="full">
<div class="token-status" id="save-status">In attesa…</div>
<div class="token-status" id="test-status"></div>
</div>
</div>
</div>
<div class="card">
<h2>Promo</h2>
<div class="row-flex">
<button type="button" id="promo-load" class="primary">Carica da GitHub</button>
<button type="button" id="promo-add">+ Aggiungi promo</button>
<button type="button" id="promo-import">Importa JSON locale</button>
<input type="file" id="promo-import-file" accept=".json,application/json" style="display:none">
<button type="button" id="promo-export">Esporta JSON</button>
<span class="spacer" style="flex:1"></span>
<label class="row-flex" style="gap:6px">
<input type="checkbox" id="publish-bump">
<span class="muted">bump version.json</span>
</label>
<button type="button" id="promo-publish" class="primary">Pubblica</button>
</div>
<div class="token-status" id="load-status"></div>
<div class="token-status" id="publish-status"></div>
<div id="promo-edit-list" style="margin-top:12px"></div>
</div>
<div class="card">
<h2>Versione app</h2>
<p class="muted">Aggiorna <code>version.json</code> per forzare il banner "Nuova versione" sui dispositivi degli utenti.</p>
<button type="button" id="version-bump-now">Bump version.json adesso</button>
</div>
</main>
<footer class="app-footer">
<span>ListoAPP · pannello amministratore</span>
</footer>
<div class="toast-wrap" id="toasts" aria-live="polite" aria-atomic="false"></div>
<script src="assets/admin.js" defer></script>
</body>
</html>