add detach files feature, utf8 filename fix, and error pages

This commit is contained in:
dev
2026-09-07 09:42:28 +03:00
parent 330930a22b
commit 686d82319e
7 changed files with 258 additions and 23 deletions
+57
View File
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Ошибка — WhatIDo</title>
<link rel="stylesheet" href="admin.css">
<style>
.error-page{display:flex;align-items:center;justify-content:center;min-height:100dvh;padding:24px;text-align:center}
.error-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:48px 40px;max-width:400px;width:100%}
.error-code{font-size:6rem;font-weight:700;color:var(--accent);line-height:1;margin-bottom:8px}
.error-title{font-size:1.5rem;font-weight:600;color:var(--text);margin-bottom:12px}
.error-message{color:var(--muted);font-size:1rem;line-height:1.6;margin-bottom:24px}
.error-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.error-actions a,.error-actions button{background:var(--accent);color:#fff;border:none;border-radius:8px;padding:12px 24px;font-size:.9rem;font-weight:600;cursor:pointer;text-decoration:none;transition:opacity .15s}
.error-actions a:hover,.error-actions button:hover{opacity:.85}
.error-actions .ghost{background:var(--card);border:1px solid var(--border);color:var(--accent)}
.error-actions .ghost:hover{border-color:var(--accent);background:rgba(37,99,235,.06)}
.error-details{margin-top:24px;padding-top:24px;border-top:1px solid var(--border);font-size:.75rem;color:var(--muted);text-align:left}
.error-details pre{white-space:pre-wrap;word-break:break-word;font-family:monospace;background:var(--bg);padding:12px;border-radius:8px;margin-top:8px;max-height:200px;overflow:auto}
@media(max-width:480px){.error-code{font-size:4rem}.error-card{padding:32px 20px}}
</style>
</head>
<body>
<div class="error-page">
<div class="error-card">
<div class="error-code" id="errorCode">404</div>
<h1 class="error-title" id="errorTitle">Страница не найдена</h1>
<p class="error-message" id="errorMessage">Запрашиваемая страница не существует или была перемещена.</p>
<div class="error-actions">
<a href="/" class="ghost">На главную</a>
<button onclick="history.back()">Назад</button>
</div>
<div class="error-details" id="errorDetails" style="display:none">
<strong>Детали:</strong>
<pre id="errorStack"></pre>
</div>
</div>
</div>
<script>
(function(){
const params = new URLSearchParams(location.search);
const code = params.get('code') || '404';
const title = params.get('title') || '';
const message = params.get('message') || '';
const details = params.get('details') || '';
document.getElementById('errorCode').textContent = code;
document.getElementById('errorTitle').textContent = title || (code === '404' ? 'Страница не найдена' : 'Ошибка');
document.getElementById('errorMessage').textContent = message || (code === '404' ? 'Запрашиваемая страница не существует или была перемещена.' : 'Произошла ошибка на сервере.');
if (details) {
document.getElementById('errorDetails').style.display = 'block';
document.getElementById('errorStack').textContent = details;
}
})();
</script>
</body>
</html>