(ctx context.Context, cmdName, itemName string)
| 486 | } |
| 487 | |
| 488 | func (m *model) sendCommand(ctx context.Context, cmdName, itemName string) { |
| 489 | if m.br == nil { |
| 490 | if er := m.lazyBroker(ctx); er != nil { |
| 491 | m.title.SetText("Cannot connect to broker! No action performed") |
| 492 | return |
| 493 | } |
| 494 | } |
| 495 | e := m.br.PublishRaw(ctx, common.TopicRegistryCommand, []byte("cmd"), map[string]string{ |
| 496 | "command": cmdName, |
| 497 | "itemName": itemName, |
| 498 | }) |
| 499 | if e != nil { |
| 500 | m.title.SetText("Cannot publish command: " + e.Error()) |
| 501 | } |
| 502 | go func() { |
| 503 | <-time.After(2 * time.Second) |
| 504 | m.app.QueueUpdateDraw(func() { |
| 505 | m.loadItems(m.getCurrentItem().ri, m.typeOpts(m.types[m.currentType])...) |
| 506 | }) |
| 507 | }() |
| 508 | } |
| 509 | |
| 510 | func (m *model) LsofLines(args []string) (map[string][]string, error) { |
| 511 | // Some systems (Arch, Debian) install lsof in /usr/bin and others (centos) |
no test coverage detected