Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8984 Allow script log to be filtered #16446

Merged
merged 13 commits into from
Jul 1, 2024
Merged

8984 Allow script log to be filtered #16446

merged 13 commits into from
Jul 1, 2024

Conversation

arthanson
Copy link
Collaborator

@arthanson arthanson commented Jun 7, 2024

Fixes: #8984

Monosnap NewBranchScript | NetBox 2024-06-07 11-36-27

Added a chit to show log level filter:

DeviceConnectionsReport | NetBox 2024-06-20 11-22-36

@arthanson arthanson changed the title 8984 Allow script log to be filtered DRAFT: 8984 Allow script log to be filtered Jun 7, 2024
@arthanson arthanson changed the title DRAFT: 8984 Allow script log to be filtered 8984 Allow script log to be filtered Jun 7, 2024
@arthanson arthanson marked this pull request as ready for review June 7, 2024 20:00
netbox/templates/extras/script_result.html Outdated Show resolved Hide resolved
netbox/extras/views.py Outdated Show resolved Hide resolved
netbox/extras/views.py Outdated Show resolved Hide resolved
netbox/extras/views.py Outdated Show resolved Hide resolved
netbox/templates/extras/script_result.html Outdated Show resolved Hide resolved
netbox/templates/extras/script_result.html Outdated Show resolved Hide resolved
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to convey the currently applied filter on the view. From the screenshot below, it's not apparently what log level is applied (currently "warning") or that there may be messages omitted.

screenshot

@jeremystretch jeremystretch added this to the v4.1 milestone Jun 17, 2024
@arthanson
Copy link
Collaborator Author

We need to convey the currently applied filter on the view. From the screenshot below, it's not apparently what log level is applied (currently "warning") or that there may be messages omitted.

Added a chit to show the log-level filter to keep it consistent with rest of filtering displays.

DeviceConnectionsReport | NetBox 2024-06-20 11-22-36

@jeremystretch
Copy link
Member

I've made some cosmetic improvements to the threshold selector.
screenshot

Comment on lines +142 to +143
LogLevelChoices.LOG_DEFAULT: 0,
LogLevelChoices.LOG_DEBUG: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear on the distinction between debug and default: Debug is the lowest-ranked level, so shouldn't that be the default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing LogLevelChoices has default defined so it needs to be mapped, we could filter and remove it from the dropdown but I included it because it is already existing. If we removed it from LogLevelChoices then we would need a migration script to convert old script runs to remove it.

@jeremystretch jeremystretch merged commit 5ac5135 into feature Jul 1, 2024
6 checks passed
@jeremystretch jeremystretch deleted the 8984-script-log branch July 1, 2024 20:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants