From c71816c872e71d837d98933c4d69367ff39aa6da Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Mon, 23 May 2022 11:11:14 +0200 Subject: [PATCH 1/3] Update index html and manifest --- src/main.rs | 134 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 104 insertions(+), 30 deletions(-) diff --git a/src/main.rs b/src/main.rs index 224af71..ec29002 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,15 +47,33 @@ fn index() -> content::RawHtml<&'static str> { content::RawHtml( " - - - - +
+

ESP Web Flaher

+ +
+ +
+ + +
+ NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor) +
+
+ Your browser does not support the Web Serial API. Try Chrome +
+
+ + @@ -64,29 +82,85 @@ fn index() -> content::RawHtml<&'static str> { } #[get("/manifest.json")] -fn manifest(data: &State) -> content::RawJson { - content::RawJson(format!( +fn manifest() -> content::RawJson<&'static str> { + content::RawJson( r#" -{{ - "name": "Something", - "version": "1", - "home_assistant_domain": "esphome", - "funding_url": "https://esphome.io/guides/supporters.html", - "new_install_prompt_erase": false, - "builds": [ - {{ - "chipFamily": "{}", - "parts": [ - {{ "path": "bootloader.bin", "offset": 4096 }}, - {{ "path": "partitions.bin", "offset": 32768 }}, - {{ "path": "firmware.bin", "offset": 65536 }} - ] - }} - ] - }} -"#, - data.chip - )) +{ + "name": "ESP ", + "new_install_prompt_erase": true, + "builds": [ + { + "chipFamily": "ESP32", + "parts": [ + { + "path": "bootloader.bin", + "offset": 4096 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + }, + { + "chipFamily": "ESP32-C3", + "parts": [ + { + "path": "bootloader.bin", + "offset": 0 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + }, + { + "chipFamily": "ESP32-S2", + "parts": [ + { + "path": "bootloader.bin", + "offset": 4096 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + }, + { + "chipFamily": "ESP32-S3", + "parts": [ + { + "path": "bootloader.bin", + "offset": 0 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + } + ] +} +"# + ) } struct PartsData { From 87eac18e264561fcf71b820fc64bee9195fe1d55 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Mon, 23 May 2022 11:17:55 +0200 Subject: [PATCH 2/3] Fix format --- src/main.rs | 202 ++++++++++++++++++++++++++-------------------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/src/main.rs b/src/main.rs index ec29002..bb63506 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,38 +46,38 @@ fn firmware(data: &State) -> Vec { fn index() -> content::RawHtml<&'static str> { content::RawHtml( " - - -
-

ESP Web Flaher

+ + +
+

ESP Web Flaher

-
+
-
- - -
- NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor) -
-
- Your browser does not support the Web Serial API. Try Chrome -
-
+
+ + +
+ NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor) + +
+ Your browser does not support the Web Serial API. Try Chrome +
+
- + - - - ", + + + ", ) } @@ -85,81 +85,81 @@ fn index() -> content::RawHtml<&'static str> { fn manifest() -> content::RawJson<&'static str> { content::RawJson( r#" -{ - "name": "ESP ", - "new_install_prompt_erase": true, - "builds": [ - { - "chipFamily": "ESP32", - "parts": [ { - "path": "bootloader.bin", - "offset": 4096 - }, - { - "path": "partitions.bin", - "offset": 32768 - }, - { - "path": "firmware.bin", - "offset": 65536 + "name": "ESP ", + "new_install_prompt_erase": true, + "builds": [ + { + "chipFamily": "ESP32", + "parts": [ + { + "path": "bootloader.bin", + "offset": 4096 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + }, + { + "chipFamily": "ESP32-C3", + "parts": [ + { + "path": "bootloader.bin", + "offset": 0 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + }, + { + "chipFamily": "ESP32-S2", + "parts": [ + { + "path": "bootloader.bin", + "offset": 4096 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + }, + { + "chipFamily": "ESP32-S3", + "parts": [ + { + "path": "bootloader.bin", + "offset": 0 + }, + { + "path": "partitions.bin", + "offset": 32768 + }, + { + "path": "firmware.bin", + "offset": 65536 + } + ] + } + ] } - ] - }, - { - "chipFamily": "ESP32-C3", - "parts": [ - { - "path": "bootloader.bin", - "offset": 0 - }, - { - "path": "partitions.bin", - "offset": 32768 - }, - { - "path": "firmware.bin", - "offset": 65536 - } - ] - }, - { - "chipFamily": "ESP32-S2", - "parts": [ - { - "path": "bootloader.bin", - "offset": 4096 - }, - { - "path": "partitions.bin", - "offset": 32768 - }, - { - "path": "firmware.bin", - "offset": 65536 - } - ] - }, - { - "chipFamily": "ESP32-S3", - "parts": [ - { - "path": "bootloader.bin", - "offset": 0 - }, - { - "path": "partitions.bin", - "offset": 32768 - }, - { - "path": "firmware.bin", - "offset": 65536 - } - ] - } - ] -} -"# + "#, ) } From 64d728015ba7204841b9cc7c797d433325ec0967 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Mon, 23 May 2022 11:23:47 +0200 Subject: [PATCH 3/3] Update app name --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index bb63506..85c7879 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,7 +86,7 @@ fn manifest() -> content::RawJson<&'static str> { content::RawJson( r#" { - "name": "ESP ", + "name": "ESP Application", "new_install_prompt_erase": true, "builds": [ {