pinokiod 1.1.50 → 1.1.51
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 +2 -1
- package/server/index.js +10 -0
- package/server/public/style.css +21 -0
- package/server/views/index.ejs +19 -0
|
@@ -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.51",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -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')
|
|
@@ -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,
|
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/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>
|