-
Notifications
You must be signed in to change notification settings - Fork 388
frontend: logs: Persist showTimestamps toggle in localStorage #3595
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
base: main
Are you sure you want to change the base?
frontend: logs: Persist showTimestamps toggle in localStorage #3595
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: blazethunderstorm The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@illume @sniok @joaquimrocha pls review i have also added the localstorage feaure |
@@ -61,7 +61,12 @@ export function PodLogViewer(props: PodLogViewerProps) { | |||
const { item, onClose, open, ...other } = props; | |||
const [container, setContainer] = React.useState(getDefaultContainer()); | |||
const [showPrevious, setShowPrevious] = React.useState<boolean>(false); | |||
const [showTimestamps, setShowTimestamps] = React.useState<boolean>(true); | |||
const TIMESTAMP_SETTING_KEY = 'headlamp.logs.showTimestamps'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use existing useLocalStorageState
hook for this
@sniok alright would do that |
@sniok i have made req changes pls review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this, to be clear: I would suggest looking into issues without (recent) open PRs addressing them. This avoids multiple people doing the same work twice
For this PR, as per our contribution guidelines:
- Would you be able to squash your changes into a single atomic commit?
- Could you change the PR and commit titles in the format to the following format?
<area>: <description of changes>
6bf9340
to
6fd0cbf
Compare
6fd0cbf
to
6bf9340
Compare
6bf9340
to
957c9b3
Compare
957c9b3
to
6bf9340
Compare
95127cd
to
9694009
Compare
9694009
to
6bf9340
Compare
@skoeva cant the commits be sqaushed while merging ? |
i am facing a bit of probelm from my end |
@skoeva can it be done pls tell ? |
@blazethunderstorm |
Summary
This PR adds a reconnect fallback for the logs view by setting a cancelLogsStream callback in PodLogViewer, improving resilience when the logs stream is disconnected.
Related Issue
Fixes #3572
Changes
AAdded cancelLogsStream state to manage log stream cancellation.
Implemented handleReconnect to restart logs stream if it gets disconnected.
Ensured stream is properly cleaned up when reconnecting
Steps to Test
Open the logs view for a Pod.
Simulate network disconnect or close the stream.
Click on the "Reconnect" button to reattach the logs stream.
Confirm logs resume without page reload.
Screenshots (if applicable)
Screencast.from.2025-07-08.19-55-01.mp4
Notes for the Reviewer