bouncer/templates/error.gohtml

109 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-06-26 14:36:28 +02:00
{{ define "default" }}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
{{ $title := print .StatusCode " - " .Status }}
<title>{{ $title }}</title>
<style>
html {
box-sizing: border-box;
font-size: 16px;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul {
margin: 0;
padding: 0;
font-weight: normal;
}
html,
body {
width: 100%;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-color: #ffe4e4;
}
#container {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
flex-direction: column;
}
#card {
padding: 1.5em 1em;
border: 1px solid #d90202;
background-color: #feb0b0;
border-radius: 5px;
box-shadow: 2px 2px #cccccc1c;
color: #810000 !important;
}
.title {
margin-bottom: 1.2em;
}
p {
margin-bottom: 0.5em;
}
code,
pre {
font-family: monospace;
}
.footer {
font-size: 0.7em;
margin-top: 2em;
text-align: right;
}
.stacktrace {
max-height: 250px;
overflow-y: auto;
background-color: #dca0a0;
padding: 0 10px;
border-radius: 5px;
margin-top: 10px;
}
2024-06-26 14:36:28 +02:00
</style>
</head>
<body>
<div id="container">
<div id="card">
<h2 class="title">⚠ {{ $title }}</h2>
2024-06-26 14:36:28 +02:00
{{ if .Debug }}
<h3>Stack Trace</h3>
<div class="stacktrace">
<pre>{{ printf "%+v" .Err }}</pre>
</div>
2024-06-26 14:36:28 +02:00
{{ end }}
<p class="footer">
Propulsé par
<a href="https://forge.cadoles.com/Cadoles/bouncer">Bouncer</a>.
</p>
</div>
</div>
</body>
</html>
{{ end }}