1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge branch 'develop' into develop-2.8

This commit is contained in:
Jeremy Stretch
2020-03-10 15:06:37 -04:00
156 changed files with 1561 additions and 1674 deletions

View File

@@ -4,13 +4,27 @@
<html lang="en">
<head>
<title>{% block title %}Home{% endblock %} - NetBox</title>
<link rel="stylesheet" href="{% static 'bootstrap-3.4.1-dist/css/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'font-awesome-4.7.0/css/font-awesome.min.css' %}">
<link rel="stylesheet" href="{% static 'jquery-ui-1.12.1/jquery-ui.css' %}">
<link rel="stylesheet" href="{% static 'select2-4.0.12/dist/css/select2.min.css' %}">
<link rel="stylesheet" href="{% static 'select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'flatpickr-4.6.3/themes/light.css' %}">
<link rel="stylesheet" href="{% static 'css/base.css' %}?v{{ settings.VERSION }}">
<link rel="stylesheet"
href="{% static 'bootstrap-3.4.1-dist/css/bootstrap.min.css' %}"
onerror="window.location='{% url 'media_failure' %}?filename=bootstrap-3.4.1-dist/css/bootstrap.min.css'">
<link rel="stylesheet"
href="{% static 'font-awesome-4.7.0/css/font-awesome.min.css' %}"
onerror="window.location='{% url 'media_failure' %}?filename=font-awesome-4.7.0/css/font-awesome.min.css'">
<link rel="stylesheet"
href="{% static 'jquery-ui-1.12.1/jquery-ui.css' %}"
onerror="window.location='{% url 'media_failure' %}?filename=jquery-ui-1.12.1/jquery-ui.css'">
<link rel="stylesheet"
href="{% static 'select2-4.0.12/dist/css/select2.min.css' %}"
onerror="window.location='{% url 'media_failure' %}?filename=select2-4.0.12/dist/css/select2.min.css'">
<link rel="stylesheet"
href="{% static 'select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css' %}"
onerror="window.location='{% url 'media_failure' %}?filename=select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css'">
<link rel="stylesheet"
href="{% static 'flatpickr-4.6.3/themes/light.css' %}"
onerror="window.location='{% url 'media_failure' %}?filename=flatpickr-4.6.3/themes/light.css'">
<link rel="stylesheet"
href="{% static 'css/base.css' %}?v{{ settings.VERSION }}"
onerror="window.location='{% url 'media_failure' %}?filename=css/base.css'">
<link rel="icon" type="image/png" href="{% static 'img/netbox.ico' %}" />
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
@@ -66,13 +80,20 @@
</div>
</div>
</footer>
<script src="{% static 'jquery/jquery-3.4.1.min.js' %}"></script>
<script src="{% static 'jquery-ui-1.12.1/jquery-ui.min.js' %}"></script>
<script src="{% static 'bootstrap-3.4.1-dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'select2-4.0.12/dist/js/select2.min.js' %}"></script>
<script src="{% static 'clipboard.js/clipboard-2.0.4.min.js' %}"></script>
<script src="{% static 'flatpickr-4.6.3/flatpickr.min.js' %}"></script>
<script src="{% static 'js/forms.js' %}?v{{ settings.VERSION }}"></script>
<script src="{% static 'jquery/jquery-3.4.1.min.js' %}"
onerror="window.location='{% url 'media_failure' %}?filename=jquery/jquery-3.4.1.min.js'"></script>
<script src="{% static 'jquery-ui-1.12.1/jquery-ui.min.js' %}"
onerror="window.location='{% url 'media_failure' %}?filename=jquery-ui-1.12.1/jquery-ui.min.js'"></script>
<script src="{% static 'bootstrap-3.4.1-dist/js/bootstrap.min.js' %}"
onerror="window.location='{% url 'media_failure' %}?filename=bootstrap-3.4.1-dist/js/bootstrap.min.js'"></script>
<script src="{% static 'select2-4.0.12/dist/js/select2.min.js' %}"
onerror="window.location='{% url 'media_failure' %}?filename=select2-4.0.12/dist/js/select2.min.js'"></script>
<script src="{% static 'clipboard.js/clipboard-2.0.4.min.js' %}"
onerror="window.location='{% url 'media_failure' %}?filename=clipboard.js/clipboard-2.0.4.min.js'"></script>
<script src="{% static 'flatpickr-4.6.3/flatpickr.min.js' %}"
onerror="window.location='{% url 'media_failure' %}?filename=flatpickr-4.6.3/flatpickr.min.js'"></script>
<script src="{% static 'js/forms.js' %}?v{{ settings.VERSION }}"
onerror="window.location='{% url 'media_failure' %}?filename=js/forms.js'"></script>
<script type="text/javascript">
var netbox_api_path = "/{{ settings.BASE_PATH }}api/";
var loading = $(".loading");

View File

