fix(webhooks): Show webhooks panel only to admin users
All checks were successful
All checks were successful
This commit is contained in:
@@ -302,6 +302,9 @@ function showDashboard() {
|
||||
sp.style.display = 'none';
|
||||
sp.innerHTML = '';
|
||||
document.getElementById('admin-controls').style.display = isAdmin ? 'flex' : 'none';
|
||||
// Show webhooks section for admin users
|
||||
const webhooksSection = document.getElementById('webhooks-section');
|
||||
if (webhooksSection) webhooksSection.style.display = isAdmin ? '' : 'none';
|
||||
// Initialise days input from saved value
|
||||
const daysInput = document.getElementById('history-days');
|
||||
if (daysInput) daysInput.value = historyDays;
|
||||
@@ -1163,10 +1166,7 @@ function initWebhooks() {
|
||||
const webhooksSection = document.getElementById('webhooks-section');
|
||||
if (!webhooksSection) return;
|
||||
|
||||
// Show webhooks section for admin users
|
||||
if (isAdmin) {
|
||||
webhooksSection.style.display = '';
|
||||
}
|
||||
// Note: visibility is controlled by showDashboard() based on isAdmin
|
||||
|
||||
document.getElementById('webhooks-header').addEventListener('click', toggleWebhookSection);
|
||||
document.getElementById('enable-sonarr-webhook').addEventListener('click', enableSonarrWebhook);
|
||||
|
||||
Reference in New Issue
Block a user