Skip to content

Commit 96e870d

Browse files
authored
Merge pull request #6662 from andywarburton/main
Added css support to web workflow
2 parents c4c1520 + 35797ff commit 96e870d

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

supervisor/shared/web_workflow/static/directory.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<title></title>
55
<meta charset="UTF-8">
66
<script src="/directory.js" defer=true></script>
7+
<link rel="stylesheet" href="/style.css">
78
</head>
89
<body>
910
<h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1>

supervisor/shared/web_workflow/static/serial.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<script src="/serial.js" defer=true></script>
8+
<link rel="stylesheet" href="/style.css">
89
</head>
910
<body style="flex-direction: column; display: flex; height: 100%; width: 100%; margin: 0; font-size: 1rem;">
1011
<div style="flex: auto; display: flex; overflow: auto; flex-direction: column;">
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
body {
2+
max-width: 960px;
3+
margin: 20px auto;
4+
font-size: 18px;
5+
font-family: "Proxima Nova", Verdana, sans-serif;
6+
line-height: 20.7px;
7+
}

supervisor/shared/web_workflow/static/welcome.html

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,28 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<script src="/welcome.js" defer=true></script>
8+
<link rel="stylesheet" href="/style.css">
89
</head>
910
<body>
11+
1012
<h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;Welcome!</h1>
11-
Welcome to CircuitPython's Web API. Go to the <a href="/fs/">file browser</a> to work with files in the CIRCUITPY drive. Go to the <a href="/cp/serial/">serial terminal</a> to see code output and interact with the REPL. Make sure you've set <code>CIRCUITPY_WEB_API_PASSWORD='somepassword'</code> in <code>/.env</code>. Provide the password when the browser prompts for it. Leave the username blank.
12-
<h2>Device Info</h2>
13-
Board: <a id="board"></a><br>
14-
Version: <span id="version"></span><br>
15-
Hostname: <a id="hostname"></a><br>
16-
IP: <a id="ip"></a>
17-
<h2>Other Devices</h2>
18-
Here are other CircuitPython devices on your network:
13+
14+
<p>Welcome to CircuitPython's Web API. Go to the <a href="/fs/">file browser</a> to work with files in the CIRCUITPY drive. Go to the <a href="/cp/serial/">serial terminal</a> to see code output and interact with the REPL. Make sure you've set <code>CIRCUITPY_WEB_API_PASSWORD='somepassword'</code> in <code>/.env</code>. Provide the password when the browser prompts for it. <strong>Leave the username blank.</strong></p>
15+
16+
<h2>Device Info:</h2>
17+
18+
<dl>
19+
<dt>Board:</dt>
20+
<dd><a id="board"></a></dd>
21+
<dt>Version:</dt>
22+
<dd><span id="version"></span></dd>
23+
<dt>Hostname:</dt>
24+
<dd><a id="hostname"></a></dd>
25+
<dt>IP:</dt>
26+
<dd><a id="ip"></a></dd>
27+
</dl>
28+
29+
<h2>Here are other CircuitPython devices on your network:</h2>
1930
<ul id="devices">
2031
</ul>
2132
</body>

supervisor/shared/web_workflow/web_workflow.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ STATIC_FILE(directory_html);
894894
STATIC_FILE(directory_js);
895895
STATIC_FILE(welcome_html);
896896
STATIC_FILE(welcome_js);
897+
STATIC_FILE(style_css);
897898
STATIC_FILE(serial_html);
898899
STATIC_FILE(serial_js);
899900
STATIC_FILE(blinka_16x16_ico);
@@ -1103,6 +1104,8 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) {
11031104
_REPLY_STATIC(socket, request, welcome_js);
11041105
} else if (strcmp(request->path, "/serial.js") == 0) {
11051106
_REPLY_STATIC(socket, request, serial_js);
1107+
} else if (strcmp(request->path, "/style.css") == 0) {
1108+
_REPLY_STATIC(socket, request, style_css);
11061109
} else if (strcmp(request->path, "/favicon.ico") == 0) {
11071110
// TODO: Autogenerate this based on the blinka bitmap and change the
11081111
// palette based on MAC address.

0 commit comments

Comments
 (0)