pinokiod 3.9.16 → 3.9.17
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/loader.js +0 -8
- package/kernel/shell.js +0 -2
- package/package.json +1 -1
- package/server/index.js +2 -0
- package/server/public/fseditor.js +22 -15
- package/server/views/app.ejs +10 -8
package/kernel/loader.js
CHANGED
|
@@ -12,7 +12,6 @@ class Loader {
|
|
|
12
12
|
clearModule(_path)
|
|
13
13
|
|
|
14
14
|
let exists = await this.exists(_path)
|
|
15
|
-
console.log({ exists, _path })
|
|
16
15
|
if (!exists) {
|
|
17
16
|
return { resolved: null, dirname: path.dirname(_path), }
|
|
18
17
|
}
|
|
@@ -20,31 +19,24 @@ class Loader {
|
|
|
20
19
|
if (/\.json$/i.test(_path)) {
|
|
21
20
|
resolved = await this.requireJSON(_path)
|
|
22
21
|
dirname = path.dirname(_path)
|
|
23
|
-
console.log("#1", { resolved, dirname })
|
|
24
22
|
} else if (/\.js$/i.test(_path)) {
|
|
25
23
|
resolved = await this.requireJS(_path)
|
|
26
24
|
dirname = path.dirname(_path)
|
|
27
|
-
console.log("#2", { resolved, dirname })
|
|
28
25
|
// } else if (/\.(csv|txt)$/i.test(_path)) {
|
|
29
26
|
// resolved = await this.requireCSV(_path)
|
|
30
27
|
// } else if (/\.(yaml|yml)$/.test(_path)) {
|
|
31
28
|
// resolved = await this.requireYAML(_path)
|
|
32
29
|
} else {
|
|
33
|
-
console.log("#3", { resolved, dirname })
|
|
34
30
|
// load JS if directory
|
|
35
31
|
try {
|
|
36
32
|
let stat = await fs.promises.stat(_path)
|
|
37
|
-
console.log({ stat, _path })
|
|
38
33
|
if (stat.isDirectory()) {
|
|
39
|
-
console.log("isDirectory")
|
|
40
34
|
resolved = await this.requireJS(_path)
|
|
41
35
|
dirname = _path
|
|
42
36
|
} else {
|
|
43
|
-
console.log("isNotDirectory")
|
|
44
37
|
resolved = null
|
|
45
38
|
}
|
|
46
39
|
} catch (e) {
|
|
47
|
-
console.log("3Error", e)
|
|
48
40
|
resolved = null
|
|
49
41
|
}
|
|
50
42
|
}
|
package/kernel/shell.js
CHANGED
|
@@ -955,7 +955,6 @@ class Shell {
|
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
kill(message, force, cb) {
|
|
958
|
-
console.log("KILL")
|
|
959
958
|
|
|
960
959
|
this.done = true
|
|
961
960
|
this.ready = false
|
|
@@ -987,7 +986,6 @@ class Shell {
|
|
|
987
986
|
this.kernel.shell.rm(this.id)
|
|
988
987
|
this.ondata({ raw: `\r\n\r\n██ Terminated Shell ${this.id}\r\n████\r\n` })
|
|
989
988
|
this.ondata({ raw: "", type: "shell.kill" })
|
|
990
|
-
console.log("before cb 1")
|
|
991
989
|
cb()
|
|
992
990
|
} else {
|
|
993
991
|
kill(this.ptyProcess.pid, "SIGKILL", true)
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -4244,8 +4244,10 @@ class Server {
|
|
|
4244
4244
|
*/
|
|
4245
4245
|
|
|
4246
4246
|
let formData = req.body
|
|
4247
|
+
console.log("req.files", req.files)
|
|
4247
4248
|
for(let key in req.files) {
|
|
4248
4249
|
let file = req.files[key]
|
|
4250
|
+
console.log({ key, file })
|
|
4249
4251
|
formData[file.fieldname] = file.buffer
|
|
4250
4252
|
}
|
|
4251
4253
|
console.log({ formData })
|
|
@@ -38,6 +38,7 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
38
38
|
</div>
|
|
39
39
|
</div>`
|
|
40
40
|
}
|
|
41
|
+
let meta_class = ((copy || move) ? 'hidden' : '')
|
|
41
42
|
let result = await Swal.fire({
|
|
42
43
|
title: title_label,
|
|
43
44
|
html: `<div class='filepond-wrapper'>
|
|
@@ -46,11 +47,11 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
46
47
|
</div>
|
|
47
48
|
<div class='folder-rows'>
|
|
48
49
|
${folderpath_html}
|
|
49
|
-
<div class='folder-row'>
|
|
50
|
+
<div class='folder-row ${meta_class}'>
|
|
50
51
|
<label for='new-folder-title'>Title</label>
|
|
51
52
|
<input id="new-folder-title" class="swal2-input" placeholder="Folder Name" value="${title}" />
|
|
52
53
|
</div>
|
|
53
|
-
<div class='folder-row'>
|
|
54
|
+
<div class='folder-row ${meta_class}'>
|
|
54
55
|
<label for='new-folder-description'>Description</label>
|
|
55
56
|
<textarea id="new-folder-description" class="swal2-input" placeholder="Folder Description">${description}</textarea>
|
|
56
57
|
</div>
|
|
@@ -87,13 +88,15 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
87
88
|
allowImageEdit: true,
|
|
88
89
|
allowImageTransform: true,
|
|
89
90
|
|
|
91
|
+
credits: false,
|
|
92
|
+
|
|
90
93
|
|
|
91
94
|
labelIdle: `Drag & Drop your picture or <span class="filepond--label-action">Browse</span>`,
|
|
92
|
-
imagePreviewHeight: 170,
|
|
95
|
+
// imagePreviewHeight: 170,
|
|
93
96
|
imageCropAspectRatio: '1:1',
|
|
94
97
|
imageResizeTargetWidth: 200,
|
|
95
98
|
imageResizeTargetHeight: 200,
|
|
96
|
-
stylePanelLayout: 'compact circle',
|
|
99
|
+
// stylePanelLayout: 'compact circle',
|
|
97
100
|
instantUpload: false,
|
|
98
101
|
server: {
|
|
99
102
|
// process: {
|
|
@@ -101,7 +104,8 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
101
104
|
process: async (fieldName, file, metadata, load, error, progress, abort) => {
|
|
102
105
|
const formData = new FormData();
|
|
103
106
|
|
|
104
|
-
console.log("upload", { dirty })
|
|
107
|
+
console.log("upload", { dirty, file })
|
|
108
|
+
formData.append('avatar', file)
|
|
105
109
|
if (dirty) {
|
|
106
110
|
formData.append("icon_dirty", true)
|
|
107
111
|
}
|
|
@@ -120,6 +124,7 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
120
124
|
path = old_path
|
|
121
125
|
formData.append("new_path", old_path)
|
|
122
126
|
}
|
|
127
|
+
debugger
|
|
123
128
|
if (mode === "copy") {
|
|
124
129
|
formData.append("copy", true)
|
|
125
130
|
} else if (mode === "move") {
|
|
@@ -157,6 +162,7 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
157
162
|
},
|
|
158
163
|
onaddfile(error, file) {
|
|
159
164
|
console.log({ file, initial_file })
|
|
165
|
+
debugger
|
|
160
166
|
if (initial_file) {
|
|
161
167
|
compare(initial_file.file, file.file).then((same) => {
|
|
162
168
|
if (same) {
|
|
@@ -176,16 +182,17 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
176
182
|
},
|
|
177
183
|
// onprocessfile(error, file) {
|
|
178
184
|
// console.log("onprocessfile")
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
// debugger
|
|
186
|
+
//// if (error) {
|
|
187
|
+
//// alert(error.body)
|
|
188
|
+
//// } else {
|
|
189
|
+
//// Swal.close()
|
|
190
|
+
//// if (new_path) {
|
|
191
|
+
//// location.href = redirect(new_path)
|
|
192
|
+
//// } else {
|
|
193
|
+
//// location.href = location.href
|
|
194
|
+
//// }
|
|
195
|
+
//// }
|
|
189
196
|
// },
|
|
190
197
|
files: [
|
|
191
198
|
{
|
package/server/views/app.ejs
CHANGED
|
@@ -303,7 +303,7 @@ body.dark .app-info-card > * {
|
|
|
303
303
|
color: var(--dark-color);
|
|
304
304
|
}
|
|
305
305
|
.app-info-title {
|
|
306
|
-
padding:
|
|
306
|
+
padding: 15px 0;
|
|
307
307
|
}
|
|
308
308
|
.footer {
|
|
309
309
|
/*
|
|
@@ -792,22 +792,24 @@ body.dark .appcanvas {
|
|
|
792
792
|
<i class='fa-solid fa-bolt'></i> Initialize
|
|
793
793
|
</div>
|
|
794
794
|
</a>
|
|
795
|
+
<!--
|
|
795
796
|
<a class='btn header-item frame-link' href="/prototype?type=extension&path=<%=path%>">
|
|
796
797
|
<div class='tab'>
|
|
797
798
|
<i class='fa-solid fa-puzzle-piece'></i> Extensions
|
|
798
799
|
</div>
|
|
799
800
|
</a>
|
|
801
|
+
-->
|
|
800
802
|
<div class='btn header-item frame-link' id='edit'>
|
|
801
|
-
<div class='tab'><i class="fa-solid fa-pencil"></i> Edit
|
|
803
|
+
<div class='tab'><i class="fa-solid fa-pencil"></i> Edit</div>
|
|
802
804
|
</div>
|
|
803
805
|
<div class='btn header-item frame-link' id='move'>
|
|
804
|
-
<div class='tab'><i class="fa-solid fa-right-to-bracket"></i> Move
|
|
806
|
+
<div class='tab'><i class="fa-solid fa-right-to-bracket"></i> Move</div>
|
|
805
807
|
</div>
|
|
806
808
|
<div class='btn header-item frame-link' id='copy'>
|
|
807
|
-
<div class='tab'><i class="fa-solid fa-copy"></i> Copy
|
|
809
|
+
<div class='tab'><i class="fa-solid fa-copy"></i> Copy</div>
|
|
808
810
|
</div>
|
|
809
811
|
<div class='btn header-item frame-link' id='delete' data-name="<%=name%>">
|
|
810
|
-
<div class='tab'><i class="fa-solid fa-trash-can"></i> Delete
|
|
812
|
+
<div class='tab'><i class="fa-solid fa-trash-can"></i> Delete</div>
|
|
811
813
|
</div>
|
|
812
814
|
</div>
|
|
813
815
|
</div>
|
|
@@ -1473,7 +1475,7 @@ body.dark .appcanvas {
|
|
|
1473
1475
|
move: true,
|
|
1474
1476
|
edit: true,
|
|
1475
1477
|
redirect: (new_path) => {
|
|
1476
|
-
return new_path
|
|
1478
|
+
return "./" + new_path
|
|
1477
1479
|
}
|
|
1478
1480
|
})
|
|
1479
1481
|
})
|
|
@@ -1488,7 +1490,7 @@ body.dark .appcanvas {
|
|
|
1488
1490
|
iconpath: `<%=config.iconpath%>`,
|
|
1489
1491
|
edit: true,
|
|
1490
1492
|
redirect: (new_path) => {
|
|
1491
|
-
return new_path
|
|
1493
|
+
return "./" + new_path
|
|
1492
1494
|
}
|
|
1493
1495
|
})
|
|
1494
1496
|
})
|
|
@@ -1504,7 +1506,7 @@ body.dark .appcanvas {
|
|
|
1504
1506
|
copy: true,
|
|
1505
1507
|
edit: true,
|
|
1506
1508
|
redirect: (new_path) => {
|
|
1507
|
-
return new_path
|
|
1509
|
+
return "./" + new_path
|
|
1508
1510
|
}
|
|
1509
1511
|
})
|
|
1510
1512
|
/*
|