feat(irc): improve list view (#466)

* feat(irc): add irc status examples

* feat(irc): add dropdown menu to list

* feat(irc): update heroicons and add expand button

* feat(irc): update heroicons and add expand button
This commit is contained in:
ze0s 2022-09-22 16:39:05 +02:00 committed by GitHub
parent f5faf066a9
commit 300418b9f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 478 additions and 258 deletions

View file

@ -20,6 +20,7 @@ type Service interface {
StartHandlers()
StopHandlers()
StopNetwork(key handlerKey) error
RestartNetwork(ctx context.Context, id int64) error
ListNetworks(ctx context.Context) ([]domain.IrcNetwork, error)
GetNetworksWithHealth(ctx context.Context) ([]domain.IrcNetworkWithHealth, error)
GetNetworkByID(ctx context.Context, id int64) (*domain.IrcNetwork, error)
@ -279,6 +280,15 @@ func (s *service) checkIfNetworkRestartNeeded(network *domain.IrcNetwork) error
return nil
}
func (s *service) RestartNetwork(ctx context.Context, id int64) error {
network, err := s.repo.GetNetworkByID(ctx, id)
if err != nil {
return err
}
return s.restartNetwork(*network)
}
func (s *service) restartNetwork(network domain.IrcNetwork) error {
// look if we have the network in handlers, if so restart it
if existingHandler, found := s.handlers[handlerKey{network.Server, network.NickServ.Account}]; found {