Merge pull request #17909 from netbox-community/develop

Release v4.1.6
This commit is contained in:
Jeremy Stretch 2024-10-31 13:50:45 -04:00 committed by GitHub
commit 58bc388457
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 5888 additions and 5168 deletions

View File

@ -14,7 +14,7 @@ body:
attributes: attributes:
label: NetBox version label: NetBox version
description: What version of NetBox are you currently running? description: What version of NetBox are you currently running?
placeholder: v4.1.5 placeholder: v4.1.6
validations: validations:
required: true required: true
- type: dropdown - type: dropdown

View File

@ -39,7 +39,7 @@ body:
attributes: attributes:
label: NetBox Version label: NetBox Version
description: What version of NetBox are you currently running? description: What version of NetBox are you currently running?
placeholder: v4.1.5 placeholder: v4.1.6
validations: validations:
required: true required: true
- type: dropdown - type: dropdown

View File

@ -7,6 +7,9 @@ contact_links:
- name: ❓ Discussion - name: ❓ Discussion
url: https://github.com/netbox-community/netbox/discussions url: https://github.com/netbox-community/netbox/discussions
about: "If you're just looking for help, try starting a discussion instead." about: "If you're just looking for help, try starting a discussion instead."
- name: 👔 Professional Support
url: https://netboxlabs.com/netbox-enterprise/
about: "Professional support is available for NetBox Enterprise or Cloud."
- name: 🌎 Correct a Translation - name: 🌎 Correct a Translation
url: https://explore.transifex.com/netbox-community/netbox/ url: https://explore.transifex.com/netbox-community/netbox/
about: "Spot an incorrect translation? You can propose a fix on Transifex." about: "Spot an incorrect translation? You can propose a fix on Transifex."

View File

