This commit is contained in:
@@ -1033,6 +1033,13 @@ function esc(s) {
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
async function loadRegistrationSetting() {
|
||||
try {
|
||||
const res = await apiFetch('registration');
|
||||
document.getElementById('registrationToggle').checked = res.registration_enabled === true;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
async function loadUsers() {
|
||||
const list = document.getElementById('userList');
|
||||
try {
|
||||
@@ -1076,7 +1083,11 @@ async function removeUser(id) {
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('settingsModal').addEventListener('show.bs.modal', loadUsers);
|
||||
document.getElementById('settingsModal').addEventListener('show.bs.modal', () => {
|
||||
loadUsers();
|
||||
loadRegistrationSetting();
|
||||
});
|
||||
document.getElementById('registrationToggle').addEventListener('change', saveRegistrationSetting);
|
||||
|
||||
// ==================== DOCUMENTS ====================
|
||||
const DOC_TYPE_ICONS = {
|
||||
|
||||
@@ -480,6 +480,16 @@
|
||||
<button class="btn btn-primary" id="addUserBtn"><i class="fas fa-plus"></i> Add</button>
|
||||
</div>
|
||||
<small class="text-secondary">Get the user token from the user's Jakach Auth profile or ask them to log in once.</small>
|
||||
<hr class="border-secondary">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h6 class="text-secondary mb-0"><i class="fas fa-user-plus me-1"></i> New User Registration</h6>
|
||||
<small class="text-secondary">Allow new users to register via login link</small>
|
||||
</div>
|
||||
<div class="form-check form-switch mb-0">
|
||||
<input class="form-check-input" type="checkbox" id="registrationToggle" style="cursor:pointer;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user