pinokiod 1.2.73 → 1.3.1
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 +1 -1
- package/kernel/api/index.js +2 -0
- package/kernel/bin/registry.js +3 -0
- package/kernel/index.js +25 -22
- package/package.json +2 -2
- package/server/index.js +6 -2
- package/server/public/style.css +26 -7
package/kernel/api/fs/index.js
CHANGED
|
@@ -507,7 +507,7 @@ class FS {
|
|
|
507
507
|
ondata({ raw: "\r\nURIs:\r\n" + JSON.stringify(url, null, 2).replace(/\n/g, "\r\n") })
|
|
508
508
|
for(let i=0; i<url.length; i++) {
|
|
509
509
|
let u = url[i]
|
|
510
|
-
ondata({ raw:
|
|
510
|
+
ondata({ raw: `\r\n[${i+1}/${url.length}] Downloading ${u}\r\n` })
|
|
511
511
|
req.params.url = u
|
|
512
512
|
await this.downloadOne(req, ondata, kernel)
|
|
513
513
|
}
|
package/kernel/api/index.js
CHANGED
package/kernel/bin/registry.js
CHANGED
|
@@ -5,9 +5,12 @@ class Registry {
|
|
|
5
5
|
message: "reg query HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem /v LongPathsEnabled",
|
|
6
6
|
}, (stream) => {
|
|
7
7
|
})
|
|
8
|
+
console.log("registry check", { res })
|
|
8
9
|
let matches = /(LongPathsEnabled.+)[\r\n]+/.exec(res.response)
|
|
10
|
+
console.log("matches", matches)
|
|
9
11
|
if (matches && matches.length > 0) {
|
|
10
12
|
let chunks = matches[1].split(/\s+/)
|
|
13
|
+
console.log("chunks", chunks)
|
|
11
14
|
if (chunks.length === 3) {
|
|
12
15
|
if (Number(chunks[2]) === 1) {
|
|
13
16
|
return true
|
package/kernel/index.js
CHANGED
|
@@ -119,6 +119,7 @@ class Kernel {
|
|
|
119
119
|
async clearLog(group) {
|
|
120
120
|
let relativePath = path.relative(this.homedir, group)
|
|
121
121
|
for(let type of ["info", "buf", "cleaned"]) {
|
|
122
|
+
//for(let type of ["info", "cleaned"]) {
|
|
122
123
|
let logPath = path.resolve(this.homedir, "logs", "shell", type, relativePath)
|
|
123
124
|
let logFolder = path.dirname(logPath)
|
|
124
125
|
let filename = path.basename(logPath)
|
|
@@ -142,16 +143,18 @@ class Kernel {
|
|
|
142
143
|
let relativePath = path.relative(this.homedir, group)
|
|
143
144
|
|
|
144
145
|
if (!path.isAbsolute(relativePath)) {
|
|
145
|
-
for(let type of ["info", "buf", "cleaned"]) {
|
|
146
|
-
|
|
146
|
+
//for(let type of ["info", "buf", "cleaned"]) {
|
|
147
|
+
for(let type of ["info", "cleaned"]) {
|
|
148
|
+
let logPath = path.resolve(this.homedir, "logs", "shell", type, relativePath + "." + info.index + ".txt")
|
|
147
149
|
let logFolder = path.dirname(logPath)
|
|
148
150
|
await fs.promises.mkdir(logFolder, { recursive: true }).catch((e) => { })
|
|
149
151
|
await fs.promises.appendFile(logPath, data[type])
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
154
|
} else {
|
|
153
|
-
for(let type of ["info", "buf", "cleaned"]) {
|
|
154
|
-
|
|
155
|
+
//for(let type of ["info", "buf", "cleaned"]) {
|
|
156
|
+
for(let type of ["info", "cleaned"]) {
|
|
157
|
+
let logPath = path.resolve(this.homedir, "logs", "shell", type, "index.txt")
|
|
155
158
|
let logFolder = path.dirname(logPath)
|
|
156
159
|
await fs.promises.mkdir(logFolder, { recursive: true }).catch((e) => { })
|
|
157
160
|
await fs.promises.appendFile(logPath, data[type])
|
|
@@ -251,9 +254,9 @@ class Kernel {
|
|
|
251
254
|
await this.api.init()
|
|
252
255
|
|
|
253
256
|
|
|
254
|
-
|
|
255
|
-
await
|
|
256
|
-
let info =
|
|
257
|
+
this.sys = new Sysinfo()
|
|
258
|
+
await this.sys.init(this)
|
|
259
|
+
let info = this.sys.info
|
|
257
260
|
await fs.promises.mkdir(this.path("logs"), { recursive: true }).catch((e) => { })
|
|
258
261
|
await fs.promises.writeFile(this.path("logs/system.json"), JSON.stringify({
|
|
259
262
|
platform: this.platform,
|
|
@@ -270,24 +273,12 @@ class Kernel {
|
|
|
270
273
|
arch: this.arch,
|
|
271
274
|
...info
|
|
272
275
|
})
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this.sysinfo_interval = setInterval(async () => {
|
|
277
|
-
try {
|
|
278
|
-
await sysinfo.refresh()
|
|
279
|
-
let info = sysinfo.info
|
|
280
|
-
this.template.update(info)
|
|
281
|
-
this.sysinfo = info
|
|
282
|
-
} catch (e) {
|
|
283
|
-
console.log("sysinfo error", e)
|
|
284
|
-
}
|
|
285
|
-
}, 10000) // update every 10 seconds
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
await this.update_sysinfo()
|
|
286
279
|
|
|
287
280
|
// await this.template.init()
|
|
288
281
|
|
|
289
|
-
this.gpu = info.gpu
|
|
290
|
-
this.gpus = info.gpus
|
|
291
282
|
|
|
292
283
|
// let PuppeteerPath = this.bin.path("puppet", "node_modules", "puppeteer")
|
|
293
284
|
// this.puppet = (await this.loader.load(PuppeteerPath)).resolved
|
|
@@ -299,6 +290,18 @@ class Kernel {
|
|
|
299
290
|
console.log("### ERROR", e)
|
|
300
291
|
}
|
|
301
292
|
}
|
|
293
|
+
async update_sysinfo() {
|
|
294
|
+
try {
|
|
295
|
+
await this.sys.refresh()
|
|
296
|
+
let info = this.sys.info
|
|
297
|
+
this.template.update(info)
|
|
298
|
+
this.sysinfo = info
|
|
299
|
+
this.gpu = info.gpu
|
|
300
|
+
this.gpus = info.gpus
|
|
301
|
+
} catch (e) {
|
|
302
|
+
console.log("sysinfo error", e)
|
|
303
|
+
}
|
|
304
|
+
}
|
|
302
305
|
async exec(params, ondata) {
|
|
303
306
|
// params.path = this.path()
|
|
304
307
|
// if (this.client) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinokiod",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"jsonpath-plus": "^7.2.0",
|
|
38
38
|
"key-store": "^1.2.0",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
40
|
-
"lproxy": "^0.0.
|
|
40
|
+
"lproxy": "^0.0.9",
|
|
41
41
|
"marked": "^5.0.1",
|
|
42
42
|
"mime-types": "^2.1.35",
|
|
43
43
|
"multer": "^1.4.5-lts.1",
|
package/server/index.js
CHANGED
|
@@ -328,6 +328,8 @@ class Server {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
console.log({ type: 1, requirements })
|
|
332
|
+
|
|
331
333
|
let error = null
|
|
332
334
|
try {
|
|
333
335
|
this.compatible()
|
|
@@ -674,6 +676,9 @@ class Server {
|
|
|
674
676
|
return r.relevant
|
|
675
677
|
})
|
|
676
678
|
|
|
679
|
+
console.log({ type: 2, requirements })
|
|
680
|
+
|
|
681
|
+
|
|
677
682
|
let mem = this.getMemory(filepath)
|
|
678
683
|
// let localMem = this.kernel.memory.local[filepath]
|
|
679
684
|
// let globalMem = this.kernel.memory.global[filepath]
|
|
@@ -1125,8 +1130,6 @@ class Server {
|
|
|
1125
1130
|
for(let i=0; i<config.menu.length; i++) {
|
|
1126
1131
|
let menuitem = config.menu[i]
|
|
1127
1132
|
|
|
1128
|
-
console.log({ menuitem })
|
|
1129
|
-
|
|
1130
1133
|
if (menuitem.menu) {
|
|
1131
1134
|
let m = await this.renderMenu(uri, name, { menu: menuitem.menu }, pathComponents)
|
|
1132
1135
|
menuitem.menu = m.menu
|
|
@@ -1406,6 +1409,7 @@ class Server {
|
|
|
1406
1409
|
if (mod.installed) {
|
|
1407
1410
|
installed = await mod.installed()
|
|
1408
1411
|
}
|
|
1412
|
+
console.log("_installed", { name, type, installed })
|
|
1409
1413
|
return installed
|
|
1410
1414
|
}
|
|
1411
1415
|
}
|
package/server/public/style.css
CHANGED
|
@@ -1111,7 +1111,8 @@ body.dark .swal2-popup {
|
|
|
1111
1111
|
color: var(--dark-btn-color);
|
|
1112
1112
|
}
|
|
1113
1113
|
.swal2-popup {
|
|
1114
|
-
border-radius:
|
|
1114
|
+
border-radius: 20px !important;
|
|
1115
|
+
box-sizing: border-box;
|
|
1115
1116
|
}
|
|
1116
1117
|
.swal2-html-container a {
|
|
1117
1118
|
text-decoration: none;
|
|
@@ -1121,15 +1122,27 @@ body.dark .swal2-popup {
|
|
|
1121
1122
|
text-align: center;
|
|
1122
1123
|
padding: 10px;
|
|
1123
1124
|
display: block;
|
|
1125
|
+
box-sizing: border-box;
|
|
1126
|
+
}
|
|
1127
|
+
body.dark .swal2-html-container .btn {
|
|
1128
|
+
background: white;
|
|
1129
|
+
color: black;
|
|
1130
|
+
}
|
|
1131
|
+
.swal2-html-container .btn {
|
|
1132
|
+
padding: 10px !important;
|
|
1133
|
+
font-weight: bold;
|
|
1124
1134
|
}
|
|
1125
1135
|
.swal2-html-container a.btn {
|
|
1126
1136
|
color: white;
|
|
1127
1137
|
display: inline-block;
|
|
1128
|
-
|
|
1138
|
+
box-sizing: border-box;
|
|
1129
1139
|
}
|
|
1130
1140
|
.swal2-html-container {
|
|
1131
1141
|
display: block !important;
|
|
1132
|
-
margin: 0px
|
|
1142
|
+
margin: 0px 15px !important;
|
|
1143
|
+
/*
|
|
1144
|
+
margin: 0 10px 10px !important;
|
|
1145
|
+
*/
|
|
1133
1146
|
}
|
|
1134
1147
|
.swal2-html-container .desc:empty {
|
|
1135
1148
|
display: none;
|
|
@@ -1137,9 +1150,11 @@ body.dark .swal2-popup {
|
|
|
1137
1150
|
.swal2-html-container .desc {
|
|
1138
1151
|
font-size: 14px;
|
|
1139
1152
|
text-align: left;
|
|
1140
|
-
padding: 10px;
|
|
1141
1153
|
box-sizing: border-box;
|
|
1142
1154
|
}
|
|
1155
|
+
.swal2-html-container .desc ol {
|
|
1156
|
+
padding-inline-start: 25px;
|
|
1157
|
+
}
|
|
1143
1158
|
.swal2-html-container .field {
|
|
1144
1159
|
font-size: 14px;
|
|
1145
1160
|
box-sizing: border-box;
|
|
@@ -1175,12 +1190,16 @@ body.dark .swal2-popup {
|
|
|
1175
1190
|
.swal2-title:empty {
|
|
1176
1191
|
display: none !important;
|
|
1177
1192
|
}
|
|
1193
|
+
body.dark .swal2-title {
|
|
1194
|
+
color: white !important;
|
|
1195
|
+
}
|
|
1178
1196
|
.swal2-title {
|
|
1197
|
+
color: black !important;
|
|
1179
1198
|
display: block !important;
|
|
1180
1199
|
text-align: left !important;
|
|
1181
1200
|
letter-spacing: -1px !important;
|
|
1182
1201
|
font-size: 30px !important;
|
|
1183
|
-
padding:
|
|
1202
|
+
padding: 15px !important;
|
|
1184
1203
|
/*
|
|
1185
1204
|
background: rgba(0,0,200,0.04);
|
|
1186
1205
|
*/
|
|
@@ -1195,7 +1214,7 @@ body.dark .swal2-popup {
|
|
|
1195
1214
|
*/
|
|
1196
1215
|
}
|
|
1197
1216
|
.swal2-modal {
|
|
1198
|
-
padding:
|
|
1217
|
+
padding: 10px !important;
|
|
1199
1218
|
/*
|
|
1200
1219
|
background: rgba(0,0,0,0.8) !important;
|
|
1201
1220
|
*/
|
|
@@ -1246,7 +1265,7 @@ body.dark .swal2-styled.swal2-confirm{
|
|
|
1246
1265
|
*/
|
|
1247
1266
|
}
|
|
1248
1267
|
.swal2-styled.swal2-confirm{
|
|
1249
|
-
background:
|
|
1268
|
+
background: black !important;
|
|
1250
1269
|
margin: 0;
|
|
1251
1270
|
font-weight: bold;
|
|
1252
1271
|
border: none;
|