mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 19:05:55 +02:00
fix: analytic not send data
This commit is contained in:
parent
2bc14bd23b
commit
cc6a325ddd
2 changed files with 169 additions and 166 deletions
|
@ -67,7 +67,7 @@ export default defineConfig({
|
|||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:9001/',
|
||||
target: 'http://127.0.0.1:9002/',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true
|
||||
|
|
|
@ -90,6 +90,7 @@ func Analytic(c *gin.Context) {
|
|||
}
|
||||
|
||||
// write
|
||||
err = ws.WriteJSON(stat)
|
||||
if err != nil || websocket.IsUnexpectedCloseError(err,
|
||||
websocket.CloseGoingAway,
|
||||
websocket.CloseNoStatusReceived,
|
||||
|
@ -172,6 +173,7 @@ func GetNodeStat(c *gin.Context) {
|
|||
|
||||
for {
|
||||
// write
|
||||
err = ws.WriteJSON(analytic.GetNodeStat())
|
||||
if err != nil || websocket.IsUnexpectedCloseError(err,
|
||||
websocket.CloseGoingAway,
|
||||
websocket.CloseNoStatusReceived,
|
||||
|
@ -201,6 +203,7 @@ func GetNodesAnalytic(c *gin.Context) {
|
|||
|
||||
for {
|
||||
// write
|
||||
err = ws.WriteJSON(analytic.NodeMap)
|
||||
if err != nil || websocket.IsUnexpectedCloseError(err,
|
||||
websocket.CloseGoingAway,
|
||||
websocket.CloseNoStatusReceived,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue