Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / websocket / index.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <% content_for :page_title do %>
6   Event bus debugging page
7 <% end %>
8 <h1>Event bus debugging page</h1>
9
10 <form>
11 <textarea style="width:100%; height: 10em" id="websocket-message-content"></textarea>
12 <button type="button" id="send-to-websocket">Send</button>
13 </form>
14
15 <br>
16
17 <p id="PutStuffHere"></p>
18
19 <script>
20 $(function() {
21 putStuffThere = function (content) {
22   $("#PutStuffHere").append(content + "<br>");
23 };
24
25 var dispatcher = new WebSocket('<%= arvados_api_client.discovery[:websocketUrl] %>?api_token=<%= Thread.current[:arvados_api_token] %>');
26 dispatcher.onmessage = function(event) {
27   //putStuffThere(JSON.parse(event.data));
28   putStuffThere(event.data);
29 };
30
31 sendStuff = function () {
32   dispatcher.send($("#websocket-message-content").val());
33 };
34
35 $("#send-to-websocket").click(sendStuff);
36 });
37
38 </script>