Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
todo enable nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
ingbyr committed Sep 13, 2022
1 parent a849360 commit ffb508a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gohost/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,7 @@ func (s *Service) EnableHost() {
// TODO enable as group node
// TODO enable as localhost node
}

func (s *Service) EnableNode(node *TreeNode) {
// TODO Load all enable nodes
}
9 changes: 7 additions & 2 deletions tui/tree_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,13 @@ func (v *TreeView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return RefreshTreeViewItems{}
}
case key.Matches(m, keys.Apply):
selectedNode.SetEnabled(!selectedNode.IsEnabled())
svc.UpdateNode(selectedNode)
cmd = func() tea.Msg {
selectedNode.SetEnabled(!selectedNode.IsEnabled())
svc.UpdateNode(selectedNode)
svc.EnableNode(selectedNode)
// TODO
return RefreshTreeViewItems{}
}
}
}

Expand Down

0 comments on commit ffb508a

Please sign in to comment.