From a085be2811e331bdccf5422337441b8878a1c400 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Wed, 2 Oct 2013 13:42:56 +0200 Subject: [PATCH] Show console output from server --- css/noflo-ui.css | 9 +++++++++ src/runtimes/websocket.coffee | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/css/noflo-ui.css b/css/noflo-ui.css index 895088247..d562daab6 100644 --- a/css/noflo-ui.css +++ b/css/noflo-ui.css @@ -80,6 +80,15 @@ body { border: none; } +.dataflow-card .noflo-ui-preview .preview pre { + max-height: 300px; + color: #7ee67e; + font-size: 10px; + overflow-x: hidden; + overflow-y: scroll; + font-family: monospace; +} + .dataflow-node-inspector-inputs label.connected { display: none; } diff --git a/src/runtimes/websocket.coffee b/src/runtimes/websocket.coffee index f50564f9a..83605f64e 100644 --- a/src/runtimes/websocket.coffee +++ b/src/runtimes/websocket.coffee @@ -10,6 +10,18 @@ class WebSocketRuntime extends Base getType: -> 'websocket' + getElement: -> + console = document.createElement 'pre' + + @on 'network', (message) -> + return unless message.command is 'output' + console.innerHTML = "#{console.innerHTML}#{message.payload.message}\n" + console.scrollTop = console.scrollHeight + @on 'disconnected', -> + console.innerHTML = '' + + console + connect: (preview) -> return if @connection or @connecting