Fix format

This commit is contained in:
Sergio Gasquez 2022-05-23 11:17:55 +02:00
parent c71816c872
commit 87eac18e26

View File

@ -46,38 +46,38 @@ fn firmware(data: &State<PartsData>) -> Vec<u8> {
fn index() -> content::RawHtml<&'static str> { fn index() -> content::RawHtml<&'static str> {
content::RawHtml( content::RawHtml(
" "
<html> <html>
<body> <body>
<center> <center>
<h1>ESP Web Flaher</h1> <h1>ESP Web Flaher</h1>
<div id=\"main\" style=\"display: none;\"> <div id=\"main\" style=\"display: none;\">
<br> <br>
<script type=\"module\" src=\"https://unpkg.com/esp-web-tools@8.0.2/dist/web/install-button.js?module\"> <script type=\"module\" src=\"https://unpkg.com/esp-web-tools@8.0.2/dist/web/install-button.js?module\">
</script> </script>
<esp-web-install-button id=\"installButton\" manifest=\"manifest.json\"></esp-web-install-button> <esp-web-install-button id=\"installButton\" manifest=\"manifest.json\"></esp-web-install-button>
<br> <br>
<span><i>NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor)</i></span> <span><i>NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor)</i></span>
</div> </div>
<div id=\"notSupported\" style=\"display: none;\"> <div id=\"notSupported\" style=\"display: none;\">
Your browser does not support the Web Serial API. Try Chrome Your browser does not support the Web Serial API. Try Chrome
</div> </div>
</center> </center>
<script> <script>
if (navigator.serial) { if (navigator.serial) {
document.getElementById(\"notSupported\").style.display = 'none'; document.getElementById(\"notSupported\").style.display = 'none';
document.getElementById(\"main\").style.display = 'block'; document.getElementById(\"main\").style.display = 'block';
} else { } else {
document.getElementById(\"notSupported\").style.display = 'block'; document.getElementById(\"notSupported\").style.display = 'block';
document.getElementById(\"main\").style.display = 'none'; document.getElementById(\"main\").style.display = 'none';
} }
</script> </script>
</body> </body>
</html> </html>
", ",
) )
} }
@ -85,81 +85,81 @@ fn index() -> content::RawHtml<&'static str> {
fn manifest() -> content::RawJson<&'static str> { fn manifest() -> content::RawJson<&'static str> {
content::RawJson( content::RawJson(
r#" r#"
{
"name": "ESP ",
"new_install_prompt_erase": true,
"builds": [
{
"chipFamily": "ESP32",
"parts": [
{ {
"path": "bootloader.bin", "name": "ESP ",
"offset": 4096 "new_install_prompt_erase": true,
}, "builds": [
{ {
"path": "partitions.bin", "chipFamily": "ESP32",
"offset": 32768 "parts": [
}, {
{ "path": "bootloader.bin",
"path": "firmware.bin", "offset": 4096
"offset": 65536 },
{
"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
}
]
}
]
}
"#
) )
} }