changed menu shortcut

mine
derailed 2019-08-13 23:46:42 -06:00
parent f7bd5301a8
commit c742e2e848
8 changed files with 36 additions and 71 deletions

View File

@ -0,0 +1,25 @@
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s_small.png" align="right" width="200" height="auto"/>
# Release v0.8.2
## Notes
Thank you to all that contributed with flushing out issues and enhancements for K9s! I'll try to mark some of these issues as fixed. But if you don't mind grab the latest rev and see if we're happier with some of the fixes! If you've filed an issue please help me verify and close. Your support, kindness and awesome suggestions to make K9s better is as ever very much noticed and appreciated!
Also if you dig this tool, please make some noise on social! [@kitesurfer](https://twitter.com/kitesurfer)
---
## Change Logs
Maintenance release
---
## Resolved Bugs/Features
+ [Issue #285](https://github.com/derailed/k9s/issues/285)
---
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2019 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)

View File

@ -161,36 +161,6 @@ const (
Key9 Key9
) )
// Defines AltKeys
const (
KeyAltA tcell.Key = 4 * (iota + 97)
KeyAltB
KeyAltC
KeyAltD
KeyAltE
KeyAltF
KeyAltG
KeyAltH
KeyAltI
KeyAltJ
KeyAltK
KeyAltL
KeyAltM
KeyAltN
KeyAltO
KeyAltP
KeyAltQ
KeyAltR
KeyAltS
KeyAltT
KeyAltU
KeyAltV
KeyAltW
KeyAltX
KeyAltY
KeyAltZ
)
// Defines char keystrokes // Defines char keystrokes
const ( const (
KeyA tcell.Key = iota + 97 KeyA tcell.Key = iota + 97
@ -275,7 +245,6 @@ func initKeys() {
initNumbKeys() initNumbKeys()
initStdKeys() initStdKeys()
initShiftKeys() initShiftKeys()
initAltKeys()
} }
func initNumbKeys() { func initNumbKeys() {
@ -348,32 +317,3 @@ func initShiftKeys() {
tcell.KeyNames[tcell.Key(KeyShiftY)] = "Shift-Y" tcell.KeyNames[tcell.Key(KeyShiftY)] = "Shift-Y"
tcell.KeyNames[tcell.Key(KeyShiftZ)] = "Shift-Z" tcell.KeyNames[tcell.Key(KeyShiftZ)] = "Shift-Z"
} }
func initAltKeys() {
tcell.KeyNames[tcell.Key(KeyAltA)] = "Alt-A"
tcell.KeyNames[tcell.Key(KeyAltB)] = "Alt-B"
tcell.KeyNames[tcell.Key(KeyAltC)] = "Alt-C"
tcell.KeyNames[tcell.Key(KeyAltD)] = "Alt-D"
tcell.KeyNames[tcell.Key(KeyAltE)] = "Alt-E"
tcell.KeyNames[tcell.Key(KeyAltF)] = "Alt-F"
tcell.KeyNames[tcell.Key(KeyAltG)] = "Alt-G"
tcell.KeyNames[tcell.Key(KeyAltH)] = "Alt-H"
tcell.KeyNames[tcell.Key(KeyAltI)] = "Alt-I"
tcell.KeyNames[tcell.Key(KeyAltJ)] = "Alt-J"
tcell.KeyNames[tcell.Key(KeyAltK)] = "Alt-K"
tcell.KeyNames[tcell.Key(KeyAltL)] = "Alt-L"
tcell.KeyNames[tcell.Key(KeyAltM)] = "Alt-M"
tcell.KeyNames[tcell.Key(KeyAltN)] = "Alt-N"
tcell.KeyNames[tcell.Key(KeyAltO)] = "Alt-O"
tcell.KeyNames[tcell.Key(KeyAltP)] = "Alt-P"
tcell.KeyNames[tcell.Key(KeyAltQ)] = "Alt-Q"
tcell.KeyNames[tcell.Key(KeyAltR)] = "Alt-R"
tcell.KeyNames[tcell.Key(KeyAltS)] = "Alt-S"
tcell.KeyNames[tcell.Key(KeyAltT)] = "Alt-T"
tcell.KeyNames[tcell.Key(KeyAltU)] = "Alt-U"
tcell.KeyNames[tcell.Key(KeyAltV)] = "Alt-V"
tcell.KeyNames[tcell.Key(KeyAltW)] = "Alt-W"
tcell.KeyNames[tcell.Key(KeyAltX)] = "Alt-X"
tcell.KeyNames[tcell.Key(KeyAltY)] = "Alt-Y"
tcell.KeyNames[tcell.Key(KeyAltZ)] = "Alt-Z"
}

View File

@ -50,8 +50,8 @@ func (v *containerView) extraActions(aa ui.KeyActions) {
aa[ui.KeyP] = ui.NewKeyAction("Previous", v.backCmd, false) aa[ui.KeyP] = ui.NewKeyAction("Previous", v.backCmd, false)
aa[ui.KeyShiftC] = ui.NewKeyAction("Sort CPU", v.sortColCmd(6, false), true) aa[ui.KeyShiftC] = ui.NewKeyAction("Sort CPU", v.sortColCmd(6, false), true)
aa[ui.KeyShiftM] = ui.NewKeyAction("Sort MEM", v.sortColCmd(7, false), true) aa[ui.KeyShiftM] = ui.NewKeyAction("Sort MEM", v.sortColCmd(7, false), true)
aa[ui.KeyAltC] = ui.NewKeyAction("Sort CPU%", v.sortColCmd(8, false), true) aa[ui.KeyShiftX] = ui.NewKeyAction("Sort CPU%", v.sortColCmd(8, false), true)
aa[ui.KeyAltM] = ui.NewKeyAction("Sort MEM%", v.sortColCmd(9, false), true) aa[ui.KeyShiftZ] = ui.NewKeyAction("Sort MEM%", v.sortColCmd(9, false), true)
} }
func (v *containerView) k9sEnv() K9sEnv { func (v *containerView) k9sEnv() K9sEnv {

View File

@ -99,7 +99,7 @@ func (v *forwardView) registerActions() {
tv.SetActions(ui.KeyActions{ tv.SetActions(ui.KeyActions{
tcell.KeyEnter: ui.NewKeyAction("Goto", v.gotoBenchCmd, true), tcell.KeyEnter: ui.NewKeyAction("Goto", v.gotoBenchCmd, true),
tcell.KeyCtrlB: ui.NewKeyAction("Bench", v.benchCmd, true), tcell.KeyCtrlB: ui.NewKeyAction("Bench", v.benchCmd, true),
ui.KeyAltB: ui.NewKeyAction("Bench Stop", v.benchStopCmd, true), tcell.KeyCtrlK: ui.NewKeyAction("Bench Stop", v.benchStopCmd, true),
tcell.KeyCtrlD: ui.NewKeyAction("Delete", v.deleteCmd, true), tcell.KeyCtrlD: ui.NewKeyAction("Delete", v.deleteCmd, true),
ui.KeySlash: ui.NewKeyAction("Filter", tv.activateCmd, false), ui.KeySlash: ui.NewKeyAction("Filter", tv.activateCmd, false),
ui.KeyP: ui.NewKeyAction("Previous", v.app.prevCmd, false), ui.KeyP: ui.NewKeyAction("Previous", v.app.prevCmd, false),

View File

@ -100,8 +100,8 @@ func (v *helpView) showNav() ui.Hints {
func (v *helpView) showGeneral() ui.Hints { func (v *helpView) showGeneral() ui.Hints {
return ui.Hints{ return ui.Hints{
{":<cmd>", "Command mode"}, {":cmd", "Command mode"},
{"/<term>", "Filter mode"}, {"/term", "Filter mode"},
{"esc", "Clear filter"}, {"esc", "Clear filter"},
{"tab", "Next term match"}, {"tab", "Next term match"},
{"backtab", "Previous term match"}, {"backtab", "Previous term match"},

View File

@ -21,8 +21,8 @@ func newNodeView(t string, app *appView, list resource.List) resourceViewer {
func (v *nodeView) extraActions(aa ui.KeyActions) { func (v *nodeView) extraActions(aa ui.KeyActions) {
aa[ui.KeyShiftC] = ui.NewKeyAction("Sort CPU", v.sortColCmd(7, false), true) aa[ui.KeyShiftC] = ui.NewKeyAction("Sort CPU", v.sortColCmd(7, false), true)
aa[ui.KeyShiftM] = ui.NewKeyAction("Sort MEM", v.sortColCmd(8, false), true) aa[ui.KeyShiftM] = ui.NewKeyAction("Sort MEM", v.sortColCmd(8, false), true)
aa[ui.KeyAltC] = ui.NewKeyAction("Sort CPU%", v.sortColCmd(9, false), true) aa[ui.KeyShiftX] = ui.NewKeyAction("Sort CPU%", v.sortColCmd(9, false), true)
aa[ui.KeyAltM] = ui.NewKeyAction("Sort MEM%", v.sortColCmd(10, false), true) aa[ui.KeyShiftZ] = ui.NewKeyAction("Sort MEM%", v.sortColCmd(10, false), true)
} }
func (v *nodeView) sortColCmd(col int, asc bool) func(evt *tcell.EventKey) *tcell.EventKey { func (v *nodeView) sortColCmd(col int, asc bool) func(evt *tcell.EventKey) *tcell.EventKey {

View File

@ -50,7 +50,7 @@ func newPodView(t string, app *appView, list resource.List) resourceViewer {
} }
func (v *podView) extraActions(aa ui.KeyActions) { func (v *podView) extraActions(aa ui.KeyActions) {
aa[ui.KeyAltK] = ui.NewKeyAction("Kill", v.killCmd, true) aa[tcell.KeyCtrlK] = ui.NewKeyAction("Kill", v.killCmd, true)
aa[ui.KeyS] = ui.NewKeyAction("Shell", v.shellCmd, true) aa[ui.KeyS] = ui.NewKeyAction("Shell", v.shellCmd, true)
aa[ui.KeyL] = ui.NewKeyAction("Logs", v.logsCmd, true) aa[ui.KeyL] = ui.NewKeyAction("Logs", v.logsCmd, true)
@ -61,8 +61,8 @@ func (v *podView) extraActions(aa ui.KeyActions) {
aa[ui.KeyShiftT] = ui.NewKeyAction("Sort Restart", v.sortColCmd(3, false), true) aa[ui.KeyShiftT] = ui.NewKeyAction("Sort Restart", v.sortColCmd(3, false), true)
aa[ui.KeyShiftC] = ui.NewKeyAction("Sort CPU", v.sortColCmd(4, false), true) aa[ui.KeyShiftC] = ui.NewKeyAction("Sort CPU", v.sortColCmd(4, false), true)
aa[ui.KeyShiftM] = ui.NewKeyAction("Sort MEM", v.sortColCmd(5, false), true) aa[ui.KeyShiftM] = ui.NewKeyAction("Sort MEM", v.sortColCmd(5, false), true)
aa[ui.KeyAltC] = ui.NewKeyAction("Sort CPU%", v.sortColCmd(6, false), true) aa[ui.KeyShiftX] = ui.NewKeyAction("Sort CPU%", v.sortColCmd(6, false), true)
aa[ui.KeyAltM] = ui.NewKeyAction("Sort MEM%", v.sortColCmd(7, false), true) aa[ui.KeyShiftZ] = ui.NewKeyAction("Sort MEM%", v.sortColCmd(7, false), true)
aa[ui.KeyShiftD] = ui.NewKeyAction("Sort IP", v.sortColCmd(8, true), true) aa[ui.KeyShiftD] = ui.NewKeyAction("Sort IP", v.sortColCmd(8, true), true)
aa[ui.KeyShiftO] = ui.NewKeyAction("Sort Node", v.sortColCmd(9, true), true) aa[ui.KeyShiftO] = ui.NewKeyAction("Sort Node", v.sortColCmd(9, true), true)
} }

View File

@ -46,7 +46,7 @@ func (v *svcView) getSelection() string {
func (v *svcView) extraActions(aa ui.KeyActions) { func (v *svcView) extraActions(aa ui.KeyActions) {
aa[ui.KeyL] = ui.NewKeyAction("Logs", v.logsCmd, true) aa[ui.KeyL] = ui.NewKeyAction("Logs", v.logsCmd, true)
aa[tcell.KeyCtrlB] = ui.NewKeyAction("Bench", v.benchCmd, true) aa[tcell.KeyCtrlB] = ui.NewKeyAction("Bench", v.benchCmd, true)
aa[ui.KeyAltB] = ui.NewKeyAction("Bench Stop", v.benchStopCmd, true) aa[tcell.KeyCtrlK] = ui.NewKeyAction("Bench Stop", v.benchStopCmd, true)
aa[ui.KeyShiftT] = ui.NewKeyAction("Sort Type", v.sortColCmd(1, false), true) aa[ui.KeyShiftT] = ui.NewKeyAction("Sort Type", v.sortColCmd(1, false), true)
} }