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

feat: add a way to clean logs in container's log page #9528

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benoitf
Copy link
Collaborator

@benoitf benoitf commented Oct 22, 2024

What does this PR do?

add a way to clear logs in container's logs

Screenshot / video of UI

Screen.Recording.2024-10-22.at.09.15.11.mov

What issues does this PR fix or reference?

fixes #8311

How to test this PR?

start a container, go to the logs and then click on the clear button

  • Tests are covering the bug fix or the new feature

@benoitf benoitf requested a review from a team as a code owner October 22, 2024 09:12
@benoitf benoitf requested review from jeffmaury, deboer-tim and axel7083 and removed request for a team October 22, 2024 09:12
@benoitf benoitf marked this pull request as draft October 22, 2024 09:37
fixes containers#8311
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@benoitf benoitf marked this pull request as ready for review October 22, 2024 09:57
@danivilla9
Copy link
Contributor

I just tried it on Fedora 40, and looks like it works to me. The 'Clear logs' button is overlapped by the scrollbar, unlike on mac, though:
Screenshot from 2024-10-22 16-53-06
And when changing to a different tab inside of container details and back to Logs the 'deleted' text appears again. I suppose this is expected, right?

@benoitf
Copy link
Collaborator Author

benoitf commented Oct 22, 2024

before implementing I tried several approach and I found out that switching back and getting the logs again was allowing people to get back the log.
Originally I explored the idea of setting a timestamp after which we're asking logs, but then, there was not an easy way to reset this one. So I had the feeling the approach chosen in this PR was less intrusive.

about the overlap of the scrollbar, I can try to move it more to the left

Copy link
Contributor

@deboer-tim deboer-tim left a comment

Choose a reason for hiding this comment

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

Mac scrollbars are narrower so that bit wasn't an issue for me, but I noticed some other minor UI issues as noted.

The 'reappearing logs' were also a surprise to me, and rules out uses like 'clear logs, go do X, come back to see what logs were generated'. Instead of a timestamp would 'remove top X lines' be any simpler, or is it clearing it the issue?

}
</script>

<div class="absolute top-0 right-0 px-1 z-50 m-1 opacity-50 space-x-1">
Copy link
Contributor

Choose a reason for hiding this comment

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

The first Logs I went to I wouldn't have known the button was there if I wasn't looking. Maybe a little more opacity?
Screenshot 2024-10-22 at 3 51 42 PM

Likewise, it is over top of the mem tooltip. z-order should be lowered so that tooltips remain on top.
Screenshot 2024-10-22 at 3 53 41 PM

<div class="absolute top-0 right-0 px-1 z-50 m-1 opacity-50 space-x-1">
<button title="Clear logs" onclick={clear}>
<Fa
class="cursor-pointer rounded-full bg-[var(--pd-button-disabled)] min-h-8 w-8 p-1.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing a hover effect.

The icon isn't as bright as the actions on top, but if I remove the opacity it is too bright. I think it's missing a text- and regular opacity would help with the previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add ability to clean the logs
3 participants