-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixing and improvements for 0.0.3 (#4)
* Changes * Headscratcher * v0.0.3 fixes
- Loading branch information
1 parent
e1b67eb
commit 53355a0
Showing
28 changed files
with
467 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
## [0.0.3] - 2023-11-30 | ||
|
||
### Added | ||
- Job filtering on secrets and mount views | ||
- Better navigation options between views | ||
- `vaul7y -v` to check the version | ||
- Added a check and error out to prevent vaul7y from freezing if vault token and address are not set | ||
|
||
### Fixed | ||
- Error and Info modals tabbing out and changing focus | ||
- Enter key constantly moving you to the Secret Engines view. Its due to the way Unix system recognize Enter and Ctrl+M | ||
- Fixed an issue with watcher causing conflicts | ||
- Fixed logger to discard messages and not brake rendering when debugging is not enabled |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
local-vault: | ||
vault server -dev | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import ( | |
) | ||
|
||
const ( | ||
TableTitleMounts = "System Mounts" | ||
TableTitleMounts = "Secret Engines" | ||
) | ||
|
||
var ( | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package component | ||
|
||
import ( | ||
"github.com/dkyanakiev/vaulty/primitives" | ||
"github.com/gdamore/tcell/v2" | ||
"github.com/rivo/tview" | ||
) | ||
|
||
const pageNameSelector = "selector" | ||
|
||
type SelectorModal struct { | ||
Modal Selector | ||
Props *SelectorProps | ||
pages *tview.Pages | ||
keyBindings map[tcell.Key]func() | ||
} | ||
|
||
type SelectorProps struct { | ||
Items []string | ||
AllocationID string | ||
} | ||
|
||
func NewSelectorModal() *SelectorModal { | ||
s := &SelectorModal{ | ||
Modal: primitives.NewSelectionModal(), | ||
Props: &SelectorProps{}, | ||
keyBindings: map[tcell.Key]func(){}, | ||
} | ||
|
||
s.Modal.GetTable().SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { | ||
if fn, ok := s.keyBindings[event.Key()]; ok { | ||
fn() | ||
} | ||
|
||
return event | ||
}) | ||
|
||
return s | ||
} | ||
|
||
func (s *SelectorModal) Render() error { | ||
if s.pages == nil { | ||
return ErrComponentNotBound | ||
} | ||
|
||
if s.Props.Items == nil { | ||
return ErrComponentPropsNotSet | ||
} | ||
|
||
table := s.Modal.GetTable() | ||
table.Clear() | ||
|
||
for i, v := range s.Props.Items { | ||
table.RenderRow([]string{v}, i, tcell.ColorWhite) | ||
} | ||
|
||
s.Modal.GetTable().SetTitle("Select a Task (alloc: %s)", s.Props.AllocationID) | ||
|
||
s.pages.AddPage(pageNameSelector, s.Modal.Container(), true, true) | ||
|
||
return nil | ||
} | ||
|
||
func (s *SelectorModal) Bind(pages *tview.Pages) { | ||
s.pages = pages | ||
} | ||
|
||
func (s *SelectorModal) SetSelectedFunc(fn func(task string)) { | ||
s.Modal.GetTable().SetSelectedFunc(func(row, column int) { | ||
task := s.Modal.GetTable().GetCellContent(row, 0) | ||
fn(task) | ||
s.Close() | ||
}) | ||
} | ||
|
||
func (s *SelectorModal) Close() { | ||
s.pages.RemovePage(pageNameSelector) | ||
} | ||
|
||
func (s *SelectorModal) BindKey(key tcell.Key, fn func()) { | ||
s.keyBindings[key] = fn | ||
} |
Oops, something went wrong.