pinokiod 3.11.0 → 3.11.2
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/bin/git.js +34 -21
- package/kernel/bin/index.js +7 -7
- package/kernel/bin/setup.js +80 -30
- package/kernel/index.js +13 -7
- package/kernel/peer.js +4 -3
- package/package.json +1 -1
- package/server/index.js +149 -39
- package/server/public/common.js +5 -0
- package/server/public/nav.js +1 -0
- package/server/public/style.css +2 -2
- package/server/views/app.ejs +2 -1
- package/server/views/connect/x.ejs +7 -2
- package/server/views/connect.ejs +2 -1
- package/server/views/download.ejs +3 -2
- package/server/views/editor.ejs +2 -2
- package/server/views/env_editor.ejs +1 -1
- package/server/views/explore.ejs +2 -1
- package/server/views/file_explorer.ejs +2 -1
- package/server/views/frame.ejs +1 -1
- package/server/views/general_editor.ejs +1 -1
- package/server/views/github.ejs +19 -6
- package/server/views/help.ejs +2 -1
- package/server/views/install.ejs +2 -1
- package/server/views/keys.ejs +1 -1
- package/server/views/network.ejs +2 -1
- package/server/views/pre.ejs +1 -1
- package/server/views/prototype/old_index.ejs +1 -1
- package/server/views/prototype/show.ejs +1 -1
- package/server/views/required_env_editor.ejs +1 -1
- package/server/views/settings.ejs +2 -1
- package/server/views/setup.ejs +78 -42
- package/server/views/setup_home.ejs +1 -1
- package/server/views/share_editor.ejs +1 -1
- package/server/views/shell.ejs +14 -3
- package/server/views/sidebar.ejs +1 -1
- package/server/views/terminal.ejs +2 -2
package/kernel/bin/git.js
CHANGED
|
@@ -12,34 +12,47 @@ class Git {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
async install(req, ondata) {
|
|
15
|
+
console.log("GIT install")
|
|
16
|
+
await this.kernel.bin.exec({
|
|
17
|
+
message: [
|
|
18
|
+
"conda clean -y --all",
|
|
19
|
+
`conda install -y -c conda-forge ${this.cmd()}`
|
|
20
|
+
]
|
|
21
|
+
}, ondata)
|
|
15
22
|
if (this.kernel.platform === "darwin") {
|
|
23
|
+
console.log("brew install gh")
|
|
16
24
|
await this.kernel.bin.exec({
|
|
17
|
-
conda: { skip: true },
|
|
18
|
-
message: "brew install gh",
|
|
19
|
-
}, ondata)
|
|
20
|
-
} else {
|
|
21
|
-
await this.kernel.bin.exec({
|
|
25
|
+
// conda: { skip: true },
|
|
22
26
|
message: [
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
"echo $PATH",
|
|
28
|
+
"which brew",
|
|
29
|
+
"brew install gh",
|
|
30
|
+
],
|
|
31
|
+
}, (e) => {
|
|
32
|
+
process.stdout.write(e.raw)
|
|
33
|
+
ondata(e)
|
|
34
|
+
})
|
|
27
35
|
}
|
|
28
36
|
await fs.promises.mkdir(this.kernel.path("config/gh"), { recursive: true }).catch((e) => { })
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// }
|
|
37
|
+
|
|
38
|
+
let gitconfig_path = path.resolve(this.kernel.homedir, "gitconfig")
|
|
39
|
+
// check if gitconfig exists
|
|
40
|
+
let exists = await this.kernel.api.exists(gitconfig_path)
|
|
41
|
+
// if not, create one
|
|
42
|
+
if (!exists) {
|
|
43
|
+
await fs.promises.copyFile(
|
|
44
|
+
path.resolve(__dirname, "..", "gitconfig_template"),
|
|
45
|
+
gitconfig_path
|
|
46
|
+
)
|
|
47
|
+
}
|
|
41
48
|
}
|
|
42
49
|
async installed() {
|
|
50
|
+
let gitconfig_path = path.resolve(this.kernel.homedir, "gitconfig")
|
|
51
|
+
let exists = await this.kernel.api.exists(gitconfig_path)
|
|
52
|
+
if (!exists) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
43
56
|
if (this.kernel.platform === "darwin") {
|
|
44
57
|
let gh_config_exists = await this.kernel.exists("config/gh")
|
|
45
58
|
return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.brew.has("gh") && gh_config_exists
|
package/kernel/bin/index.js
CHANGED
|
@@ -285,13 +285,13 @@ class Bin {
|
|
|
285
285
|
await fs.promises.writeFile(pipconfig_path, pipconfigStr)
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
// add gitconfig => support git lfs, long path, etc.
|
|
289
|
-
let gitconfig_path = path.resolve(this.kernel.homedir, "gitconfig")
|
|
290
|
-
// check if gitconfig exists
|
|
291
|
-
await fs.promises.copyFile(
|
|
292
|
-
path.resolve(__dirname, "..", "gitconfig_template"),
|
|
293
|
-
gitconfig_path
|
|
294
|
-
)
|
|
288
|
+
// // add gitconfig => support git lfs, long path, etc.
|
|
289
|
+
// let gitconfig_path = path.resolve(this.kernel.homedir, "gitconfig")
|
|
290
|
+
// // check if gitconfig exists
|
|
291
|
+
// await fs.promises.copyFile(
|
|
292
|
+
// path.resolve(__dirname, "..", "gitconfig_template"),
|
|
293
|
+
// gitconfig_path
|
|
294
|
+
// )
|
|
295
295
|
|
|
296
296
|
for(let mod of this.mods) {
|
|
297
297
|
if (mod.mod.start) {
|
package/kernel/bin/setup.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
const os = require('os')
|
|
2
2
|
let platform = os.platform()
|
|
3
|
+
let zip_cmd
|
|
4
|
+
if (platform === 'win32') {
|
|
5
|
+
zip_cmd = "7zip"
|
|
6
|
+
} else {
|
|
7
|
+
zip_cmd = "p7zip"
|
|
8
|
+
}
|
|
3
9
|
module.exports = {
|
|
4
10
|
ai: (kernel) => {
|
|
5
11
|
let conda_requirements = [
|
|
12
|
+
zip_cmd,
|
|
6
13
|
"uv",
|
|
7
14
|
"node",
|
|
8
15
|
"huggingface",
|
|
@@ -12,19 +19,21 @@ module.exports = {
|
|
|
12
19
|
]
|
|
13
20
|
let requirements = [
|
|
14
21
|
{ name: "conda", },
|
|
22
|
+
{ name: "zip", },
|
|
23
|
+
]
|
|
24
|
+
if (platform === "darwin") {
|
|
25
|
+
requirements.push({ name: "brew" })
|
|
26
|
+
}
|
|
27
|
+
requirements = requirements.concat([
|
|
15
28
|
{ name: "git", },
|
|
16
|
-
// { name: "zip", },
|
|
17
29
|
{ name: "node", },
|
|
18
30
|
{ name: "ffmpeg", },
|
|
19
31
|
// { name: "caddy", }
|
|
20
|
-
]
|
|
32
|
+
])
|
|
21
33
|
if (platform === "win32") {
|
|
22
34
|
requirements.push({ name: "registry" })
|
|
23
35
|
requirements.push({ name: "vs" })
|
|
24
36
|
}
|
|
25
|
-
if (platform === "darwin") {
|
|
26
|
-
requirements.push({ name: "brew" })
|
|
27
|
-
}
|
|
28
37
|
if (platform === "linux") {
|
|
29
38
|
requirements.push({ name: "gxx" })
|
|
30
39
|
conda_requirements.push("gxx")
|
|
@@ -49,34 +58,50 @@ module.exports = {
|
|
|
49
58
|
}
|
|
50
59
|
},
|
|
51
60
|
javascript: (kernel) => {
|
|
61
|
+
let requirements = [
|
|
62
|
+
{ name: "conda", },
|
|
63
|
+
{ name: "zip", },
|
|
64
|
+
]
|
|
65
|
+
if (platform === "darwin") {
|
|
66
|
+
requirements.push({ name: "brew" })
|
|
67
|
+
}
|
|
68
|
+
requirements = requirements.concat([
|
|
69
|
+
{ name: "git", },
|
|
70
|
+
{ name: "node", },
|
|
71
|
+
{ name: "py" },
|
|
72
|
+
])
|
|
52
73
|
return {
|
|
53
74
|
icon: "fa-brands fa-js",
|
|
54
75
|
title: "Node.js",
|
|
55
76
|
description: "Set up self-contained node.js development environment",
|
|
56
|
-
requirements
|
|
57
|
-
{ name: "conda", },
|
|
58
|
-
{ name: "git", },
|
|
59
|
-
{ name: "node", },
|
|
60
|
-
{ name: "py" },
|
|
61
|
-
],
|
|
77
|
+
requirements,
|
|
62
78
|
conda_requirements: [
|
|
79
|
+
zip_cmd,
|
|
63
80
|
"node",
|
|
64
81
|
"git",
|
|
65
82
|
]
|
|
66
83
|
}
|
|
67
84
|
},
|
|
68
85
|
python: (kernel) => {
|
|
86
|
+
let requirements = [
|
|
87
|
+
{ name: "conda", },
|
|
88
|
+
{ name: "zip", },
|
|
89
|
+
]
|
|
90
|
+
if (platform === "darwin") {
|
|
91
|
+
requirements.push({ name: "brew" })
|
|
92
|
+
}
|
|
93
|
+
requirements = requirements.concat([
|
|
94
|
+
{ name: "git", },
|
|
95
|
+
{ name: "uv", },
|
|
96
|
+
{ name: "py" },
|
|
97
|
+
])
|
|
69
98
|
return {
|
|
70
99
|
icon: "fa-brands fa-python",
|
|
71
100
|
title: "Python",
|
|
72
101
|
description: "Set up self-contained python development environment",
|
|
73
|
-
requirements
|
|
74
|
-
{ name: "conda", },
|
|
75
|
-
{ name: "git", },
|
|
76
|
-
{ name: "uv", },
|
|
77
|
-
{ name: "py" },
|
|
78
|
-
],
|
|
102
|
+
requirements,
|
|
79
103
|
conda_requirements: [
|
|
104
|
+
zip_cmd,
|
|
80
105
|
"uv",
|
|
81
106
|
"git",
|
|
82
107
|
]
|
|
@@ -85,11 +110,18 @@ module.exports = {
|
|
|
85
110
|
dev: (kernel) => {
|
|
86
111
|
let requirements = [
|
|
87
112
|
{ name: "conda", },
|
|
113
|
+
{ name: "zip", },
|
|
114
|
+
]
|
|
115
|
+
if (platform === "darwin") {
|
|
116
|
+
requirements.push({ name: "brew" })
|
|
117
|
+
}
|
|
118
|
+
requirements = requirements.concat([
|
|
88
119
|
{ name: "git", },
|
|
89
120
|
{ name: "node", },
|
|
90
121
|
{ name: "uv", },
|
|
91
|
-
]
|
|
122
|
+
])
|
|
92
123
|
let conda_requirements = [
|
|
124
|
+
zip_cmd,
|
|
93
125
|
"uv",
|
|
94
126
|
"node",
|
|
95
127
|
"git",
|
|
@@ -114,34 +146,52 @@ module.exports = {
|
|
|
114
146
|
}
|
|
115
147
|
},
|
|
116
148
|
network: (kernel) => {
|
|
149
|
+
let requirements = [
|
|
150
|
+
{ name: "conda", },
|
|
151
|
+
{ name: "zip", },
|
|
152
|
+
]
|
|
153
|
+
if (platform === "darwin") {
|
|
154
|
+
requirements.push({ name: "brew" })
|
|
155
|
+
}
|
|
156
|
+
requirements = requirements.concat([
|
|
157
|
+
{ name: "git", },
|
|
158
|
+
{ name: "caddy", },
|
|
159
|
+
{ name: "py", },
|
|
160
|
+
])
|
|
161
|
+
console.log("Setup.network", requirements)
|
|
117
162
|
return {
|
|
118
163
|
icon: "fa-solid fa-wifi",
|
|
119
164
|
title: "Network",
|
|
120
165
|
description: "Automatic HTTPS and local network sharing for ALL local apps",
|
|
121
|
-
requirements
|
|
122
|
-
{ name: "conda", },
|
|
123
|
-
{ name: "git", },
|
|
124
|
-
{ name: "caddy", },
|
|
125
|
-
{ name: "py", },
|
|
126
|
-
],
|
|
166
|
+
requirements,
|
|
127
167
|
conda_requirements: [
|
|
168
|
+
zip_cmd,
|
|
128
169
|
"git",
|
|
129
170
|
"caddy"
|
|
130
171
|
]
|
|
131
172
|
}
|
|
132
173
|
},
|
|
133
174
|
connect: (kernel) => {
|
|
175
|
+
let requirements = [
|
|
176
|
+
{ name: "conda", },
|
|
177
|
+
{ name: "zip", },
|
|
178
|
+
]
|
|
179
|
+
if (platform === "darwin") {
|
|
180
|
+
requirements.push({ name: "brew" })
|
|
181
|
+
}
|
|
182
|
+
requirements = requirements.concat([
|
|
183
|
+
{ name: "git", },
|
|
184
|
+
{ name: "caddy", },
|
|
185
|
+
{ name: "py", },
|
|
186
|
+
])
|
|
187
|
+
console.log("Setup.connect", requirements)
|
|
134
188
|
return {
|
|
135
189
|
icon: "fa-solid fa-wifi",
|
|
136
190
|
title: "API Connect",
|
|
137
191
|
description: "Connect with 3rd party APIs",
|
|
138
|
-
requirements
|
|
139
|
-
{ name: "conda", },
|
|
140
|
-
{ name: "git", },
|
|
141
|
-
{ name: "caddy", },
|
|
142
|
-
{ name: "py", },
|
|
143
|
-
],
|
|
192
|
+
requirements,
|
|
144
193
|
conda_requirements: [
|
|
194
|
+
zip_cmd,
|
|
145
195
|
"git",
|
|
146
196
|
"caddy"
|
|
147
197
|
]
|
package/kernel/index.js
CHANGED
|
@@ -264,14 +264,20 @@ class Kernel {
|
|
|
264
264
|
}
|
|
265
265
|
async refresh(notify_peers) {
|
|
266
266
|
let env = await Environment.get(this.homedir)
|
|
267
|
-
let peer_active =
|
|
267
|
+
let peer_active = true
|
|
268
268
|
// if PINOKIO_NETWORK_SHARE is 0 or false, turn it off
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (env && env.
|
|
274
|
-
|
|
269
|
+
// By default it should be on.
|
|
270
|
+
// It's off if the value is set, and it's 0 or false
|
|
271
|
+
|
|
272
|
+
//if (env && env.PINOKIO_NETWORK_ACTIVE && (env.PINOKIO_NETWORK_ACTIVE==="1" || env.PINOKIO_NETWORK_ACTIVE.toLowerCase()==="true")) {
|
|
273
|
+
if (env && env.PINOKIO_NETWORK_ACTIVE && (env.PINOKIO_NETWORK_ACTIVE==="0" || env.PINOKIO_NETWORK_ACTIVE.toLowerCase()==="false")) {
|
|
274
|
+
peer_active = false
|
|
275
|
+
}
|
|
276
|
+
let https_active = true
|
|
277
|
+
//if (env && env.PINOKIO_HTTPS_ACTIVE && (env.PINOKIO_HTTPS_ACTIVE==="1" || env.PINOKIO_HTTPS_ACTIVE.toLowerCase()==="true")) {
|
|
278
|
+
if (env && env.PINOKIO_HTTPS_ACTIVE && (env.PINOKIO_HTTPS_ACTIVE==="0" || env.PINOKIO_HTTPS_ACTIVE.toLowerCase()==="false")) {
|
|
279
|
+
//https_active = true
|
|
280
|
+
https_active = false
|
|
275
281
|
}
|
|
276
282
|
// console.log("kernel.refresh", { active, notify_peers })
|
|
277
283
|
|
package/kernel/peer.js
CHANGED
|
@@ -29,10 +29,11 @@ class PeerDiscovery {
|
|
|
29
29
|
let env = await Environment.get(kernel.homedir)
|
|
30
30
|
|
|
31
31
|
// by default expose to the local network
|
|
32
|
-
this.active =
|
|
32
|
+
this.active = true
|
|
33
33
|
// if PINOKIO_NETWORK_SHARE is 0 or false, turn it off
|
|
34
|
-
if (env && env.PINOKIO_NETWORK_ACTIVE && (env.PINOKIO_NETWORK_ACTIVE==="
|
|
35
|
-
|
|
34
|
+
if (env && env.PINOKIO_NETWORK_ACTIVE && (env.PINOKIO_NETWORK_ACTIVE==="0" || env.PINOKIO_NETWORK_ACTIVE.toLowerCase()==="false")) {
|
|
35
|
+
//if (env && env.PINOKIO_NETWORK_ACTIVE && (env.PINOKIO_NETWORK_ACTIVE==="1" || env.PINOKIO_NETWORK_ACTIVE.toLowerCase()==="true")) {
|
|
36
|
+
this.active = false
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
this.name = os.userInfo().username
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -2449,6 +2449,10 @@ class Server {
|
|
|
2449
2449
|
let p2 = path.resolve(home, "prototype")
|
|
2450
2450
|
await fse.remove(p2)
|
|
2451
2451
|
|
|
2452
|
+
let gitconfig = path.resolve(home, "gitconfig")
|
|
2453
|
+
await fse.remove(gitconfig)
|
|
2454
|
+
|
|
2455
|
+
|
|
2452
2456
|
console.log("[TRY] Updating to the new version")
|
|
2453
2457
|
this.kernel.store.set("version", this.version.pinokiod)
|
|
2454
2458
|
console.log("[DONE] Updating to the new version")
|
|
@@ -2770,6 +2774,51 @@ class Server {
|
|
|
2770
2774
|
// }
|
|
2771
2775
|
}))
|
|
2772
2776
|
|
|
2777
|
+
this.app.get("/check_router_up", ex(async (req, res) => {
|
|
2778
|
+
// check if caddy is runnign properly
|
|
2779
|
+
// try https://pinokio.localhost
|
|
2780
|
+
// if it works, proceed
|
|
2781
|
+
// if not, redirect
|
|
2782
|
+
let https_running = false
|
|
2783
|
+
try {
|
|
2784
|
+
let res = await axios.get(`http://127.0.0.1:2019/config/`, {
|
|
2785
|
+
timeout: 2000
|
|
2786
|
+
})
|
|
2787
|
+
let test = /pinokio\.localhost/.test(JSON.stringify(res.data))
|
|
2788
|
+
if (test) {
|
|
2789
|
+
https_running = true
|
|
2790
|
+
}
|
|
2791
|
+
} catch (e) {
|
|
2792
|
+
console.log(e)
|
|
2793
|
+
}
|
|
2794
|
+
console.log({ https_running })
|
|
2795
|
+
if (!https_running) {
|
|
2796
|
+
res.json({ error: "pinokio.host not yet available" })
|
|
2797
|
+
// res.redirect("/setup/connect?callback=/connect/" + req.params.provider)
|
|
2798
|
+
return
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
// check if pinokio.localhost router is running
|
|
2803
|
+
let router_running = false
|
|
2804
|
+
let router = this.kernel.router.published()
|
|
2805
|
+
for(let ip in router) {
|
|
2806
|
+
let domains = router[ip]
|
|
2807
|
+
if (domains.includes("pinokio.localhost")) {
|
|
2808
|
+
router_running = true
|
|
2809
|
+
break
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
console.log({ router_running })
|
|
2813
|
+
if (!router_running) {
|
|
2814
|
+
res.json({ error: "pinokio.localhost not yet available" })
|
|
2815
|
+
// res.redirect("/setup/connect?callback=/connect/" + req.params.provider)
|
|
2816
|
+
return
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
res.json({ success: true })
|
|
2820
|
+
}))
|
|
2821
|
+
|
|
2773
2822
|
/*
|
|
2774
2823
|
GET /connect => display connection options
|
|
2775
2824
|
- github
|
|
@@ -2804,32 +2853,13 @@ class Server {
|
|
|
2804
2853
|
let { requirements, install_required, requirements_pending, error } = await this.kernel.bin.check({
|
|
2805
2854
|
bin: this.kernel.bin.preset("connect"),
|
|
2806
2855
|
})
|
|
2807
|
-
console.log({ requirements_pending, install_required })
|
|
2856
|
+
console.log("1", { requirements_pending, install_required })
|
|
2808
2857
|
if (!requirements_pending && install_required) {
|
|
2858
|
+
console.log("REDIRECT", req.params.provider)
|
|
2809
2859
|
res.redirect("/setup/connect?callback=/connect/" + req.params.provider)
|
|
2810
2860
|
return
|
|
2811
2861
|
}
|
|
2812
2862
|
|
|
2813
|
-
// check if router is running
|
|
2814
|
-
let router_running = false
|
|
2815
|
-
let router = this.kernel.router.published()
|
|
2816
|
-
for(let ip in router) {
|
|
2817
|
-
let domains = router[ip]
|
|
2818
|
-
if (domains.includes("pinokio.localhost")) {
|
|
2819
|
-
router_running = true
|
|
2820
|
-
break
|
|
2821
|
-
}
|
|
2822
|
-
}
|
|
2823
|
-
console.log({ router_running })
|
|
2824
|
-
if (!router_running) {
|
|
2825
|
-
res.redirect("/setup/connect?callback=/connect/" + req.params.provider)
|
|
2826
|
-
return
|
|
2827
|
-
}
|
|
2828
|
-
|
|
2829
|
-
// check if caddy is runnign properly
|
|
2830
|
-
// try https://pinokio.localhost
|
|
2831
|
-
// if it works, proceed
|
|
2832
|
-
// if not, redirect
|
|
2833
2863
|
let https_running = false
|
|
2834
2864
|
try {
|
|
2835
2865
|
let res = await axios.get(`http://127.0.0.1:2019/config/`, {
|
|
@@ -2844,10 +2874,30 @@ class Server {
|
|
|
2844
2874
|
}
|
|
2845
2875
|
console.log({ https_running })
|
|
2846
2876
|
if (!https_running) {
|
|
2877
|
+
// res.json({ error: "pinokio.host not yet available" })
|
|
2847
2878
|
res.redirect("/setup/connect?callback=/connect/" + req.params.provider)
|
|
2848
2879
|
return
|
|
2849
2880
|
}
|
|
2850
2881
|
|
|
2882
|
+
|
|
2883
|
+
// check if pinokio.localhost router is running
|
|
2884
|
+
let router_running = false
|
|
2885
|
+
let router = this.kernel.router.published()
|
|
2886
|
+
for(let ip in router) {
|
|
2887
|
+
let domains = router[ip]
|
|
2888
|
+
if (domains.includes("pinokio.localhost")) {
|
|
2889
|
+
router_running = true
|
|
2890
|
+
break
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
console.log({ router_running })
|
|
2894
|
+
if (!router_running) {
|
|
2895
|
+
// res.json({ error: "pinokio.localhost not yet available" })
|
|
2896
|
+
res.redirect("/setup/connect?callback=/connect/" + req.params.provider)
|
|
2897
|
+
return
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
|
|
2851
2901
|
let readme = await this.kernel.connect[req.params.provider].readme()
|
|
2852
2902
|
res.render(`connect/${req.params.provider}`, {
|
|
2853
2903
|
portal: this.portal,
|
|
@@ -3022,28 +3072,63 @@ class Server {
|
|
|
3022
3072
|
}
|
|
3023
3073
|
let md = await fs.promises.readFile(path.resolve(__dirname, "..", "kernel/connect/providers/github/README.md"), "utf8")
|
|
3024
3074
|
let readme = marked.parse(md)
|
|
3075
|
+
|
|
3076
|
+
let hosts = ""
|
|
3077
|
+
let hosts_file = this.kernel.path("config/gh/hosts.yml")
|
|
3078
|
+
let e = await this.exists(hosts_file)
|
|
3079
|
+
console.log({ hosts_file, e })
|
|
3080
|
+
if (e) {
|
|
3081
|
+
hosts = await fs.promises.readFile(hosts_file, "utf8")
|
|
3082
|
+
console.log( { hosts: `#${hosts}#` })
|
|
3083
|
+
if (hosts.startsWith("{}")) {
|
|
3084
|
+
hosts = ""
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
console.log("hosts", hosts)
|
|
3088
|
+
|
|
3089
|
+
let items
|
|
3090
|
+
if (hosts.length > 0) {
|
|
3091
|
+
// logged in => display logout
|
|
3092
|
+
items = [{
|
|
3093
|
+
icon: "fa-solid fa-circle-xmark",
|
|
3094
|
+
title: "Logout",
|
|
3095
|
+
description: "Log out of Github",
|
|
3096
|
+
url: "/github/logout"
|
|
3097
|
+
}]
|
|
3098
|
+
} else {
|
|
3099
|
+
// logged out => display login
|
|
3100
|
+
items = [{
|
|
3101
|
+
icon: "fa-solid fa-key",
|
|
3102
|
+
title: "Login",
|
|
3103
|
+
description: "Log into Github",
|
|
3104
|
+
url: "/github/login"
|
|
3105
|
+
}]
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3025
3108
|
res.render("github", {
|
|
3109
|
+
hosts,
|
|
3026
3110
|
readme,
|
|
3027
3111
|
portal: this.portal,
|
|
3028
3112
|
logo: this.logo,
|
|
3029
3113
|
theme: this.theme,
|
|
3030
3114
|
agent: this.agent,
|
|
3031
|
-
items
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3115
|
+
items
|
|
3116
|
+
// items: [{
|
|
3117
|
+
// icon: "fa-solid fa-key",
|
|
3118
|
+
// title: "Login",
|
|
3119
|
+
// description: "Log into Github",
|
|
3120
|
+
// url: "/github/login"
|
|
3121
|
+
//// }, {
|
|
3122
|
+
//// icon: "fa-solid fa-check",
|
|
3123
|
+
//// title: "Status",
|
|
3124
|
+
//// description: "Check Github login status",
|
|
3125
|
+
//// url: "/github/status"
|
|
3126
|
+
// }, {
|
|
3127
|
+
// icon: "fa-solid fa-circle-xmark",
|
|
3128
|
+
// title: "Logout",
|
|
3129
|
+
// description: "Log out of Github",
|
|
3130
|
+
// url: "/github/logout"
|
|
3131
|
+
// }]
|
|
3047
3132
|
})
|
|
3048
3133
|
}))
|
|
3049
3134
|
this.app.get("/github/status", ex(async (req, res) => {
|
|
@@ -3067,7 +3152,7 @@ class Server {
|
|
|
3067
3152
|
params.set("message", encodeURIComponent(message))
|
|
3068
3153
|
params.set("path", this.kernel.homedir)
|
|
3069
3154
|
// params.set("kill", "/Logged in/i")
|
|
3070
|
-
params.set("kill_message", "Click to return home")
|
|
3155
|
+
// params.set("kill_message", "Click to return home")
|
|
3071
3156
|
params.set("callback", encodeURIComponent("/github"))
|
|
3072
3157
|
params.set("id", id)
|
|
3073
3158
|
params.set("target", "_top")
|
|
@@ -3091,7 +3176,7 @@ class Server {
|
|
|
3091
3176
|
params.set("input", true)
|
|
3092
3177
|
params.set("path", this.kernel.homedir)
|
|
3093
3178
|
params.set("kill", "/Logged in/i")
|
|
3094
|
-
params.set("kill_message", "Your Github account is now connected.")
|
|
3179
|
+
// params.set("kill_message", "Your Github account is now connected.")
|
|
3095
3180
|
params.set("callback", encodeURIComponent("/github"))
|
|
3096
3181
|
params.set("id", id)
|
|
3097
3182
|
params.set("target", "_top")
|
|
@@ -3229,14 +3314,38 @@ class Server {
|
|
|
3229
3314
|
bin
|
|
3230
3315
|
})
|
|
3231
3316
|
// set dependencies for conda
|
|
3317
|
+
let cr = new Set()
|
|
3232
3318
|
for(let i=0; i<requirements.length; i++) {
|
|
3233
3319
|
let r = requirements[i]
|
|
3234
3320
|
if (r.name === "conda") {
|
|
3235
3321
|
requirements[i].dependencies = bin.conda_requirements
|
|
3322
|
+
if (bin.conda_requirements) {
|
|
3323
|
+
for(let r of bin.conda_requirements) {
|
|
3324
|
+
cr.add(r)
|
|
3325
|
+
}
|
|
3326
|
+
}
|
|
3236
3327
|
}
|
|
3237
3328
|
}
|
|
3329
|
+
|
|
3330
|
+
// if the setup mode includes caddy, wait
|
|
3331
|
+
let wait = null
|
|
3332
|
+
if (cr.has("caddy")) {
|
|
3333
|
+
wait = "caddy"
|
|
3334
|
+
}
|
|
3335
|
+
console.log({ wait, cr })
|
|
3336
|
+
|
|
3238
3337
|
let current = req.query.callback || req.originalUrl
|
|
3338
|
+
console.log("render setup", { current })
|
|
3339
|
+
|
|
3340
|
+
// console.log("2", { requirements_pending, install_required })
|
|
3341
|
+
// if (!requirements_pending && !install_required) {
|
|
3342
|
+
// console.log("redirect", current)
|
|
3343
|
+
// res.redirect(current)
|
|
3344
|
+
// return
|
|
3345
|
+
// }
|
|
3346
|
+
//
|
|
3239
3347
|
res.render("setup", {
|
|
3348
|
+
wait,
|
|
3240
3349
|
error,
|
|
3241
3350
|
current,
|
|
3242
3351
|
install_required,
|
|
@@ -4392,6 +4501,7 @@ class Server {
|
|
|
4392
4501
|
res.redirect("/pinokio/install")
|
|
4393
4502
|
}))
|
|
4394
4503
|
this.app.get("/pinokio/install", ex((req, res) => {
|
|
4504
|
+
console.log("render /pinokio/install")
|
|
4395
4505
|
let requirements = req.session.requirements
|
|
4396
4506
|
let callback = req.session.callback
|
|
4397
4507
|
req.session.requirements = null
|
package/server/public/common.js
CHANGED
|
@@ -48,6 +48,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
48
48
|
history.forward()
|
|
49
49
|
})
|
|
50
50
|
}
|
|
51
|
+
if (document.querySelector("#refresh-page")) {
|
|
52
|
+
document.querySelector("#refresh-page").addEventListener("click", (e) => {
|
|
53
|
+
location.reload()
|
|
54
|
+
})
|
|
55
|
+
}
|
|
51
56
|
if (document.querySelector("#genlog")) {
|
|
52
57
|
document.querySelector("#genlog").addEventListener("click", (e) => {
|
|
53
58
|
e.preventDefault()
|
package/server/public/nav.js
CHANGED
|
@@ -15,6 +15,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
15
15
|
if (document.querySelector("#new-window")) {
|
|
16
16
|
document.querySelector("#new-window").addEventListener("click", (e) => {
|
|
17
17
|
let agent = document.body.getAttribute("data-agent")
|
|
18
|
+
debugger
|
|
18
19
|
if (agent === "electron") {
|
|
19
20
|
window.open("/", "_blank", "self")
|
|
20
21
|
} else {
|
package/server/public/style.css
CHANGED
package/server/views/app.ejs
CHANGED
|
@@ -735,12 +735,13 @@ body.dark .appcanvas {
|
|
|
735
735
|
<script src="/filepond.min.js"></script>
|
|
736
736
|
<script src="/fseditor.js"></script>
|
|
737
737
|
</head>
|
|
738
|
-
<body class='<%=theme%>' data-platform="<%=platform%>">
|
|
738
|
+
<body class='<%=theme%>' data-platform="<%=platform%>" data-agent="<%=agent%>">
|
|
739
739
|
<header class='navheader grabbable'>
|
|
740
740
|
<h1>
|
|
741
741
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
742
742
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
743
743
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
744
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
744
745
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
745
746
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
746
747
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
@@ -125,8 +125,11 @@ hr {
|
|
|
125
125
|
table {
|
|
126
126
|
table-layout: fixed;
|
|
127
127
|
width: 100%;
|
|
128
|
+
box-sizing: border-box;
|
|
128
129
|
}
|
|
129
130
|
td {
|
|
131
|
+
background: rgba(0,0,0,0.04);
|
|
132
|
+
padding: 10px;
|
|
130
133
|
word-wrap:break-word;
|
|
131
134
|
font-size: 14px;
|
|
132
135
|
}
|
|
@@ -135,7 +138,7 @@ td.key {
|
|
|
135
138
|
color: royalblue;
|
|
136
139
|
}
|
|
137
140
|
.head {
|
|
138
|
-
padding:
|
|
141
|
+
padding: 30px;
|
|
139
142
|
text-align: center;
|
|
140
143
|
}
|
|
141
144
|
.head .desc {
|
|
@@ -185,12 +188,13 @@ pre {
|
|
|
185
188
|
<script src="/highlight.js"></script>
|
|
186
189
|
<script src="/highlight-js.js"></script>
|
|
187
190
|
</head>
|
|
188
|
-
<body class='<%=theme%>'>
|
|
191
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
189
192
|
<header class='navheader grabbable'>
|
|
190
193
|
<h1>
|
|
191
194
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
192
195
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
193
196
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
197
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
194
198
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
195
199
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
196
200
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
@@ -224,6 +228,7 @@ pre {
|
|
|
224
228
|
hljs.highlightAll();
|
|
225
229
|
|
|
226
230
|
const render = (kv) => {
|
|
231
|
+
console.log("render", kv)
|
|
227
232
|
let html = Object.keys(kv).map((key) => {
|
|
228
233
|
return `<tr><td class='key'>${key}</td><td>${kv[key]}</td></tr>`
|
|
229
234
|
}).join("")
|
package/server/views/connect.ejs
CHANGED
|
@@ -223,12 +223,13 @@ body.dark .config {
|
|
|
223
223
|
<script src="/common.js"></script>
|
|
224
224
|
<script src="/opener.js"></script>
|
|
225
225
|
</head>
|
|
226
|
-
<body class='<%=theme%>'>
|
|
226
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
227
227
|
<header class='navheader grabbable'>
|
|
228
228
|
<h1>
|
|
229
229
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
230
230
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
231
231
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
232
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
232
233
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
233
234
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
234
235
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
@@ -105,15 +105,16 @@ body.frozen {
|
|
|
105
105
|
<script src="/report.js"></script>
|
|
106
106
|
</head>
|
|
107
107
|
<% if (install_required) { %>
|
|
108
|
-
<body class='frozen <%=theme%>'>
|
|
108
|
+
<body class='frozen <%=theme%>' data-agent="<%=agent%>">
|
|
109
109
|
<% } else { %>
|
|
110
|
-
<body class='<%=theme%>'>
|
|
110
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
111
111
|
<% } %>
|
|
112
112
|
<header class='grabbable'>
|
|
113
113
|
<h1>
|
|
114
114
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
115
115
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
116
116
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
117
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
117
118
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
118
119
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
119
120
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
package/server/views/editor.ejs
CHANGED
|
@@ -858,9 +858,9 @@ const reloadMemory = async () => {
|
|
|
858
858
|
</script>
|
|
859
859
|
</head>
|
|
860
860
|
<% if (install_required) { %>
|
|
861
|
-
<body class='columns frozen <%=theme%>'>
|
|
861
|
+
<body class='columns frozen <%=theme%>' data-agent="<%=agent%>">
|
|
862
862
|
<% } else { %>
|
|
863
|
-
<body class='columns <%=theme%>'>
|
|
863
|
+
<body class='columns <%=theme%>' data-agent="<%=agent%>">
|
|
864
864
|
<% } %>
|
|
865
865
|
<header class='navheader'>
|
|
866
866
|
<h1>
|
|
@@ -264,7 +264,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
264
264
|
})
|
|
265
265
|
</script>
|
|
266
266
|
</head>
|
|
267
|
-
<body class='<%=theme%> <%=init ? 'center' : ''%>'>
|
|
267
|
+
<body class='<%=theme%> <%=init ? 'center' : ''%>' data-agent="<%=agent%>">
|
|
268
268
|
<main>
|
|
269
269
|
<% if (init) { %>
|
|
270
270
|
<div>
|
package/server/views/explore.ejs
CHANGED
|
@@ -117,12 +117,13 @@ body main iframe {
|
|
|
117
117
|
<script src="/sweetalert2.js"></script>
|
|
118
118
|
<script src="/nav.js"></script>
|
|
119
119
|
</head>
|
|
120
|
-
<body class='<%=theme%>'>
|
|
120
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
121
121
|
<header class='navheader grabbable'>
|
|
122
122
|
<h1>
|
|
123
123
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
124
124
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
125
125
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
126
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
126
127
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
127
128
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
128
129
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
@@ -148,7 +148,7 @@ body.dark .browser-options-row {
|
|
|
148
148
|
<script src="/fuse.js"></script>
|
|
149
149
|
<script src="/report.js"></script>
|
|
150
150
|
</head>
|
|
151
|
-
<body class='<%=theme%>'>
|
|
151
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
152
152
|
<% if (error) { %>
|
|
153
153
|
<nav class='error-message'>
|
|
154
154
|
<div><%=error%></div>
|
|
@@ -165,6 +165,7 @@ body.dark .browser-options-row {
|
|
|
165
165
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
166
166
|
<button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
|
|
167
167
|
<button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
|
|
168
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
168
169
|
<% } %>
|
|
169
170
|
<% paths.forEach((path) => { %>
|
|
170
171
|
<% if (path.action) { %>
|
package/server/views/frame.ejs
CHANGED
|
@@ -185,7 +185,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
185
185
|
})
|
|
186
186
|
</script>
|
|
187
187
|
</head>
|
|
188
|
-
<body class='columns <%=theme%>'>
|
|
188
|
+
<body class='columns <%=theme%>' data-agent="<%=agent%>">
|
|
189
189
|
<header class='navheader grabbable'>
|
|
190
190
|
<h1>
|
|
191
191
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
package/server/views/github.ejs
CHANGED
|
@@ -110,9 +110,16 @@ main {
|
|
|
110
110
|
margin: 0 auto;
|
|
111
111
|
max-width: 800px;
|
|
112
112
|
width: 100%;
|
|
113
|
+
align-items: center;
|
|
114
|
+
}
|
|
115
|
+
.setup-items pre {
|
|
116
|
+
width: 100%;
|
|
117
|
+
padding: 30px;
|
|
118
|
+
background: rgba(0,0,0,0.04) !important;
|
|
119
|
+
margin-bottom: 20px;
|
|
113
120
|
}
|
|
114
121
|
.head {
|
|
115
|
-
padding:
|
|
122
|
+
padding: 30px;
|
|
116
123
|
text-align: center;
|
|
117
124
|
}
|
|
118
125
|
.head .desc {
|
|
@@ -172,12 +179,13 @@ hr {
|
|
|
172
179
|
<script src="/common.js"></script>
|
|
173
180
|
<script src="/opener.js"></script>
|
|
174
181
|
</head>
|
|
175
|
-
<body class='<%=theme%>'>
|
|
182
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
176
183
|
<header class='navheader grabbable'>
|
|
177
184
|
<h1>
|
|
178
185
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
179
186
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
180
187
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
188
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
181
189
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
182
190
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
183
191
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
@@ -197,12 +205,17 @@ hr {
|
|
|
197
205
|
<div class='head'>
|
|
198
206
|
<h3><i class="fa-brands fa-github"></i><br><br>Connect with Github</h3>
|
|
199
207
|
</div>
|
|
208
|
+
<div class='setup-items'>
|
|
209
|
+
<% if (hosts.length > 0) { %>
|
|
210
|
+
<pre><%=hosts%></pre>
|
|
211
|
+
<% } else { %>
|
|
212
|
+
<pre>not logged in</pre>
|
|
213
|
+
<% } %>
|
|
214
|
+
</div>
|
|
200
215
|
<div class='setup-items'>
|
|
201
216
|
<% items.forEach((item) => { %>
|
|
202
|
-
<a class='
|
|
203
|
-
<i class="<%=item.icon%>"></i>
|
|
204
|
-
<h3><%=item.title%></h3>
|
|
205
|
-
<div class='desc'><%=item.description%></div>
|
|
217
|
+
<a class='btn' href="<%=item.url%>">
|
|
218
|
+
<i class="<%=item.icon%>"></i> <%=item.title%>
|
|
206
219
|
</a>
|
|
207
220
|
<% }) %>
|
|
208
221
|
</div>
|
package/server/views/help.ejs
CHANGED
|
@@ -250,12 +250,13 @@ body.dark .item .tile .badge {
|
|
|
250
250
|
<script src="/nav.js"></script>
|
|
251
251
|
<script src="/report.js"></script>
|
|
252
252
|
</head>
|
|
253
|
-
<body class='<%=theme%>'>
|
|
253
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
254
254
|
<header class='navheader grabbable'>
|
|
255
255
|
<h1>
|
|
256
256
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
257
257
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
258
258
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
259
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
259
260
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
260
261
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
261
262
|
<div class='flexible'></div>
|
package/server/views/install.ejs
CHANGED
|
@@ -131,7 +131,7 @@ body {
|
|
|
131
131
|
<script src="/waitmodal.js"></script>
|
|
132
132
|
<script src="/notifyinput.js"></script>
|
|
133
133
|
</head>
|
|
134
|
-
<body class='<%=theme%>'>
|
|
134
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
135
135
|
<header class='grabbable'></header>
|
|
136
136
|
<div id='status-screen'><b><i class="fas fa-circle-notch fa-spin"></i> Setting up...</b><br>Setting up core modules including conda, uv, git, etc.</div>
|
|
137
137
|
<div class='terminal-container'>
|
|
@@ -187,6 +187,7 @@ const createTerm = async (_theme) => {
|
|
|
187
187
|
return term
|
|
188
188
|
}
|
|
189
189
|
document.addEventListener("DOMContentLoaded", async () => {
|
|
190
|
+
debugger
|
|
190
191
|
const n = new N()
|
|
191
192
|
let socket = new Socket()
|
|
192
193
|
<% if (theme === "dark") { %>
|
package/server/views/keys.ejs
CHANGED
package/server/views/network.ejs
CHANGED
|
@@ -398,12 +398,13 @@ input:checked + .slider:before {
|
|
|
398
398
|
<script src="/common.js"></script>
|
|
399
399
|
<script src="/opener.js"></script>
|
|
400
400
|
</head>
|
|
401
|
-
<body class='<%=theme%>'>
|
|
401
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
402
402
|
<header class='navheader grabbable'>
|
|
403
403
|
<h1>
|
|
404
404
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
405
405
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
406
406
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
407
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
407
408
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
408
409
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
409
410
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
package/server/views/pre.ejs
CHANGED
|
@@ -541,7 +541,7 @@ body.dark .header-item.cursor.header-top {
|
|
|
541
541
|
<script src="/filepond.min.js"></script>
|
|
542
542
|
<script src="/commander.js"></script>
|
|
543
543
|
</head>
|
|
544
|
-
<body class='<%=theme%>'>
|
|
544
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
545
545
|
<header class='navheader grabbable'>
|
|
546
546
|
<h1>
|
|
547
547
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
@@ -573,7 +573,7 @@ body.dark .header-item.cursor.header-top {
|
|
|
573
573
|
<script src="/filepond.min.js"></script>
|
|
574
574
|
<script src="/commander.js"></script>
|
|
575
575
|
</head>
|
|
576
|
-
<body class='<%=theme%>'>
|
|
576
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
577
577
|
<div class='appcanvas'>
|
|
578
578
|
<main>
|
|
579
579
|
<div class='doc'>
|
|
@@ -254,7 +254,7 @@ body.dark .keys pre {
|
|
|
254
254
|
<script src="/nav.js"></script>
|
|
255
255
|
<script src="/report.js"></script>
|
|
256
256
|
</head>
|
|
257
|
-
<body class='<%=theme%>'>
|
|
257
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
258
258
|
<!--
|
|
259
259
|
<nav>
|
|
260
260
|
<a class='logo' href="/">dal</a>
|
|
@@ -265,6 +265,7 @@ body.dark .keys pre {
|
|
|
265
265
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
266
266
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
267
267
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
268
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
268
269
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
269
270
|
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
270
271
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
package/server/views/setup.ejs
CHANGED
|
@@ -126,7 +126,7 @@ body {
|
|
|
126
126
|
<script src="/common.js"></script>
|
|
127
127
|
<script src="/report.js"></script>
|
|
128
128
|
</head>
|
|
129
|
-
<body class='<%=theme%>'>
|
|
129
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
130
130
|
<header class='grabbable'>
|
|
131
131
|
<h1>
|
|
132
132
|
<a class='path' href="/"><%-logo%></a>
|
|
@@ -146,55 +146,58 @@ body {
|
|
|
146
146
|
<div class='content'>
|
|
147
147
|
<div class='loading'>
|
|
148
148
|
<i class="fa-solid fa-circle-notch fa-spin"></i>
|
|
149
|
+
<span>Stand by...</span>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
<% } else if (!install_required && wait === 'caddy') { %>
|
|
154
|
+
<div class='requirements'>
|
|
155
|
+
<div class='content'>
|
|
156
|
+
<div class='loading'>
|
|
157
|
+
<i class="fa-solid fa-circle-notch fa-spin"></i>
|
|
158
|
+
<span>Stand by...</span>
|
|
149
159
|
</div>
|
|
150
160
|
</div>
|
|
151
161
|
</div>
|
|
152
162
|
<% } else { %>
|
|
153
|
-
|
|
154
|
-
<div class='
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<% } %>
|
|
173
|
-
</div>
|
|
174
|
-
<% }) %>
|
|
175
|
-
</div>
|
|
176
|
-
<% if (!install_required) { %>
|
|
177
|
-
<a class='btn' href="/">Return home</a>
|
|
178
|
-
<% } %>
|
|
179
|
-
<form class="<%= install_required ? '' : 'hidden'%>" id='install-form' method="post" action="/pinokio/install">
|
|
180
|
-
<input type='hidden' name="requirements" value="<%=JSON.stringify(requirements)%>">
|
|
181
|
-
<input type='hidden' name='callback' value="<%=current%>">
|
|
182
|
-
<button class='btn'>Install</button>
|
|
183
|
-
</form>
|
|
184
|
-
<div class='item'>
|
|
185
|
-
<div class='d'>Not working? <a id='del-bin'>Try a fresh install</a></div>
|
|
186
|
-
<div class='reset-bin-loading hidden'>
|
|
187
|
-
<i class="fa-solid fa-circle-notch fa-spin"></i> Stand by. Do not close this window..
|
|
163
|
+
<div class='requirements'>
|
|
164
|
+
<div class='content'>
|
|
165
|
+
<% if (install_required) { %>
|
|
166
|
+
<div class='title'><i class="fa-solid fa-circle-exclamation"></i> Installation required</div>
|
|
167
|
+
<% } else { %>
|
|
168
|
+
<div class='title'><i class="fa-solid fa-circle-exclamation"></i> Installation complete</div>
|
|
169
|
+
<% } %>
|
|
170
|
+
<div class='btn-group'>
|
|
171
|
+
<% requirements.map((r) => { %>
|
|
172
|
+
<div class='requirement-item'>
|
|
173
|
+
<% if (r.installed) { %>
|
|
174
|
+
<div class='name'><%=r.name%></div>
|
|
175
|
+
<div class='flexible'></div>
|
|
176
|
+
<div class='label'>Installed</div>
|
|
177
|
+
<% } else { %>
|
|
178
|
+
<div class='name highlighted'><%=r.name%></div>
|
|
179
|
+
<div class='flexible'></div>
|
|
180
|
+
<div class='label highlighted'>Not Installed</div>
|
|
181
|
+
<% } %>
|
|
188
182
|
</div>
|
|
183
|
+
<% }) %>
|
|
184
|
+
</div>
|
|
185
|
+
<% if (!install_required) { %>
|
|
186
|
+
<a class='btn' href="<%=current%>">Continue</a>
|
|
187
|
+
<% } %>
|
|
188
|
+
<form class="<%= install_required ? '' : 'hidden'%>" id='install-form' method="post" action="/pinokio/install">
|
|
189
|
+
<input type='hidden' name="requirements" value="<%=JSON.stringify(requirements)%>">
|
|
190
|
+
<input type='hidden' name='callback' value="<%=current%>">
|
|
191
|
+
<button class='btn'>Install</button>
|
|
192
|
+
</form>
|
|
193
|
+
<div class='item'>
|
|
194
|
+
<div class='d'>Not working? <a id='del-bin'>Try a fresh install</a></div>
|
|
195
|
+
<div class='reset-bin-loading hidden'>
|
|
196
|
+
<i class="fa-solid fa-circle-notch fa-spin"></i> Stand by. Do not close this window..
|
|
189
197
|
</div>
|
|
190
198
|
</div>
|
|
191
199
|
</div>
|
|
192
|
-
|
|
193
|
-
<main>
|
|
194
|
-
<div id='terminal'>all installed</div>
|
|
195
|
-
<a href="/" class='btn'>Home</a>
|
|
196
|
-
</main>
|
|
197
|
-
<% } %>
|
|
200
|
+
</div>
|
|
198
201
|
<% } %>
|
|
199
202
|
<script>
|
|
200
203
|
document.addEventListener("DOMContentLoaded", async () => {
|
|
@@ -221,6 +224,39 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
221
224
|
})
|
|
222
225
|
location.href = location.href
|
|
223
226
|
<% } %>
|
|
227
|
+
<% if (!requirements_pending && !install_required && wait === "caddy") { %>
|
|
228
|
+
console.log("RESTART")
|
|
229
|
+
|
|
230
|
+
let r = await fetch("/network", {
|
|
231
|
+
method: "post",
|
|
232
|
+
headers: { "Content-Type": "application/json" },
|
|
233
|
+
body: JSON.stringify({
|
|
234
|
+
PINOKIO_NETWORK_ACTIVE: "1",
|
|
235
|
+
PINOKIO_HTTPS_ACTIVE: "1",
|
|
236
|
+
})
|
|
237
|
+
}).then((res) => {
|
|
238
|
+
return res.json()
|
|
239
|
+
})
|
|
240
|
+
fetch("/restart", {
|
|
241
|
+
method: "post"
|
|
242
|
+
}, () => {
|
|
243
|
+
})
|
|
244
|
+
console.log("Fetch finished")
|
|
245
|
+
await new Promise((resolve, reject) => {
|
|
246
|
+
let interval = setInterval(() => {
|
|
247
|
+
fetch("/check_router_up").then((res) => {
|
|
248
|
+
return res.json()
|
|
249
|
+
}).then((res) => {
|
|
250
|
+
console.log(res)
|
|
251
|
+
if (res.success) {
|
|
252
|
+
clearInterval(interval)
|
|
253
|
+
resolve()
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
}, 500)
|
|
257
|
+
})
|
|
258
|
+
location.href = "<%=current%>"
|
|
259
|
+
<% } %>
|
|
224
260
|
if (document.querySelector("#del-bin")) {
|
|
225
261
|
document.querySelector("#del-bin").addEventListener("click", async (e) => {
|
|
226
262
|
console.log("del-bin")
|
package/server/views/shell.ejs
CHANGED
|
@@ -575,8 +575,13 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
575
575
|
<% if (callback) { %>
|
|
576
576
|
callbacks: {
|
|
577
577
|
onClose: () => {
|
|
578
|
+
// reload after 500ms in case the page didn't change because only the hash changed.
|
|
579
|
+
// if it's a different url, the location.reload won't trigger since location.href
|
|
580
|
+
// assingment will send the user to the url before settimeout happens
|
|
578
581
|
location.href = "<%=callback%>"
|
|
579
|
-
|
|
582
|
+
setTimeout(() => {
|
|
583
|
+
location.reload()
|
|
584
|
+
}, 500)
|
|
580
585
|
}
|
|
581
586
|
}
|
|
582
587
|
<% } %>
|
|
@@ -584,7 +589,12 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
584
589
|
<% } else { %>
|
|
585
590
|
<% if (callback) { %>
|
|
586
591
|
location.href = "<%=callback%>"
|
|
587
|
-
|
|
592
|
+
// reload after 500ms in case the page didn't change because only the hash changed.
|
|
593
|
+
// if it's a different url, the location.reload won't trigger since location.href
|
|
594
|
+
// assingment will send the user to the url before settimeout happens
|
|
595
|
+
setTimeout(() => {
|
|
596
|
+
location.reload()
|
|
597
|
+
}, 500)
|
|
588
598
|
<% } %>
|
|
589
599
|
<% } %>
|
|
590
600
|
})
|
|
@@ -757,7 +767,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
757
767
|
|
|
758
768
|
</script>
|
|
759
769
|
</head>
|
|
760
|
-
<body class='<%=theme%>'>
|
|
770
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
761
771
|
<% if (target === "_top") { %>
|
|
762
772
|
<header class='navheader grabbable'>
|
|
763
773
|
<% } else { %>
|
|
@@ -767,6 +777,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
767
777
|
<% if (target === "_top") { %>
|
|
768
778
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
769
779
|
<% } %>
|
|
780
|
+
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
770
781
|
<div class='hidden btn run play-btn'>
|
|
771
782
|
<span class='play'><i class="fa-solid fa-play"></i> Start</span>
|
|
772
783
|
</div>
|
package/server/views/sidebar.ejs
CHANGED
|
@@ -34,7 +34,7 @@ html, body {
|
|
|
34
34
|
}
|
|
35
35
|
</style>
|
|
36
36
|
</head>
|
|
37
|
-
<body class='<%=theme%>'>
|
|
37
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
38
38
|
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
39
39
|
<a class='header-item' href="<%=home%>">
|
|
40
40
|
<img src="<%=rawpath%>/<%=config.icon%>?raw=true"/>
|
|
@@ -893,9 +893,9 @@ const reloadMemory = async () => {
|
|
|
893
893
|
</script>
|
|
894
894
|
</head>
|
|
895
895
|
<% if (install_required) { %>
|
|
896
|
-
<body class='frozen <%=theme%>'>
|
|
896
|
+
<body class='frozen <%=theme%>' data-agent="<%=agent%>">
|
|
897
897
|
<% } else { %>
|
|
898
|
-
<body class='<%=theme%>'>
|
|
898
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
899
899
|
<% } %>
|
|
900
900
|
<% if (!install_required) { %>
|
|
901
901
|
<header class='navheader2'>
|