Added defaultsToFullScreen flag for Live/Details view,logs (#2516)
* Added fullScreen flag for LiveView, updated readme.md * Added fullScreenLView default value for tests * Extended DefaultsToFullScreen to include logView and DetailsViewmine
parent
a1e94856ba
commit
3c20f0d5a1
27
README.md
27
README.md
|
|
@ -385,16 +385,27 @@ K9s uses aliases to navigate most K8s resources.
|
||||||
refreshRate: 2
|
refreshRate: 2
|
||||||
# Number of retries once the connection to the api-server is lost. Default 15.
|
# Number of retries once the connection to the api-server is lost. Default 15.
|
||||||
maxConnRetry: 5
|
maxConnRetry: 5
|
||||||
# Enable mouse support. Default false
|
|
||||||
enableMouse: true
|
|
||||||
# Set to true to hide K9s header. Default false
|
|
||||||
headless: false
|
|
||||||
# Set to true to hide K9s crumbs. Default false
|
|
||||||
crumbsless: false
|
|
||||||
# Indicates whether modification commands like delete/kill/edit are disabled. Default is false
|
# Indicates whether modification commands like delete/kill/edit are disabled. Default is false
|
||||||
readOnly: false
|
readOnly: false
|
||||||
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exist k9s via the :quit command. Default is false.
|
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exist k9s via the :quit command. Default is false.
|
||||||
noExitOnCtrlC: false
|
noExitOnCtrlC: false
|
||||||
|
#UI settings
|
||||||
|
ui:
|
||||||
|
# Enable mouse support. Default false
|
||||||
|
enableMouse: false
|
||||||
|
# Set to true to hide K9s header. Default false
|
||||||
|
headless: false
|
||||||
|
# Set to true to hide the K9S logo Default false
|
||||||
|
logoless: false
|
||||||
|
# Set to true to hide K9s crumbs. Default false
|
||||||
|
crumbsless: false
|
||||||
|
noIcons: false
|
||||||
|
# Toggles reactive UI. This option provide for watching on disk artifacts changes and update the UI live Defaults to false.
|
||||||
|
reactive: false
|
||||||
|
# By default all contexts wil use the dracula skin unless explicitly overridden in the context config file.
|
||||||
|
skin: dracula # => assumes the file skins/dracula.yaml is present in the $XDG_DATA_HOME/k9s/skins directory
|
||||||
|
# Allows to set certain views default fullscreen mode. (yaml, helm history, describe, value_extender, details, logs) Default false
|
||||||
|
defaultsToFullScreen: false
|
||||||
# Toggles icons display as not all terminal support these chars.
|
# Toggles icons display as not all terminal support these chars.
|
||||||
noIcons: false
|
noIcons: false
|
||||||
# Toggles whether k9s should check for the latest revision from the Github repository releases. Default is false.
|
# Toggles whether k9s should check for the latest revision from the Github repository releases. Default is false.
|
||||||
|
|
@ -409,8 +420,6 @@ K9s uses aliases to navigate most K8s resources.
|
||||||
buffer: 500
|
buffer: 500
|
||||||
# Represents how far to go back in the log timeline in seconds. Setting to -1 will tail logs. Default is -1.
|
# Represents how far to go back in the log timeline in seconds. Setting to -1 will tail logs. Default is -1.
|
||||||
sinceSeconds: 300 # => tail the last 5 mins.
|
sinceSeconds: 300 # => tail the last 5 mins.
|
||||||
# Go full screen while displaying logs. Default false
|
|
||||||
fullScreenLogs: false
|
|
||||||
# Toggles log line wrap. Default false
|
# Toggles log line wrap. Default false
|
||||||
textWrap: false
|
textWrap: false
|
||||||
# Toggles log line timestamp info. Default false
|
# Toggles log line timestamp info. Default false
|
||||||
|
|
@ -912,6 +921,7 @@ k9s:
|
||||||
reactive: false
|
reactive: false
|
||||||
# By default all contexts wil use the dracula skin unless explicitly overridden in the context config file.
|
# By default all contexts wil use the dracula skin unless explicitly overridden in the context config file.
|
||||||
skin: dracula # => assumes the file skins/dracula.yaml is present in the $XDG_DATA_HOME/k9s/skins directory
|
skin: dracula # => assumes the file skins/dracula.yaml is present in the $XDG_DATA_HOME/k9s/skins directory
|
||||||
|
defaultsToFullScreen: false
|
||||||
skipLatestRevCheck: false
|
skipLatestRevCheck: false
|
||||||
disablePodCounting: false
|
disablePodCounting: false
|
||||||
shellPod:
|
shellPod:
|
||||||
|
|
@ -929,7 +939,6 @@ k9s:
|
||||||
tail: 100
|
tail: 100
|
||||||
buffer: 5000
|
buffer: 5000
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@
|
||||||
"crumbsless": {"type": "boolean"},
|
"crumbsless": {"type": "boolean"},
|
||||||
"noIcons": {"type": "boolean"},
|
"noIcons": {"type": "boolean"},
|
||||||
"reactive": {"type": "boolean"},
|
"reactive": {"type": "boolean"},
|
||||||
"skin": {"type": "string"}
|
"skin": {"type": "string"},
|
||||||
|
"defaultsToFullScreen": {"type": "boolean"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shellPod": {
|
"shellPod": {
|
||||||
|
|
@ -101,7 +102,6 @@
|
||||||
"tail": {"type": "integer"},
|
"tail": {"type": "integer"},
|
||||||
"buffer": {"type": "integer"},
|
"buffer": {"type": "integer"},
|
||||||
"sinceSeconds": {"type": "integer"},
|
"sinceSeconds": {"type": "integer"},
|
||||||
"fullScreen": {"type": "boolean"},
|
|
||||||
"textWrap": {"type": "boolean"},
|
"textWrap": {"type": "boolean"},
|
||||||
"showTime": {"type": "boolean"}
|
"showTime": {"type": "boolean"}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ k9s:
|
||||||
tail: 100
|
tail: 100
|
||||||
buffer: 5000
|
buffer: 5000
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ k9s:
|
||||||
tail: 100
|
tail: 100
|
||||||
buffer: 5000
|
buffer: 5000
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ type Logger struct {
|
||||||
TailCount int64 `json:"tail" yaml:"tail"`
|
TailCount int64 `json:"tail" yaml:"tail"`
|
||||||
BufferSize int `json:"buffer" yaml:"buffer"`
|
BufferSize int `json:"buffer" yaml:"buffer"`
|
||||||
SinceSeconds int64 `json:"sinceSeconds" yaml:"sinceSeconds"`
|
SinceSeconds int64 `json:"sinceSeconds" yaml:"sinceSeconds"`
|
||||||
FullScreen bool `json:"fullScreen" yaml:"fullScreen"`
|
|
||||||
TextWrap bool `json:"textWrap" yaml:"textWrap"`
|
TextWrap bool `json:"textWrap" yaml:"textWrap"`
|
||||||
ShowTime bool `json:"showTime" yaml:"showTime"`
|
ShowTime bool `json:"showTime" yaml:"showTime"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ k9s:
|
||||||
crumbsless: false
|
crumbsless: false
|
||||||
reactive: false
|
reactive: false
|
||||||
noIcons: false
|
noIcons: false
|
||||||
|
defaultsToFullScreen: false
|
||||||
skipLatestRevCheck: false
|
skipLatestRevCheck: false
|
||||||
disablePodCounting: false
|
disablePodCounting: false
|
||||||
shellPod:
|
shellPod:
|
||||||
|
|
@ -29,7 +30,6 @@ k9s:
|
||||||
tail: 100
|
tail: 100
|
||||||
buffer: 5000
|
buffer: 5000
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ k9s:
|
||||||
crumbsless: false
|
crumbsless: false
|
||||||
reactive: false
|
reactive: false
|
||||||
noIcons: false
|
noIcons: false
|
||||||
|
defaultsToFullScreen: false
|
||||||
skipLatestRevCheck: false
|
skipLatestRevCheck: false
|
||||||
disablePodCounting: false
|
disablePodCounting: false
|
||||||
shellPod:
|
shellPod:
|
||||||
|
|
@ -29,7 +30,6 @@ k9s:
|
||||||
tail: 500
|
tail: 500
|
||||||
buffer: 800
|
buffer: 800
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ k9s:
|
||||||
crumbsless: false
|
crumbsless: false
|
||||||
reactive: false
|
reactive: false
|
||||||
noIcons: false
|
noIcons: false
|
||||||
|
defaultsToFullScreen: false
|
||||||
skipLatestRevCheck: false
|
skipLatestRevCheck: false
|
||||||
disablePodCounting: false
|
disablePodCounting: false
|
||||||
shellPod:
|
shellPod:
|
||||||
|
|
@ -29,7 +30,6 @@ k9s:
|
||||||
tail: 200
|
tail: 200
|
||||||
buffer: 2000
|
buffer: 2000
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ k9s:
|
||||||
tail: 200
|
tail: 200
|
||||||
buffer: 2000
|
buffer: 2000
|
||||||
sinceSeconds: -1
|
sinceSeconds: -1
|
||||||
fullScreen: false
|
|
||||||
textWrap: false
|
textWrap: false
|
||||||
showTime: false
|
showTime: false
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,7 @@ type UI struct {
|
||||||
// Skin reference the general k9s skin name.
|
// Skin reference the general k9s skin name.
|
||||||
// Can be overridden per context.
|
// Can be overridden per context.
|
||||||
Skin string `json:"skin" yaml:"skin,omitempty"`
|
Skin string `json:"skin" yaml:"skin,omitempty"`
|
||||||
|
|
||||||
|
// DefaultsToFullScreen toggles fullscreen on views like logs, yaml, details.
|
||||||
|
DefaultsToFullScreen bool `json:"defaultsToFullScreen" yaml:"defaultsToFullScreen"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ func (d *Details) Init(_ context.Context) error {
|
||||||
|
|
||||||
d.app.Styles.AddListener(d)
|
d.app.Styles.AddListener(d)
|
||||||
d.StylesChanged(d.app.Styles)
|
d.StylesChanged(d.app.Styles)
|
||||||
|
d.setFullScreen(d.app.Config.K9s.UI.DefaultsToFullScreen)
|
||||||
|
|
||||||
d.app.Prompt().SetModel(d.cmdBuff)
|
d.app.Prompt().SetModel(d.cmdBuff)
|
||||||
d.cmdBuff.AddListener(d)
|
d.cmdBuff.AddListener(d)
|
||||||
|
|
@ -226,16 +227,20 @@ func (d *Details) toggleFullScreenCmd(evt *tcell.EventKey) *tcell.EventKey {
|
||||||
return evt
|
return evt
|
||||||
}
|
}
|
||||||
|
|
||||||
d.fullScreen = !d.fullScreen
|
d.setFullScreen(!d.fullScreen)
|
||||||
d.SetFullScreen(d.fullScreen)
|
|
||||||
d.Box.SetBorder(!d.fullScreen)
|
return nil
|
||||||
if d.fullScreen {
|
}
|
||||||
|
|
||||||
|
func (d *Details) setFullScreen(isFullScreen bool) {
|
||||||
|
d.fullScreen = isFullScreen
|
||||||
|
d.SetFullScreen(isFullScreen)
|
||||||
|
d.Box.SetBorder(!isFullScreen)
|
||||||
|
if isFullScreen {
|
||||||
d.Box.SetBorderPadding(0, 0, 0, 0)
|
d.Box.SetBorderPadding(0, 0, 0, 0)
|
||||||
} else {
|
} else {
|
||||||
d.Box.SetBorderPadding(0, 0, 1, 1)
|
d.Box.SetBorderPadding(0, 0, 1, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Details) prevCmd(evt *tcell.EventKey) *tcell.EventKey {
|
func (d *Details) prevCmd(evt *tcell.EventKey) *tcell.EventKey {
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ func (v *LiveView) Init(_ context.Context) error {
|
||||||
|
|
||||||
v.app.Styles.AddListener(v)
|
v.app.Styles.AddListener(v)
|
||||||
v.StylesChanged(v.app.Styles)
|
v.StylesChanged(v.app.Styles)
|
||||||
|
v.setFullScreen(v.app.Config.K9s.UI.DefaultsToFullScreen)
|
||||||
|
|
||||||
v.app.Prompt().SetModel(v.cmdBuff)
|
v.app.Prompt().SetModel(v.cmdBuff)
|
||||||
v.cmdBuff.AddListener(v)
|
v.cmdBuff.AddListener(v)
|
||||||
|
|
@ -286,16 +287,20 @@ func (v *LiveView) toggleFullScreenCmd(evt *tcell.EventKey) *tcell.EventKey {
|
||||||
return evt
|
return evt
|
||||||
}
|
}
|
||||||
|
|
||||||
v.fullScreen = !v.fullScreen
|
v.setFullScreen(!v.fullScreen)
|
||||||
v.SetFullScreen(v.fullScreen)
|
|
||||||
v.Box.SetBorder(!v.fullScreen)
|
return nil
|
||||||
if v.fullScreen {
|
}
|
||||||
|
|
||||||
|
func (v *LiveView) setFullScreen(isFullScreen bool) {
|
||||||
|
v.fullScreen = isFullScreen
|
||||||
|
v.SetFullScreen(isFullScreen)
|
||||||
|
v.Box.SetBorder(!isFullScreen)
|
||||||
|
if isFullScreen {
|
||||||
v.Box.SetBorderPadding(0, 0, 0, 0)
|
v.Box.SetBorderPadding(0, 0, 0, 0)
|
||||||
} else {
|
} else {
|
||||||
v.Box.SetBorderPadding(0, 0, 1, 1)
|
v.Box.SetBorderPadding(0, 0, 1, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *LiveView) nextCmd(evt *tcell.EventKey) *tcell.EventKey {
|
func (v *LiveView) nextCmd(evt *tcell.EventKey) *tcell.EventKey {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ func NewLogIndicator(cfg *config.Config, styles *config.Styles, allContainers bo
|
||||||
TextView: tview.NewTextView(),
|
TextView: tview.NewTextView(),
|
||||||
indicator: make([]byte, 0, 100),
|
indicator: make([]byte, 0, 100),
|
||||||
scrollStatus: 1,
|
scrollStatus: 1,
|
||||||
fullScreen: cfg.K9s.Logger.FullScreen,
|
fullScreen: cfg.K9s.UI.DefaultsToFullScreen,
|
||||||
textWrap: cfg.K9s.Logger.TextWrap,
|
textWrap: cfg.K9s.Logger.TextWrap,
|
||||||
showTime: cfg.K9s.Logger.ShowTime,
|
showTime: cfg.K9s.Logger.ShowTime,
|
||||||
shouldDisplayAllContainers: allContainers,
|
shouldDisplayAllContainers: allContainers,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue