manage.html
3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Hello WebSocket</title>
    <link th:href="@{/webjars/bootstrap/3.3.7/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/websocket.css}" rel="stylesheet">
    <script th:src="@{/webjars/jquery/3.1.1-1/jquery.min.js}"></script>
    <script th:src="@{/webjars/sockjs-client/1.0.2/sockjs.min.js}"></script>
    <script th:src="@{/webjars/stomp-websocket/2.3.3/stomp.min.js}"></script>
    <script th:src="@{/js/websocket.js}"></script>
</head>
<body>
<noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript! Websocket relies on Javascript being
    enabled. Please enable
    Javascript and reload this page!</h2></noscript>
    <div class="col-md-6 divleft">
        <div>
            <form class="form-inline">
                <div class="form-group">
                    <button id="connect" class="btn btn-default" type="submit">连接</button>
                    <button id="disconnect" class="btn btn-default" type="submit" disabled="disabled">断开
                    </button>
                      <label for="connect">WebSocket</label>   ws://127.0.0.1:8888/wms/endpoint
                </div>
            </form>
        </div>
        <hr/>
        <div>
            <div class="divtitle"><label for="name">websocket广播文本消息      </label>destination:/app/websocket/message/string</div>
            <form class="form-inline">
                <div class="form-group">
                    <input type="text" id="name" class="form-control" placeholder="msg" text="">
                    <button id="send" class="btn btn-default" type="submit">发送</button>
                </div>
            </form>
            <div class="divtitle"><label for="name">websocket广播json消息      </label>destination:/app/websocket/message/json</div>
            <form class="form-inline">
                <div class="form-group">
                    <textarea cols="60" rows='8' id="json" class="form-control" placeholder="msg">
{
  "sendTo": [    "zf",    "youjie"  ],
  "data": {
    "id": 100,
    "name": "李德胜1",
    "group": [ "胡必成2",   "史林",    "郑位",   "常凯申"
    ]
  }
}
                    </textarea>
                    <button id="send2" class="btn btn-default" type="submit">发送</button>
                </div>
            </form>
            <hr/>
            <div class="divtitle"><label for="name">httpget广播文本消息      </label>http://127.0.0.1:8888/wms/websocket/message/string?msg=abcasdf</div>
            <form class="form-inline">
                <div class="form-group">
                    <input type="text" id="msg" class="form-control" placeholder="msg" text="">
                    <button id="send3" class="btn btn-default" type="submit">发送</button>
                </div>
            </form>
            <div class="divtitle"><label for="name">httppost广播json消息      </label>http://127.0.0.1:8888/wms/websocket/message/json</div>
            <form class="form-inline">
                <div class="form-group">
                    <textarea cols="60" rows='8' id="json2" class="form-control" placeholder="msg">
{
  "sendTo": [    "zf",    "youjie"  ],
  "data": {
    "id": 100,
    "name": "李德胜1",
    "group": [ "胡必成2",   "史林",    "郑位",   "常凯申"
    ]
  }
}
                    </textarea>
                    <button id="send4" class="btn btn-default" type="submit">发送</button>
                </div>
            </form>
        </div>
    </div>
        <div class="col-md-6">
            <table id="conversation" class="table table-striped">
                <thead>
                <tr>
                    <th>接收消息</th>
                </tr>
                </thead>
                <tbody id="greetings">
                </tbody>
            </table>
        </div>
</body>
</html>