@ -1,5 +1,13 @@
# NetBox v4.1 # NetBox v4.1
## v4.1.6 (2024-10-31)
### Bug Fixes
* [#17700](https://github.com/netbox-community/netbox/issues/17700) - Fix warning when no scripts are found within a script module
* [#17884](https://github.com/netbox-community/netbox/issues/17884) - Fix translation support for certain tab headings
* [#17885](https://github.com/netbox-community/netbox/issues/17885) - Fix regression preventing custom scripts from executing
## v4.1.5 (2024-10-28) ## v4.1.5 (2024-10-28)
### Enhancements ### Enhancements

View File

@ -11,7 +11,7 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse from django.urls import reverse
from django.utils.html import escape from django.utils.html import escape
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy as _
from django.views.generic import View from django.views.generic import View
from jinja2.exceptions import TemplateError from jinja2.exceptions import TemplateError

View File

@ -1180,7 +1180,8 @@ class ScriptView(BaseScriptView):
data=form.cleaned_data, data=form.cleaned_data,
request=copy_safe_request(request), request=copy_safe_request(request),
job_timeout=script.python_class.job_timeout, job_timeout=script.python_class.job_timeout,
commit=form.cleaned_data.pop('_commit') commit=form.cleaned_data.pop('_commit'),
name=script.name
) )
return redirect('extras:script_result', job_pk=job.pk) return redirect('extras:script_result', job_pk=job.pk)

View File

@ -3,7 +3,7 @@ from django.db.models import Prefetch
from django.db.models.expressions import RawSQL from django.db.models.expressions import RawSQL
from django.shortcuts import get_object_or_404, redirect, render from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy as _
from circuits.models import Provider from circuits.models import Provider
from dcim.filtersets import InterfaceFilterSet from dcim.filtersets import InterfaceFilterSet

View File

@ -4,7 +4,7 @@ from django.contrib import messages
from django.db import transaction from django.db import transaction
from django.db.models import Q from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy as _
from django.views.generic import View from django.views.generic import View
from core.models import Job, ObjectChange from core.models import Job, ObjectChange

View File

@ -30,7 +30,7 @@
"gridstack": "10.3.1", "gridstack": "10.3.1",
"htmx.org": "1.9.12", "htmx.org": "1.9.12",
"query-string": "9.1.1", "query-string": "9.1.1",
"sass": "1.80.4", "sass": "1.80.5",
"tom-select": "2.3.1", "tom-select": "2.3.1",
"typeface-inter": "3.18.1", "typeface-inter": "3.18.1",
"typeface-roboto-mono": "1.1.13" "typeface-roboto-mono": "1.1.13"

View File

@ -2656,10 +2656,10 @@ safe-regex-test@^1.0.3:
es-errors "^1.3.0" es-errors "^1.3.0"
is-regex "^1.1.4" is-regex "^1.1.4"
sass@1.80.4: sass@1.80.5:
version "1.80.4" version "1.80.5"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.80.4.tgz#bc0418fd796cad2f1a1309d8b4d7fe44b7027de0" resolved "https://registry.yarnpkg.com/sass/-/sass-1.80.5.tgz#0ba965223d44df22497f2966b498cf5c453fae8f"
integrity sha512-rhMQ2tSF5CsuuspvC94nPM9rToiAFw2h3JTrLlgmNw1MH79v8Cr3DH6KF6o6r+8oofY3iYVPUf66KzC8yuVN1w== integrity sha512-TQd2aoQl/+zsxRMEDSxVdpPIqeq9UFc6pr7PzkugiTx3VYCFPUaa3P4RrBQsqok4PO200Vkz0vXQBNlg7W907g==
dependencies: dependencies:
"@parcel/watcher" "^2.4.1" "@parcel/watcher" "^2.4.1"
chokidar "^4.0.0" chokidar "^4.0.0"

View File

@ -1,3 +1,3 @@
version: "4.1.5" version: "4.1.6"
edition: "Community" edition: "Community"
published: "2024-10-28" published: "2024-10-31"

View File

@ -37,101 +37,104 @@
{% endif %} {% endif %}
</div> </div>
</h2> </h2>
{% if module.scripts %} {% with scripts=module.scripts.all %}
<table class="table table-hover scripts"> {% if scripts %}
<thead> <table class="table table-hover scripts">
<tr> <thead>
<th>{% trans "Name" %}</th> <tr>
<th>{% trans "Description" %}</th> <th>{% trans "Name" %}</th>
<th>{% trans "Last Run" %}</th> <th>{% trans "Description" %}</th>
<th>{% trans "Status" %}</th> <th>{% trans "Last Run" %}</th>
<th></th> <th>{% trans "Status" %}</th>
</tr> <th></th>
</thead> </tr>
<tbody> </thead>
{% for script in module.scripts.all %} <tbody>
{% with last_job=script.get_latest_jobs|first %} {% for script in scripts %}
<tr> {% with last_job=script.get_latest_jobs|first %}
<td> <tr>
{% if script.is_executable %} <td>
<a href="{% url 'extras:script' script.pk %}" id="{{ script.module }}.{{ script.class_name }}">{{ script.python_class.name }}</a> {% if script.is_executable %}
<a href="{% url 'extras:script' script.pk %}" id="{{ script.module }}.{{ script.class_name }}">{{ script.python_class.name }}</a>
{% else %}
<a href="{% url 'extras:script_jobs' script.pk %}" id="{{ script.module }}.{{ script.class_name }}">{{ script.python_class.name }}</a>
<span class="text-danger">
<i class="mdi mdi-alert" title="{% trans "Script is no longer present in the source file" %}"></i>
</span>
{% endif %}
</td>
<td>{{ script.python_class.Meta.description|markdown|placeholder }}</td>
{% if last_job %}
<td>
<a href="{% url 'extras:script_result' job_pk=last_job.pk %}">{{ last_job.created|isodatetime }}</a>
</td>
<td>
{% badge last_job.get_status_display last_job.get_status_color %}
</td>
{% else %} {% else %}
<a href="{% url 'extras:script_jobs' script.pk %}" id="{{ script.module }}.{{ script.class_name }}">{{ script.python_class.name }}</a> <td class="text-muted">{% trans "Never" %}</td>
<span class="text-danger"> <td>{{ ''|placeholder }}</td>
<i class="mdi mdi-alert" title="{% trans "Script is no longer present in the source file" %}"></i>
</span>
{% endif %} {% endif %}
</td> <td>
<td>{{ script.python_class.Meta.description|markdown|placeholder }}</td> {% if request.user|can_run:script and script.is_executable %}
<div class="float-end d-print-none">
<form action="{% url 'extras:script' script.pk %}" method="post">
{% csrf_token %}
<button type="submit" name="_run" class="btn btn-primary btn-sm">
{% if last_job %}
<i class="mdi mdi-replay"></i> {% trans "Run Again" %}
{% else %}
<i class="mdi mdi-play"></i> {% trans "Run Script" %}
{% endif %}
</button>
</form>
</div>
{% endif %}
</td>
</tr>
{% if last_job %} {% if last_job %}
<td> {% for test_name, data in last_job.data.tests.items %}
<a href="{% url 'extras:script_result' job_pk=last_job.pk %}">{{ last_job.created|isodatetime }}</a> <tr>
</td> <td colspan="4" class="method">
<td> <span class="ps-3">{{ test_name }}</span>
{% badge last_job.get_status_display last_job.get_status_color %} </td>
</td> <td class="text-end text-nowrap script-stats">
{% else %} <span class="badge text-bg-success">{{ data.success }}</span>
<td class="text-muted">{% trans "Never" %}</td> <span class="badge text-bg-info">{{ data.info }}</span>
<td>{{ ''|placeholder }}</td> <span class="badge text-bg-warning">{{ data.warning }}</span>
<span class="badge text-bg-danger">{{ data.failure }}</span>
</td>
</tr>
{% endfor %}
{% elif not last_job.data.log %}
{# legacy #}
{% for method, stats in last_job.data.items %}
<tr>
<td colspan="4" class="method">
<span class="ps-3">{{ method }}</span>
</td>
<td class="text-end text-nowrap report-stats">
<span class="badge bg-success">{{ stats.success }}</span>
<span class="badge bg-info">{{ stats.info }}</span>
<span class="badge bg-warning">{{ stats.warning }}</span>
<span class="badge bg-danger">{{ stats.failure }}</span>
</td>
</tr>
{% endfor %}
{% endif %} {% endif %}
<td> {% endwith %}
{% if request.user|can_run:script and script.is_executable %} {% endfor %}
<div class="float-end d-print-none"> </tbody>
<form action="{% url 'extras:script' script.pk %}" method="post"> </table>
{% csrf_token %} {% else %}
<button type="submit" name="_run" class="btn btn-primary btn-sm"> <div class="card-body">
{% if last_job %} <div class="alert alert-warning" role="alert">
<i class="mdi mdi-replay"></i> {% trans "Run Again" %} <i class="mdi mdi-alert"></i>
{% else %} {% blocktrans with module=module.name %}Could not load scripts from module {{ module }}{% endblocktrans %}
<i class="mdi mdi-play"></i> {% trans "Run Script" %} </div>
{% endif %}
</button>
</form>
</div>
{% endif %}
</td>
</tr>
{% if last_job %}
{% for test_name, data in last_job.data.tests.items %}
<tr>
<td colspan="4" class="method">
<span class="ps-3">{{ test_name }}</span>
</td>
<td class="text-end text-nowrap script-stats">
<span class="badge text-bg-success">{{ data.success }}</span>
<span class="badge text-bg-info">{{ data.info }}</span>
<span class="badge text-bg-warning">{{ data.warning }}</span>
<span class="badge text-bg-danger">{{ data.failure }}</span>
</td>
</tr>
{% endfor %}
{% elif not last_job.data.log %}
{# legacy #}
{% for method, stats in last_job.data.items %}
<tr>
<td colspan="4" class="method">
<span class="ps-3">{{ method }}</span>
</td>
<td class="text-end text-nowrap report-stats">
<span class="badge bg-success">{{ stats.success }}</span>
<span class="badge bg-info">{{ stats.info }}</span>
<span class="badge bg-warning">{{ stats.warning }}</span>
<span class="badge bg-danger">{{ stats.failure }}</span>
</td>
</tr>
{% endfor %}
{% endif %}
{% endwith %}
{% endfor %}
</tbody>
</table>
{% else %}
<div class="card-body">
<div class="alert alert-warning" role="alert">
<i class="mdi mdi-alert"></i> Could not load scripts from {{ module.name }}
</div> </div>
</div> {% endif %}
{% endif %} {% endwith %}
</div> </div>
{% empty %} {% empty %}
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">

View File

@ -1,6 +1,6 @@
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy as _
from netbox.views import generic from netbox.views import generic
from utilities.query import count_related from utilities.query import count_related

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ from django.db.models import Prefetch, Sum
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy as _
from django.views.generic.base import RedirectView from django.views.generic.base import RedirectView
from jinja2.exceptions import TemplateError from jinja2.exceptions import TemplateError

View File

@ -1,5 +1,5 @@
Django==5.0.9 Django==5.0.9
django-cors-headers==4.5.0 django-cors-headers==4.6.0
django-debug-toolbar==4.4.6 django-debug-toolbar==4.4.6
django-filter==24.3 django-filter==24.3
django-htmx==1.21.0 django-htmx==1.21.0
@ -8,7 +8,7 @@ django-mptt==0.16.0
django-pglocks==1.0.4 django-pglocks==1.0.4
django-prometheus==2.3.1 django-prometheus==2.3.1
django-redis==5.4.0 django-redis==5.4.0
django-rich==1.12.0 django-rich==1.13.0
django-rq==2.10.2 django-rq==2.10.2
django-taggit==6.1.0 django-taggit==6.1.0
django-tables2==2.7.0 django-tables2==2.7.0
@ -20,7 +20,7 @@ feedparser==6.0.11
gunicorn==23.0.0 gunicorn==23.0.0
Jinja2==3.1.4 Jinja2==3.1.4
Markdown==3.7 Markdown==3.7
mkdocs-material==9.5.42 mkdocs-material==9.5.43
mkdocstrings[python-legacy]==0.26.2 mkdocstrings[python-legacy]==0.26.2
netaddr==1.3.0 netaddr==1.3.0
nh3==0.2.18 nh3==0.2.18