pinokiod 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/api/index.js +1 -0
- package/kernel/api/proxy/index.js +31 -0
- package/kernel/bin/cuda.js +10 -6
- package/kernel/bin/ffmpeg.js +4 -2
- package/kernel/bin/llvm.js +2 -2
- package/package.json +3 -1
- package/server/views/browser.ejs +4 -0
package/kernel/api/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const Lproxy = require('lproxy')
|
|
2
|
+
class P {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.proxy = new Lproxy()
|
|
5
|
+
}
|
|
6
|
+
async start (req, ondata, kernel) {
|
|
7
|
+
/*
|
|
8
|
+
{
|
|
9
|
+
"method": "proxy.start",
|
|
10
|
+
"params": {
|
|
11
|
+
"uri": "http://localhost:8192"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
*/
|
|
15
|
+
let { proxy, url } = await this.proxy.start(req.params.uri)
|
|
16
|
+
this.kernel.api.proxies[req.parent.path] = proxy
|
|
17
|
+
return { proxy, url }
|
|
18
|
+
}
|
|
19
|
+
async stop (req, ondata, kernel) {
|
|
20
|
+
/*
|
|
21
|
+
{
|
|
22
|
+
"method": "proxy.stop",
|
|
23
|
+
"params": {
|
|
24
|
+
"uri": "http://localhost:8192"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
*/
|
|
28
|
+
this.proxy.stop(req.params.uri)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
module.exports = P
|
package/kernel/bin/cuda.js
CHANGED
|
@@ -2,18 +2,21 @@ class Cuda {
|
|
|
2
2
|
async install(req, ondata) {
|
|
3
3
|
if (this.kernel.platform === "win32") {
|
|
4
4
|
await this.kernel.bin.exec({
|
|
5
|
-
message: "conda install -y cudnn libzlib-wapi -c conda-forge"
|
|
6
|
-
|
|
5
|
+
message: "conda install -y cudnn libzlib-wapi -c conda-forge",
|
|
6
|
+
conda: "base",
|
|
7
7
|
}, ondata)
|
|
8
8
|
await this.kernel.bin.exec({
|
|
9
|
-
message: "conda install -y cuda -c nvidia/label/cuda-11.8.0"
|
|
9
|
+
message: "conda install -y cuda -c nvidia/label/cuda-11.8.0",
|
|
10
|
+
conda: "base",
|
|
10
11
|
}, ondata)
|
|
11
12
|
} else {
|
|
12
13
|
await this.kernel.bin.exec({
|
|
13
|
-
message: "conda install -y cudnn -c conda-forge"
|
|
14
|
+
message: "conda install -y cudnn -c conda-forge",
|
|
15
|
+
conda: "base",
|
|
14
16
|
}, ondata)
|
|
15
17
|
await this.kernel.bin.exec({
|
|
16
|
-
message: "conda install -y cuda -c nvidia/label/cuda-11.8.0"
|
|
18
|
+
message: "conda install -y cuda -c nvidia/label/cuda-11.8.0",
|
|
19
|
+
conda: "base",
|
|
17
20
|
}, ondata)
|
|
18
21
|
}
|
|
19
22
|
}
|
|
@@ -38,7 +41,8 @@ class Cuda {
|
|
|
38
41
|
// }
|
|
39
42
|
async uninstall(req, ondata) {
|
|
40
43
|
await this.kernel.bin.exec({
|
|
41
|
-
message: "conda remove cudnn cuda"
|
|
44
|
+
message: "conda remove cudnn cuda",
|
|
45
|
+
conda: "base",
|
|
42
46
|
}, ondata)
|
|
43
47
|
}
|
|
44
48
|
}
|
package/kernel/bin/ffmpeg.js
CHANGED
|
@@ -5,7 +5,8 @@ const decompress = require('decompress');
|
|
|
5
5
|
class Ffmpeg {
|
|
6
6
|
async install(req, ondata) {
|
|
7
7
|
await this.kernel.bin.exec({
|
|
8
|
-
message: "conda install -y -c conda-forge ffmpeg"
|
|
8
|
+
message: "conda install -y -c conda-forge ffmpeg",
|
|
9
|
+
conda: "base"
|
|
9
10
|
}, ondata)
|
|
10
11
|
}
|
|
11
12
|
async installed() {
|
|
@@ -13,7 +14,8 @@ class Ffmpeg {
|
|
|
13
14
|
}
|
|
14
15
|
async uninstall(req, ondata) {
|
|
15
16
|
await this.kernel.bin.exec({
|
|
16
|
-
message: "conda remove ffmpeg"
|
|
17
|
+
message: "conda remove ffmpeg",
|
|
18
|
+
conda: "base"
|
|
17
19
|
}, ondata)
|
|
18
20
|
}
|
|
19
21
|
}
|
package/kernel/bin/llvm.js
CHANGED
|
@@ -3,7 +3,7 @@ class LLVM {
|
|
|
3
3
|
if (this.kernel.platform === 'darwin') {
|
|
4
4
|
await bin.exec({ message: "brew install llvm" }, ondata)
|
|
5
5
|
} else {
|
|
6
|
-
await bin.exec({ message: "conda install -y -c conda-forge llvm" }, ondata)
|
|
6
|
+
await bin.exec({ message: "conda install -y -c conda-forge llvm", conda: "base" }, ondata)
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
async installed() {
|
|
@@ -14,7 +14,7 @@ class LLVM {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
async uninstall(req, ondata) {
|
|
17
|
-
await this.kernel.bin.exec({ message: "conda remove llvm" }, ondata)
|
|
17
|
+
await this.kernel.bin.exec({ message: "conda remove llvm", conda: "base" }, ondata)
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
module.exports = LLVM
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinokiod",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,11 +30,13 @@
|
|
|
30
30
|
"glob": "^10.3.3",
|
|
31
31
|
"glob-gitignore": "^1.0.14",
|
|
32
32
|
"handlebars": "^4.7.7",
|
|
33
|
+
"http-proxy": "^1.18.1",
|
|
33
34
|
"http-terminator": "^3.2.0",
|
|
34
35
|
"isomorphic-git": "^1.23.0",
|
|
35
36
|
"jsonpath-plus": "^7.2.0",
|
|
36
37
|
"key-store": "^1.2.0",
|
|
37
38
|
"lodash": "^4.17.21",
|
|
39
|
+
"lproxy": "^0.0.1",
|
|
38
40
|
"marked": "^5.0.1",
|
|
39
41
|
"mime-types": "^2.1.35",
|
|
40
42
|
"multer": "^1.4.5-lts.1",
|
package/server/views/browser.ejs
CHANGED
|
@@ -544,6 +544,10 @@ const renderSelection = (e, force) => {
|
|
|
544
544
|
let frame = document.createElement("iframe")
|
|
545
545
|
frame.name = target.target
|
|
546
546
|
frame.src = target.href
|
|
547
|
+
frame.setAttribute(
|
|
548
|
+
"allow",
|
|
549
|
+
"clipboard-read; clipboard-write; accelerometer; ambient-light-sensor; autoplay; battery; camera; display-capture; gamepad; geolocation; gyroscope; hid; identity-credentials-get; microphone; midi; otp-credentials; serial;"
|
|
550
|
+
)
|
|
547
551
|
document.querySelector("main").appendChild(frame)
|
|
548
552
|
loaded[target.target] = true
|
|
549
553
|
}
|