mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
3a0e8af6e3
Closes #19984 As part of this, I refactored the error template to take in a slice of actions rather than using individual booleans and strings to control the behavior. We decided a link resolves the issue for now so that is what I added, although we may want to consider a way to start the workspace and follow the logs dynamically on that page and then show the app when finished (similar to the tasks page), or at least make the link automatically start the workspace instead of only taking you to the dashboard where you have to then start the workspace.
205 lines
4.7 KiB
HTML
205 lines
4.7 KiB
HTML
{{/*
|
|
This template is used by application handlers to render friendly error pages
|
|
when there is a proxy error (for example, when the target app isn't running).
|
|
|
|
Since it is served from subdomains, both on proxies and the primary, it MUST
|
|
NOT access any external resources. It must be entirely self-contained. This
|
|
includes anything in `/static` or `/icon`, as these are not served from
|
|
subdomains.
|
|
*/}}
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>
|
|
{{- if not .Error.HideStatus }}{{ .Error.Status }} - {{end}}{{
|
|
.Error.Title }}
|
|
</title>
|
|
<style>
|
|
* {
|
|
padding: 0;
|
|
margin: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--color-white: #FFFFFF;
|
|
--color-warning: #F3722C;
|
|
--color-surface-primary: #090B0B;
|
|
--color-zinc-900: #18181B;
|
|
--color-zinc-400: #A1A1AA;
|
|
--color-zinc-800: #27272A;
|
|
}
|
|
|
|
html,
|
|
body {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100%;
|
|
|
|
background: var(--color-surface-primary);
|
|
color: var(--color-zinc-400);
|
|
|
|
font-family: system-ui, sans-serif;
|
|
font-size: 16px;
|
|
}
|
|
|
|
header {
|
|
text-align: center;
|
|
}
|
|
|
|
.container {
|
|
--side-padding: 1.5rem;
|
|
width: 100%;
|
|
max-width: calc(31.25rem + var(--side-padding) * 2);
|
|
padding: 0 var(--side-padding);
|
|
}
|
|
|
|
.coder-svg {
|
|
width: 5rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 1.5rem;
|
|
font-weight: 400;
|
|
color: var(--color-white);
|
|
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
p,
|
|
li {
|
|
line-height: 140%;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.button-group {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 0.75rem;
|
|
|
|
margin-top: 1.5rem;
|
|
}
|
|
|
|
.button-group a,
|
|
.button-group button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
padding: 0.5rem 1rem;
|
|
|
|
border-radius: 0.375rem;
|
|
border: 1px solid var(--color-zinc-800);
|
|
background: none;
|
|
|
|
color: var(--color-white);
|
|
text-decoration: none;
|
|
font-size: 0.875rem;
|
|
font-weight: 400;
|
|
|
|
width: 12.5rem;
|
|
height: 2.5rem;
|
|
|
|
cursor: pointer;
|
|
}
|
|
|
|
.button-group a:hover,
|
|
.button-group button:hover {
|
|
background-color: var(--color-zinc-900);
|
|
border-color: var(--color-zinc-800);
|
|
}
|
|
|
|
.warning {
|
|
border: 1px solid var(--color-warning);
|
|
background: var(--color-zinc-900);
|
|
width: 100%;
|
|
|
|
margin: 1.5rem 0 0;
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.warning-title {
|
|
display: inline-flex;
|
|
align-self: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.warning-title h3 {
|
|
font-size: 1rem;
|
|
font-weight: 400;
|
|
color: var(--color-white);
|
|
|
|
margin-left: 0.75rem;
|
|
}
|
|
|
|
.warning li {
|
|
padding-top: 0.625rem;
|
|
margin-left: 1.875rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
{{/*
|
|
DO NOT LOAD AN EXTERNAL IMAGE HERE. See the comment at the top of
|
|
this file for more details.
|
|
*/}}
|
|
<svg class="coder-svg" viewBox="0 0 66 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M18.996 7C29.9934 7.00003 36.1588 12.5745 36.3671 20.7799L26.8691 21.0919C26.6191 16.5433 22.8492 13.5554 18.996 13.6445C13.7055 13.756 9.78938 17.5243 9.78934 23.5C9.78934 29.4757 13.7054 33.1773 18.996 33.1773C22.8492 33.177 26.5357 30.323 26.9524 25.7743L36.4503 25.9974C36.2004 34.3365 29.6602 40 18.996 40C8.33164 40 0 33.5338 0 23.5C3.90577e-05 13.4216 7.9984 7 18.996 7ZM66 7.97504V39.1914H41.0058V7.97504H66Z"
|
|
fill="white" />
|
|
</svg>
|
|
|
|
<h1>
|
|
{{- if not .Error.HideStatus }}{{ .Error.Status }} - {{end}}{{
|
|
.Error.Title }}
|
|
</h1>
|
|
{{- if .Error.RenderDescriptionMarkdown }} {{ .ErrorDescriptionHTML }} {{
|
|
else }}
|
|
<p>{{ .Error.Description }}</p>
|
|
{{ end }} {{- if .Error.AdditionalInfo }}
|
|
<br />
|
|
<p>{{ .Error.AdditionalInfo }}</p>
|
|
{{ end }}
|
|
</header>
|
|
|
|
{{- if .Error.Warnings }}
|
|
<div class="warning">
|
|
<div class="warning-title">
|
|
<svg height="1em" width="auto" focusable="false" aria-hidden="true" viewBox="0 0 24 24">
|
|
<path fill="#e66828" d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z">
|
|
</path>
|
|
</svg>
|
|
<h3>Warnings</h3>
|
|
</div>
|
|
<ul>
|
|
{{ range $i, $v := .Error.Warnings }}
|
|
<li>{{ $v }}</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{- if .Error.Actions }}
|
|
<div class="button-group">
|
|
{{ range $i, $v := .Error.Actions }}
|
|
{{- if $v.URL }}
|
|
<a href="{{ $v.URL }}">{{ $v.Text }}</a>
|
|
{{ else }}
|
|
<button onclick="window.location.reload()">{{ $v.Text }}</button>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</body>
|
|
</html>
|