mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-28 06:06:36 +00:00
Add attributes to reflect support status
This commit is contained in:
parent
97fa24e668
commit
625fa87ec4
@ -45,6 +45,15 @@ Allows for optionally passing an attribute to trigger an erase before installati
|
|||||||
|
|
||||||
All attributes can also be set via properties (`manifest`, `eraseFirst`)
|
All attributes can also be set via properties (`manifest`, `eraseFirst`)
|
||||||
|
|
||||||
|
## Styling
|
||||||
|
|
||||||
|
The following attributes are automatically added to `<esp-web-install-button>`:
|
||||||
|
|
||||||
|
| Attribute | Description |
|
||||||
|
| -- | -- |
|
||||||
|
| `install-supported` | Added if installing firmware is supported
|
||||||
|
| `install-unsupported` | Added if installing firmware is not supported
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Run `script/develop`. This starts a server. Open it on http://localhost:5000.
|
Run `script/develop`. This starts a server. Open it on http://localhost:5000.
|
||||||
|
@ -13,11 +13,13 @@ class InstallButton extends HTMLElement {
|
|||||||
this.renderRoot = this.attachShadow({ mode: "open" });
|
this.renderRoot = this.attachShadow({ mode: "open" });
|
||||||
|
|
||||||
if (!InstallButton.isSupported) {
|
if (!InstallButton.isSupported) {
|
||||||
|
this.setAttribute("install-unsupported", "");
|
||||||
this.renderRoot.innerHTML =
|
this.renderRoot.innerHTML =
|
||||||
"<slot name='unsupported'>Your browser does not support installing things on ESP devices. Use Google Chrome or Microsoft Edge.</slot>";
|
"<slot name='unsupported'>Your browser does not support installing things on ESP devices. Use Google Chrome or Microsoft Edge.</slot>";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setAttribute("install-supported", "");
|
||||||
this.addEventListener("mouseover", () => {
|
this.addEventListener("mouseover", () => {
|
||||||
// Preload
|
// Preload
|
||||||
import("./start-flash");
|
import("./start-flash");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user