diff --git a/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html b/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html index 97ca476..268f64d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html +++ b/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html @@ -96,7 +96,22 @@ }; $.table.init(options); }); - + + var socket = new WebSocket("ws://localhost:8080/websocket"); + + socket.onopen = function(event) { + console.log("WebSocket连接已打开"); + }; + + socket.onmessage = function(event) { + var data = event.data; + console.log("接收到数据:" + data); + // 在这里更新前端界面,显示接收到的数据 + }; + + socket.onclose = function(event) { + console.log("WebSocket连接已关闭"); + }; function customViewFormatter (data) { var template = $('#profileTemplate').html() var view = ''