<!-- 错链 -->
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>错链监测</title>
    <link rel="stylesheet" type="text/css" href="/style/html.css" />
    <link rel="stylesheet" type="text/css" href="/style/base.css" />
</head>
<body class="black-bg">
<!-- 头部 Start -->
<div class="header flex-row  flex-y-center">
    <h1>错链监测</h1>
</div>
<!-- 头部 End -->
<!-- 内容 Start -->
<div class="container">
    <!-- 正文 Start -->
    <div class="content m-t-20">
        <div class="content-list flex-row" style="top:0">
            <div class="content-list-left w100 flex-col">
                <div class="content-list-body height-79" style="width: auto;">
                    <ul id="messageUlOne">
                        <li class="content-list-body-tit">
                            <div class="w50"><h5>站点名称</h5></div>
                            <div class="w15"><h5>错误链接数量</h5></div>
                            <div class="w15"><h5>挂马数量</h5></div>
                            <div class="w15"><h5>商业赌博网站链接数量</h5></div>
                        </li>
                        <li th:each="item : ${dataSource}" >
                            <div class="w50"><span th:text="${item.siteName}"></span></div>
                            <div class="w15"><span th:text="${item.errorCount}"></span></div>
                            <div class="w15"><span th:text="${item.maliciousCount}"></span></div>
                            <div class="w15"><span th:text="${item.gambleCount}"></span></div>
                            <img class="table-triangle-top" src="img/triangle.png">
                            <img class="table-triangle-btm" src="img/triangle.png">
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- 正文 End -->
</div>
<!-- 内容End -->
<script type="text/javascript" src="/js/socket.js"></script>
<script>
    socket.onMessage = function (res) {
        let message = []
        if (10010 == JSON.parse(res).code) {
            message = JSON.parse(res).data
            // 处理接收到的消息
            document.getElementById("messageUlOne").innerHTML = "<li class=\"content-list-body-tit\">\n" +
                "                            <div class=\"w50\"><h5>站点名称</h5></div>\n" +
                "                            <div class=\"w15\"><h5>错误链接数量</h5></div>\n" +
                "                            <div class=\"w15\"><h5>挂马数量</h5></div>\n" +
                "                            <div class=\"w15\"><h5>商业赌博网站链接数量</h5></div>\n" +
                "                        </li>";
            for (let i = 0; i < message.length; i++) {
                document.getElementById("messageUlOne").innerHTML += "<li>\n" +
                    `                  <div class="w50"><span>${message[i].siteName}</span></div>\n` +
                    `                  <div class="w15"><span>${message[i].errorCount}</span></div>\n` +
                    `                  <div class="w15"><span>${message[i].maliciousCount}</span></div>\n` +
                    `                  <div class="w15"><span>${message[i].gambleCount}</span></div>\n` +
                    `                  <img class="table-triangle-top" src="img/triangle.png" />\n` +
                    `                  <img class="table-triangle-btm" src="img/triangle.png" />\n` +
                    `                </li>`
            }
        }
    };
</script>
</body>
</html>


</script>