Files
vault-unwrap/html-template/file-viewer.html

79 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<title>{{.Title}}</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #f9f9f9;
}
.file-container {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
img {
max-width: 100%;
height: auto;
margin: 20px 0;
}
.file-info {
margin-top: 20px;
padding: 15px;
background: #f5f5f5;
border-radius: 5px;
}
.download-btn {
display: inline-block;
padding: 10px 20px;
background: #4CAF50;
color: white;
text-decoration: none;
border-radius: 5px;
margin: 10px;
}
.action-btn {
display: inline-block;
padding: 10px 20px;
background: #f0f0f0;
color: #333;
text-decoration: none;
border-radius: 5px;
margin: 10px;
}
</style>
</head>
<body>
<div class="file-container">
<h1>{{.Title}}</h1>
{{if .IsImage}}
<img src="data:{{.MimeType}};base64,{{.Base64Data}}" alt="File preview">
{{else}}
<div class="file-info">
<p>Этот файл не может быть отображен в браузере</p>
</div>
{{end}}
<div class="file-info">
<p><strong>Тип файла:</strong> {{.MimeType}}</p>
<p><strong>Размер:</strong> {{.FileSize}} KB</p>
<p><strong>Имя файла:</strong> {{.FileName}}</p>
<a href="data:{{.MimeType}};base64,{{.Base64Data}}"
class="download-btn"
download="{{.FileName}}">
Скачать файл
</a>
<a href="/" class="action-btn">На главную</a>
<a href="javascript:history.back()" class="action-btn">Назад</a>
</div>
</div>
</body>
</html>