pinokiod 3.2.238 → 3.2.240
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/index.js +31 -26
- package/package.json +1 -1
- package/server/index.js +2 -2
- package/server/views/index.ejs +18 -0
package/kernel/index.js
CHANGED
|
@@ -491,36 +491,41 @@ class Kernel {
|
|
|
491
491
|
})
|
|
492
492
|
|
|
493
493
|
// get env
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
let
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
494
|
+
if (!this.launch_complete) {
|
|
495
|
+
let interval = setInterval(async () => {
|
|
496
|
+
if (this.i) {
|
|
497
|
+
for(let api of this.i.api) {
|
|
498
|
+
let env_path = path.resolve(this.api.userdir, api.path)
|
|
499
|
+
let e = await Environment.get(env_path)
|
|
500
|
+
console.log(e)
|
|
501
|
+
if (e.PINOKIO_SCRIPT_AUTOLAUNCH && e.PINOKIO_SCRIPT_AUTOLAUNCH.trim().length > 0) {
|
|
502
|
+
let autolaunch_path = path.resolve(env_path, e.PINOKIO_SCRIPT_AUTOLAUNCH)
|
|
503
|
+
let exists = await this.exists(autolaunch_path)
|
|
504
|
+
console.log("ATTEMPTING AUTOLAUNCH", autolaunch_path)
|
|
505
|
+
if (exists) {
|
|
506
|
+
console.log("SCRIPT EXISTS. Starting...", autolaunch_path)
|
|
507
|
+
let res = await new Promise((resolve, reject) => {
|
|
508
|
+
this.api.process({
|
|
509
|
+
uri: autolaunch_path,
|
|
510
|
+
input: {}
|
|
511
|
+
// client: req.client,
|
|
512
|
+
// caller: req.parent.path,
|
|
513
|
+
}, (r) => {
|
|
514
|
+
resolve(r.input)
|
|
515
|
+
})
|
|
514
516
|
})
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
517
|
+
} else {
|
|
518
|
+
console.log("SCRIPT DOES NOT EXIST. Ignoring.", autolaunch_path)
|
|
519
|
+
}
|
|
518
520
|
}
|
|
519
521
|
}
|
|
522
|
+
console.log("clear Interval")
|
|
523
|
+
clearInterval(interval)
|
|
524
|
+
this.launch_complete = true
|
|
525
|
+
console.log("SETTING launch complete", this.launch_complete)
|
|
520
526
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}, 1000)
|
|
527
|
+
}, 1000)
|
|
528
|
+
}
|
|
524
529
|
}
|
|
525
530
|
// console.log({ grant_permission })
|
|
526
531
|
// if (grant_permission) {
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -3079,10 +3079,10 @@ class Server {
|
|
|
3079
3079
|
res.json({ success: true })
|
|
3080
3080
|
}))
|
|
3081
3081
|
this.app.get("/pinokio/info", ex(async (req, res) => {
|
|
3082
|
-
console.time("getInfo")
|
|
3083
3082
|
await this.kernel.getInfo()
|
|
3084
|
-
console.timeEnd("getInfo")
|
|
3085
3083
|
let info = Object.assign({}, this.kernel.i)
|
|
3084
|
+
info.launch_complete = this.kernel.launch_complete
|
|
3085
|
+
console.log("kernel.launch_complete", this.kernel.launch_complete)
|
|
3086
3086
|
delete info.vars
|
|
3087
3087
|
delete info.shell_env
|
|
3088
3088
|
delete info.memory
|
package/server/views/index.ejs
CHANGED
|
@@ -1077,6 +1077,24 @@ if (document.querySelector("#genlog")) {
|
|
|
1077
1077
|
})
|
|
1078
1078
|
})
|
|
1079
1079
|
}
|
|
1080
|
+
fetch("/pinokio/info").then((res) => {
|
|
1081
|
+
return res.json()
|
|
1082
|
+
}).then((res) => {
|
|
1083
|
+
if (!res.launch_complete) {
|
|
1084
|
+
let interval = setInterval(async () => {
|
|
1085
|
+
let res = await fetch("/pinokio/info").then((res) => {
|
|
1086
|
+
return res.json()
|
|
1087
|
+
})
|
|
1088
|
+
if (res.launch_complete) {
|
|
1089
|
+
console.log("launched")
|
|
1090
|
+
clearInterval(interval)
|
|
1091
|
+
location.href = location.href
|
|
1092
|
+
} else {
|
|
1093
|
+
console.log("not yet launched")
|
|
1094
|
+
}
|
|
1095
|
+
}, 1000)
|
|
1096
|
+
}
|
|
1097
|
+
})
|
|
1080
1098
|
|
|
1081
1099
|
</script>
|
|
1082
1100
|
</body>
|