diff --git a/.circleci/config.yml b/.circleci/config.yml index 91dfe07..6e3f953 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,7 +44,7 @@ jobs: - run: name: "save build config" working_directory: ".pio/build/<< pipeline.parameters.environment >>" - command: "echo 'PLATFORMIO_BUILD_FLAGS=\"<< pipeline.parameters.build_flags >>\" pio run -e << pipeline.parameters.environment >> ' > buildconfig.txt" + command: "echo 'GIT_SHA=\"<< pipeline.git.revision >>\" PLATFORMIO_BUILD_FLAGS=\"<< pipeline.parameters.build_flags >>\" pio run -e << pipeline.parameters.environment >> ' > buildconfig.txt" - run: name: "rename" working_directory: ".pio/build/<< pipeline.parameters.environment >>" diff --git a/webinstall/install.css b/webinstall/install.css index 972b865..26a1a45 100644 --- a/webinstall/install.css +++ b/webinstall/install.css @@ -21,4 +21,18 @@ body { font-size: 16px; font-family: system-ui; line-height: 1.5em; +} +#loading{ + height: 6em; +} +#loadingText{ + text-align: center; +} +#loadingFrame{ + display: flex; + flex-direction: column; + align-items: center; +} +.hidden{ + display: none !important; } \ No newline at end of file diff --git a/webinstall/install.html b/webinstall/install.html index 414d431..da4d0bd 100644 --- a/webinstall/install.html +++ b/webinstall/install.html @@ -11,7 +11,12 @@
-
+
+
+
+ +
+
\ No newline at end of file diff --git a/webinstall/install.js b/webinstall/install.js index acd998d..87d8c33 100644 --- a/webinstall/install.js +++ b/webinstall/install.js @@ -1,6 +1,6 @@ import {XtermOutputHandler} from "./installUtil.js"; import ESPInstaller from "./installUtil.js"; -import { addEl, getParam } from "./helper.js"; +import { addEl, getParam, setValue, setVisible } from "./helper.js"; import * as zip from "https://cdn.jsdelivr.net/npm/@zip.js/zip.js@2.7.29/+esm"; (function(){ let espLoaderTerminal; @@ -130,12 +130,16 @@ import * as zip from "https://cdn.jsdelivr.net/npm/@zip.js/zip.js@2.7.29/+esm"; } } - const buildCustomButtons = (name, updateData, fullData,version,element) => { + const buildCustomButtons = (name, updateData, fullData,version,info,element) => { let bFrame = document.querySelector(element || '.content'); if (!bFrame) return; bFrame.textContent = ''; - addEl('div', 'version', bFrame, "Custom Installation"); - let btLine = addEl('div', 'buttons', bFrame); + let item=addEl('div','item',bFrame); + addEl('div', 'version', item, "Custom "+version); + if (info){ + addEl('div','version',item,info); + } + let btLine = addEl('div', 'buttons', item); let tb = addEl('button', 'installButton', btLine, 'Initial'); tb.addEventListener('click', async () => { enableConsole(false, true); @@ -162,8 +166,25 @@ import * as zip from "https://cdn.jsdelivr.net/npm/@zip.js/zip.js@2.7.29/+esm"; }); } const showLoading=(on)=>{ - + setVisible('loadingFrame',on); }; + class BinaryStringWriter extends zip.Writer { + + constructor() { + super(); + this.binaryString = ""; + } + + writeUint8Array(array) { + for (let indexCharacter = 0; indexCharacter < array.length; indexCharacter++) { + this.binaryString += String.fromCharCode(array[indexCharacter]); + } + } + + getData() { + return this.binaryString; + } + } window.onload = async () => { if (! ESPInstaller.checkAvailable()){ showError("your browser does not support the ESP flashing (no serial)"); @@ -172,6 +193,7 @@ import * as zip from "https://cdn.jsdelivr.net/npm/@zip.js/zip.js@2.7.29/+esm"; let custom=getParam('custom'); let user; let repo; + let errorText=`unable to query release info for user ${user}, repo ${repo}: `; if (! custom){ user = window.gitHubUser||getParam('user'); repo = window.gitHubRepo || getParam('repo'); @@ -189,26 +211,42 @@ import * as zip from "https://cdn.jsdelivr.net/npm/@zip.js/zip.js@2.7.29/+esm"; buildButtons(user, repo); } else{ + errorText="unable to download custom build"; showLoading(true); + setValue('loadingText','downloading custom build') let reader= new zip.HttpReader(custom); let zipReader= new zip.ZipReader(reader); const entries=(await zipReader.getEntries()); let fullData; let updateData; let base=""; + let environment; + let buildflags; for (let i=0;i