Fix format
This commit is contained in:
parent
c71816c872
commit
87eac18e26
202
src/main.rs
202
src/main.rs
@ -46,38 +46,38 @@ fn firmware(data: &State<PartsData>) -> Vec<u8> {
|
||||
fn index() -> content::RawHtml<&'static str> {
|
||||
content::RawHtml(
|
||||
"
|
||||
<html>
|
||||
<body>
|
||||
<center>
|
||||
<h1>ESP Web Flaher</h1>
|
||||
<html>
|
||||
<body>
|
||||
<center>
|
||||
<h1>ESP Web Flaher</h1>
|
||||
|
||||
<div id=\"main\" style=\"display: none;\">
|
||||
<div id=\"main\" style=\"display: none;\">
|
||||
|
||||
<br>
|
||||
<script type=\"module\" src=\"https://unpkg.com/esp-web-tools@8.0.2/dist/web/install-button.js?module\">
|
||||
</script>
|
||||
<esp-web-install-button id=\"installButton\" manifest=\"manifest.json\"></esp-web-install-button>
|
||||
<br>
|
||||
<span><i>NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor)</i></span>
|
||||
</div>
|
||||
<div id=\"notSupported\" style=\"display: none;\">
|
||||
Your browser does not support the Web Serial API. Try Chrome
|
||||
</div>
|
||||
</center>
|
||||
<br>
|
||||
<script type=\"module\" src=\"https://unpkg.com/esp-web-tools@8.0.2/dist/web/install-button.js?module\">
|
||||
</script>
|
||||
<esp-web-install-button id=\"installButton\" manifest=\"manifest.json\"></esp-web-install-button>
|
||||
<br>
|
||||
<span><i>NOTE: Make sure to close anything using your devices com port (e.g. Serial monitor)</i></span>
|
||||
</div>
|
||||
<div id=\"notSupported\" style=\"display: none;\">
|
||||
Your browser does not support the Web Serial API. Try Chrome
|
||||
</div>
|
||||
</center>
|
||||
|
||||
<script>
|
||||
if (navigator.serial) {
|
||||
document.getElementById(\"notSupported\").style.display = 'none';
|
||||
document.getElementById(\"main\").style.display = 'block';
|
||||
} else {
|
||||
document.getElementById(\"notSupported\").style.display = 'block';
|
||||
document.getElementById(\"main\").style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
if (navigator.serial) {
|
||||
document.getElementById(\"notSupported\").style.display = 'none';
|
||||
document.getElementById(\"main\").style.display = 'block';
|
||||
} else {
|
||||
document.getElementById(\"notSupported\").style.display = 'block';
|
||||
document.getElementById(\"main\").style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
",
|
||||
</body>
|
||||
</html>
|
||||
",
|
||||
)
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
"#
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user