集成WebSocket实时输出日志到页面,更新SQl文件

This commit is contained in:
郑杰
2018-11-01 09:26:31 +08:00
parent 7d8edeaafa
commit 7af23a6bd8
2 changed files with 4 additions and 4 deletions
+2
View File
@@ -4,6 +4,8 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Aurora 后台管理</title>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<script src="https://cdn.bootcss.com/stomp.js/2.3.3/stomp.min.js"></script>
<!-- build:css -->
<link rel="stylesheet" th:href="@{'/css/github_activity_widget.css'}">
<link rel="stylesheet" th:href="@{'/css/jquery.jOrgChart.css'}">
@@ -7,9 +7,7 @@
<!-- build:css -->
<link rel="stylesheet" th:href="@{'/css/logMsg.css'}">
<!-- build:js -->
<script th:src="@{'/js/jquery.min.js'}"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<script src="https://cdn.bootcss.com/stomp.js/2.3.3/stomp.min.js"></script>
<script th:src="@{'/js/jquery.min.js'}"></script>
<!-- endbuild -->
</head>
<body>
@@ -36,7 +34,7 @@
var stompClient = null;
if(stompClient==null){
var socket =new SockJS('/websocket?token=kl');
stompClient = Stomp.over(socket);
stompClient = Stomp.over(socket)
stompClient.connect({token:"kl"}, function(frame) {
stompClient.subscribe('/topic/pullLogger', function(event) {
var content=JSON.parse(event.body);