mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-09-03 07:24:52 +08:00
fix(cluster): show the error text when a remote node is unreachable
Three call sites passed the error into the details slot and left content empty, so the notification rendered with a blank body: the UI does $gettext(item.content) and vue3-gettext returns "" for an empty msgid, and the external notifier returns Content directly when Details is not a map. The reason was discarded at every layer. These are the transport-failure paths, which is exactly when a cluster operator needs the message. The 17 other notification.Error call sites already pass err.Error() as content.
This commit is contained in:
@@ -49,7 +49,7 @@ func syncReload(nodeIDs []uint64) {
|
||||
resp, err := client.R().
|
||||
Post("/api/nginx/reload")
|
||||
if err != nil {
|
||||
notification.Error("Reload Remote Nginx Error", "", err.Error())
|
||||
notification.Error("Reload Remote Nginx Error", err.Error(), nil)
|
||||
return
|
||||
}
|
||||
if resp.StatusCode() != http.StatusOK {
|
||||
@@ -102,7 +102,7 @@ func syncRestart(nodeIDs []uint64) {
|
||||
resp, err := client.R().
|
||||
Post("/api/nginx/restart")
|
||||
if err != nil {
|
||||
notification.Error("Restart Remote Nginx Error", "", err.Error())
|
||||
notification.Error("Restart Remote Nginx Error", err.Error(), nil)
|
||||
return
|
||||
}
|
||||
if resp.StatusCode() != http.StatusOK {
|
||||
|
||||
@@ -84,7 +84,7 @@ func syncDisable(name string) {
|
||||
resp, err := client.R().
|
||||
Post(fmt.Sprintf("/api/sites/%s/disable", name))
|
||||
if err != nil {
|
||||
notification.Error("Disable Remote Site Error", "", err.Error())
|
||||
notification.Error("Disable Remote Site Error", err.Error(), nil)
|
||||
return
|
||||
}
|
||||
if resp.StatusCode() != http.StatusOK {
|
||||
|
||||
Reference in New Issue
Block a user