Add translation handles

This commit is contained in:
2025-12-09 11:23:38 +01:00
parent f234790aeb
commit 3dd485ca89
2 changed files with 276 additions and 20 deletions

View File

@@ -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();