Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
simple-jupyter-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marwan
simple-jupyter-api
Commits
4769acad
Commit
4769acad
authored
Nov 29, 2023
by
marwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re push
parent
652497b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
initjs.js
+5
-7
No files found.
initjs.js
View file @
4769acad
...
@@ -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"
);
...
@@ -238,7 +238,7 @@ module.exports = function (RED) {
...
@@ -238,7 +238,7 @@ module.exports = function (RED) {
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
;
node
.
closing
=
false
;
startconn
();
startconn
();
// start outbound connection
// 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment