Skip to content

Commit 570c6f6

Browse files
Create settings.html
1 parent 411de1b commit 570c6f6

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

app/templates/settings.html

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
<div class="container">
5+
<h2>User Settings</h2>
6+
7+
<div class="card">
8+
<h3>DirectAdmin Configuration</h3>
9+
<p class="settings-description">Configure your DirectAdmin server connection to manage email forwarders.</p>
10+
11+
<form id="daConfigForm">
12+
<div class="form-group">
13+
<label for="da_server">DirectAdmin Server URL</label>
14+
<input type="url" id="da_server" name="da_server" placeholder="https://server.example.com:2222" required>
15+
<small>Include protocol (https://) and port (usually 2222)</small>
16+
</div>
17+
18+
<div class="form-group">
19+
<label for="da_username">DirectAdmin Username</label>
20+
<input type="text" id="da_username" name="da_username" required>
21+
<small>Your DirectAdmin API username</small>
22+
</div>
23+
24+
<div class="form-group">
25+
<label for="da_password">DirectAdmin Password</label>
26+
<input type="password" id="da_password" name="da_password" placeholder="Leave empty to keep current password">
27+
<small>Your DirectAdmin API password (encrypted storage)</small>
28+
</div>
29+
30+
<div class="form-group">
31+
<label for="da_domain">Domain</label>
32+
<input type="text" id="da_domain" name="da_domain" placeholder="example.com" required>
33+
<small>The domain you want to manage forwarders for</small>
34+
</div>
35+
36+
<div class="form-actions">
37+
<button type="button" class="btn-secondary" onclick="testConnection()">Test Connection</button>
38+
<button type="submit" class="btn-primary">Save Settings</button>
39+
</div>
40+
</form>
41+
</div>
42+
43+
<div class="card">
44+
<h3>Account Settings</h3>
45+
46+
<div class="settings-section">
47+
<h4>Two-Factor Authentication</h4>
48+
{% if current_user.totp_enabled %}
49+
<p class="status-enabled">✓ 2FA is enabled</p>
50+
<button class="btn-secondary" onclick="window.location.href='/disable-2fa'">Disable 2FA</button>
51+
{% else %}
52+
<p class="status-disabled">⚠ 2FA is not enabled</p>
53+
<button class="btn-primary" onclick="window.location.href='/setup-2fa'">Enable 2FA</button>
54+
{% endif %}
55+
</div>
56+
57+
<div class="settings-section">
58+
<h4>Change Password</h4>
59+
<button class="btn-secondary" onclick="window.location.href='/change-password'">Change Password</button>
60+
</div>
61+
</div>
62+
</div>
63+
64+
<script src="{{ url_for('static', filename='settings.js') }}"></script>
65+
{% endblock %}

0 commit comments

Comments
 (0)