-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
86 lines (84 loc) · 3.39 KB
/
popup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Popup</title>
<style>
a:visited {
color: LinkText;
}
</style>
</head>
<body style="width: 350px; background-color: #ffffff; color: #000000;">
<div id="page-loading">
Initializing EasyTFA...<br>
<em>This might take some time</em>
</div>
<div id="page-init" style="display: none;">
<h3>EasyTFA setup</h3>
<form id="form-init" action="#">
<label for="server-selection">Choose your server:</label>
<select name="server" id="server-selection" style="width: 100%;">
<option value="eu-relay1.easytfa.com">EU Relay 1 - https://eu-relay1.easytfa.com (Default)</option>
<option value="eu-relay2.easytfa.com">EU Relay 2 - https://eu-relay2.easytfa.com</option>
<option value="custom">Custom/Self-hosted server</option>
</select><br>
<div id="server-custom-url-container" style="display: none;">
<div style="display: flex">
<div>https://</div>
<div style="flex-grow: 1; padding-right: 8px;"><input type="text" id="server-custom-url" name="server-custom-url" style="width: 100%"></div>
</div>
</div>
<button type="button" id="btn-test-server-connection" style="margin-top:5px;">Test server connection</button>
<br>
<button type="submit" id="btn-submit-server-connection" style="margin-top:5px;">Choose server</button>
<br>
<div id="result-test-server-connection">
<h4>Server Test Result</h4>
<span id="result-test-server-status"></span><br>
<b>URL:</b> <span id="result-test-server-url" class="result-test-server-field">-</span><br>
<b>Version:</b> <span id="result-test-server-version" class="result-test-server-field">-</span><br>
<b>Push-Notifications:</b> <span id="result-test-server-push-notifications" class="result-test-server-field">-</span><br>
<b>Latency:</b> <span id="result-test-server-latency" class="result-test-server-field">-</span>
</div>
</form>
<p>
<a href="https://github.com/easytfa/easy-tfa-server" target="_blank">Want to host your own server?</a>
</p>
</div>
<div id="page-link" style="display: none;">
<h3>Scan this QR-Code to link</h3>
<div>
<b>URL:</b> <span id="server-url">(no server)</span>
<div><a href="#" id="switch-server-link">Switch server</a></div>
<div style="text-align: center">
<div id="qrcode" style="display: none;">
<canvas id="qr"></canvas>
</div>
</div>
<div id="status">Connecting to server...</div>
</div>
<p>
Open your app, go into the EasyTFA settings, select "Link Browser" and scan the QR code above to link your devices.
</p>
<p>
Make sure the server URL in the app matches the URL displayed above.
</p>
</div>
<div id="page-linked" style="display: none;">
This browser is currently linked to the app.<br>
<b>URL:</b> <span id="page-linked-server-url">(no server)</span>
<p>
<button type="button" id="page-linked-switch-server-link">Switch server</button><br>
You can always switch to a different server. Make sure that you select the same server on all devices.
</p>
<p>
<button id="unlink">Unlink</button><br>
Unlinking the browser extension will allow you to link a new app to this browser.
You can also use this button to re-link your app after you unlinked this browser in the app.
</p>
</div>
<script src="qrious.min.js"></script>
<script src="popup.js"></script>
</body>
</html>