-
Notifications
You must be signed in to change notification settings - Fork 144
feat(ui): Show eks cluster name in the main UI #447
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,15 +54,15 @@ type UIModel struct { | |
| DisablePricing bool | ||
| } | ||
|
|
||
| func NewUIModel(extraLabels []string, nodeSort string, style *Style) *UIModel { | ||
| func NewUIModel(extraLabels []string, nodeSort string, style *Style, context string) *UIModel { | ||
| pager := paginator.New() | ||
| pager.Type = paginator.Dots | ||
| pager.ActiveDot = activeDot | ||
| pager.InactiveDot = inactiveDot | ||
| return &UIModel{ | ||
| // red to green | ||
| progress: progress.New(style.gradient), | ||
| cluster: NewCluster(), | ||
| cluster: NewCluster(context), | ||
| extraLabels: extraLabels, | ||
| paginator: pager, | ||
| nodeSorter: makeNodeSorter(nodeSort), | ||
|
|
@@ -88,6 +88,10 @@ func (u *UIModel) View() string { | |
| }) | ||
|
|
||
| ctw := text.NewColorTabWriter(&b, 0, 8, 1) | ||
|
|
||
| fmt.Fprintln(&b, "Viewing cluster: ", u.cluster.name) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think taking up a new line on the screen is too much, can it be fit anywhere else? Maybe after the "q: quit" message?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, in my use case it's a pretty important information that's why I put it up. |
||
| fmt.Fprintln(&b) | ||
|
|
||
| u.writeClusterSummary(u.cluster.resources, stats, ctw) | ||
| ctw.Flush() | ||
| u.progress.ShowPercentage = true | ||
|
|
@@ -122,6 +126,7 @@ func (u *UIModel) View() string { | |
|
|
||
| fmt.Fprintln(&b, u.paginator.View()) | ||
| fmt.Fprintln(&b, helpStyle("←/→ page • q: quit")) | ||
|
|
||
| return b.String() | ||
| } | ||
|
|
||
|
|
||
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.
It should be possible to pull this from the kubeconfig file, I would greatly prefer that to running the kubectl binary.
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.
You're right, would be better to just parse the json config file. I'll do that
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.
I think you can get it via something like this: