Browse Source

Merge pull request #1189 from woncode/patch-1

fix:离开仪表盘页面时关闭WebSocket,避免一直在后台拉取信息损耗性能
Jacky 1 day ago
parent
commit
9b8fb25534
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/src/views/dashboard/ServerAnalytic.vue

+ 4 - 0
app/src/views/dashboard/ServerAnalytic.vue

@@ -90,6 +90,10 @@ onMounted(() => {
   })
 })
 
+onUnmounted(() => {
+  websocket?.close()
+})
+
 function handle_uptime(t: number) {
   // uptime
   let _uptime = Math.floor(t)