Files
Glimmer/internal/server/templates/bin_token.html
lucioandClaude Opus 4.8 87477556e2 Redesign admin Pastes page as Xiaohongshu-style cards with previews
- Replace the pastes table with a masonry card grid: each card shows the
  paste's first image as a thumbnail, a short plain-text summary, meta badges,
  and Copy link / Edit / QR / Delete actions.
- Clicking anywhere on a card (except the action buttons) opens an in-page
  preview modal with the rendered paste in an iframe; it can be expanded to the
  main content area or closed (Esc/backdrop/button). Keyboard accessible.
- Generate and cache 512px (long side) JPEG thumbnails for uploaded images on
  first request (GET /uploads/thumb/{filename}); also generated at upload time
  and invalidated on resize/delete. WebP falls back to the original.
- Sync the public paste pages (bin_view, bin_token) to the dark theme so they
  match the rest of the app and the preview iframe.
- Relax framing headers to same-origin (X-Frame-Options SAMEORIGIN,
  frame-ancestors 'self') so the same-origin preview iframe can load; cross-site
  framing stays blocked.
- Document the new thumbnail route in the README routes table.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-05 00:23:51 -07:00

44 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Access Token Required — Glimmer</title>
<link rel="stylesheet" href="/static/pico.min.css">
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<nav>
<ul><li><strong><a href="/">Glimmer</a></strong></li></ul>
<ul><li><a href="/">Home</a></li></ul>
</nav>
<main class="container" style="max-width:480px;padding-top:4rem;text-align:center">
<p style="font-size:4rem;line-height:1;margin:0">&#128274;</p>
<h2 style="margin-top:0.5rem">Access Token Required</h2>
<p style="color:var(--pico-muted-color)">This paste is protected. Enter the access token to view it.</p>
{{if .Error}}
<article aria-label="error" class="alert-error" style="text-align:left">{{.Error}}</article>
{{end}}
<form id="token-form" style="text-align:left;margin-top:1.5rem">
<label>
Token
<input type="text" id="token-input" required placeholder="Enter access token" autofocus>
</label>
<button type="submit" style="width:100%">View Paste</button>
</form>
</main>
<script>
document.getElementById('token-form').addEventListener('submit', function(e) {
e.preventDefault();
var token = document.getElementById('token-input').value.trim();
if (token) {
window.location.href = window.location.pathname + '/' + encodeURIComponent(token);
}
});
</script>
</body>
</html>