feat: add admin console, cleanup, and thumbnail workers
- Implement a token-authenticated admin console at `/admin` with overview metrics and file management. - Add a background worker to periodically clean up expired boxes based on `WARPBOX_CLEANUP_EVERY`. - Add a background worker to generate image and video thumbnails based on `WARPBOX_THUMBNAIL_EVERY`. - Update file storage paths to use `@each@` and `@thumb@` prefixes to separate original files from thumbnails. - Add severity fields to startup logs and update configuration templates.
This commit is contained in:
46
backend/templates/layouts/base.html
Normal file
46
backend/templates/layouts/base.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{{define "base"}}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{if .Title}}{{.Title}} - {{end}}{{.AppName}}</title>
|
||||
<meta name="description" content="{{.Description}}">
|
||||
<meta name="theme-color" content="#09090b">
|
||||
<meta property="og:site_name" content="{{.AppName}}">
|
||||
<meta property="og:title" content="{{if .Title}}{{.Title}}{{else}}{{.AppName}}{{end}}">
|
||||
<meta property="og:description" content="{{.Description}}">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="{{.BaseURL}}">
|
||||
{{if .ImageURL}}<meta property="og:image" content="{{.ImageURL}}">{{end}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
{{if .ImageURL}}<meta name="twitter:image" content="{{.ImageURL}}">{{end}}
|
||||
<link rel="stylesheet" href="/static/css/app.css">
|
||||
<script defer src="/static/js/app.js"></script>
|
||||
</head>
|
||||
<body class="dark">
|
||||
<a class="skip-link" href="#main">Skip to content</a>
|
||||
<header class="site-header">
|
||||
<nav class="nav" aria-label="Main navigation">
|
||||
<a class="brand" href="/" aria-label="{{.AppName}} home">
|
||||
<span class="brand-mark" aria-hidden="true">W</span>
|
||||
<span>{{.AppName}}</span>
|
||||
</a>
|
||||
<div class="nav-links">
|
||||
<a class="button button-ghost" href="/api/v1/health">API</a>
|
||||
<a class="button button-outline" href="/healthz">Health</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="main">
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<span>{{.AppName}} · {{.CurrentYear}} · self-hosted</span>
|
||||
<span class="footer-links"><a href="/">Upload</a><a href="/healthz">Health</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user