mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Add translation handles
This commit is contained in:
@@ -39,6 +39,18 @@ function renderAdmins(list) {
|
||||
identity.appendChild(avatar);
|
||||
identity.appendChild(details);
|
||||
li.appendChild(identity);
|
||||
|
||||
const actions = document.createElement('div');
|
||||
actions.className = 'actions';
|
||||
|
||||
const removeBtn = document.createElement('button');
|
||||
removeBtn.type = 'button';
|
||||
removeBtn.className = 'secondary';
|
||||
removeBtn.textContent = 'Remove';
|
||||
removeBtn.addEventListener('click', () => removeAdmin(admin.login));
|
||||
|
||||
actions.appendChild(removeBtn);
|
||||
li.appendChild(actions);
|
||||
adminList.appendChild(li);
|
||||
});
|
||||
}
|
||||
@@ -50,6 +62,13 @@ function fetchAdmins() {
|
||||
.catch(() => renderAdmins([]));
|
||||
}
|
||||
|
||||
function removeAdmin(username) {
|
||||
if (!username) return;
|
||||
fetch(`/api/channels/${broadcaster}/admins/${encodeURIComponent(username)}`, {
|
||||
method: 'DELETE'
|
||||
}).then(fetchAdmins);
|
||||
}
|
||||
|
||||
function addAdmin() {
|
||||
const input = document.getElementById('new-admin');
|
||||
const username = input.value.trim();
|
||||
|
||||
Reference in New Issue
Block a user