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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
initjs.js
+9
-11
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"
);
...
@@ -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
...
...
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