Implement error pages, improve request logging
This commit is contained in:
parent
0cf51b8ff1
commit
e9c34a2337
19 changed files with 462 additions and 167 deletions
|
@ -12,6 +12,7 @@
|
|||
<link rel="icon" href="/images/favicon-128.png" sizes="128x128">
|
||||
<link rel="icon" href="/images/favicon-192.png" sizes="192x192">
|
||||
<link rel="icon" href="/images/favicon-228.png" sizes="228x228">
|
||||
<link rel="icon" href="/images/favicon.ico">
|
||||
|
||||
<!-- Android -->
|
||||
<link rel="shortcut icon" sizes="196x196" href="/images/favicon-196.png">
|
||||
|
@ -22,10 +23,18 @@
|
|||
<link rel="apple-touch-icon" href="/images/favicon-180.png" sizes="180x180">
|
||||
|
||||
<link rel="stylesheet" href="/css/cacert.bundle.css">
|
||||
<meta name="theme-color" content="#11568c">
|
||||
<title>{{ .Title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ template "content" . }}
|
||||
<body class="resource-app d-flex flex-column h-100">
|
||||
<main role="main" class="flex-shrink-0">
|
||||
{{ template "content" . }}
|
||||
</main>
|
||||
<footer class="footer mt-auto py-3">
|
||||
<div class="container">
|
||||
<span class="text-muted small">© 2020 <a href="https://www.cacert.org/">CAcert</a></span>
|
||||
</div>
|
||||
</footer>
|
||||
<script type="text/javascript" src="/js/cacert.bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
13
templates/app/errors.gohtml
Normal file
13
templates/app/errors.gohtml
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{ define "content" }}
|
||||
<div class="container text-center error-message">
|
||||
<img src="/images/CAcert-logo.svg" width="300" height="68" alt="CAcert" class="mb-4">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<h2>{{ if .details.ErrorCode }}
|
||||
<strong>{{ .details.ErrorCode }}</strong> {{ end }}{{ .details.ErrorMessage }}</h2>
|
||||
{{ if .details.ErrorDetails }}
|
||||
{{ range .details.ErrorDetails }}
|
||||
<p>{{ . }}</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
|
@ -1,5 +1,8 @@
|
|||
{{ define "content" }}
|
||||
<h1>{{ .Greeting }}</h1>
|
||||
<p>{{ .IntroductionText }}</p>
|
||||
<a href="{{ .LogoutURL }}">{{ .LogoutLabel }}</a>
|
||||
<div class="container">
|
||||
<img src="/images/CAcert-logo.svg" width="300" height="68" alt="CAcert" class="mb-4">
|
||||
<h1>{{ .Greeting }}</h1>
|
||||
<p>{{ .IntroductionText }}</p>
|
||||
<a class="btn btn-outline-primary" href="{{ .LogoutURL }}">{{ .LogoutLabel }}</a>
|
||||
</div>
|
||||
{{ end }}
|
Reference in a new issue