@@ -119,7 +119,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if circuit.comments %}
{{ circuit.comments|gfm }}
{{ circuit.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -88,11 +88,11 @@
</tr>
<tr>
<td>NOC Contact</td>
<td class="rendered-markdown">{{ provider.noc_contact|gfm|placeholder }}</td>
<td class="rendered-markdown">{{ provider.noc_contact|render_markdown|placeholder }}</td>
</tr>
<tr>
<td>Admin Contact</td>
<td class="rendered-markdown">{{ provider.admin_contact|gfm|placeholder }}</td>
<td class="rendered-markdown">{{ provider.admin_contact|render_markdown|placeholder }}</td>
</tr>
<tr>
<td>Circuits</td>
@@ -110,7 +110,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if provider.comments %}
{{ provider.comments|gfm }}
{{ provider.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -134,7 +134,7 @@
{% include 'inc/paginator.html' with paginator=circuits_table.paginator page=circuits_table.page %}
</div>
</div>
{% include 'inc/modal.html' with modal_name='graphs' %}
{% include 'inc/modal.html' with name='graphs' title='Graphs' %}
{% endblock %}
{% block javascript %}

View File

@@ -53,7 +53,7 @@
<div class="form-group">
<label class="col-md-3 control-label required">Type</label>
<div class="col-md-9">
<p class="form-control-static">{{ termination_a|model_name|capfirst }}</p>
<p class="form-control-static">{{ termination_a|meta:"verbose_name"|capfirst }}</p>
</div>
</div>
<div class="form-group">

View File

@@ -325,7 +325,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if device.comments %}
{{ device.comments|gfm }}
{{ device.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -873,7 +873,7 @@
{% endif %}
</div>
</div>
{% include 'inc/modal.html' with modal_name='graphs' %}
{% include 'inc/modal.html' with name='graphs' title='Graphs' %}
{% include 'secrets/inc/private_key_modal.html' %}
{% endblock %}

View File

@@ -149,7 +149,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if devicetype.comments %}
{{ devicetype.comments|gfm }}
{{ devicetype.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -11,7 +11,7 @@
<tr>
<td>Type</td>
<td>
{{ termination|model_name|capfirst }}
{{ termination|meta:"verbose_name"|capfirst }}
</td>
</tr>
<tr>

View File

@@ -17,7 +17,7 @@
<div class="panel-body text-center">
{% if end.device %}
{# Device component #}
{% with model=end|model_name %}
{% with model=end|meta:"verbose_name" %}
<strong>{{ model|bettertitle }} {{ end }}</strong><br />
{% if model == 'interface' %}
{{ end.get_type_display }}

View File

@@ -158,7 +158,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if powerfeed.comments %}
{{ powerfeed.comments|gfm }}
{{ powerfeed.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -198,7 +198,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if rack.comments %}
{{ rack.comments|gfm }}
{{ rack.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -143,7 +143,7 @@
<td>
{% if site.physical_address %}
<div class="pull-right noprint">
<a href="http://maps.google.com/?q={{ site.physical_address|oneline|urlencode }}" target="_blank" class="btn btn-primary btn-xs">
<a href="http://maps.google.com/?q={{ site.physical_address|urlencode }}" target="_blank" class="btn btn-primary btn-xs">
<i class="glyphicon glyphicon-map-marker"></i> Map it
</a>
</div>
@@ -206,7 +206,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if site.comments %}
{{ site.comments|gfm }}
{{ site.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -288,7 +288,7 @@
</div>
</div>
</div>
{% include 'inc/modal.html' with modal_name='graphs' %}
{% include 'inc/modal.html' with name='graphs' title='Graphs' %}
{% endblock %}
{% block javascript %}

View File

@@ -47,7 +47,7 @@
<tr>
<td>{{ forloop.counter }}</td>
<td>{% log_level level %}</td>
<td class="rendered-markdown">{{ message|gfm }}</td>
<td class="rendered-markdown">{{ message|render_markdown }}</td>
</tr>
{% empty %}
<tr>

View File

@@ -90,7 +90,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if tag.comments %}
{{ tag.comments|gfm }}
{{ tag.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -1,11 +1,16 @@
<div class="modal fade" id="{{ modal_name }}_modal" tabindex="-1" role="dialog">
<div class="modal fade" id="{{ name }}_modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
{% if title %}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">{{ title }}</h4>
</div>
{% endif %}
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="{{ modal_name }}_modal_title">Modal title</h4>
{{ content }}
</div>
<div class="modal-body"></div>
</div>
</div>
</div>

View File

@@ -67,12 +67,17 @@
{% endif %}
<a href="{% url 'dcim:rackrole_list' %}">Rack Roles</a>
</li>
<li{% if not perms.dcim.view_rackreservation %} class="disabled"{% endif %}>
{% if perms.dcim.add_rackreservation %}
<div class="buttons pull-right">
<a href="{% url 'dcim:rackreservation_import' %}" class="btn btn-xs btn-info" title="Import"><i class="fa fa-download"></i></a>
</div>
{% endif %}
<a href="{% url 'dcim:rackreservation_list' %}">Reservations</a>
</li>
<li{% if not perms.dcim.view_rack %} class="disabled"{% endif %}>
<a href="{% url 'dcim:rack_elevation_list' %}">Elevations</a>
</li>
<li{% if not perms.dcim.view_rackreservation %} class="disabled"{% endif %}>
<a href="{% url 'dcim:rackreservation_list' %}">Reservations</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">Tenancy</li>
<li{% if not perms.tenancy.view_tenant %} class="disabled"{% endif %}>
@@ -338,6 +343,11 @@
<li class="divider"></li>
<li class="dropdown-header">Services</li>
<li{% if not perms.ipam.view_service %} class="disabled"{% endif %}>
{% if perms.ipam.add_service %}
<div class="buttons pull-right">
<a href="{% url 'ipam:service_import' %}" class="btn btn-xs btn-info" title="Import"><i class="fa fa-download"></i></a>
</div>
{% endif %}
<a href="{% url 'ipam:service_list' %}">Services</a>
</li>
</ul>

View File

@@ -35,7 +35,7 @@
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-3 control-label">{{ obj.interface.parent|model_name|bettertitle }}</label>
<label class="col-md-3 control-label">{{ obj.interface.parent|meta:"verbose_name"|bettertitle }}</label>
<div class="col-md-9">
<p class="form-control-static">
<a href="{{ obj.interface.parent.get_absolute_url }}">{{ obj.interface.parent }}</a>

View File

@@ -0,0 +1,48 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Static Media Failure - NetBox</title>
<meta charset="UTF-8">
<style type="text/css">
body {
font-family: sans-serif;
}
li.tip {
line-height: 150%;
margin-bottom: 30px;
}
</style>
</head>
<body>
<div style="margin: auto; width: 800px">
<h1>Static Media Failure</h1>
<h3>
The following static media file failed to load:
<a href="{% static filename %}"><code style="color: red">{{ filename }}</code></a>
</h3>
<p>Check the following:</p>
<ul>
<li class="tip">
<code><strong>manage.py collectstatic</strong></code> was run during the most recent upgrade. This installs the most recent
iteration of each static file into the static root path.
</li>
<li class="tip">
The HTTP service (e.g. nginx or Apache) is configured to serve files from the <code>STATIC_ROOT</code> path.
Refer to <a href="https://netbox.readthedocs.io/en/stable/installation/">the installation
documentation</a> for further guidance.
<ul>
{% if request.user.is_staff or request.user.is_superuser %}
<li><code>STATIC_ROOT: <strong>{{ settings.STATIC_ROOT }}</strong></code></li>
{% endif %}
<li><code>STATIC_URL: <strong>{{ settings.STATIC_URL }}</strong></code></li>
</ul>
</li>
<li class="tip">
The file <code>{{ filename }}</code> exists in the static root directory and is readable by the HTTP process.
</li>
</ul>
<p>Click <a href="/">here</a> to attempt loading NetBox again.</p>
</div>
</body>
</html>

View File

@@ -87,7 +87,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if tenant.comments %}
{{ tenant.comments|gfm }}
{{ tenant.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -1,5 +1,6 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% load helpers %}
{% block content %}
<form action="" method="post" enctype="multipart/form-data" class="form form-horizontal">
@@ -9,7 +10,14 @@
{% endfor %}
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h3>{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}</h3>
<h3>
{% if settings.DOCS_ROOT %}
<div class="pull-right">
<button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#docs_modal"><i class="fa fa-question"></i></button>
</div>
{% endif %}
{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}
</h3>
{% block tabs %}{% endblock %}
{% if form.non_field_errors %}
<div class="panel panel-danger">
@@ -43,4 +51,7 @@
</div>
</div>
</form>
{% if settings.DOCS_ROOT %}
{% include 'inc/modal.html' with name='docs' content=obj|get_docs %}
{% endif %}
{% endblock %}

View File

@@ -15,7 +15,7 @@
{% export_button content_type %}
{% endif %}
</div>
<h1>{% block title %}{{ content_type.model_class|model_name_plural|bettertitle }}{% endblock %}</h1>
<h1>{% block title %}{{ content_type.model_class|meta:"verbose_name_plural"|bettertitle }}{% endblock %}</h1>
<div class="row">
<div class="col-md-{% if filter_form %}9{% else %}12{% endif %}">
{% with bulk_edit_url=content_type.model_class|url_name:"bulk_edit" bulk_delete_url=content_type.model_class|url_name:"bulk_delete" %}

View File

@@ -115,7 +115,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if cluster.comments %}
{{ cluster.comments|gfm }}
{{ cluster.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}

View File

@@ -152,7 +152,7 @@
</div>
<div class="panel-body rendered-markdown">
{% if virtualmachine.comments %}
{{ virtualmachine.comments|gfm }}
{{ virtualmachine.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}