mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Changed LogLevelChoices order; Changed ScriptResultView to select LogLevelChoices to LOG_DEFAULT and setup the html template to put (All) in the last one
This commit is contained in:
parent
57fa1dd18d
commit
ebef1b983a
@ -162,12 +162,12 @@ class LogLevelChoices(ChoiceSet):
|
||||
LOG_FAILURE = 'failure'
|
||||
|
||||
CHOICES = (
|
||||
(LOG_DEBUG, _('Debug'), 'teal'),
|
||||
(LOG_DEFAULT, _('Default'), 'gray'),
|
||||
(LOG_INFO, _('Info'), 'cyan'),
|
||||
(LOG_SUCCESS, _('Success'), 'green'),
|
||||
(LOG_WARNING, _('Warning'), 'yellow'),
|
||||
(LOG_FAILURE, _('Failure'), 'red'),
|
||||
(LOG_DEBUG, _('Debug'), 'teal'),
|
||||
)
|
||||
|
||||
SYSTEM_LEVELS = {
|
||||
|
@ -1374,9 +1374,9 @@ class ScriptResultView(TableMixin, generic.ObjectView):
|
||||
if job.completed:
|
||||
table = self.get_table(job, request, bulk_actions=False)
|
||||
|
||||
log_threshold = request.GET.get('log_threshold', LogLevelChoices.LOG_DEBUG)
|
||||
log_threshold = request.GET.get('log_threshold', LogLevelChoices.LOG_DEFAULT)
|
||||
if log_threshold not in LOG_LEVEL_RANK:
|
||||
log_threshold = LogLevelChoices.LOG_DEBUG
|
||||
log_threshold = LogLevelChoices.LOG_DEFAULT
|
||||
|
||||
context = {
|
||||
'script': job.object,
|
||||
|
@ -53,7 +53,7 @@
|
||||
<div class="dropdown-menu">
|
||||
{% for level, name in log_levels.items %}
|
||||
<a class="dropdown-item d-flex justify-content-between" href="{% url 'extras:script_result' job_pk=job.pk %}?log_threshold={{ level }}">
|
||||
{{ name }}{% if forloop.first %} ({% trans "All" %}){% endif %}
|
||||
{{ name }}{% if forloop.last %} ({% trans "All" %}){% endif %}
|
||||
{% if level == log_threshold %}<span class="badge bg-green ms-auto"></span>{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user