pinokiod 1.1.50 → 1.1.52
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/proxy/index.js +3 -1
- package/package.json +3 -2
- package/server/index.js +14 -4
- package/server/public/style.css +21 -0
- package/server/views/browser.ejs +13 -49
- package/server/views/index.ejs +19 -0
- package/server/views/settings.ejs +22 -5
|
@@ -21,9 +21,11 @@ class P {
|
|
|
21
21
|
let { name, uri, ...o } = req.params
|
|
22
22
|
console.log("proxy.start", { name, uri, o })
|
|
23
23
|
let response = await kernel.api.startProxy(req.parent.path, req.params.uri, req.params.name, o)
|
|
24
|
+
|
|
24
25
|
ondata({
|
|
25
|
-
raw:
|
|
26
|
+
raw: `Proxy Started ${JSON.stringify(response)}\r\n`
|
|
26
27
|
})
|
|
28
|
+
|
|
27
29
|
return response
|
|
28
30
|
}
|
|
29
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinokiod",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.52",
|
|
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.8",
|
|
41
41
|
"marked": "^5.0.1",
|
|
42
42
|
"mime-types": "^2.1.35",
|
|
43
43
|
"multer": "^1.4.5-lts.1",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"open": "8.4.2",
|
|
48
48
|
"pdrive": "^0.0.23",
|
|
49
49
|
"portfinder": "^1.0.32",
|
|
50
|
+
"qrcode": "^1.5.3",
|
|
50
51
|
"random-useragent": "^0.5.0",
|
|
51
52
|
"rimraf": "^5.0.0",
|
|
52
53
|
"sanitize-filename": "^1.6.3",
|
package/server/index.js
CHANGED
|
@@ -14,6 +14,8 @@ const os = require('os')
|
|
|
14
14
|
const { fork } = require('child_process');
|
|
15
15
|
const semver = require('semver')
|
|
16
16
|
const fse = require('fs-extra')
|
|
17
|
+
const QRCode = require('qrcode')
|
|
18
|
+
|
|
17
19
|
|
|
18
20
|
const git = require('isomorphic-git')
|
|
19
21
|
const http = require('isomorphic-git/http/node')
|
|
@@ -349,8 +351,8 @@ class Server {
|
|
|
349
351
|
let configArray = [{
|
|
350
352
|
key: "home",
|
|
351
353
|
description: [
|
|
352
|
-
"*
|
|
353
|
-
"*
|
|
354
|
+
"* NO white spaces (' ')",
|
|
355
|
+
"* NO exFAT drives",
|
|
354
356
|
],
|
|
355
357
|
val: this.kernel.homedir,
|
|
356
358
|
placeholder: "Enter the absolute path to use as your Pinokio home folder (D:\\pinokio, /Users/alice/pinokiofs, etc.)"
|
|
@@ -1011,8 +1013,16 @@ class Server {
|
|
|
1011
1013
|
|
|
1012
1014
|
let pinokio_proxy = this.kernel.api.proxies["/"]
|
|
1013
1015
|
|
|
1016
|
+
console.log("pinokio_proxy", pinokio_proxy)
|
|
1017
|
+
let qr = null
|
|
1018
|
+
if (pinokio_proxy && pinokio_proxy.length > 0) {
|
|
1019
|
+
qr = await QRCode.toDataURL(pinokio_proxy[0].proxy)
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
|
|
1014
1023
|
res.render("index", {
|
|
1015
1024
|
proxy: pinokio_proxy[0],
|
|
1025
|
+
qr,
|
|
1016
1026
|
error: error,
|
|
1017
1027
|
logo: this.logo,
|
|
1018
1028
|
// memory: mem,
|
|
@@ -1690,8 +1700,8 @@ class Server {
|
|
|
1690
1700
|
let configArray = [{
|
|
1691
1701
|
key: "home",
|
|
1692
1702
|
description: [
|
|
1693
|
-
"*
|
|
1694
|
-
"*
|
|
1703
|
+
"* NO white spaces (' ')",
|
|
1704
|
+
"* NO exFAT drives",
|
|
1695
1705
|
],
|
|
1696
1706
|
val: this.kernel.homedir ? this.kernel.homedir : path.resolve(os.homedir(), "pinokio"),
|
|
1697
1707
|
placeholder: "Enter the absolute path to use as your Pinokio home folder (D:\\pinokio, /Users/alice/pinokiofs, etc.)"
|
package/server/public/style.css
CHANGED
|
@@ -81,6 +81,27 @@ footer .toggle-expand {
|
|
|
81
81
|
footer pre {
|
|
82
82
|
background: none !important;
|
|
83
83
|
}
|
|
84
|
+
.swal2-popup.min-popup a {
|
|
85
|
+
outline: none;
|
|
86
|
+
}
|
|
87
|
+
.swal2-popup.min-popup img {
|
|
88
|
+
margin: 10px 0;
|
|
89
|
+
}
|
|
90
|
+
.swal2-popup.min-popup {
|
|
91
|
+
width: 300px;
|
|
92
|
+
text-align: center !important;
|
|
93
|
+
padding: 30px 0 !important;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
.swal2-title.min-title {
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
text-align: center !important;
|
|
99
|
+
padding: 0 0 !important;
|
|
100
|
+
}
|
|
101
|
+
.min-modal {
|
|
102
|
+
text-align: center;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
}
|
|
84
105
|
.wait-modal {
|
|
85
106
|
padding: 20px;
|
|
86
107
|
text-align: center;
|
package/server/views/browser.ejs
CHANGED
|
@@ -922,7 +922,6 @@ const renderSelection = (e, force) => {
|
|
|
922
922
|
}
|
|
923
923
|
} else {
|
|
924
924
|
console.log("# 14")
|
|
925
|
-
// document.querySelector(".bar").classList.add("hidden")
|
|
926
925
|
document.querySelector(".container").classList.remove("active")
|
|
927
926
|
document.querySelector("aside").classList.add("active")
|
|
928
927
|
}
|
|
@@ -1051,7 +1050,8 @@ const addTab = async (url) => {
|
|
|
1051
1050
|
if (document.querySelector("#menu")) {
|
|
1052
1051
|
document.querySelector("#menu").addEventListener("click", async (e) => {
|
|
1053
1052
|
location.hash = ""
|
|
1054
|
-
|
|
1053
|
+
refresh()
|
|
1054
|
+
// renderSelection()
|
|
1055
1055
|
})
|
|
1056
1056
|
}
|
|
1057
1057
|
document.querySelector(".app-info").addEventListener("click", async (e) => {
|
|
@@ -1199,54 +1199,13 @@ document.querySelector("aside").addEventListener("click", async (e) => {
|
|
|
1199
1199
|
|
|
1200
1200
|
})
|
|
1201
1201
|
const refresh = async () => {
|
|
1202
|
+
console.log("REFRESH")
|
|
1202
1203
|
const html = await fetch("<%=sidebar%>").then((res) => {
|
|
1203
1204
|
return res.text()
|
|
1204
1205
|
})
|
|
1205
|
-
/*
|
|
1206
|
-
const res = await fetch("<%=sidebar%>").then((res) => {
|
|
1207
|
-
return res.json()
|
|
1208
|
-
})
|
|
1209
|
-
const html = res.config.menu.map((item, index) => {
|
|
1210
|
-
console.log("item", item)
|
|
1211
|
-
if (item.btn) {
|
|
1212
|
-
return `<a data-index="${index+1}" target="${item.src}" href="${item.href}" class='btn header-item selectable frame-link'>
|
|
1213
|
-
<div class='tab'>${item.btn}</div>
|
|
1214
|
-
${item.running ? "<i class='fa-solid fa-spin fa-circle-notch'></i>" : ""}
|
|
1215
|
-
</a>`
|
|
1216
|
-
} else if (item.label) {
|
|
1217
|
-
return ""
|
|
1218
|
-
}
|
|
1219
|
-
}).join("")
|
|
1220
|
-
console.log("refresh", html)
|
|
1221
|
-
*/
|
|
1222
1206
|
document.querySelector(".menu").innerHTML = html
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
// update the frames so the name matches the tab links
|
|
1226
|
-
|
|
1227
|
-
// 1. iterate through all the "h" menu items
|
|
1228
|
-
// 2. for each tab that starts with "h" (hard), iterate through all iframes
|
|
1229
|
-
// 3. to find a frame whose src.includes(item.href)
|
|
1230
|
-
// 4. update the frame's name to the target attribute
|
|
1231
|
-
|
|
1232
|
-
// let hardFrames = document.querySelectorAll(".browserview iframe[name^=h]")
|
|
1233
|
-
// for(let frame of hardFrames) {
|
|
1234
|
-
// frame.removeAttribute("name")
|
|
1235
|
-
// location.hash = ""
|
|
1236
|
-
// }
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
1207
|
location.hash = ""
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
//
|
|
1245
|
-
|
|
1246
1208
|
renderSelection()
|
|
1247
|
-
// cursorIndex = 0
|
|
1248
|
-
//renderCursor()
|
|
1249
|
-
|
|
1250
1209
|
}
|
|
1251
1210
|
window.addEventListener('message', (event) => {
|
|
1252
1211
|
console.log("Message received from the child: ", event.data); // Message received from child
|
|
@@ -1265,11 +1224,16 @@ window.addEventListener('message', (event) => {
|
|
|
1265
1224
|
document.querySelector("#location").value = url
|
|
1266
1225
|
}
|
|
1267
1226
|
} else if (event.data.type) {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1227
|
+
let asideHidden = (window.getComputedStyle(document.querySelector("aside")).display === "none")
|
|
1228
|
+
console.log("asideHidden", asideHidden)
|
|
1229
|
+
if (!asideHidden) {
|
|
1230
|
+
// refresh only if aside
|
|
1231
|
+
|
|
1232
|
+
if (event.data.type === 'disconnect') {
|
|
1233
|
+
refresh()
|
|
1234
|
+
} else {
|
|
1235
|
+
refresh()
|
|
1236
|
+
}
|
|
1273
1237
|
}
|
|
1274
1238
|
}
|
|
1275
1239
|
} else {
|
package/server/views/index.ejs
CHANGED
|
@@ -119,7 +119,10 @@ 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 id='wifi' data-proxy="<%=proxy.proxy%>" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>WiFi</div></a>
|
|
123
|
+
<!--
|
|
122
124
|
<a class='btn2' href="<%=proxy.proxy%>" target="_blank"><div><i class="fa-solid fa-wifi"></i></div><div>WiFi</div></a>
|
|
125
|
+
-->
|
|
123
126
|
<a class='btn2' id='report'><div><i class="fa-solid fa-bug"></i></div><div>Report Bug</div></a>
|
|
124
127
|
<a class='btn2' href='https://discord.gg/TQdNwadtE4' target="_blank"><div><i class="fa-brands fa-discord"></i></div><div>Discord</div></a>
|
|
125
128
|
<a class='btn2' href='https://twitter.com/cocktailpeanut' target="_blank"><div><i class="fa-brands fa-twitter"></i></div><div>Twitter</div></a>
|
|
@@ -618,6 +621,22 @@ document.addEventListener("click", (e) => {
|
|
|
618
621
|
target.closest(".line").classList.add("selected")
|
|
619
622
|
}
|
|
620
623
|
})
|
|
624
|
+
<% if (qr) { %>
|
|
625
|
+
document.querySelector("#wifi").addEventListener("click", async (e) => {
|
|
626
|
+
await Swal.fire({
|
|
627
|
+
title: "Wifi Sharing",
|
|
628
|
+
customClass: {
|
|
629
|
+
popup: "min-popup",
|
|
630
|
+
title: "min-title"
|
|
631
|
+
},
|
|
632
|
+
showConfirmButton: false,
|
|
633
|
+
html: `<div class='min-modal'>
|
|
634
|
+
<div><img src="<%=qr%>"></div>
|
|
635
|
+
<a href="<%=proxy.proxy%>" target="_blank"><%=proxy.proxy%></a>
|
|
636
|
+
</div>`
|
|
637
|
+
})
|
|
638
|
+
})
|
|
639
|
+
<% } %>
|
|
621
640
|
<% } %>
|
|
622
641
|
|
|
623
642
|
</script>
|
|
@@ -66,9 +66,10 @@
|
|
|
66
66
|
padding: 20px 0;
|
|
67
67
|
}
|
|
68
68
|
.titleview h1 {
|
|
69
|
+
word-break: break-word;
|
|
69
70
|
font-size: 40px;
|
|
70
71
|
text-transform: uppercase;
|
|
71
|
-
letter-spacing:
|
|
72
|
+
letter-spacing: -1px;
|
|
72
73
|
}
|
|
73
74
|
.item > .d {
|
|
74
75
|
padding-bottom: 10px;
|
|
@@ -84,11 +85,11 @@
|
|
|
84
85
|
padding-bottom: 5px;
|
|
85
86
|
}
|
|
86
87
|
.item .explanation {
|
|
87
|
-
white-space: pre;
|
|
88
88
|
padding-top: 5px;
|
|
89
89
|
color: brown;
|
|
90
|
-
font-size:
|
|
90
|
+
font-size: 12px;
|
|
91
91
|
font-weight: bold;
|
|
92
|
+
font-family: verdana;
|
|
92
93
|
}
|
|
93
94
|
body.dark .item input[type=text] {
|
|
94
95
|
background: rgba(255,255,255,0.1);
|
|
@@ -106,6 +107,10 @@ body.dark .item select {
|
|
|
106
107
|
width: 100%;
|
|
107
108
|
}
|
|
108
109
|
.item select {
|
|
110
|
+
-webkit-appearance: none;
|
|
111
|
+
-moz-appearance: none;
|
|
112
|
+
appearance: none;
|
|
113
|
+
|
|
109
114
|
background: rgba(0,0,0,0.05);
|
|
110
115
|
padding: 10px;
|
|
111
116
|
box-sizing: border-box;
|
|
@@ -174,6 +179,18 @@ hr {
|
|
|
174
179
|
height: 1px;
|
|
175
180
|
border: none;
|
|
176
181
|
}
|
|
182
|
+
.reset-cache-loading {
|
|
183
|
+
padding: 10px;
|
|
184
|
+
background: rgba(0,0,0,0.1);
|
|
185
|
+
margin-bottom: 10px;
|
|
186
|
+
text-align: center;
|
|
187
|
+
}
|
|
188
|
+
.reset-bin-loading {
|
|
189
|
+
padding: 10px;
|
|
190
|
+
background: rgba(0,0,0,0.1);
|
|
191
|
+
margin-bottom: 10px;
|
|
192
|
+
text-align: center;
|
|
193
|
+
}
|
|
177
194
|
</style>
|
|
178
195
|
<script src="/hotkeys.min.js"></script>
|
|
179
196
|
<script src="/sweetalert2.js"></script>
|
|
@@ -318,7 +335,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
318
335
|
<% if (locals.bin) { %>
|
|
319
336
|
document.querySelector("#del-bin").addEventListener("click", async (e) => {
|
|
320
337
|
console.log("del-bin")
|
|
321
|
-
let
|
|
338
|
+
let proceed = confirm("Are you sure you wish to delete the bin folder?")
|
|
322
339
|
if (proceed) {
|
|
323
340
|
document.querySelector(".reset-bin-loading").classList.remove("hidden")
|
|
324
341
|
document.querySelector("#del-bin").classList.add("hidden")
|
|
@@ -342,7 +359,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
342
359
|
})
|
|
343
360
|
document.querySelector("#del-cache").addEventListener("click", async (e) => {
|
|
344
361
|
console.log("del-cache")
|
|
345
|
-
let
|
|
362
|
+
let proceed = confirm("Are you sure you wish to delete the cache folder?")
|
|
346
363
|
if (proceed) {
|
|
347
364
|
document.querySelector(".reset-cache-loading").classList.remove("hidden")
|
|
348
365
|
document.querySelector("#del-cache").classList.add("hidden")
|