Skip to content

Commit 87ce021

Browse files
author
Bruno Quaresma
authored
fix: centralize warning message in static error (coder#20389)
- Centralize warning message in static error - Change a few typography styles to match coder/coder **Before:** <img width="1624" height="967" alt="Screenshot 2025-10-20 at 14 35 56" src="https://github.com/user-attachments/assets/5f0b36cb-47f5-4c34-9a08-41f356bcc860" /> **After:** <img width="1624" height="967" alt="Screenshot 2025-10-20 at 14 35 48" src="https://github.com/user-attachments/assets/aa3fe961-3d12-4288-9e65-2736ec856dfc" /> Fixes coder#20369
1 parent 86f0f39 commit 87ce021

1 file changed

Lines changed: 173 additions & 181 deletions

File tree

‎site/static/error.html‎

Lines changed: 173 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,179 @@
11
{{/*
2-
This template is used by application handlers to render friendly error pages
3-
when there is a proxy error (for example, when the target app isn't running).
2+
This template is used by application handlers to render friendly error pages
3+
when there is a proxy error (for example, when the target app isn't running).
44

5-
Since it is served from subdomains, both on proxies and the primary, it MUST
6-
NOT access any external resources. It must be entirely self-contained. This
7-
includes anything in `/static` or `/icon`, as these are not served from
8-
subdomains.
5+
Since it is served from subdomains, both on proxies and the primary, it MUST
6+
NOT access any external resources. It must be entirely self-contained. This
7+
includes anything in `/static` or `/icon`, as these are not served from
8+
subdomains.
99
*/}}
1010
<!doctype html>
1111
<html lang="en">
12-
<head>
13-
<meta charset="UTF-8" />
14-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
15-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
16-
<title>
17-
{{- if not .Error.HideStatus }}{{ .Error.Status }} - {{end}}{{
18-
.Error.Title }}
19-
</title>
20-
<style>
21-
* {
22-
padding: 0;
23-
margin: 0;
24-
box-sizing: border-box;
25-
}
26-
27-
html,
28-
body {
29-
background-color: #05060b;
30-
color: #f7f9fd;
31-
display: flex;
32-
align-items: center;
33-
justify-content: center;
34-
font-family: sans-serif;
35-
font-size: 16px;
36-
height: 100%;
37-
}
38-
39-
.container {
40-
--side-padding: 24px;
41-
width: 100%;
42-
max-width: calc(500px + var(--side-padding) * 2);
43-
padding: 0 var(--side-padding);
44-
text-align: center;
45-
}
46-
47-
.coder-svg {
48-
width: 80px;
49-
margin-bottom: 24px;
50-
}
51-
52-
h1 {
53-
font-weight: 700;
54-
font-size: 36px;
55-
margin-bottom: 8px;
56-
}
57-
58-
p,
59-
li {
60-
color: #b2bfd7;
61-
line-height: 140%;
62-
}
63-
64-
.warning li {
65-
text-align: left;
66-
padding-top: 10px;
67-
margin-left: 30px;
68-
}
69-
70-
.button-group {
71-
display: flex;
72-
align-items: center;
73-
justify-content: center;
74-
gap: 12px;
75-
margin-top: 24px;
76-
}
77-
78-
.button-group a,
79-
.button-group button {
80-
display: inline-flex;
81-
align-items: center;
82-
justify-content: center;
83-
padding: 6px 16px;
84-
border-radius: 4px;
85-
border: 1px solid #2c3854;
86-
text-decoration: none;
87-
background: none;
88-
font-size: inherit;
89-
color: inherit;
90-
width: 200px;
91-
height: 42px;
92-
cursor: pointer;
93-
}
94-
95-
.button-group a:hover,
96-
.button-group button:hover {
97-
border-color: hsl(222, 31%, 40%);
98-
}
99-
100-
.warning {
101-
margin-top: 24px;
102-
border: 1px solid rgb(243, 140, 89);
103-
background: rgb(13, 19, 33);
104-
width: calc(520px + var(--side-padding) * 2);
105-
/* Recenter */
106-
margin-left: calc(-1 * (100px + var(--side-padding)));
107-
padding: 10px;
108-
}
109-
110-
.warning-title {
111-
display: inline-flex;
112-
align-self: center;
113-
align-items: center;
114-
}
115-
116-
.svg-icon svg {
117-
height: 1em;
118-
width: 1em;
119-
}
120-
121-
.warning-title h3 {
122-
margin-left: 10px;
123-
}
124-
</style>
125-
</head>
126-
<body>
127-
<div class="container">
128-
{{/*
129-
DO NOT LOAD AN EXTERNAL IMAGE HERE. See the comment at the top of
130-
this file for more details.
131-
*/}}
132-
<svg
133-
class="coder-svg"
134-
viewBox="0 0 66 48"
135-
fill="none"
136-
xmlns="http://www.w3.org/2000/svg"
137-
>
138-
<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" />
139-
</svg>
140-
141-
<h1>
142-
{{- if not .Error.HideStatus }}{{ .Error.Status }} - {{end}}{{
143-
.Error.Title }}
144-
</h1>
145-
{{- if .Error.RenderDescriptionMarkdown }} {{ .ErrorDescriptionHTML }} {{
146-
else }}
147-
<p>{{ .Error.Description }}</p>
148-
{{ end }} {{- if .Error.AdditionalInfo }}
149-
<br />
150-
<p>{{ .Error.AdditionalInfo }}</p>
151-
{{ end }} {{- if .Error.Warnings }}
152-
<div class="warning">
153-
<div class="warning-title">
154-
<svg
155-
height="1em"
156-
width="auto"
157-
focusable="false"
158-
aria-hidden="true"
159-
viewBox="0 0 24 24"
160-
>
161-
<path
162-
fill="#e66828"
163-
d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
164-
></path>
165-
</svg>
166-
<h3>Warnings</h3>
167-
</div>
168-
<ul>
169-
{{ range $i, $v := .Error.Warnings }}
170-
<li>{{ $v }}</li>
171-
{{ end }}
172-
</ul>
173-
</div>
174-
{{ end }}
175-
<div class="button-group">
176-
{{- if and .Error.AdditionalButtonText .Error.AdditionalButtonLink }}
177-
<a href="{{ .Error.AdditionalButtonLink }}"
178-
>{{ .Error.AdditionalButtonText }}</a
179-
>
180-
{{ end }} {{- if .Error.RetryEnabled }}
181-
<button onclick="window.location.reload()">Retry</button>
182-
{{ end }}
183-
<a href="{{ .Error.DashboardURL }}">Back to site</a>
184-
</div>
185-
</div>
186-
</body>
12+
<head>
13+
<meta charset="UTF-8" />
14+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
15+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
16+
<title>
17+
{{- if not .Error.HideStatus }}{{ .Error.Status }} - {{end}}{{
18+
.Error.Title }}
19+
</title>
20+
<style>
21+
* {
22+
padding: 0;
23+
margin: 0;
24+
box-sizing: border-box;
25+
}
26+
27+
html,
28+
body {
29+
background-color: #05060b;
30+
color: #a1a1aa;
31+
display: flex;
32+
align-items: center;
33+
justify-content: center;
34+
font-family: sans-serif;
35+
font-size: 16px;
36+
height: 100%;
37+
}
38+
39+
header {
40+
text-align: center;
41+
}
42+
43+
.container {
44+
--side-padding: 24px;
45+
width: 100%;
46+
max-width: calc(500px + var(--side-padding) * 2);
47+
padding: 0 var(--side-padding);
48+
}
49+
50+
.coder-svg {
51+
width: 80px;
52+
margin-bottom: 24px;
53+
}
54+
55+
h1 {
56+
font-size: 24px;
57+
margin-bottom: 8px;
58+
font-weight: 400;
59+
color: white;
60+
}
61+
62+
p,
63+
li {
64+
line-height: 140%;
65+
font-size: 14px;
66+
}
67+
68+
69+
.button-group {
70+
display: flex;
71+
align-items: center;
72+
justify-content: center;
73+
gap: 12px;
74+
margin-top: 24px;
75+
}
76+
77+
.button-group a,
78+
.button-group button {
79+
display: inline-flex;
80+
align-items: center;
81+
justify-content: center;
82+
padding: 6px 16px;
83+
border-radius: 4px;
84+
border: 1px solid #2c3854;
85+
text-decoration: none;
86+
background: none;
87+
font-size: inherit;
88+
color: inherit;
89+
width: 200px;
90+
height: 42px;
91+
cursor: pointer;
92+
}
93+
94+
.button-group a:hover,
95+
.button-group button:hover {
96+
border-color: hsl(222, 31%, 40%);
97+
}
98+
99+
.warning {
100+
margin-top: 24px;
101+
border: 1px solid rgb(243, 140, 89);
102+
background: rgb(13, 19, 33);
103+
width: 100%;
104+
padding: 24px;
105+
}
106+
107+
.warning-title {
108+
display: inline-flex;
109+
align-self: center;
110+
align-items: center;
111+
}
112+
113+
.warning-title h3 {
114+
margin-left: 12px;
115+
font-size: 16px;
116+
font-weight: 500;
117+
color: white;
118+
}
119+
120+
.warning li {
121+
padding-top: 10px;
122+
margin-left: 30px;
123+
}
124+
</style>
125+
</head>
126+
127+
<body>
128+
<div class="container">
129+
<header>
130+
{{/*
131+
DO NOT LOAD AN EXTERNAL IMAGE HERE. See the comment at the top of
132+
this file for more details.
133+
*/}}
134+
<svg class="coder-svg" viewBox="0 0 66 48" fill="none" xmlns="http://www.w3.org/2000/svg">
135+
<path
136+
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"
137+
fill="white" />
138+
</svg>
139+
140+
<h1>
141+
{{- if not .Error.HideStatus }}{{ .Error.Status }} - {{end}}{{
142+
.Error.Title }}
143+
</h1>
144+
{{- if .Error.RenderDescriptionMarkdown }} {{ .ErrorDescriptionHTML }} {{
145+
else }}
146+
<p>{{ .Error.Description }}</p>
147+
{{ end }} {{- if .Error.AdditionalInfo }}
148+
<br />
149+
<p>{{ .Error.AdditionalInfo }}</p>
150+
{{ end }}
151+
</header>
152+
153+
{{- if .Error.Warnings }}
154+
<div class="warning">
155+
<div class="warning-title">
156+
<svg height="1em" width="auto" focusable="false" aria-hidden="true" viewBox="0 0 24 24">
157+
<path fill="#e66828" d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z">
158+
</path>
159+
</svg>
160+
<h3>Warnings</h3>
161+
</div>
162+
<ul>
163+
{{ range $i, $v := .Error.Warnings }}
164+
<li>{{ $v }}</li>
165+
{{ end }}
166+
</ul>
167+
</div>
168+
{{ end }}
169+
<div class="button-group">
170+
{{- if and .Error.AdditionalButtonText .Error.AdditionalButtonLink }}
171+
<a href="{{ .Error.AdditionalButtonLink }}">{{ .Error.AdditionalButtonText }}</a>
172+
{{ end }} {{- if .Error.RetryEnabled }}
173+
<button onclick="window.location.reload()">Retry</button>
174+
{{ end }}
175+
<a href="{{ .Error.DashboardURL }}">Back to site</a>
176+
</div>
177+
</div>
178+
</body>
187179
</html>

0 commit comments

Comments
 (0)