From ebef1b983a57e4926623fc37706c55b9fb7c9106 Mon Sep 17 00:00:00 2001 From: Renato Almeida de Oliveira Zaroubin Date: Mon, 27 Jan 2025 18:17:38 +0000 Subject: [PATCH] Changed LogLevelChoices order; Changed ScriptResultView to select LogLevelChoices to LOG_DEFAULT and setup the html template to put (All) in the last one --- netbox/extras/choices.py | 2 +- netbox/extras/views.py | 4 ++-- netbox/templates/extras/script_result.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/netbox/extras/choices.py b/netbox/extras/choices.py index 4525d8689..5d8d3f791 100644 --- a/netbox/extras/choices.py +++ b/netbox/extras/choices.py @@ -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 = { diff --git a/netbox/extras/views.py b/netbox/extras/views.py index 9cb9dd54a..eeed32b8a 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -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, diff --git a/netbox/templates/extras/script_result.html b/netbox/templates/extras/script_result.html index 18a28998f..6c437df23 100644 --- a/netbox/templates/extras/script_result.html +++ b/netbox/templates/extras/script_result.html @@ -53,7 +53,7 @@