2021-05-17 16:27:27 -04:00
|
|
|
{# Base template for (almost) all NetBox pages #}
|
|
|
|
{% load static %}
|
|
|
|
{% load helpers %}
|
2016-03-01 11:23:03 -05:00
|
|
|
<!DOCTYPE html>
|
2021-07-24 10:31:46 -07:00
|
|
|
<html
|
|
|
|
lang="en"
|
2021-09-01 15:22:38 -07:00
|
|
|
data-netbox-url-name="{{ request.resolver_match.url_name }}"
|
2021-09-01 09:34:33 -04:00
|
|
|
data-netbox-base-path="{{ settings.BASE_PATH }}"
|
2021-09-29 17:44:28 -07:00
|
|
|
{% with preferences|get_key:'ui.colormode' as color_mode %}
|
|
|
|
{% if color_mode == 'dark'%}
|
|
|
|
data-netbox-color-mode="dark"
|
|
|
|
{% elif color_mode == 'light' %}
|
|
|
|
data-netbox-color-mode="light"
|
|
|
|
{% else %}
|
|
|
|
data-netbox-color-mode="unset"
|
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
2021-07-24 10:31:46 -07:00
|
|
|
>
|
2021-03-13 02:19:42 -07:00
|
|
|
<head>
|
2021-05-17 16:27:27 -04:00
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<meta
|
|
|
|
name="viewport"
|
2021-07-30 00:35:38 -07:00
|
|
|
content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover"
|
2021-05-17 16:27:27 -04:00
|
|
|
/>
|
|
|
|
|
|
|
|
{# Page title #}
|
2021-05-07 12:05:56 -07:00
|
|
|
<title>{% block title %}Home{% endblock %} | NetBox</title>
|
2021-05-17 16:27:27 -04:00
|
|
|
|
2022-11-03 06:29:45 -07:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
|
|
|
src="{% static 'setmode.js' %}"
|
|
|
|
onerror="window.location='{% url 'media_failure' %}?filename=setmode.js'">
|
|
|
|
</script>
|
|
|
|
|
2021-08-01 00:27:27 -07:00
|
|
|
<script type="text/javascript">
|
2021-10-27 11:34:21 -07:00
|
|
|
(function () {
|
2022-11-03 06:29:45 -07:00
|
|
|
initMode()
|
2021-10-27 11:34:21 -07:00
|
|
|
})();
|
2022-08-29 14:40:03 -07:00
|
|
|
window.CSRF_TOKEN = "{{ csrf_token }}";
|
2021-07-24 10:31:46 -07:00
|
|
|
</script>
|
|
|
|
|
2021-05-17 16:27:27 -04:00
|
|
|
{# Static resources #}
|
2021-03-13 02:19:42 -07:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
2021-12-21 13:00:52 -05:00
|
|
|
href="{% static 'netbox-external.css'%}?v={{ settings.VERSION }}"
|
2021-05-07 16:12:27 -07:00
|
|
|
onerror="window.location='{% url 'media_failure' %}?filename=netbox-external.css'"
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
2021-12-21 13:00:52 -05:00
|
|
|
href="{% static 'netbox-light.css'%}?v={{ settings.VERSION }}"
|
2021-05-07 16:12:27 -07:00
|
|
|
onerror="window.location='{% url 'media_failure' %}?filename=netbox-light.css'"
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
2021-12-21 13:00:52 -05:00
|
|
|
href="{% static 'netbox-dark.css'%}?v={{ settings.VERSION }}"
|
2021-05-07 16:12:27 -07:00
|
|
|
onerror="window.location='{% url 'media_failure' %}?filename=netbox-dark.css'"
|
2021-03-13 02:19:42 -07:00
|
|
|
/>
|
2021-08-18 16:17:50 -07:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
media="print"
|
2021-12-21 13:00:52 -05:00
|
|
|
href="{% static 'netbox-print.css'%}?v={{ settings.VERSION }}"
|
2021-08-18 16:17:50 -07:00
|
|
|
onerror="window.location='{% url 'media_failure' %}?filename=netbox-print.css'"
|
|
|
|
/>
|
2021-03-13 02:19:42 -07:00
|
|
|
<link rel="icon" type="image/png" href="{% static 'netbox.ico' %}" />
|
2021-12-17 17:31:36 +03:00
|
|
|
<link rel="apple-touch-icon" type="image/png" href="{% static 'netbox_touch-icon-180.png' %}" />
|
2021-05-17 16:27:27 -04:00
|
|
|
|
|
|
|
{# Javascript #}
|
2021-03-13 02:19:42 -07:00
|
|
|
<script
|
2021-04-20 01:18:24 -07:00
|
|
|
type="text/javascript"
|
2021-12-21 13:00:52 -05:00
|
|
|
src="{% static 'netbox.js' %}?v={{ settings.VERSION }}"
|
2021-04-15 16:52:30 -07:00
|
|
|
onerror="window.location='{% url 'media_failure' %}?filename=netbox.js'">
|
|
|
|
</script>
|
2021-05-17 16:27:27 -04:00
|
|
|
|
|
|
|
{# Additional <head> content #}
|
2021-04-20 01:18:24 -07:00
|
|
|
{% block head %}{% endblock %}
|
|
|
|
</head>
|
2021-08-05 09:35:36 -07:00
|
|
|
|
2021-07-24 10:31:46 -07:00
|
|
|
<body>
|
2021-08-01 00:27:27 -07:00
|
|
|
<script type="text/javascript">
|
2022-02-25 11:14:43 -07:00
|
|
|
function checkSideNav() {
|
2021-08-01 00:27:27 -07:00
|
|
|
// Check localStorage to see if the sidebar should be pinned.
|
|
|
|
var sideNavRaw = localStorage.getItem('netbox-sidenav');
|
2021-08-05 09:35:36 -07:00
|
|
|
// Determine if the device has a small screeen. This media query is equivalent to
|
|
|
|
// bootstrap's media-breakpoint-down(lg) breakpoint mixin, which is what the sidenav's
|
|
|
|
// CSS uses.
|
|
|
|
var isSmallScreen = window.matchMedia('(max-width: 991.98px)').matches;
|
2021-08-01 00:27:27 -07:00
|
|
|
if (typeof sideNavRaw === 'string') {
|
|
|
|
var sideNavState = JSON.parse(sideNavRaw);
|
2021-08-05 09:35:36 -07:00
|
|
|
if (sideNavState.pinned === true && !isSmallScreen) {
|
|
|
|
// If the sidebar should be pinned and this is not a small screen, set the appropriate
|
|
|
|
// body attributes prior to the rest of the content rendering. This prevents
|
|
|
|
// jumpy/glitchy behavior on page reloads.
|
2021-08-01 00:27:27 -07:00
|
|
|
document.body.setAttribute('data-sidenav-pinned', '');
|
|
|
|
document.body.setAttribute('data-sidenav-show', '');
|
2022-02-25 11:14:43 -07:00
|
|
|
document.body.removeAttribute('data-sidenav-hidden');
|
2021-08-05 09:35:36 -07:00
|
|
|
} else {
|
2022-02-25 11:14:43 -07:00
|
|
|
document.body.removeAttribute('data-sidenav-pinned');
|
2021-08-01 11:12:07 -07:00
|
|
|
document.body.setAttribute('data-sidenav-hidden', '');
|
2021-08-01 00:27:27 -07:00
|
|
|
}
|
|
|
|
}
|
2022-02-25 11:14:43 -07:00
|
|
|
}
|
|
|
|
window.addEventListener('resize', function(){ checkSideNav() });
|
|
|
|
checkSideNav();
|
2021-08-01 00:27:27 -07:00
|
|
|
</script>
|
2021-05-17 16:27:27 -04:00
|
|
|
|
|
|
|
{# Page layout #}
|
2021-04-20 01:18:24 -07:00
|
|
|
{% block layout %}{% endblock %}
|
2021-05-17 16:27:27 -04:00
|
|
|
|
|
|
|
{# Additional Javascript #}
|
2021-03-13 02:19:42 -07:00
|
|
|
{% block javascript %}{% endblock %}
|
2021-05-17 16:27:27 -04:00
|
|
|
|
|
|
|
{# User messages #}
|
|
|
|
{% include 'inc/messages.html' %}
|
|
|
|
|
|
|
|
{# Data container #}
|
2021-04-20 01:18:24 -07:00
|
|
|
<div id="netbox-data" style="display: none!important; visibility: hidden!important">
|
2021-05-17 16:27:27 -04:00
|
|
|
{% block data %}{% endblock %}
|
2021-04-20 01:18:24 -07:00
|
|
|
</div>
|
2021-05-17 16:27:27 -04:00
|
|
|
|
2021-03-13 02:19:42 -07:00
|
|
|
</body>
|
2016-03-01 11:23:03 -05:00
|
|
|
</html>
|