forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): Add button for wrapping lines in pod logs viewer (argoproj#…
…15506) * Add back wrap log line button Signed-off-by: Yi Cai <yicai@redhat.com> * Fixed lint issue Signed-off-by: Yi Cai <yicai@redhat.com> * Updated icon and location of Wrap Lines btn Signed-off-by: Yi Cai <yicai@redhat.com> * Fixed lint issue Signed-off-by: Yi Cai <yicai@redhat.com> * Put back pre tag and Ansi component Signed-off-by: Yi Cai <yicai@redhat.com> --------- Signed-off-by: Yi Cai <yicai@redhat.com>
- Loading branch information
1 parent
2cab3cd
commit a2923a4
Showing
4 changed files
with
38 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
ui/src/app/applications/components/pod-logs-viewer/wrap-lines-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {services, ViewPreferences} from '../../../shared/services'; | ||
import * as React from 'react'; | ||
import {ToggleButton} from '../../../shared/components/toggle-button'; | ||
|
||
// WrapLinesButton is a component that wraps log lines. | ||
export const WrapLinesButton = ({prefs}: {prefs: ViewPreferences}) => ( | ||
<ToggleButton | ||
title='Wrap Lines' | ||
onToggle={() => { | ||
const wrap = prefs.appDetails.wrapLines; | ||
services.viewPreferences.updatePreferences({...prefs, appDetails: {...prefs.appDetails, wrapLines: !wrap}}); | ||
}} | ||
toggled={prefs.appDetails.wrapLines} | ||
icon='share' | ||
rotate={true} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters