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
gui: Add search bar for logging (fixes #9252) #9255
base: main
Are you sure you want to change the base?
Conversation
…hing#9215) This adds our short device ID to the basic auth realm. This has at least two consequences: - It is different from what's presented by another device on the same address (e.g., if I use SSH forwards to different dives on the same local address), preventing credentials for one from being sent to another. - It is different from what we did previously, meaning we avoid cached credentials from old versions interfering with the new login flow. I don't *think* there should be things that depend on our precise realm string, so this shouldn't break any existing setups... Sneakily this also changes the session cookie and CSRF name, because I think `id.Short().String()` is nicer than `id.String()[:5]` and the short ID is two characters longer. That's also not a problem...
Will it still update the filtered view when new messages come in that match the pattern? |
The version in the PR does not, although it makes a lot of sense come to think of it. Let me add that in real quick. Here's what I'll do:
By the way, this is the first time I do a PR in a more official/organized project where I am not the owner. For cases like this where updating code in a commit is required, at what point do you prefer a new PR is made versus simple appending a commit to a PR? Appreciate the help/patience, |
Thank you. Just push more commits to this PR's branch, that's fine. It will be squashed when merging anyway. |
Latest push to this branch includes the following changes:
|
Nice, two things however... Now it's always case sensitive, instead of never. :) And I think it's quite unintuitive that nothing happens until you type the third character... I start typing in the filter field, and nothing happens, I'm not sure if it's working? Then once you reach the hidden invisible limit it does |
Purpose
Adds search functionality to the GUI logs. There is a conversation regarding this addition here: #9252.
Testing
I tested by building from source with the changes and ensuring that current logging functionality was persisted, as well as checking that the search bar works correctly and is reasonably performant.
Screenshots
Documentation
#9252 was the original issue that was raised.
As for documenting the code:
An input of type text is added to the logging html file, ng-keyup callback calls logging.filter.
The function
logging.filter
does the following:logging.entries
array is searched for entries that match the query using the javascriptincludes
function.logging.filtered
array. When the logging text area is redrawn, we select the array to draw from based on whether we are filtering or not (that's why I've also addedlogging.isFiltering
).logging.filtered
array is cleared and re-parsed upon a new input.Authorship
DAlba-sudo, d.alba.work@gmail.com
Your name and email will be added automatically to the AUTHORS file
based on the commit metadata.