Spaces:
Configuration error
Configuration error
zack
commited on
Commit
Β·
77526d6
1
Parent(s):
ea1961d
π fix: address vulnerabilities and update module.py
Browse files- backend/src/resources/module.py +1 -1
- frontend/components/xterm.js +21 -0
- package-lock.json +11 -5
- package.json +2 -1
backend/src/resources/module.py
CHANGED
@@ -48,7 +48,7 @@ class Dock:
|
|
48 |
|
49 |
DOCKER_LOCAL_HOST = '0.0.0.0'
|
50 |
DOCKER_PORT = Dock() # Determine the best possible port
|
51 |
-
|
52 |
def InterLauncher(name, interface, listen=2000, **kwargs):
|
53 |
"""
|
54 |
@params:
|
|
|
48 |
|
49 |
DOCKER_LOCAL_HOST = '0.0.0.0'
|
50 |
DOCKER_PORT = Dock() # Determine the best possible port
|
51 |
+
n
|
52 |
def InterLauncher(name, interface, listen=2000, **kwargs):
|
53 |
"""
|
54 |
@params:
|
frontend/components/xterm.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { useEffect, useRef } from 'react';
|
2 |
+
import { Terminal } from 'xterm';
|
3 |
+
import 'xterm/css/xterm.css';
|
4 |
+
|
5 |
+
const TerminalComponent = ({ socket }) => {
|
6 |
+
const terminalRef = useRef(null);
|
7 |
+
|
8 |
+
useEffect(() => {
|
9 |
+
const terminal = new Terminal();
|
10 |
+
terminal.open(terminalRef.current);
|
11 |
+
socket.on('data', data => {
|
12 |
+
terminal.write(data);
|
13 |
+
});
|
14 |
+
|
15 |
+
return () => socket.off('data');
|
16 |
+
}, [socket]);
|
17 |
+
|
18 |
+
return <div ref={terminalRef} />;
|
19 |
+
};
|
20 |
+
|
21 |
+
export default TerminalComponent;
|
package-lock.json
CHANGED
@@ -5,7 +5,8 @@
|
|
5 |
"packages": {
|
6 |
"": {
|
7 |
"dependencies": {
|
8 |
-
"react-scripts": "^5.0.1"
|
|
|
9 |
},
|
10 |
"devDependencies": {
|
11 |
"@svgr/webpack": "^8.1.0"
|
@@ -16981,16 +16982,16 @@
|
|
16981 |
}
|
16982 |
},
|
16983 |
"node_modules/typescript": {
|
16984 |
-
"version": "
|
16985 |
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-
|
16986 |
-
"integrity": "sha512-
|
16987 |
"peer": true,
|
16988 |
"bin": {
|
16989 |
"tsc": "bin/tsc",
|
16990 |
"tsserver": "bin/tsserver"
|
16991 |
},
|
16992 |
"engines": {
|
16993 |
-
"node": ">=
|
16994 |
}
|
16995 |
},
|
16996 |
"node_modules/unbox-primitive": {
|
@@ -18133,6 +18134,11 @@
|
|
18133 |
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
18134 |
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="
|
18135 |
},
|
|
|
|
|
|
|
|
|
|
|
18136 |
"node_modules/y18n": {
|
18137 |
"version": "5.0.8",
|
18138 |
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
|
|
5 |
"packages": {
|
6 |
"": {
|
7 |
"dependencies": {
|
8 |
+
"react-scripts": "^5.0.1",
|
9 |
+
"xterm": "^5.3.0"
|
10 |
},
|
11 |
"devDependencies": {
|
12 |
"@svgr/webpack": "^8.1.0"
|
|
|
16982 |
}
|
16983 |
},
|
16984 |
"node_modules/typescript": {
|
16985 |
+
"version": "4.9.5",
|
16986 |
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
16987 |
+
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
16988 |
"peer": true,
|
16989 |
"bin": {
|
16990 |
"tsc": "bin/tsc",
|
16991 |
"tsserver": "bin/tsserver"
|
16992 |
},
|
16993 |
"engines": {
|
16994 |
+
"node": ">=4.2.0"
|
16995 |
}
|
16996 |
},
|
16997 |
"node_modules/unbox-primitive": {
|
|
|
18134 |
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
18135 |
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="
|
18136 |
},
|
18137 |
+
"node_modules/xterm": {
|
18138 |
+
"version": "5.3.0",
|
18139 |
+
"resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz",
|
18140 |
+
"integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg=="
|
18141 |
+
},
|
18142 |
"node_modules/y18n": {
|
18143 |
"version": "5.0.8",
|
18144 |
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
package.json
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
"@svgr/webpack": "^8.1.0"
|
4 |
},
|
5 |
"dependencies": {
|
6 |
-
"react-scripts": "^5.0.1"
|
|
|
7 |
}
|
8 |
}
|
|
|
3 |
"@svgr/webpack": "^8.1.0"
|
4 |
},
|
5 |
"dependencies": {
|
6 |
+
"react-scripts": "^5.0.1",
|
7 |
+
"xterm": "^5.3.0"
|
8 |
}
|
9 |
}
|