1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Merge pull request #504 from billz/glaszig-feature/wifi-qr-code

Glaszig feature/wifi qr code
This commit is contained in:
Bill Zimmerman 2020-02-28 08:30:28 +01:00 committed by GitHub
commit 2120b0e215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -143,6 +143,16 @@ $(document).on("submit", ".js-dhcp-settings-form", function(e) {
$(".js-add-dhcp-static-lease").trigger("click"); $(".js-add-dhcp-static-lease").trigger("click");
}); });
$(document).on("click", "#gen_wpa_passphrase", function(e) {
$('#txtwpapassphrase').val(genPassword(63));
});
function genPassword(pwdLen) {
var pwdChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var rndPass = Array(pwdLen).fill(pwdChars).map(function(x) { return x[Math.floor(Math.random() * x.length)] }).join('');
return rndPass;
}
function setupBtns() { function setupBtns() {
$('#btnSummaryRefresh').click(function(){getAllInterfaces();}); $('#btnSummaryRefresh').click(function(){getAllInterfaces();});
$('.intsave').click(function(){ $('.intsave').click(function(){

View File

@ -91,9 +91,12 @@
<label for="cbxwpapairwise"><?php echo _("Encryption Type"); ?></label> <label for="cbxwpapairwise"><?php echo _("Encryption Type"); ?></label>
<?php SelectorOptions('wpa_pairwise', $arrEncType, $arrConfig['wpa_pairwise'], 'cbxwpapairwise'); ?> <?php SelectorOptions('wpa_pairwise', $arrEncType, $arrConfig['wpa_pairwise'], 'cbxwpapairwise'); ?>
</div> </div>
<div class="form-group">
<label for="txtwpapassphrase"><?php echo _("PSK"); ?></label> <label for="txtwpapassphrase"><?php echo _("PSK"); ?></label>
<div class="input-group">
<input type="text" class="form-control" id="txtwpapassphrase" name="wpa_passphrase" value="<?php echo htmlspecialchars($arrConfig['wpa_passphrase'], ENT_QUOTES); ?>" /> <input type="text" class="form-control" id="txtwpapassphrase" name="wpa_passphrase" value="<?php echo htmlspecialchars($arrConfig['wpa_passphrase'], ENT_QUOTES); ?>" />
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" id="gen_wpa_passphrase"><i class="fas fa-magic"></i></button>
</div>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">