From 2a0e4f7ee22e8c133efeba8e199fd9a30b10f964 Mon Sep 17 00:00:00 2001 From: Andy Warburton Date: Thu, 28 Jul 2022 12:03:22 +0100 Subject: [PATCH 1/7] added css support to web workflow Added a bare minimum css implementation to web workflow to improve readability --- supervisor/shared/web_workflow/static/directory.html | 1 + supervisor/shared/web_workflow/static/serial.html | 1 + supervisor/shared/web_workflow/static/style.css | 7 +++++++ supervisor/shared/web_workflow/static/welcome.html | 1 + supervisor/shared/web_workflow/web_workflow.c | 3 +++ 5 files changed, 13 insertions(+) create mode 100644 supervisor/shared/web_workflow/static/style.css diff --git a/supervisor/shared/web_workflow/static/directory.html b/supervisor/shared/web_workflow/static/directory.html index d0ca1a3b32..0586cd0a54 100644 --- a/supervisor/shared/web_workflow/static/directory.html +++ b/supervisor/shared/web_workflow/static/directory.html @@ -4,6 +4,7 @@ +

 

diff --git a/supervisor/shared/web_workflow/static/serial.html b/supervisor/shared/web_workflow/static/serial.html index 0c13248904..5dfcb6cc7d 100644 --- a/supervisor/shared/web_workflow/static/serial.html +++ b/supervisor/shared/web_workflow/static/serial.html @@ -5,6 +5,7 @@ +
diff --git a/supervisor/shared/web_workflow/static/style.css b/supervisor/shared/web_workflow/static/style.css new file mode 100644 index 0000000000..7aa3eda00b --- /dev/null +++ b/supervisor/shared/web_workflow/static/style.css @@ -0,0 +1,7 @@ +body { + max-width: 960px; + margin: 20px auto; + font-size: 18px; + font-family: "Proxima Nova", Verdana, sans-serif; + line-height: 20.7px; +} \ No newline at end of file diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index 139e9eba39..d63b47584f 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -5,6 +5,7 @@ +

 Welcome!

diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index ff1c4060c3..a9435cc258 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -861,6 +861,7 @@ STATIC_FILE(directory_html); STATIC_FILE(directory_js); STATIC_FILE(welcome_html); STATIC_FILE(welcome_js); +STATIC_FILE(style_css); STATIC_FILE(serial_html); STATIC_FILE(serial_js); STATIC_FILE(blinka_16x16_ico); @@ -1070,6 +1071,8 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { _REPLY_STATIC(socket, request, welcome_js); } else if (strcmp(request->path, "/serial.js") == 0) { _REPLY_STATIC(socket, request, serial_js); + } else if (strcmp(request->path, "/style.css") == 0) { + _REPLY_STATIC(socket, request, style_css); } else if (strcmp(request->path, "/favicon.ico") == 0) { // TODO: Autogenerate this based on the blinka bitmap and change the // palette based on MAC address. From ccd60632845f4d3b38cc5424844985478ec115a7 Mon Sep 17 00:00:00 2001 From: Andy Warburton Date: Thu, 28 Jul 2022 16:08:05 +0100 Subject: [PATCH 2/7] Update welcome.html Made html more semantic. --- .../shared/web_workflow/static/welcome.html | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index d63b47584f..321fe09d43 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -8,16 +8,26 @@ +

 Welcome!

- Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank. + +

Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank.

+

Device Info

- Board:
- Version:
- Hostname:
- IP: -

Other Devices

- Here are other CircuitPython devices on your network: + +
+
Board:
+
+
Version:
+
+
Hostname:
+
+
IP:
+
+
Other Devices
+
+

Here are other CircuitPython devices on your network:

    -
+ From 1332bb6534fe1888f8c4ca10ed3d36df2b64ff06 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 Jul 2022 08:16:16 -0700 Subject: [PATCH 3/7] Add newline --- supervisor/shared/web_workflow/static/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/web_workflow/static/style.css b/supervisor/shared/web_workflow/static/style.css index 7aa3eda00b..f6ef757b3f 100644 --- a/supervisor/shared/web_workflow/static/style.css +++ b/supervisor/shared/web_workflow/static/style.css @@ -4,4 +4,4 @@ body { font-size: 18px; font-family: "Proxima Nova", Verdana, sans-serif; line-height: 20.7px; -} \ No newline at end of file +} From df14f953981500b56b19753215adee2d64ab03c5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 Jul 2022 08:16:51 -0700 Subject: [PATCH 4/7] Delete trailing spaces --- supervisor/shared/web_workflow/web_workflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index a9435cc258..b87493b1bc 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -1072,7 +1072,7 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (strcmp(request->path, "/serial.js") == 0) { _REPLY_STATIC(socket, request, serial_js); } else if (strcmp(request->path, "/style.css") == 0) { - _REPLY_STATIC(socket, request, style_css); + _REPLY_STATIC(socket, request, style_css); } else if (strcmp(request->path, "/favicon.ico") == 0) { // TODO: Autogenerate this based on the blinka bitmap and change the // palette based on MAC address. From 8b6e4cc4e80834b452dc0a912bb8cd6cca049ec3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 Jul 2022 08:18:52 -0700 Subject: [PATCH 5/7] Delete trailing spaces --- supervisor/shared/web_workflow/static/welcome.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index 321fe09d43..a7976055d3 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -28,6 +28,6 @@

Here are other CircuitPython devices on your network:

    -
+ From ac53e7e4390d91b3791e6a0de3e087ad2cb94948 Mon Sep 17 00:00:00 2001 From: Andy Warburton Date: Thu, 28 Jul 2022 16:57:02 +0100 Subject: [PATCH 6/7] further refinements --- supervisor/shared/web_workflow/static/welcome.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index a7976055d3..125158fd8d 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -13,7 +13,7 @@

Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank.

-

Device Info

+

Device Info:

Board:
@@ -22,12 +22,12 @@
Hostname:
-
IP:
-
-
Other Devices
+
IP:
+
+

Here are other CircuitPython devices on your network:

    -
+ From 35797ff3f07ef2cee2841125b2bf1d235595d43d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 Jul 2022 12:52:41 -0700 Subject: [PATCH 7/7] Remove trailing spaces --- supervisor/shared/web_workflow/static/welcome.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index 125158fd8d..e075c0200d 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -25,9 +25,9 @@
IP:
- +

Here are other CircuitPython devices on your network:

    -
+