aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/static
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-12 17:47:55 +0300
committerGravatar Vitaly Takmazov2016-12-12 17:47:55 +0300
commit1702d4f5e4eace80a1323e520b004a08497e3309 (patch)
treeef94261fc72008fd47f20a0842981de7bdecc85c /juick-ws/src/main/static
parentcf5d3c5a78ae5be2209bb0d0d91ce1eaf0296c04 (diff)
juick-ws: drop status servlet
Diffstat (limited to 'juick-ws/src/main/static')
-rw-r--r--juick-ws/src/main/static/scripts.js46
-rw-r--r--juick-ws/src/main/static/style.css2
2 files changed, 0 insertions, 48 deletions
diff --git a/juick-ws/src/main/static/scripts.js b/juick-ws/src/main/static/scripts.js
deleted file mode 100644
index 3a7e4a5f..00000000
--- a/juick-ws/src/main/static/scripts.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var Terminal = require('terminal');
-require('whatwg-fetch');
-
-function ready(fn) {
- if (document.readyState != 'loading') {
- fn();
- } else {
- document.addEventListener('DOMContentLoaded', fn);
- }
-}
-
-function refreshStatus() {
- setTimeout(function() {
- fetch("/api/status")
- .then(function(response) {
- return response.text();
- }).then(function(body) {
- status.textContent = JSON.parse(body).status;
- refreshStatus();
- })
- }, 5000);
-}
-
-function keepalive(ws) {
- setTimeout(function() {
- ws.send(" ");
- keepalive();
- }, 60000);
-}
-
-ready(function() {
- var ws = new WebSocket('wss://ws.juick.com/');
- var term = new Terminal('terminal', {}, {});
- var status = document.querySelector("#status");
- ws.onopen = function() {
- term.output("<br/>connected");
- };
- ws.onclose = function() {
- term.output("<br/>disconnected");
- }
- ws.onmessage = function(msg) {
- term.output("<br/>" + JSON.stringify(JSON.parse(msg.data), null, 2));
- }
- refreshStatus();
- keepalive(ws);
-}) \ No newline at end of file
diff --git a/juick-ws/src/main/static/style.css b/juick-ws/src/main/static/style.css
deleted file mode 100644
index ee5ec6b7..00000000
--- a/juick-ws/src/main/static/style.css
+++ /dev/null
@@ -1,2 +0,0 @@
-@import "normalize.css";
-@import "terminal"; \ No newline at end of file