This commit is contained in:
1
templates/audit.html
Normal file
1
templates/audit.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<h1>Audit-Log</h1><section class="card"><table><thead><tr><th>Zeit</th><th>Aktion</th><th>Objekt</th><th>Info</th></tr></thead><tbody>{{range .Audit}}<tr><td>{{.CreatedAt}}</td><td>{{.Action}}</td><td>{{.Entity}}</td><td>{{.Message}}</td></tr>{{end}}</tbody></table></section>{{end}}{{template "base" .}}
|
||||
1
templates/dashboard.html
Normal file
1
templates/dashboard.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<h1>Dashboard</h1><div class="stats"><div class="stat"><strong>{{.ManufacturerCount}}</strong><span>Hersteller</span></div><div class="stat"><strong>{{.SoftwareCount}}</strong><span>Software</span></div><div class="stat"><strong>{{.ReleaseCount}}</strong><span>Releases</span></div></div><section class="card"><h2>Letzte Releases</h2>{{if .Releases}}<table><thead><tr><th>Software</th><th>Version</th><th>Channel</th><th>Architektur</th><th>Datum</th><th>Links</th></tr></thead><tbody>{{range .Releases}}<tr><td>{{softwareName .SoftwareID $.Software}}</td><td><strong>{{.Version}}</strong></td><td>{{.Channel}}</td><td>{{.Architecture}}</td><td>{{.ReleaseDate}}</td><td>{{if .ReleaseURL}}<a href="{{.ReleaseURL}}" rel="noopener noreferrer">Info</a>{{end}} {{if .DownloadURL}}<a href="{{.DownloadURL}}" rel="noopener noreferrer">Download</a>{{end}}</td></tr>{{end}}</tbody></table>{{else}}<p class="muted">Noch keine Releases vorhanden.</p>{{end}}</section>{{end}}{{template "base" .}}
|
||||
3
templates/layout.html
Normal file
3
templates/layout.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{define "base"}}
|
||||
<!doctype html><html lang="de"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{.Title}} · ReleaseWatcher</title><link rel="stylesheet" href="/static/app.css"></head><body><header class="top"><a class="brand" href="/">ReleaseWatcher</a>{{if .User.Email}}<nav><a href="/manufacturers">Hersteller</a><a href="/software">Software</a><a href="/releases">Releases</a>{{if eq .User.Role "admin"}}<a href="/users">Benutzer</a><a href="/audit">Audit</a>{{end}}<a href="/logout">Logout</a></nav><span class="user">{{.User.DisplayName}} · {{.User.Role}}</span>{{end}}</header><main class="container">{{if .Error}}<div class="alert error">{{.Error}}</div>{{end}}{{if .Info}}<div class="alert info">{{.Info}}</div>{{end}}{{template "content" .}}</main></body></html>
|
||||
{{end}}
|
||||
1
templates/login.html
Normal file
1
templates/login.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<section class="card narrow"><h1>Anmelden</h1><p class="muted">Standard-Login: admin@example.local / admin12345. Bitte in Produktion per Umgebungsvariablen ändern.</p><form method="post" class="form"><label>E-Mail<input name="email" type="email" required autofocus></label><label>Passwort<input name="password" type="password" required></label><button>Anmelden</button></form></section>{{end}}{{template "base" .}}
|
||||
1
templates/manufacturers.html
Normal file
1
templates/manufacturers.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<h1>Hersteller</h1><section class="grid"><form method="post" class="card form"><h2>Hersteller pflegen</h2><label>Name<input name="name" required></label><label>Website<input name="website" type="url" placeholder="https://..."></label><label>Notizen<textarea name="notes" rows="4"></textarea></label><button>Speichern</button></form><section class="card"><h2>Liste</h2><table><thead><tr><th>Name</th><th>Website</th><th>Notizen</th></tr></thead><tbody>{{range .Manufacturers}}<tr><td><strong>{{.Name}}</strong></td><td>{{if .Website}}<a href="{{.Website}}" rel="noopener noreferrer">Website</a>{{end}}</td><td>{{.Notes}}</td></tr>{{end}}</tbody></table></section></section>{{end}}{{template "base" .}}
|
||||
1
templates/releases.html
Normal file
1
templates/releases.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<h1>Releases</h1>{{if eq .User.Role "admin"}}<section class="card"><form method="post" class="form release-form"><h2>Neues Release erstellen</h2><div class="two"><label>Software<select name="software_id" required>{{range .Software}}<option value="{{.ID}}">{{.Name}}</option>{{end}}</select></label><label>Version<input name="version" required placeholder="1.2.3"></label><label>Channel<input name="channel" required placeholder="stable"></label><label>Architektur<input name="architecture" required placeholder="x86_64"></label><label>Release-Datum<input name="release_date" type="date"></label><label>Download-Link<input name="download_url" type="url" placeholder="https://..."></label><label>Release-Link<input name="release_url" type="url" placeholder="https://..."></label></div><label>Release-Informationen<textarea name="info" rows="4"></textarea></label><label>Schwachstellen, eine pro Zeile: CVE | Schweregrad | Beschreibung | Referenz<textarea name="vulnerabilities" rows="4" placeholder="CVE-2026-1234 | high | Beispiel | https://..."></textarea></label><button>Release veröffentlichen</button></form></section>{{else}}<div class="alert info">Mitarbeiter können Daten pflegen. Neue Releases dürfen nur Admins erstellen.</div>{{end}}<section class="card"><h2>Release-Historie</h2><table><thead><tr><th>Software</th><th>Version</th><th>Channel</th><th>Architektur</th><th>Schwachstellen</th><th>Links</th></tr></thead><tbody>{{range .Releases}}<tr><td>{{softwareName .SoftwareID $.Software}}</td><td><strong>{{.Version}}</strong><p class="muted">{{.ReleaseDate}}</p></td><td>{{.Channel}}</td><td>{{.Architecture}}</td><td>{{range .Vulnerabilities}}<div><strong>{{.CVE}}</strong> {{.Severity}}<br><span class="muted">{{.Description}}</span></div>{{else}}<span class="muted">Keine angegeben</span>{{end}}</td><td>{{if .ReleaseURL}}<a href="{{.ReleaseURL}}" rel="noopener noreferrer">Info</a>{{end}} {{if .DownloadURL}}<a href="{{.DownloadURL}}" rel="noopener noreferrer">Download</a>{{end}}</td></tr>{{end}}</tbody></table></section>{{end}}{{template "base" .}}
|
||||
1
templates/software.html
Normal file
1
templates/software.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<h1>Software</h1><section class="grid"><form method="post" class="card form"><h2>Software pflegen</h2><label>Hersteller<select name="manufacturer_id" required>{{range .Manufacturers}}<option value="{{.ID}}">{{.Name}}</option>{{end}}</select></label><label>Name<input name="name" required></label><label>Homepage<input name="homepage" type="url" placeholder="https://..."></label><label>Architekturen<input name="architectures" placeholder="x86_64, arm64, windows"></label><label>Channels<input name="channels" placeholder="stable, beta, nightly"></label><label>Informationen<textarea name="description" rows="5"></textarea></label><button>Speichern</button></form><section class="card"><h2>Liste</h2><table><thead><tr><th>Hersteller</th><th>Name</th><th>Architekturen</th><th>Channels</th><th>Discord-Kanal</th><th>Homepage</th></tr></thead><tbody>{{range .Software}}<tr><td>{{manufacturerName .ManufacturerID $.Manufacturers}}</td><td><strong>{{.Name}}</strong></td><td>{{join .Architectures ", "}}</td><td>{{join .Channels ", "}}</td><td>{{if .DiscordChannelID}}<code>{{.DiscordChannelID}}</code>{{else}}<span class="muted">nicht verknüpft</span>{{end}}</td><td>{{if .Homepage}}<a href="{{.Homepage}}" rel="noopener noreferrer">Link</a>{{end}}</td></tr>{{else}}<tr><td colspan="6" class="muted">Noch keine Software angelegt.</td></tr>{{end}}</tbody></table><p class="muted">Wenn Discord aktiviert ist, wird beim Anlegen automatisch ein Kanal im Format <code>hersteller-software</code> erstellt und hier verknüpft.</p></section></section>{{end}}{{template "base" .}}
|
||||
1
templates/users.html
Normal file
1
templates/users.html
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}<h1>Benutzer</h1><section class="grid"><form method="post" class="card form"><h2>Benutzer anlegen</h2><label>Name<input name="display_name" required></label><label>E-Mail<input name="email" type="email" required></label><label>Rolle<select name="role"><option value="employee">Mitarbeiter</option><option value="admin">Admin</option></select></label><label>Initiales Passwort<input name="password" type="password" minlength="10" required></label><button>Anlegen</button></form><section class="card"><h2>Benutzerliste</h2><table><thead><tr><th>Name</th><th>E-Mail</th><th>Rolle</th><th>Erstellt</th></tr></thead><tbody>{{range .Users}}<tr><td><strong>{{.DisplayName}}</strong></td><td>{{.Email}}</td><td>{{.Role}}</td><td>{{.CreatedAt}}</td></tr>{{end}}</tbody></table></section></section><section class="card"><h2>Discord-Empfänger</h2><p class="muted">Diese Nutzer erhalten beim Erstellen eines Releases eine DM vom Bot.</p><table><thead><tr><th>Discord-Name</th><th>User-ID</th><th>Hinzugefügt</th></tr></thead><tbody>{{range .DiscordSubscribers}}<tr><td><strong>{{.Username}}</strong></td><td><code>{{.UserID}}</code></td><td>{{.CreatedAt}}</td></tr>{{else}}<tr><td colspan="3" class="muted">Noch keine Empfänger registriert.</td></tr>{{end}}</tbody></table></section>{{end}}{{template "base" .}}
|
||||
Reference in New Issue
Block a user