pinokiod 0.1.53 → 0.1.55

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.
@@ -39,11 +39,11 @@ class FS {
39
39
  async share(req, ondata, kernel) {
40
40
  /////////////////////////////////////////////////////////////////////////////
41
41
  //
42
- // 1. 1:1 Interface mapping (1 interface, 1 file path)
42
+ // 1. 1:1 Drive mapping (1 file path per 1 drive folder)
43
43
  // {
44
44
  // “method”: “fs.share”,
45
45
  // “params”: {
46
- // "interface": {
46
+ // "drive": {
47
47
  // “models/checkpoints": "app/models/checkpoints",
48
48
  // “models/vae": "app/models/VAE",
49
49
  // },
@@ -52,11 +52,11 @@ class FS {
52
52
  // }
53
53
  //
54
54
  //
55
- // 2. 1:N Interface mapping (1 interface, N file paths)
55
+ // 2. 1:N Drive mapping (N file paths per 1 drive folder)
56
56
  // {
57
57
  // “method”: “fs.share”,
58
58
  // “params”: {
59
- // "interface": {
59
+ // "drive": {
60
60
  // “models/checkpoints": "app/models/checkpoints",
61
61
  // “models/loras": [ "app/models/Lora", "app/models/LyCORIS" ],
62
62
  // },
@@ -67,11 +67,11 @@ class FS {
67
67
  /////////////////////////////////////////////////////////////////////////////
68
68
 
69
69
 
70
- if (req.params.interface) {
70
+ if (req.params.drive) {
71
71
  const drivePath = kernel.path("drive")
72
72
  const drive = new Pdrive(drivePath)
73
- for(const route in req.params.interface) {
74
- const link = req.params.interface[route]
73
+ for(const route in req.params.drive) {
74
+ const link = req.params.drive[route]
75
75
  // Link path validation
76
76
  if (Array.isArray(link)) {
77
77
  let toContinue = false;
@@ -87,7 +87,7 @@ class FS {
87
87
  continue
88
88
  }
89
89
  }
90
- // Interface path validation
90
+ // Drive path validation
91
91
  if (path.isAbsolute(route) || route.startsWith(".")) {
92
92
  toContinue = true
93
93
  break
@@ -102,16 +102,16 @@ class FS {
102
102
  linkPath = path.resolve(req.cwd, link)
103
103
  }
104
104
 
105
- req.params.interface[route] = linkPath
105
+ req.params.drive[route] = linkPath
106
106
  }
107
107
  await drive.create({
108
108
  uri: req.parent.git,
109
- interface: req.params.interface,
109
+ drive: req.params.drive,
110
110
  peers: (req.params.peers ? req.params.peers : [])
111
111
  })
112
112
  ondata({ raw: `\r\nDone!` })
113
113
  } else {
114
- ondata({ raw: `\r\nMust pass an 'interface' mapping` })
114
+ ondata({ raw: `\r\nMust pass an 'drive' mapping` })
115
115
  }
116
116
 
117
117
  }
@@ -0,0 +1,15 @@
1
+ /*
2
+ {
3
+ method: "tab.open",
4
+ params: {
5
+ target:
6
+ url
7
+ }
8
+ }
9
+ (*/
10
+ class Tab {
11
+ async open(req, ondata, kernel) {
12
+ ondata(req.params, "tab.open")
13
+ }
14
+ }
15
+ module.exports = Tab
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,7 +40,7 @@
40
40
  "multer": "^1.4.5-lts.1",
41
41
  "node-downloader-helper": "^2.1.9",
42
42
  "node-pty-prebuilt-multiarch-cp": "^0.10.1-pre.48",
43
- "pdrive": "^0.0.9",
43
+ "pdrive": "^0.0.10",
44
44
  "portfinder": "^1.0.32",
45
45
  "rimraf": "^5.0.0",
46
46
  "sanitize-filename": "^1.6.3",
package/server/index.js CHANGED
@@ -40,6 +40,7 @@ class Server {
40
40
  pinokiod: packagejson.version,
41
41
  pinokio: config.version
42
42
  }
43
+ this.kernel.version = this.version
43
44
  this.upload = multer();
44
45
 
45
46
  // sometimes the C:\Windows\System32 is not in PATH, need to add
@@ -260,6 +261,7 @@ class Server {
260
261
  let stat = await fs.promises.stat(filepath)
261
262
  if (pathComponents.length === 0 && req.query.mode === "explore") {
262
263
  res.render("explore", {
264
+ version: this.version,
263
265
  logo: this.logo,
264
266
  theme: this.theme,
265
267
  agent: this.agent,
@@ -471,6 +471,13 @@ const renderSelection = (e, force) => {
471
471
 
472
472
  // if the iframe already exists, do not
473
473
  if (loaded[target.target]){
474
+
475
+ let mode = target.getAttribute("data-mode")
476
+ if (mode === "refresh") {
477
+ targetFrame.src = target.href
478
+ return
479
+ }
480
+
474
481
  if (e) {
475
482
  // triggered with a click
476
483
  // do not reload iframe if the href and the src is the same
@@ -696,6 +703,7 @@ window.addEventListener('message', (event) => {
696
703
  addTab(event.data.action.url)
697
704
  }
698
705
  } else {
706
+ console.log("data", event.data)
699
707
  refresh()
700
708
  }
701
709
  });
@@ -333,6 +333,8 @@ document.addEventListener("DOMContentLoaded", async () => {
333
333
  }]
334
334
  }
335
335
  */
336
+ } else if (packet.type === "tab.open") {
337
+ refreshParent(packet)
336
338
  } else if (packet.type === "browser.open") {
337
339
  /*
338
340
  {
@@ -312,6 +312,8 @@ document.addEventListener("DOMContentLoaded", async () => {
312
312
  }]
313
313
  }
314
314
  */
315
+ } else if (packet.type === "tab.open") {
316
+ refreshParent(packet)
315
317
  } else if (packet.type === "browser.open") {
316
318
  /*
317
319
  {
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  <% } else { %>
12
12
  <% if (item.btn) { %>
13
- <a data-index="<%=index%>" target="<%=item.src%>" href="<%=item.href%>" class='btn header-item frame-link'>
13
+ <a data-index="<%=index%>" target="<%=item.src%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link'>
14
14
  <div class='tab'><%-item.btn%></div>
15
15
  <% if (item.running) { %>
16
16
  <div class='loader'>