Feature/DisableAutoscroll (#2865)

* feat: add disableAutoscroll option to logger configuration

* chore: update logger configuration to enable autoscrolling
mine
Ümüt Özalp 2025-02-16 01:36:15 +01:00 committed by GitHub
parent 30291081f4
commit 4acf9384d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 20 additions and 5 deletions

View File

@ -431,6 +431,8 @@ You can now override the context portForward default address configuration by se
sinceSeconds: 300 # => tail the last 5 mins.
# Toggles log line wrap. Default false
textWrap: false
# Autoscroll in logs will be disabled. Default is false.
disableAutoscroll: false
# Toggles log line timestamp info. Default false
showTime: false
# Provide shell pod customization when nodeShell feature gate is enabled!
@ -987,6 +989,7 @@ k9s:
buffer: 5000
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -103,6 +103,7 @@
"buffer": {"type": "integer"},
"sinceSeconds": {"type": "integer"},
"textWrap": {"type": "boolean"},
"disableAutoscroll": {"type": "boolean"},
"showTime": {"type": "boolean"}
}
},

View File

@ -29,6 +29,7 @@ k9s:
buffer: 5000
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -23,6 +23,7 @@ k9s:
buffer: 5000
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -16,11 +16,12 @@ const (
// Logger tracks logger options.
type Logger struct {
TailCount int64 `json:"tail" yaml:"tail"`
BufferSize int `json:"buffer" yaml:"buffer"`
SinceSeconds int64 `json:"sinceSeconds" yaml:"sinceSeconds"`
TextWrap bool `json:"textWrap" yaml:"textWrap"`
ShowTime bool `json:"showTime" yaml:"showTime"`
TailCount int64 `json:"tail" yaml:"tail"`
BufferSize int `json:"buffer" yaml:"buffer"`
SinceSeconds int64 `json:"sinceSeconds" yaml:"sinceSeconds"`
TextWrap bool `json:"textWrap" yaml:"textWrap"`
DisableAutoscroll bool `json:"disableAutoscroll" yaml:"disableAutoscroll"`
ShowTime bool `json:"showTime" yaml:"showTime"`
}
// NewLogger returns a new instance.

View File

@ -31,6 +31,7 @@ k9s:
buffer: 5000
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -31,6 +31,7 @@ k9s:
buffer: 800
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -31,6 +31,7 @@ k9s:
buffer: 2000
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -29,6 +29,7 @@ k9s:
buffer: 2000
sinceSeconds: -1
textWrap: false
disableAutoscroll: false
showTime: false
thresholds:
cpu:

View File

@ -39,6 +39,10 @@ func NewLogIndicator(cfg *config.Config, styles *config.Styles, allContainers bo
showTime: cfg.K9s.Logger.ShowTime,
shouldDisplayAllContainers: allContainers,
}
if cfg.K9s.Logger.DisableAutoscroll {
l.scrollStatus = 0
}
l.StylesChanged(styles)
styles.AddListener(&l)
l.SetTextAlign(tview.AlignCenter)