mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 09:08:15 -06:00
8984 review changes
This commit is contained in:
parent
ca6de26d67
commit
e77b5d2245
@ -1,3 +1,5 @@
|
||||
from extras.choices import LogLevelChoices
|
||||
|
||||
# Events
|
||||
EVENT_CREATE = 'create'
|
||||
EVENT_UPDATE = 'update'
|
||||
@ -133,3 +135,12 @@ DEFAULT_DASHBOARD = [
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
LOG_LEVEL_RANK = {
|
||||
LogLevelChoices.LOG_DEFAULT: 0,
|
||||
LogLevelChoices.LOG_DEBUG: 1,
|
||||
LogLevelChoices.LOG_SUCCESS: 2,
|
||||
LogLevelChoices.LOG_INFO: 3,
|
||||
LogLevelChoices.LOG_WARNING: 4,
|
||||
LogLevelChoices.LOG_FAILURE: 5,
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ from utilities.templatetags.builtins.filters import render_markdown
|
||||
from utilities.views import ContentTypePermissionRequiredMixin, get_viewname, register_model_view
|
||||
from virtualization.models import VirtualMachine
|
||||
from . import filtersets, forms, tables
|
||||
from .constants import LOG_LEVEL_RANK
|
||||
from .models import *
|
||||
from .scripts import run_script
|
||||
from .tables import ReportResultsTable, ScriptResultsTable
|
||||
@ -1191,15 +1192,6 @@ class ScriptResultView(TableMixin, generic.ObjectView):
|
||||
table = None
|
||||
index = 0
|
||||
|
||||
LOG_LEVEL_RANK = {
|
||||
LogLevelChoices.LOG_DEFAULT: 0,
|
||||
LogLevelChoices.LOG_DEBUG: 1,
|
||||
LogLevelChoices.LOG_SUCCESS: 2,
|
||||
LogLevelChoices.LOG_INFO: 3,
|
||||
LogLevelChoices.LOG_WARNING: 4,
|
||||
LogLevelChoices.LOG_FAILURE: 5,
|
||||
}
|
||||
|
||||
log_level = LOG_LEVEL_RANK.get(request.GET.get('log_level', LogLevelChoices.LOG_DEFAULT))
|
||||
|
||||
if job.data:
|
||||
|
@ -3,6 +3,19 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div class="htmx-container">
|
||||
<p>
|
||||
{% if job.started %}
|
||||
{% trans "Started" %}: <strong>{{ job.started|isodatetime }}</strong>
|
||||
{% elif job.scheduled %}
|
||||
{% trans "Scheduled for" %}: <strong>{{ job.scheduled|isodatetime }}</strong>
|
||||
{% else %}
|
||||
{% trans "Created" %}: <strong>{{ job.created|isodatetime }}</strong>
|
||||
{% endif %}
|
||||
{% if job.completed %}
|
||||
{% trans "Duration" %}: <strong>{{ job.duration }}</strong>
|
||||
{% endif %}
|
||||
<span id="pending-result-label">{% badge job.get_status_display job.get_status_color %}</span>
|
||||
</p>
|
||||
{% if job.completed %}
|
||||
{% if tests %}
|
||||
{# Summary of test methods #}
|
||||
|
@ -41,20 +41,6 @@
|
||||
{# Object list tab #}
|
||||
<div class="tab-pane show active" id="results" role="tabpanel" aria-labelledby="results-tab">
|
||||
|
||||
<p>
|
||||
{% if job.started %}
|
||||
{% trans "Started" %}: <strong>{{ job.started|isodatetime }}</strong>
|
||||
{% elif job.scheduled %}
|
||||
{% trans "Scheduled for" %}: <strong>{{ job.scheduled|isodatetime }}</strong>
|
||||
{% else %}
|
||||
{% trans "Created" %}: <strong>{{ job.created|isodatetime }}</strong>
|
||||
{% endif %}
|
||||
{% if job.completed %}
|
||||
{% trans "Duration" %}: <strong>{{ job.duration }}</strong>
|
||||
{% endif %}
|
||||
<span id="pending-result-label">{% badge job.get_status_display job.get_status_color %}</span>
|
||||
</p>
|
||||
|
||||
{# Object table controls #}
|
||||
<div class="row mb-3">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user