Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceywasabi committed Sep 24, 2024
1 parent 1b45480 commit e7e4bb4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ jobs:
id: prep
run: |
COMMIT="${GITHUB_SHA::8}"
echo ::set-output name=commit::${COMMIT}
echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
echo "short_commit=${SHORT_COMMIT}" >> $GITHUB_OUTPUT
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
#echo ::set-output name=commit::${COMMIT}
#echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
#echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Update script.js
run: |
COMMIT_HASH=$(git rev-parse --short HEAD)
sed -i "s/^const wf_ver = .*/const wf_ver = '${COMMIT}';/" core/script.js || true
sed -i "s/^const wf_ver = .*/const wf_ver = '${COMMIT}';/" js/script.js || true
- name: Push to Dev Repo
run: |
MAINNAME="main"
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h5>DuckScript Support</h5>
<div id="qbox-container" class="p-4">
<div id="steps-container" class="p-5">
<div class="step" id="step-welcome">
<h2>O.MG Web Flasher</h2>
<h2 class="flasher-title">O.MG Web Flasher</h2>
<p>This tool is used exclusively to flash firmware to O.MG Devices</p>
<div class="m-2 bg-white agreement-modal" id="agreement-modal">
<h4>Agreement</h4>
Expand Down Expand Up @@ -152,7 +152,7 @@ <h4>Terms of Use</h4>
<div class="step d-none" id="modular-stepper">
<div class="d-flex justify-content-between bd-highlight mb-3">
<div class="p-2 bd-highlight"></div>
<div class="p-2 bd-highlight"><h2>O.MG Web Flasher</h2></div>
<div class="p-2 bd-highlight"><h2 class="flasher-title">O.MG Web Flasher</h2></div>
<div class="p-2 bd-highlight">
<button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#modalConsole">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-terminal" viewBox="0 0 16 16">
Expand Down Expand Up @@ -258,7 +258,7 @@ <h2 class="accordion-header" id="programmerStep3">
<div id="step-success" class="step d-none">
<div class="d-flex justify-content-between bd-highlight mb-3">
<div class="p-2 bd-highlight"></div>
<div class="p-2 bd-highlight"><h2>O.MG Web Flasher</h2></div>
<div class="p-2 bd-highlight"><h2 class="flasher-title">O.MG Web Flasher</h2></div>
<div class="p-2 bd-highlight">
<button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#modalConsole">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-terminal" viewBox="0 0 16 16">
Expand Down
33 changes: 22 additions & 11 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

var espTool;

const wf_ver = "1.5"

const baudRates = [115200];
const bufferSize = 512;
const eraseFillByte = 0x00;
Expand Down Expand Up @@ -129,12 +131,16 @@ document.addEventListener("DOMContentLoaded", () => {
skipWelcome=false;
toggleDevConf(true);
butCustomize.disabled=false;
butCustomize.classList.remove("d-none");
butCustomize.classList.remove("d-none");
butSettings.classList.remove("d-none");
let debug_im="Debug Mode Detected: URL is: " + window.location.href;
logMsg(debug_im);
console.log(debug_im);
debug=true;
const elements = document.getElementsByClassName("flasher-title");
for (let i = 0; i < elements.length; i++) {
elements[i].textContent += ` ${wf_ver}`;
}
debug=true;
} else {
// for 2.5 BETA RELEASE ONLY
butCustomize.disabled=false;
Expand All @@ -150,14 +156,19 @@ document.addEventListener("DOMContentLoaded", () => {
debug: false
})
butConnect.addEventListener("click", () => {
clickConnect();
/*.catch(async (e) => {
clickConnect()
.catch(async (e) => {
if(e.name === "NotFoundError"){
logMsg("User did not select a serial device!")
toggleUIHardware(false,"No device selected by user.");
} else {
console.log(e);
disconnect();
}
logMsg(e.message);
// TODO: REST
console.log(e);
disconnect();
//toggleUIConnected(false,e);
});*/

});
});

document.addEventListener('keydown', (event) => {
Expand Down Expand Up @@ -227,7 +238,7 @@ document.addEventListener("DOMContentLoaded", () => {
butProgram.disabled = true;
buildReleaseSelectors();
accordionDisable();
logMsg("Welcome to O.MG Web Serial Flasher. Ready...");
logMsg(`Welcome to O.MG Web Serial Flasher version ${wf_ver}`);

});

Expand Down Expand Up @@ -1537,7 +1548,7 @@ function toggleUIProgram(state) {
}
}

function toggleUIHardware(ready) {
function toggleUIHardware(ready,message="Hardware is unavailable.") {
let lbl = "Connect";
if (ready) {
statusStep1.classList.remove("bi-x-circle", "bi-circle", "bi-check-circle");
Expand All @@ -1547,7 +1558,7 @@ function toggleUIHardware(ready) {
} else {
// error
sdstat("error","hardware-missing");
setStatusAlert("Hardware is unavailable. Click \"Show me How\" to get further help. Refresh WebFlasher page when ready to attempt flashing again.", "danger");
setStatusAlert(`${message} Click \"Show me How\" to get further help. Refresh WebFlasher page when ready to attempt flashing again.`, "danger");
statusStep1.classList.remove("bi-x-circle", "bi-circle", "bi-check-circle");
statusStep1.classList.add("bi-x-circle");
accordionExpand(1);
Expand Down

0 comments on commit e7e4bb4

Please sign in to comment.