mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
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:
parent
f5faf066a9
commit
300418b9f1
34 changed files with 478 additions and 258 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue