mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
add qrcode to connectpage; closes #523
This commit is contained in:
parent
2943c7f2d5
commit
bcc3b1568e
|
@ -37,6 +37,7 @@
|
||||||
{% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
|
{% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
|
||||||
</span>
|
</span>
|
||||||
{% if accs %}<a href="#" id="setpw">use real password</a>{% endif %}
|
{% if accs %}<a href="#" id="setpw">use real password</a>{% endif %}
|
||||||
|
<a href="#" id="qr">show qr</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,12 +49,14 @@ function setos(os) {
|
||||||
setos(WINDOWS ? 'win' : LINUX ? 'lin' : MACOS ? 'mac' : 'idk');
|
setos(WINDOWS ? 'win' : LINUX ? 'lin' : MACOS ? 'mac' : 'idk');
|
||||||
|
|
||||||
|
|
||||||
|
var pw = '';
|
||||||
function setpw(e) {
|
function setpw(e) {
|
||||||
ev(e);
|
ev(e);
|
||||||
modal.prompt('password:', '', function (v) {
|
modal.prompt('password:', '', function (v) {
|
||||||
if (!v)
|
if (!v)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
pw = v;
|
||||||
var pw0 = ebi('pw0').innerHTML,
|
var pw0 = ebi('pw0').innerHTML,
|
||||||
oa = QSA('b');
|
oa = QSA('b');
|
||||||
|
|
||||||
|
@ -67,3 +69,12 @@ function setpw(e) {
|
||||||
}
|
}
|
||||||
if (ebi('setpw'))
|
if (ebi('setpw'))
|
||||||
ebi('setpw').onclick = setpw;
|
ebi('setpw').onclick = setpw;
|
||||||
|
|
||||||
|
|
||||||
|
ebi('qr').onclick = function () {
|
||||||
|
var url = ('' + location).split('?')[0];
|
||||||
|
if (pw)
|
||||||
|
url += '?pw=' + pw;
|
||||||
|
var txt = esc(url) + '<img class="b64" width="100" height="100" src="' + addq(url, 'qr') + '" />';
|
||||||
|
modal.alert(txt);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue