pinokiod 3.19.66 → 3.19.67
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 +5 -1
- package/kernel/api/shell/index.js +10 -2
- package/kernel/bin/index.js +1 -0
- package/kernel/shells.js +1 -0
- package/package.json +1 -1
- package/server/index.js +4 -2
- package/server/socket.js +1 -0
- package/server/views/app.ejs +14 -6
- package/server/views/file_explorer.ejs +1 -1
- package/server/views/index.ejs +13 -13
package/kernel/api/index.js
CHANGED
|
@@ -214,7 +214,11 @@ class Api {
|
|
|
214
214
|
|
|
215
215
|
|
|
216
216
|
// stop all shell processes connected to the uri
|
|
217
|
-
|
|
217
|
+
if (req.params.id) {
|
|
218
|
+
this.kernel.shell.kill({ group: req.params.id })
|
|
219
|
+
} else {
|
|
220
|
+
this.kernel.shell.kill({ group: requestPath })
|
|
221
|
+
}
|
|
218
222
|
|
|
219
223
|
// if any process is in a "wait" state, resume it
|
|
220
224
|
this.kernel.resumeprocess(requestPath)
|
|
@@ -48,7 +48,11 @@ class Shell {
|
|
|
48
48
|
|
|
49
49
|
let options = {}
|
|
50
50
|
if (req.cwd) options.cwd = req.cwd
|
|
51
|
-
if (req.parent && req.parent.
|
|
51
|
+
if (req.parent && req.parent.id) {
|
|
52
|
+
options.group = req.parent.id
|
|
53
|
+
} else if (req.parent && req.parent.path) {
|
|
54
|
+
options.group = req.parent.path
|
|
55
|
+
}
|
|
52
56
|
let id = await kernel.shell.start(req.params, options, ondata)
|
|
53
57
|
return id
|
|
54
58
|
//let id = await kernel.shell.start(req.params, options)
|
|
@@ -123,7 +127,11 @@ class Shell {
|
|
|
123
127
|
}
|
|
124
128
|
let options = {}
|
|
125
129
|
if (req.cwd) options.cwd = req.cwd
|
|
126
|
-
if (req.parent && req.parent.
|
|
130
|
+
if (req.parent && req.parent.id) {
|
|
131
|
+
options.group = req.parent.id
|
|
132
|
+
} else if (req.parent && req.parent.path) {
|
|
133
|
+
options.group = req.parent.path
|
|
134
|
+
}
|
|
127
135
|
if (req.client) {
|
|
128
136
|
req.params.rows = req.client.rows
|
|
129
137
|
req.params.cols = req.client.cols
|
package/kernel/bin/index.js
CHANGED
package/kernel/shells.js
CHANGED
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -552,6 +552,7 @@ class Server {
|
|
|
552
552
|
// repos,
|
|
553
553
|
current_urls,
|
|
554
554
|
path: this.kernel.path("api", name),
|
|
555
|
+
log_path: this.kernel.path("api", name, "logs"),
|
|
555
556
|
plugin_menu,
|
|
556
557
|
portal: this.portal,
|
|
557
558
|
install: this.install,
|
|
@@ -580,6 +581,7 @@ class Server {
|
|
|
580
581
|
theme: this.theme,
|
|
581
582
|
agent: this.agent,
|
|
582
583
|
src: "/_api/" + name,
|
|
584
|
+
logs: "/_api/" + name + "/logs",
|
|
583
585
|
execUrl: "/api/" + name,
|
|
584
586
|
// rawpath,
|
|
585
587
|
}
|
|
@@ -4382,8 +4384,8 @@ class Server {
|
|
|
4382
4384
|
}
|
|
4383
4385
|
res.json({ config: this.xterm })
|
|
4384
4386
|
}))
|
|
4385
|
-
this.app.get("/du
|
|
4386
|
-
let p = this.kernel.path("api", req.params
|
|
4387
|
+
this.app.get("/du/*", ex(async (req, res) => {
|
|
4388
|
+
let p = this.kernel.path("api", req.params[0])
|
|
4387
4389
|
try {
|
|
4388
4390
|
let d1 = await Util.du(p)
|
|
4389
4391
|
res.json({ du: d1 })
|
package/server/socket.js
CHANGED
package/server/views/app.ejs
CHANGED
|
@@ -836,11 +836,15 @@ body.dark .appcanvas {
|
|
|
836
836
|
<div class='m n system' data-type="n">
|
|
837
837
|
<a target="<%=src%>" href="<%=src%>" class='btn header-item frame-link' data-index="0" data-mode="refresh">
|
|
838
838
|
<div class='tab'>
|
|
839
|
-
<i class="fa-regular fa-folder-open"></i> Files
|
|
839
|
+
<i class="fa-regular fa-folder-open"></i> Files
|
|
840
840
|
</div>
|
|
841
|
-
|
|
842
|
-
|
|
841
|
+
<div class='disk-usage' data-path="/"></div>
|
|
842
|
+
</a>
|
|
843
|
+
<a target="<%=logs%>" href="<%=logs%>" class='btn header-item frame-link' data-index="1" data-mode="refresh">
|
|
844
|
+
<div class='tab'>
|
|
845
|
+
<i class="fa-solid fa-clock-rotate-left"></i> Logs
|
|
843
846
|
</div>
|
|
847
|
+
<div class='disk-usage' data-path="/logs"></div>
|
|
844
848
|
</a>
|
|
845
849
|
<% if (profile || feed) { %>
|
|
846
850
|
<div class='btn header-item frame-link revealer' data-group='.info-group'>
|
|
@@ -1879,9 +1883,10 @@ body.dark .appcanvas {
|
|
|
1879
1883
|
|
|
1880
1884
|
|
|
1881
1885
|
})
|
|
1882
|
-
const refresh_du = () => {
|
|
1886
|
+
const refresh_du = (path) => {
|
|
1883
1887
|
console.log("REFRESH DU")
|
|
1884
|
-
|
|
1888
|
+
let url = path ? `/du/<%=name%>/${path}` : `/du/<%=name%>`
|
|
1889
|
+
fetch(url).then((res) => {
|
|
1885
1890
|
return res.json()
|
|
1886
1891
|
}).then((res) => {
|
|
1887
1892
|
if (res.du > 0) {
|
|
@@ -1899,7 +1904,8 @@ body.dark .appcanvas {
|
|
|
1899
1904
|
val = `${Math.floor(res.du/k * 100) / 100} KB`
|
|
1900
1905
|
}
|
|
1901
1906
|
console.log("DU VAL", val)
|
|
1902
|
-
|
|
1907
|
+
let selector = `.disk-usage[data-path='/${path || ""}']`
|
|
1908
|
+
document.querySelector(selector).innerHTML = val
|
|
1903
1909
|
} else {
|
|
1904
1910
|
}
|
|
1905
1911
|
})
|
|
@@ -2032,6 +2038,7 @@ body.dark .appcanvas {
|
|
|
2032
2038
|
}
|
|
2033
2039
|
if (event.data.type === 'result') {
|
|
2034
2040
|
refresh_du()
|
|
2041
|
+
refresh_du("logs")
|
|
2035
2042
|
}
|
|
2036
2043
|
}
|
|
2037
2044
|
} else {
|
|
@@ -2044,6 +2051,7 @@ body.dark .appcanvas {
|
|
|
2044
2051
|
|
|
2045
2052
|
});
|
|
2046
2053
|
refresh_du()
|
|
2054
|
+
refresh_du("logs")
|
|
2047
2055
|
<% if (type !== 'run') { %>
|
|
2048
2056
|
debugger
|
|
2049
2057
|
fetch("<%=repos%>").then((res) => {
|
|
@@ -194,7 +194,7 @@ body.dark .browser-options-row {
|
|
|
194
194
|
</h1>
|
|
195
195
|
<% if (!ishome) { %>
|
|
196
196
|
<div class='runner'>
|
|
197
|
-
<button class='btn' id='open-fs' data-filepath="<%=filepath%>"><i class="fa-solid fa-
|
|
197
|
+
<button class='btn' id='open-fs' data-filepath="<%=filepath%>"><i class="fa-solid fa-square-arrow-up-right"></i> Open in File Explorer</button>
|
|
198
198
|
</div>
|
|
199
199
|
<% } %>
|
|
200
200
|
<% if (display.includes("dependencies")) { %>
|
package/server/views/index.ejs
CHANGED
|
@@ -798,19 +798,19 @@ if (document.querySelector("form input[type=search]")) {
|
|
|
798
798
|
// if launch_complete is false => not finished launching. wait until it's complete, and then refresh
|
|
799
799
|
// autolaunch display update
|
|
800
800
|
<% if (!launch_complete) { %>
|
|
801
|
-
let interval = setInterval(async () => {
|
|
802
|
-
let res = await fetch("/pinokio/info").then((res) => {
|
|
803
|
-
return res.json()
|
|
804
|
-
})
|
|
805
|
-
if (res.launch_complete) {
|
|
806
|
-
debugger
|
|
807
|
-
console.log("launched")
|
|
808
|
-
clearInterval(interval)
|
|
809
|
-
location.href = location.href
|
|
810
|
-
} else {
|
|
811
|
-
console.log("not yet launched")
|
|
812
|
-
}
|
|
813
|
-
}, 1000)
|
|
801
|
+
// let interval = setInterval(async () => {
|
|
802
|
+
// let res = await fetch("/pinokio/info").then((res) => {
|
|
803
|
+
// return res.json()
|
|
804
|
+
// })
|
|
805
|
+
// if (res.launch_complete) {
|
|
806
|
+
// debugger
|
|
807
|
+
// console.log("launched")
|
|
808
|
+
// clearInterval(interval)
|
|
809
|
+
// location.href = location.href
|
|
810
|
+
// } else {
|
|
811
|
+
// console.log("not yet launched")
|
|
812
|
+
// }
|
|
813
|
+
// }, 1000)
|
|
814
814
|
<% } %>
|
|
815
815
|
document.addEventListener("keydown", (e) => {
|
|
816
816
|
e = e || window.event;
|