|
2 | 2 |
|
3 | 3 | {% block content %} |
4 | 4 | <div class="container"> |
5 | | - <div class="settings"> |
6 | | - <h3>2FA Settings</h3> |
7 | | - <p>Two-Factor Authentication: <strong>{{ 'Enabled' if current_user.totp_enabled else 'Disabled' }}</strong></p> |
8 | | - <button onclick="toggle2FA()">{{ 'Disable' if current_user.totp_enabled else 'Enable' }} 2FA</button> |
| 5 | + <div class="dashboard-header"> |
| 6 | + <h2>Email Forwarders for {{ domain }}</h2> |
| 7 | + <div class="header-actions"> |
| 8 | + <button class="btn-refresh" onclick="loadForwarders()">Refresh</button> |
| 9 | + {% if not current_user.totp_enabled %} |
| 10 | + <button class="btn-secondary" onclick="window.location.href='/setup-2fa'">Enable 2FA</button> |
| 11 | + {% else %} |
| 12 | + <button class="btn-secondary btn-success">2FA Enabled ✓</button> |
| 13 | + {% endif %} |
| 14 | + </div> |
9 | 15 | </div> |
10 | 16 |
|
11 | | - <div class="forwarder-create"> |
12 | | - <h2>Create Email Forwarder for {{ domain }}</h2> |
| 17 | + <div class="card"> |
| 18 | + <h3>Create New Forwarder</h3> |
13 | 19 | <form id="createForwarderForm"> |
14 | 20 | <div class="form-group"> |
15 | | - <label for="alias">Alias</label> |
16 | | - <input type="text" id="alias" name="alias" required> |
17 | | - <span>@{{ domain }}</span> |
| 21 | + <label for="alias">Email Alias</label> |
| 22 | + <div class="input-with-domain"> |
| 23 | + <input type="text" id="alias" name="alias" required placeholder="alias"> |
| 24 | + <span>@{{ domain }}</span> |
| 25 | + </div> |
18 | 26 | </div> |
| 27 | + |
19 | 28 | <div class="form-group"> |
20 | | - <label for="destination">Destination</label> |
21 | | - <select id="destination" name="destination" required> |
| 29 | + <label for="destination">Forward To</label> |
| 30 | + <select id="destination" name="destination" required onchange="toggleCustomEmail()"> |
22 | 31 | <option value="">Loading email accounts...</option> |
23 | 32 | </select> |
| 33 | + |
| 34 | + <div id="customEmailGroup" style="display: none; margin-top: 10px;"> |
| 35 | + <input type="email" id="customEmail" placeholder="Enter custom email address" class="custom-email-input"> |
| 36 | + </div> |
24 | 37 | </div> |
25 | | - <button type="submit">Create Forwarder</button> |
26 | | - </form> |
27 | | - </div> |
28 | 38 |
|
29 | | - <div class="forwarders-list"> |
30 | | - <h2>Existing Forwarders</h2> |
31 | | - <div id="forwardersList">Loading...</div> |
| 39 | + <button type="submit" class="btn-primary">Create Forwarder</button> |
| 40 | + </form> |
32 | 41 | </div> |
33 | | -</div> |
34 | 42 |
|
35 | | -<div id="qrModal" class="modal" style="display: none;"> |
36 | | - <div class="modal-content"> |
37 | | - <h3>Scan QR Code with Authenticator App</h3> |
38 | | - <div id="qrCode"></div> |
39 | | - <p>Secret: <code id="totpSecret"></code></p> |
40 | | - <button onclick="closeModal()">Close</button> |
| 43 | + <div class="card"> |
| 44 | + <h3>Existing Forwarders</h3> |
| 45 | + <div id="forwardersList" class="forwarders-list"> |
| 46 | + <div class="loading">Loading forwarders...</div> |
| 47 | + </div> |
41 | 48 | </div> |
42 | 49 | </div> |
43 | 50 | {% endblock %} |
0 commit comments