mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
refactor: notification module
This commit is contained in:
parent
34fa4eb204
commit
ab46d1de7e
41 changed files with 3989 additions and 2411 deletions
|
@ -66,14 +66,14 @@ func syncDisable(name string) {
|
|||
SetHeader("X-Node-Secret", node.Token).
|
||||
Post(fmt.Sprintf("/api/streams/%s/disable", name))
|
||||
if err != nil {
|
||||
notification.Error("Disable Remote Stream Error", err.Error())
|
||||
notification.Error("Disable Remote Stream Error", err.Error(), nil)
|
||||
return
|
||||
}
|
||||
if resp.StatusCode() != http.StatusOK {
|
||||
notification.Error("Disable Remote Stream Error", NewSyncResult(node.Name, name, resp).String())
|
||||
notification.Error("Disable Remote Stream Error", "Disable stream %{name} from %{node} failed", NewSyncResult(node.Name, name, resp))
|
||||
return
|
||||
}
|
||||
notification.Success("Disable Remote Stream Success", NewSyncResult(node.Name, name, resp).String())
|
||||
notification.Success("Disable Remote Stream Success", "Disable stream %{name} from %{node} successfully", NewSyncResult(node.Name, name, resp))
|
||||
}()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue