Skip to content

Commit

Permalink
Feature: Added support for setup payload logo and qrcode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushikesh Patange committed Aug 29, 2023
1 parent 2e125db commit eee34b4
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">
<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">
<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 eee34b4

Please sign in to comment.