Commit 4769acad by marwan

re push

parent 652497b5
...@@ -222,7 +222,7 @@ module.exports = function (RED) { ...@@ -222,7 +222,7 @@ module.exports = function (RED) {
// Store local copies of the node configuration (as defined in the .html) // Store local copies of the node configuration (as defined in the .html)
// this.host = n.host; // this.host = n.host;
// this.port = n.port; // this.port = n.port;
this.program = n.program; node.program = n.program;
node.path = n.host; node.path = n.host;
node.wholemsg = (n.wholemsg === "true"); node.wholemsg = (n.wholemsg === "true");
...@@ -231,14 +231,14 @@ module.exports = function (RED) { ...@@ -231,14 +231,14 @@ module.exports = function (RED) {
node._clients = {}; node._clients = {};
// match absolute url // match absolute url
node.closing = false; node.closing = false;
// node.path= // node.path=
// ws://notebook:10100/api/kernels/05e6b598-8770-41e2-a1fb-b30771627859/channels // ws://notebook:10100/api/kernels/05e6b598-8770-41e2-a1fb-b30771627859/channels
function startconn() {// Connect to remote endpoint function startconn() {// Connect to remote endpoint
getKernelList(filePath, configId).then(data => { getKernelList(filePath, configId).then(data => {
if (data.status == 0) { if (data.status == 0) {
var payload = { name: this.program }; // Your payload var payload = { name: n.program }; // Your payload
axios.post(`http://${n.host}/api/kernels`, payload) axios.post(`http://${n.host}/api/kernels`, payload)
// axios.post(`http://notebook:10100/api/kernels`, payload) // axios.post(`http://notebook:10100/api/kernels`, payload)
...@@ -250,11 +250,11 @@ module.exports = function (RED) { ...@@ -250,11 +250,11 @@ module.exports = function (RED) {
.catch(error => { .catch(error => {
console.error('Error fetching data: ', error); console.error('Error fetching data: ', error);
}); });
this.kernel = data node.kernel = data
} }
else { else {
console.log(data) console.log(data)
// this.kernel = data node.kernel = data
var uri = `ws://${n.host}/api/kernels/${data.info.id}/channels` var uri = `ws://${n.host}/api/kernels/${data.info.id}/channels`
console.log(uri) console.log(uri)
var socket = new ws(uri); var socket = new ws(uri);
...@@ -301,12 +301,10 @@ module.exports = function (RED) { ...@@ -301,12 +301,10 @@ module.exports = function (RED) {
}); });
} }
node.closing = false;
{ startconn();
node.closing = false; // start outbound connection
startconn();
// start outbound connection
}
node.on("close", function () { node.on("close", function () {
// Workaround https://github.com/einaros/ws/pull/253 // Workaround https://github.com/einaros/ws/pull/253
// Remove listeners from RED.server // Remove listeners from RED.server
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment