Add emitters for install started/stopped
This commit is contained in:
parent
f0d6f67c6b
commit
7f9ec4402a
|
@ -43,6 +43,8 @@ func (h *Handler) ListenForServerEvents(ctx context.Context) {
|
|||
server.StatusEvent,
|
||||
server.ConsoleOutputEvent,
|
||||
server.InstallOutputEvent,
|
||||
server.InstallStartedEvent,
|
||||
server.InstallCompletedEvent,
|
||||
server.DaemonMessageEvent,
|
||||
server.BackupCompletedEvent,
|
||||
}
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
// Defines all of the possible output events for a server.
|
||||
// noinspection GoNameStartsWithPackageName
|
||||
const (
|
||||
DaemonMessageEvent = "daemon message"
|
||||
InstallOutputEvent = "install output"
|
||||
ConsoleOutputEvent = "console output"
|
||||
StatusEvent = "status"
|
||||
StatsEvent = "stats"
|
||||
BackupCompletedEvent = "backup completed"
|
||||
DaemonMessageEvent = "daemon message"
|
||||
InstallOutputEvent = "install output"
|
||||
InstallStartedEvent = "install started"
|
||||
InstallCompletedEvent = "install completed"
|
||||
ConsoleOutputEvent = "console output"
|
||||
StatusEvent = "status"
|
||||
StatsEvent = "stats"
|
||||
BackupCompletedEvent = "backup completed"
|
||||
)
|
||||
|
||||
type Event struct {
|
||||
|
|
|
@ -36,6 +36,9 @@ func (s *Server) Install(sync bool) error {
|
|||
}
|
||||
}
|
||||
|
||||
// Send the start event so the Panel can automatically update.
|
||||
s.Events().Publish(InstallStartedEvent, "")
|
||||
|
||||
err := s.internalInstall()
|
||||
|
||||
s.Log().Debug("notifying panel of server install state")
|
||||
|
@ -52,6 +55,10 @@ func (s *Server) Install(sync bool) error {
|
|||
l.Warn("failed to notify panel of server install state")
|
||||
}
|
||||
|
||||
// Push an event to the websocket so we can auto-refresh the information in the panel once
|
||||
// the install is completed.
|
||||
s.Events().Publish(InstallCompletedEvent, "")
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user