pinokiod 1.2.55 → 1.2.57
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/fs/index.js +23 -21
- package/package.json +1 -1
- package/server/index.js +1 -1
- package/server/public/opener.js +1 -1
- package/server/views/index.ejs +1 -0
package/kernel/api/fs/index.js
CHANGED
|
@@ -41,6 +41,10 @@ class FS {
|
|
|
41
41
|
// }
|
|
42
42
|
|
|
43
43
|
|
|
44
|
+
async link(req, ondata, kernel) {
|
|
45
|
+
let response = await this.share(req, ondata, kernel)
|
|
46
|
+
return response
|
|
47
|
+
}
|
|
44
48
|
|
|
45
49
|
async share(req, ondata, kernel) {
|
|
46
50
|
/////////////////////////////////////////////////////////////////////////////
|
|
@@ -311,7 +315,7 @@ class FS {
|
|
|
311
315
|
params := {
|
|
312
316
|
path: <filepath>,
|
|
313
317
|
<json|buffer|text>: ___,
|
|
314
|
-
|
|
318
|
+
join: { // used when the data is an array
|
|
315
319
|
<buffer|text>: <example: \n, {{os.EOL}} (default is nothing)>
|
|
316
320
|
}
|
|
317
321
|
}
|
|
@@ -335,25 +339,23 @@ class FS {
|
|
|
335
339
|
|
|
336
340
|
// 2. get the data
|
|
337
341
|
let data = req.params[type]
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
if
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
//
|
|
349
|
-
|
|
350
|
-
//
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
await this._append(filepath, data, type)
|
|
356
|
-
}
|
|
342
|
+
await this._append(filepath, data, type)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
// // 3. if array, iterate through the data and append
|
|
346
|
+
// if (Array.isArray(data)) {
|
|
347
|
+
// let chunks = data
|
|
348
|
+
// for(let i=0; i<chunks.length; i++) {
|
|
349
|
+
// let chunk = chunks[i]
|
|
350
|
+
//
|
|
351
|
+
// await this._append(filepath, chunk, type)
|
|
352
|
+
// await this._delimit(req, filepath)
|
|
353
|
+
//
|
|
354
|
+
// }
|
|
355
|
+
// } else {
|
|
356
|
+
// // 4. if not array, just append once
|
|
357
|
+
// await this._append(filepath, data, type)
|
|
358
|
+
// }
|
|
357
359
|
|
|
358
360
|
}
|
|
359
361
|
async write (req, ondata, kernel) {
|
|
@@ -361,7 +363,7 @@ class FS {
|
|
|
361
363
|
params := {
|
|
362
364
|
path: <filepath>,
|
|
363
365
|
<json|buffer|text>: ___,
|
|
364
|
-
|
|
366
|
+
join: { // used when the data is an array
|
|
365
367
|
<buffer|text>: <example: \n, {{os.EOL}} (default is nothing)>
|
|
366
368
|
}
|
|
367
369
|
}
|
package/package.json
CHANGED
package/server/index.js
CHANGED
package/server/public/opener.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
document.addEventListener("click", async (e) => {
|
|
2
2
|
// [data-filepath] should open in file explorer
|
|
3
|
-
let el = e.target.closest("data-filepath")
|
|
3
|
+
let el = e.target.closest("[data-filepath]")
|
|
4
4
|
if (!el) {
|
|
5
5
|
let filepath = e.target.getAttribute("data-filepath")
|
|
6
6
|
if (filepath) {
|
package/server/views/index.ejs
CHANGED
|
@@ -119,6 +119,7 @@ header .runner {
|
|
|
119
119
|
<% if (ishome) { %>
|
|
120
120
|
<div class='nav-btns'>
|
|
121
121
|
<a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
|
|
122
|
+
<a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
|
|
122
123
|
<a id='wifi' data-proxy="<%=proxy.proxy%>" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>WiFi</div></a>
|
|
123
124
|
<!--
|
|
124
125
|
<a class='btn2' href="<%=proxy.proxy%>" target="_blank"><div><i class="fa-solid fa-wifi"></i></div><div>WiFi</div></a>
|