diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index fdd9dc943..f34ab134c 100644 Binary files a/netbox/project-static/dist/netbox.js and b/netbox/project-static/dist/netbox.js differ diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 6b7879775..5286b72bb 100644 Binary files a/netbox/project-static/dist/netbox.js.map and b/netbox/project-static/dist/netbox.js.map differ diff --git a/netbox/project-static/src/dashboard.ts b/netbox/project-static/src/dashboard.ts index 4efc3899c..6ce10bdab 100644 --- a/netbox/project-static/src/dashboard.ts +++ b/netbox/project-static/src/dashboard.ts @@ -13,6 +13,12 @@ async function saveDashboardLayout( } export function initDashboard(): void { + // Exit if this page does not contain a dashboard + const dashboard = document.getElementById('dashboard') as Nullable; + if (dashboard == null) { + return; + } + // Initialize the grid let grid = GridStack.init({ cellHeight: 100, diff --git a/netbox/project-static/src/htmx.ts b/netbox/project-static/src/htmx.ts index bd80a0c49..5b2c65d80 100644 --- a/netbox/project-static/src/htmx.ts +++ b/netbox/project-static/src/htmx.ts @@ -3,7 +3,6 @@ import { initButtons } from './buttons'; import { initSelect } from './select'; function initDepedencies(): void { - console.log('initDepedencies()'); for (const init of [initButtons, initSelect]) { init(); } diff --git a/netbox/project-static/src/select/api/index.ts b/netbox/project-static/src/select/api/index.ts index 59a9ee59b..3fef1ad6a 100644 --- a/netbox/project-static/src/select/api/index.ts +++ b/netbox/project-static/src/select/api/index.ts @@ -2,7 +2,7 @@ import { getElements } from '../../util'; import { APISelect } from './apiSelect'; export function initApiSelect(): void { - for (const select of getElements('.netbox-api-select')) { + for (const select of getElements('.netbox-api-select:not([data-ssid])')) { new APISelect(select); } } diff --git a/netbox/project-static/src/select/color.ts b/netbox/project-static/src/select/color.ts index e2c93c37c..4c8d6454a 100644 --- a/netbox/project-static/src/select/color.ts +++ b/netbox/project-static/src/select/color.ts @@ -40,7 +40,9 @@ function styleContainer( * the selected option. */ export function initColorSelect(): void { - for (const select of getElements('select.netbox-color-select')) { + for (const select of getElements( + 'select.netbox-color-select:not([data-ssid])', + )) { for (const option of select.options) { if (canChangeColor(option)) { // Get the background color from the option's value. diff --git a/netbox/project-static/src/select/static.ts b/netbox/project-static/src/select/static.ts index c649537ba..19031bb7d 100644 --- a/netbox/project-static/src/select/static.ts +++ b/netbox/project-static/src/select/static.ts @@ -2,7 +2,7 @@ import SlimSelect from 'slim-select'; import { getElements } from '../util'; export function initStaticSelect(): void { - for (const select of getElements('.netbox-static-select')) { + for (const select of getElements('.netbox-static-select:not([data-ssid])')) { if (select !== null) { const label = document.querySelector(`label[for="${select.id}"]`) as HTMLLabelElement; diff --git a/netbox/templates/home.html b/netbox/templates/home.html index 5bed19d9d..de8a26a7f 100644 --- a/netbox/templates/home.html +++ b/netbox/templates/home.html @@ -24,7 +24,7 @@ {% block content-wrapper %} {# Render the user's customized dashboard #} -
+
{% for widget in dashboard %} {% include 'extras/dashboard/widget.html' %} {% endfor %}