pinokiod 3.19.66 → 3.19.68

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.
@@ -214,7 +214,11 @@ class Api {
214
214
 
215
215
 
216
216
  // stop all shell processes connected to the uri
217
- this.kernel.shell.kill({ group: requestPath })
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.path) options.group = req.parent.path
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.path) options.group = req.parent.path
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
@@ -41,6 +41,7 @@ class Bin {
41
41
  this.platform = os.platform()
42
42
  }
43
43
  async shell_kill(params, ondata) {
44
+ console.log("shell_kill", params)
44
45
  this.kernel.shell.kill(params.params)
45
46
  }
46
47
  async shell_start(params, ondata) {
package/kernel/shells.js CHANGED
@@ -459,6 +459,7 @@ class Shells {
459
459
  }
460
460
  }
461
461
  } else if (request.group) {
462
+ // console.log("kill group", this.shells)
462
463
  // kill all shells for the scriptpath
463
464
  let shells = []
464
465
  for(let i=0; i<this.shells.length; i++) {
package/kernel/util.js CHANGED
@@ -481,6 +481,7 @@ function push(params) {
481
481
  if (params.image && !params.contentImage) {
482
482
  params.contentImage = params.image
483
483
  }
484
+ console.log("Notifier.notify", params)
484
485
  notifier.notify(params)
485
486
  }
486
487
  function p2u(localPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.19.66",
3
+ "version": "3.19.68",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
  }
@@ -3196,6 +3198,7 @@ class Server {
3196
3198
  }
3197
3199
  }))
3198
3200
  this.app.post("/push", ex(async (req, res) => {
3201
+ console.log("Push", req.body)
3199
3202
  try {
3200
3203
  Util.push(req.body)
3201
3204
  res.json({ success: true })
@@ -4382,8 +4385,8 @@ class Server {
4382
4385
  }
4383
4386
  res.json({ config: this.xterm })
4384
4387
  }))
4385
- this.app.get("/du/:name", ex(async (req, res) => {
4386
- let p = this.kernel.path("api", req.params.name)
4388
+ this.app.get("/du/*", ex(async (req, res) => {
4389
+ let p = this.kernel.path("api", req.params[0])
4387
4390
  try {
4388
4391
  let d1 = await Util.du(p)
4389
4392
  res.json({ du: d1 })
package/server/socket.js CHANGED
@@ -4,6 +4,7 @@ const Util = require("../kernel/util")
4
4
  class Socket {
5
5
  constructor(parent) {
6
6
  this.buffer = {}
7
+ this.old_buffer = {}
7
8
  this.sessions = {}
8
9
  this.connected = {}
9
10
  this.active_shell = {}
@@ -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 <div class='disk-usage'></div>
839
+ <i class="fa-regular fa-folder-open"></i> Files
840
840
  </div>
841
- <div class='loader'>
842
- <i id='open-folder' data-filepath="<%=path%>" class="fa-solid fa-up-right-from-square"></i>
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
- fetch("/du/<%=name%>").then((res) => {
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
- document.querySelector(".disk-usage").innerHTML = val
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-eye"></i> View Folder</button>
197
+ <button class='btn' id='open-fs' data-filepath="<%=filepath%>"><i class="fa-solid fa-square-arrow-up-right"></i>&nbsp;&nbsp;Open in File Explorer</button>
198
198
  </div>
199
199
  <% } %>
200
200
  <% if (display.includes("dependencies")) { %>
@@ -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;