mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-13 03:15:48 +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: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://127.0.0.1:9001/',
|
target: 'http://127.0.0.1:9002/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false,
|
secure: false,
|
||||||
ws: true
|
ws: true
|
||||||
|
|
|
@ -90,6 +90,7 @@ func Analytic(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// write
|
// write
|
||||||
|
err = ws.WriteJSON(stat)
|
||||||
if err != nil || websocket.IsUnexpectedCloseError(err,
|
if err != nil || websocket.IsUnexpectedCloseError(err,
|
||||||
websocket.CloseGoingAway,
|
websocket.CloseGoingAway,
|
||||||
websocket.CloseNoStatusReceived,
|
websocket.CloseNoStatusReceived,
|
||||||
|
@ -172,6 +173,7 @@ func GetNodeStat(c *gin.Context) {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// write
|
// write
|
||||||
|
err = ws.WriteJSON(analytic.GetNodeStat())
|
||||||
if err != nil || websocket.IsUnexpectedCloseError(err,
|
if err != nil || websocket.IsUnexpectedCloseError(err,
|
||||||
websocket.CloseGoingAway,
|
websocket.CloseGoingAway,
|
||||||
websocket.CloseNoStatusReceived,
|
websocket.CloseNoStatusReceived,
|
||||||
|
@ -201,6 +203,7 @@ func GetNodesAnalytic(c *gin.Context) {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// write
|
// write
|
||||||
|
err = ws.WriteJSON(analytic.NodeMap)
|
||||||
if err != nil || websocket.IsUnexpectedCloseError(err,
|
if err != nil || websocket.IsUnexpectedCloseError(err,
|
||||||
websocket.CloseGoingAway,
|
websocket.CloseGoingAway,
|
||||||
websocket.CloseNoStatusReceived,
|
websocket.CloseNoStatusReceived,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue