summaryrefslogtreecommitdiff
path: root/test/socket.html
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-30 21:11:56 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-30 21:11:56 (GMT)
commita37f02747e587b25d45de98d175427d4ccb5cdf7 (patch)
tree0e456bfd7f2b4b5fa39a11a51ad32da6f985e434 /test/socket.html
parentc37f07d1416b7e371db7b32799df53df39210aa6 (diff)
session store list works now (needs auth check)
Diffstat (limited to 'test/socket.html')
-rw-r--r--test/socket.html17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/socket.html b/test/socket.html
index 7c3a149..ab631ac 100644
--- a/test/socket.html
+++ b/test/socket.html
@@ -23,7 +23,7 @@
$('#rawmsg').text("");
this.sock = new WebSocket("ws://localhost:4080/public/socket");
this.sock.onmessage = function (event) {
- $('#rawmsg').append(event.data);
+ $('#rawmsg').append(event.data + "\n");
msg = $.parseJSON(event.data)
switch (msg.TYPE) {
case "ACK":
@@ -31,19 +31,26 @@
$('#buttonrun').attr('disabled','disabled')
$('#buttonreconnect').attr('disabled','disabled')
$('#buttoncancel').removeAttr('disabled')
+ $('#buttonlist').removeAttr('disabled')
break;
case "DONE":
init();
break;
}
}
+
this.sock_onopen = function() {
this.sock.send(JSON.stringify(this.req));
}
this.sock.onopen = this.sock_onopen.bind(this);
+
this.cancel = function() {
this.sock.send(JSON.stringify({COMMAND: "cancel"}));
}
+
+ this.list = function() {
+ this.sock.send(JSON.stringify({COMMAND: "list", LOGIN_NAME: "heslinki", PASSWORD: "12423"}));
+ }
}
var s;
@@ -71,11 +78,16 @@
s.cancel();
}
+ function list() {
+ s.list();
+ }
+
function init() {
$('#sessionid').val("");
$('#buttonrun').removeAttr('disabled')
$('#buttonreconnect').removeAttr('disabled')
$('#buttoncancel').attr('disabled','disabled')
+ $('#buttonlist').attr('disabled','disabled')
}
</script>
</head>
@@ -84,9 +96,10 @@
<h1>Radio Helsinki Rivendell Importer:</h1>
<button id="buttonrun" onclick="run()">start</button>
- <button id="buttoncancel" onclick="cancel()">cancel</button>
<input id="sessionid" type="text" size="45" label="ID">
<button id="buttonreconnect" onclick="reconnect()">reconnect</button>
+ <button id="buttoncancel" onclick="cancel()">cancel</button>
+ <button id="buttonlist" onclick="list()">list</button>
<div id="rawmsg" class="data"></div>
</body>
</html>