pinokiod 2.15.38 → 2.15.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.15.38",
3
+ "version": "2.15.39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -1329,6 +1329,7 @@ class Server {
1329
1329
  readme,
1330
1330
  filepath,
1331
1331
  mode: null,
1332
+ kernel: this.kernel,
1332
1333
  //mode: (req.query && req.query.mode ? req.query.mode : null),
1333
1334
  items
1334
1335
  })
@@ -2087,10 +2088,14 @@ class Server {
2087
2088
  origin: '*'
2088
2089
  }));
2089
2090
 
2091
+ this.app.use(express.static(this.kernel.path("web/public")))
2090
2092
  this.app.use(express.static(path.resolve(__dirname, 'public')));
2091
2093
  this.app.use("/web", express.static(path.resolve(__dirname, "..", "..", "web")))
2092
2094
  this.app.set('view engine', 'ejs');
2093
- this.app.set("views", path.resolve(__dirname, "views"))
2095
+ this.app.set("views", [
2096
+ this.kernel.path("web/views"),
2097
+ path.resolve(__dirname, "views")
2098
+ ])
2094
2099
  this.app.use(express.json());
2095
2100
  this.app.use(express.urlencoded({ extended: true }));
2096
2101
  this.app.use(cookieParser());
@@ -854,7 +854,6 @@ document.addEventListener("click", async (e) => {
854
854
  actions: "hidden"
855
855
  }
856
856
  });
857
- debugger
858
857
  let res = await fetch("/pinokio/delete", {
859
858
  method: "post",
860
859
  headers: {
@@ -233,6 +233,8 @@ hr {
233
233
  <div class='nav-btns'>
234
234
  <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
235
235
  <a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
236
+ <button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Debug</div></button>
237
+ <a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
236
238
  <a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
237
239
  <button id='new-window' title='open a new window' class='btn2'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
238
240
  </div>
@@ -454,6 +456,24 @@ document.addEventListener("DOMContentLoaded", async () => {
454
456
  document.querySelector("#forward").addEventListener("click", (e) => {
455
457
  history.forward()
456
458
  })
459
+ if (document.querySelector("#genlog")) {
460
+ document.querySelector("#genlog").addEventListener("click", (e) => {
461
+ e.preventDefault()
462
+ e.stopPropagation()
463
+ e.target.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i>'
464
+ fetch("/pinokio/log", {
465
+ method: "post",
466
+ }).then((res) => {
467
+ console.log("RES", res)
468
+ let btn = document.querySelector("#genlog")
469
+ let btn2 = document.querySelector("#downloadlogs")
470
+ btn2.classList.remove("hidden")
471
+ btn.classList.add("hidden")
472
+ btn.innerHTML = '<i class="fa-solid fa-circle-check"></i> Generated!'
473
+ //btn.classList.add("hidden")
474
+ })
475
+ })
476
+ }
457
477
  document.querySelector("#explore").addEventListener("click", async (e) => {
458
478
  e.preventDefault()
459
479
  e.stopPropagation()