decouple OTP secrets from instances with a dedicated database table and CRUD API endpoints
This commit is contained in:
parent
c15f965a2b
commit
b8202abba5
5 changed files with 317 additions and 52 deletions
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
<nav id="main-nav" class="main-nav" style="display: none;">
|
||||
<button class="nav-item active" data-tab="instances">Instances</button>
|
||||
<button class="nav-item" data-tab="otp-secrets">OTP Secrets</button>
|
||||
<button class="nav-item" id="nav-admin" data-tab="admin" style="display: none;">Admin</button>
|
||||
<button class="nav-item" data-tab="profile">Profile</button>
|
||||
</nav>
|
||||
|
|
@ -66,6 +67,21 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="otp-secrets-section" class="tab-content">
|
||||
<div class="card otp-secrets-card">
|
||||
<div class="instances-header">
|
||||
<h2>OTP Secrets</h2>
|
||||
<button class="btn btn-primary btn-sm" id="show-add-otp-btn">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
||||
Add Secret
|
||||
</button>
|
||||
</div>
|
||||
<div id="otp-secrets-list" class="otp-secrets-list">
|
||||
<!-- OTP Secrets injected via JS -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="admin-section" class="tab-content">
|
||||
<div class="card user-management-card">
|
||||
<div class="instances-header">
|
||||
|
|
@ -132,14 +148,36 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="secret">OTP Secret</label>
|
||||
<input type="password" id="secret" placeholder="Base32 Secret or otpauth:// URL" required>
|
||||
<label for="otp-secret-id">OTP Secret</label>
|
||||
<select id="otp-secret-id" required>
|
||||
<option value="" disabled selected>Select an OTP secret</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Add Instance</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="add-otp-secret-modal" class="modal">
|
||||
<div class="modal-content card">
|
||||
<div class="modal-header">
|
||||
<h2 id="otp-modal-title">Add OTP Secret</h2>
|
||||
<button class="btn-close">×</button>
|
||||
</div>
|
||||
<form id="otp-secret-form">
|
||||
<div class="form-group">
|
||||
<label for="otp-name">Name</label>
|
||||
<input type="text" id="otp-name" placeholder="e.g. Main Account" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="otp-secret">Secret</label>
|
||||
<input type="password" id="otp-secret" placeholder="Base32 Secret or otpauth:// URL" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" id="otp-save-btn">Add Secret</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="add-user-modal" class="modal">
|
||||
<div class="modal-content card">
|
||||
<div class="modal-header">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue