@@ -130,12 +130,12 @@ async fn process_logs(
130
130
131
131
let html = format ! (
132
132
r###"<!DOCTYPE html>
133
- <html>
133
+ <html lang="en" translate="no" >
134
134
<head>
135
- <title>{log_uuid} - triagebot</title>
136
135
<meta charset="UTF-8">
137
136
<meta name="viewport" content="width=device-width, initial-scale=1.0">
138
- <link rel="icon" sizes="32x32" type="image/png" href="https://rust-lang.org/static/images/favicon-32x32.png">
137
+ <title>{log_id} - {owner}/{repo}</title>
138
+ <link rel="icon" sizes="32x32" type="image/png" href="https://www.rust-lang.org/static/images/favicon-32x32.png">
139
139
<style>
140
140
body {{
141
141
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
@@ -144,14 +144,18 @@ async fn process_logs(
144
144
white-space: pre;
145
145
}}
146
146
.timestamp {{
147
- color: unset ;
147
+ color: #848484 ;
148
148
text-decoration: none;
149
149
}}
150
150
.timestamp:hover {{
151
151
text-decoration: underline;
152
152
}}
153
153
.error-marker {{
154
154
scroll-margin-bottom: 15vh;
155
+ color: #e5534b;
156
+ }}
157
+ .warning-marker {{
158
+ color: #c69026;
155
159
}}
156
160
</style>
157
161
<script type="module" nonce="{nonce}">
@@ -179,6 +183,11 @@ async fn process_logs(
179
183
html = html.replace(/##\[error\]/g, () =>
180
184
`<a id="error-${{++errorCounter}}" class="error-marker">##[error]</a>`
181
185
);
186
+
187
+ // 4.b Add a span around every "##[warning]" string
188
+ html = html.replace(/##\[warning\]/g, () =>
189
+ `<span class="warning-marker">##[warning]</span>`
190
+ );
182
191
183
192
// 5. Add the html to the DOM
184
193
var cdiv = document.getElementById("console");
@@ -207,7 +216,9 @@ async fn process_logs(
207
216
. header ( CONTENT_TYPE , "text/html; charset=utf-8" )
208
217
. header (
209
218
CONTENT_SECURITY_POLICY ,
210
- format ! ( "script-src 'nonce-{nonce}' {ANSI_UP_URL}" ) ,
219
+ format ! (
220
+ "default-src 'none'; script-src 'nonce-{nonce}' 'self'; style-src 'unsafe-inline'; img-src www.rust-lang.org"
221
+ ) ,
211
222
)
212
223
. body ( Body :: from ( html) ) ?) ;
213
224
}
0 commit comments