Skip to content

Commit

Permalink
Merge pull request #23 from RushikeshPatange/feature/setup_payload_su…
Browse files Browse the repository at this point in the history
…pport

Feature: Added Support For Setup Payload Logo And QRCode.
  • Loading branch information
RushikeshPatange committed Aug 30, 2023
2 parents 2e125db + 5b1e37c commit c22b406
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ <h4 class="modal-title"><span style="color: #17a2b8;"> ESP Firmware Flashing Sta
</div>
<div id="qrIOSRow">
<div id="iosAppLogo" style="padding-bottom: 5px;"></div>
<div id='qrcodeIOSApp'></div>
<div id='qrcodeIOSApp' style="padding-right: 40px;"></div>
</div>
<div id="setupPayloadRow" class="ms-auto">
<div id="setupPayloadLogo" style="padding-bottom: 5px;"></div>
<div id='setupPayloadQRCode'></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -219,7 +223,11 @@ <h5 class="pt-4 pb-2 lh-lg"><span id="qtLabel">Choose from some of ESP's pre-bui
</div>
<div id="qrIOSRowQS">
<div id="iosAppLogoQS" style="padding-bottom: 5px;"></div>
<div id='qrcodeIOSAppQS' style="padding-bottom: 40px;"></div>
<div id='qrcodeIOSAppQS' style="padding-right: 40px;"></div>
</div>
<div id="setupPayloadRowQS" class="ms-auto">
<div id="setupPayloadLogoQS" style="padding-bottom: 5px;"></div>
<div id='setupPayloadQRCodeQS'></div>
</div>
</div>
</div>
Expand Down
29 changes: 29 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,35 @@ function buildAppLinks(){
$("#iosAppLogoQS").html("<a href='" + ios_app_url + "' target='_blank'><img src='./assets/appstore_download.png' height='50' width='130'></a>");
appURLsHTML = defaultAppURLsHTML;
}

if (config["setup_payload"] && config["setup_payload_logo"]) {
new QRCode(document.getElementById("setupPayloadQRCode"), {
text: config["setup_payload"],
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});

$("#setupPayloadLogo").html(`<img src=${config["setup_payload_logo"]} height='50' width='130'></a>`);

new QRCode(document.getElementById("setupPayloadQRCodeQS"), {
text: config["setup_payload"],
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});

$("#setupPayloadLogoQS").html(`<img src=${config["setup_payload_logo"]} height='50' width='130'></a>`);

} else {
$("#setupPayloadRow").css("display", "none");
$("#setupPayloadRowQS").css("display", "none");
}

if(appURLsHTML === defaultAppURLsHTML){
$("#progressMsgQS").html("Firmware Image flashing is complete. " + appURLsHTML);
$("#appDownloadLink").html(appURLsHTML);
Expand Down

0 comments on commit c22b406

Please sign in to comment.