(node *tview.TreeNode, done func())
| 136 | } |
| 137 | |
| 138 | func openDeleteObjectForm(node *tview.TreeNode, done func()) { |
| 139 | currentFocus := app.GetFocus() |
| 140 | baseDN := node.GetReference().(string) |
| 141 | promptModal := tview.NewModal(). |
| 142 | SetText("Do you really want to delete this object?\n" + baseDN). |
| 143 | AddButtons([]string{"No", "Yes"}). |
| 144 | SetDoneFunc(func(buttonIndex int, buttonLabel string) { |
| 145 | if buttonLabel == "Yes" { |
| 146 | err := lc.DeleteObject(baseDN) |
| 147 | if err != nil { |
| 148 | handleLDAPError(err) |
| 149 | } else { |
| 150 | if done != nil { |
| 151 | done() |
| 152 | } |
| 153 | |
| 154 | updateLog("Object deleted: "+baseDN, "green") |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | app.SetRoot(appPanel, true).SetFocus(currentFocus) |
| 159 | }) |
| 160 | |
| 161 | app.SetRoot(promptModal, false).SetFocus(promptModal) |
| 162 | } |
| 163 | |
| 164 | func openUpdateUacForm(node *tview.TreeNode, cache *EntryCache, done func()) { |
| 165 | currentFocus := app.GetFocus() |
no test coverage detected