pinokiod 3.2.250 → 3.2.252
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/index.js +1 -1
- package/kernel/index.js +4 -7
- package/package.json +1 -1
- package/server/index.js +8 -0
- package/server/views/index.ejs +16 -22
- package/server/views/install.ejs +21 -2
- package/server/views/settings.ejs +35 -0
package/kernel/bin/index.js
CHANGED
|
@@ -552,7 +552,7 @@ class Bin {
|
|
|
552
552
|
if (m.name === name) {
|
|
553
553
|
//await m.mod.install(this, ondata)
|
|
554
554
|
const message = `${m.mod.description ? '<br>' + m.mod.description : ''}`
|
|
555
|
-
ondata({ html: `<b
|
|
555
|
+
ondata({ html: `<b><i class="fas fa-circle-notch fa-spin"></i> ${progress} Installing ${name}</b>${message}` }, "notify")
|
|
556
556
|
console.log("## Before m.mod.install", requirement)
|
|
557
557
|
await m.mod.install(requirement, ondata, this.kernel)
|
|
558
558
|
|
package/kernel/index.js
CHANGED
|
@@ -520,13 +520,10 @@ class Kernel {
|
|
|
520
520
|
}
|
|
521
521
|
console.log("clear Interval")
|
|
522
522
|
clearInterval(interval)
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
resolve()
|
|
528
|
-
}, 1000)
|
|
529
|
-
})
|
|
523
|
+
setTimeout(() => {
|
|
524
|
+
this.launch_complete = true
|
|
525
|
+
console.log("SETTING launch complete", this.launch_complete)
|
|
526
|
+
}, 2000)
|
|
530
527
|
}
|
|
531
528
|
}, 1000)
|
|
532
529
|
}
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1361,6 +1361,7 @@ class Server {
|
|
|
1361
1361
|
if (meta) {
|
|
1362
1362
|
items = running.concat(notRunning)
|
|
1363
1363
|
res.render("index", {
|
|
1364
|
+
launch_complete: this.kernel.launch_complete,
|
|
1364
1365
|
home_url: `http://localhost:${this.port}`,
|
|
1365
1366
|
proxy: home_proxy,
|
|
1366
1367
|
cloudflare_pub: this.cloudflare_pub,
|
|
@@ -2301,6 +2302,7 @@ class Server {
|
|
|
2301
2302
|
folders = {
|
|
2302
2303
|
bin: path.resolve(this.kernel.homedir, "bin"),
|
|
2303
2304
|
cache: path.resolve(this.kernel.homedir, "cache"),
|
|
2305
|
+
env: path.resolve(this.kernel.homedir, "ENVIRONMENT"),
|
|
2304
2306
|
drive: path.resolve(this.kernel.homedir, "drive"),
|
|
2305
2307
|
}
|
|
2306
2308
|
}
|
|
@@ -2982,6 +2984,12 @@ class Server {
|
|
|
2982
2984
|
await fse.remove(folderPath)
|
|
2983
2985
|
await fs.promises.mkdir(folderPath, { recursive: true }).catch((e) => { })
|
|
2984
2986
|
res.json({ success: true })
|
|
2987
|
+
} else if (req.body.type === 'env') {
|
|
2988
|
+
let envpath = this.kernel.path("ENVIRONMENT")
|
|
2989
|
+
let str = await Environment.ENV("system", this.kernel.homedir)
|
|
2990
|
+
console.log({ str })
|
|
2991
|
+
await fs.promises.writeFile(path.resolve(this.kernel.homedir, "ENVIRONMENT"), str)
|
|
2992
|
+
res.json({ success: true })
|
|
2985
2993
|
} else if (req.body.type === 'browser-cache') {
|
|
2986
2994
|
if (this.browser) {
|
|
2987
2995
|
await this.browser.clearCache()
|
package/server/views/index.ejs
CHANGED
|
@@ -735,29 +735,23 @@ if (document.querySelector("form input[type=search]")) {
|
|
|
735
735
|
})
|
|
736
736
|
}
|
|
737
737
|
<% if (ishome) { %>
|
|
738
|
+
// if launch_complete is true => already finished launching so no need to refresh
|
|
739
|
+
// if launch_complete is false => not finished launching. wait until it's complete, and then refresh
|
|
738
740
|
// autolaunch display update
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
clearInterval(interval)
|
|
754
|
-
location.href = location.href
|
|
755
|
-
} else {
|
|
756
|
-
console.log("not yet launched")
|
|
757
|
-
}
|
|
758
|
-
}, 1000)
|
|
759
|
-
}
|
|
760
|
-
})
|
|
741
|
+
<% if (!launch_complete) { %>
|
|
742
|
+
let interval = setInterval(async () => {
|
|
743
|
+
let res = await fetch("/pinokio/info").then((res) => {
|
|
744
|
+
return res.json()
|
|
745
|
+
})
|
|
746
|
+
if (res.launch_complete) {
|
|
747
|
+
console.log("launched")
|
|
748
|
+
clearInterval(interval)
|
|
749
|
+
location.href = location.href
|
|
750
|
+
} else {
|
|
751
|
+
console.log("not yet launched")
|
|
752
|
+
}
|
|
753
|
+
}, 1000)
|
|
754
|
+
<% } %>
|
|
761
755
|
document.addEventListener("keydown", (e) => {
|
|
762
756
|
e = e || window.event;
|
|
763
757
|
if (e.key === "ArrowUp") {
|
package/server/views/install.ejs
CHANGED
|
@@ -94,6 +94,21 @@ body {
|
|
|
94
94
|
.timestamp {
|
|
95
95
|
color: rgba(0,0,0,0.5);
|
|
96
96
|
}
|
|
97
|
+
#status-screen {
|
|
98
|
+
padding: 10px;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
width: 100%;
|
|
101
|
+
margin: 0;
|
|
102
|
+
background: royalblue;
|
|
103
|
+
overflow: auto;
|
|
104
|
+
color: white;
|
|
105
|
+
/*
|
|
106
|
+
color: rgb(27, 28, 29);
|
|
107
|
+
*/
|
|
108
|
+
}
|
|
109
|
+
#status-screen b {
|
|
110
|
+
color: white;
|
|
111
|
+
}
|
|
97
112
|
</style>
|
|
98
113
|
<script src="/hotkeys.min.js"></script>
|
|
99
114
|
<script src="/sweetalert2.js"></script>
|
|
@@ -113,7 +128,10 @@ body {
|
|
|
113
128
|
</head>
|
|
114
129
|
<body class='<%=theme%>'>
|
|
115
130
|
<header class='grabbable'></header>
|
|
116
|
-
<div id='
|
|
131
|
+
<div id='status-screen'></div>
|
|
132
|
+
<div class='terminal-container'>
|
|
133
|
+
<div id='terminal'></div>
|
|
134
|
+
</div>
|
|
117
135
|
<input id='requirements' type='hidden' value="<%=requirements%>">
|
|
118
136
|
<input id='callback' type='hidden' value="<%=callback%>">
|
|
119
137
|
<script>
|
|
@@ -221,7 +239,8 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
221
239
|
if (packet.data.type) {
|
|
222
240
|
payload.type = packet.data.type
|
|
223
241
|
}
|
|
224
|
-
n.Noty(payload)
|
|
242
|
+
// n.Noty(payload)
|
|
243
|
+
document.querySelector("#status-screen").innerHTML = packet.data.html
|
|
225
244
|
}
|
|
226
245
|
}
|
|
227
246
|
})
|
|
@@ -330,6 +330,17 @@ hr {
|
|
|
330
330
|
<button class='red btn' id='del-cache'><i class="fa-solid fa-trash-can"></i> Reset</button>
|
|
331
331
|
</div>
|
|
332
332
|
</div>
|
|
333
|
+
<div class='item'>
|
|
334
|
+
<label><i class="fa-solid fa-folder-open"></i> environment variables</label>
|
|
335
|
+
<div class='d'>Reset the pinokio environment variables and start fresh from scratch</div>
|
|
336
|
+
<div class='reset-env-loading hidden'>
|
|
337
|
+
<i class="fa-solid fa-circle-notch fa-spin"></i> Stand by. Do not close this window..
|
|
338
|
+
</div>
|
|
339
|
+
<div>
|
|
340
|
+
<button class='btn' data-filepath="<%=env%>"><i class="fa-solid fa-up-right-from-square"></i> View ENVIRONMENT file</button>
|
|
341
|
+
<button class='red btn' id='del-env'><i class="fa-solid fa-trash-can"></i> Reset</button>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
333
344
|
<% if (agent === "electron") { %>
|
|
334
345
|
<div class='item'>
|
|
335
346
|
<label><i class="fa-solid fa-folder-open"></i> browser cache</label>
|
|
@@ -417,6 +428,30 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
417
428
|
}
|
|
418
429
|
}
|
|
419
430
|
})
|
|
431
|
+
document.querySelector("#del-env").addEventListener("click", async (e) => {
|
|
432
|
+
console.log("del-env")
|
|
433
|
+
let proceed = confirm("Are you sure you wish to reset the environment variables?")
|
|
434
|
+
if (proceed) {
|
|
435
|
+
document.querySelector(".reset-env-loading").classList.remove("hidden")
|
|
436
|
+
document.querySelector("#del-env").classList.add("hidden")
|
|
437
|
+
let res = await fetch("/pinokio/delete", {
|
|
438
|
+
method: "post",
|
|
439
|
+
headers: {
|
|
440
|
+
"Content-Type": "application/json"
|
|
441
|
+
},
|
|
442
|
+
body: JSON.stringify({ type: "env" })
|
|
443
|
+
}).then((res) => {
|
|
444
|
+
return res.json()
|
|
445
|
+
})
|
|
446
|
+
console.log(res)
|
|
447
|
+
document.querySelector(".reset-env-loading").classList.add("hidden")
|
|
448
|
+
if (res.error) {
|
|
449
|
+
alert(res.error)
|
|
450
|
+
} else {
|
|
451
|
+
location.href = location.href
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
})
|
|
420
455
|
<% } %>
|
|
421
456
|
<% if (agent === "electron") { %>
|
|
422
457
|
if (document.querySelector("#del-browser-cache")) {
|