-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
171 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { svg } from "lit"; | ||
|
||
export const closeIcon = svg` | ||
<svg width="24" height="24" viewBox="0 0 24 24"> | ||
<path | ||
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" | ||
/> | ||
</svg> | ||
`; | ||
|
||
export const firmwareIcon = svg` | ||
<svg viewBox="0 0 24 24" title="Software"> | ||
<path | ||
fill="currentColor" | ||
d="M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z" | ||
/> | ||
</svg> | ||
`; | ||
|
||
export const chipIcon = svg` | ||
<svg viewBox="0 0 24 24" title="Chipset"> | ||
<path | ||
fill="currentColor" | ||
d="M6,4H18V5H21V7H18V9H21V11H18V13H21V15H18V17H21V19H18V20H6V19H3V17H6V15H3V13H6V11H3V9H6V7H3V5H6V4M11,15V18H12V15H11M13,15V18H14V15H13M15,15V18H16V15H15Z" | ||
/> | ||
</svg> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { LitElement, html, css, TemplateResult } from "lit"; | ||
import { property } from "lit/decorators.js"; | ||
import "../components/ewt-circular-progress"; | ||
|
||
class EwtPageMessage extends LitElement { | ||
@property() icon!: string; | ||
|
||
@property() label!: string | TemplateResult; | ||
|
||
render() { | ||
return html` | ||
<div class="icon">${this.icon}</div> | ||
${this.label} | ||
`; | ||
} | ||
|
||
static styles = css` | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
} | ||
.icon { | ||
font-size: 50px; | ||
line-height: 80px; | ||
color: black; | ||
} | ||
ewt-circular-progress { | ||
margin-bottom: 16px; | ||
} | ||
`; | ||
} | ||
customElements.define("ewt-page-message", EwtPageMessage); | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"ewt-page-message": EwtPageMessage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { LitElement, html, css, TemplateResult } from "lit"; | ||
import { property } from "lit/decorators.js"; | ||
import "../components/ewt-circular-progress"; | ||
|
||
class EwtPageProgress extends LitElement { | ||
@property() label!: string | TemplateResult; | ||
|
||
@property() progress: number | undefined; | ||
|
||
render() { | ||
return html` | ||
<div> | ||
<ewt-circular-progress | ||
active | ||
?indeterminate=${this.progress === undefined} | ||
.progress=${this.progress !== undefined | ||
? this.progress / 100 | ||
: undefined} | ||
density="8" | ||
></ewt-circular-progress> | ||
${this.progress !== undefined ? html`<div>${this.progress}%</div>` : ""} | ||
</div> | ||
${this.label} | ||
`; | ||
} | ||
|
||
static styles = css` | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
} | ||
ewt-circular-progress { | ||
margin-bottom: 16px; | ||
} | ||
`; | ||
} | ||
customElements.define("ewt-page-progress", EwtPageProgress); | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"ewt-page-progress": EwtPageProgress; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Manifest } from "../const"; | ||
|
||
export const downloadManifest = async (manifestPath: string) => { | ||
const manifestURL = new URL(manifestPath, location.toString()).toString(); | ||
const resp = await fetch(manifestURL); | ||
const manifest: Manifest = await resp.json(); | ||
|
||
if ("new_install_skip_erase" in manifest) { | ||
console.warn( | ||
'Manifest option "new_install_skip_erase" is deprecated. Use "new_install_prompt_erase" instead.' | ||
); | ||
if (manifest.new_install_skip_erase) { | ||
manifest.new_install_prompt_erase = true; | ||
} | ||
} | ||
|
||
return manifest; | ||
}; |