diff --git a/netbox/project-static/src/dashboard.ts b/netbox/project-static/src/dashboard.ts index df200fffd..84337b848 100644 --- a/netbox/project-static/src/dashboard.ts +++ b/netbox/project-static/src/dashboard.ts @@ -4,16 +4,28 @@ import { apiPatch, hasError } from './util'; function lockDashboard(): void { const dashboard = document.getElementById('dashboard') as any; + const gridUnlockButton = document.getElementById('unlock_dashboard') as HTMLButtonElement; + const gridLockButton = document.getElementById('lock_dashboard') as HTMLButtonElement; if (dashboard) { dashboard.gridstack.disable(); } + if (gridUnlockButton && gridLockButton) { + gridUnlockButton.classList.remove('invisible'); + gridLockButton.classList.add('invisible'); + } } function unlockDashboard(): void { const dashboard = document.getElementById('dashboard') as any; + const gridUnlockButton = document.getElementById('unlock_dashboard') as HTMLButtonElement; + const gridLockButton = document.getElementById('lock_dashboard') as HTMLButtonElement; if (dashboard) { dashboard.gridstack.enable(); } + if (gridUnlockButton && gridLockButton) { + gridUnlockButton.classList.add('invisible'); + gridLockButton.classList.remove('invisible'); + } } async function saveDashboardLayout( diff --git a/netbox/templates/home.html b/netbox/templates/home.html index 414ac3488..f77ce3e50 100644 --- a/netbox/templates/home.html +++ b/netbox/templates/home.html @@ -41,7 +41,11 @@