pinokiod 3.8.75 → 3.8.77
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/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -2623,7 +2623,8 @@ class Server {
|
|
|
2623
2623
|
}))
|
|
2624
2624
|
this.app.get("/network", ex(async (req, res) => {
|
|
2625
2625
|
let list = []
|
|
2626
|
-
let peers_info =
|
|
2626
|
+
let peers_info = this.kernel.peer.info
|
|
2627
|
+
// let peers_info = await this.kernel.peer.refresh()
|
|
2627
2628
|
console.log({ peers_info })
|
|
2628
2629
|
let info = this.kernel.router.info()
|
|
2629
2630
|
console.log("33 info", info)
|
|
@@ -2634,8 +2635,8 @@ class Server {
|
|
|
2634
2635
|
try {
|
|
2635
2636
|
let procs = this.kernel.peer.info[host].proc
|
|
2636
2637
|
let router = this.kernel.peer.info[host].router
|
|
2638
|
+
console.log({ router })
|
|
2637
2639
|
let port_mapping = this.kernel.peer.info[host].port_mapping
|
|
2638
|
-
console.log("&&", { procs })
|
|
2639
2640
|
for(let proc of procs) {
|
|
2640
2641
|
let internal_port = proc.ip.split(":")[1]
|
|
2641
2642
|
let external_port = port_mapping[internal_port]
|
|
@@ -2646,11 +2647,15 @@ class Server {
|
|
|
2646
2647
|
//proxy: this.kernel.caddy.mapping[item.ip] || [],
|
|
2647
2648
|
router: router[external_ip] || [],
|
|
2648
2649
|
external_ip,
|
|
2650
|
+
external_port: parseInt(external_port),
|
|
2651
|
+
internal_port: parseInt(internal_port),
|
|
2649
2652
|
...proc
|
|
2650
2653
|
})
|
|
2651
2654
|
} else {
|
|
2652
2655
|
processes.push({
|
|
2653
2656
|
router: [],
|
|
2657
|
+
external_port: parseInt(external_port),
|
|
2658
|
+
internal_port: parseInt(internal_port),
|
|
2654
2659
|
...proc
|
|
2655
2660
|
})
|
|
2656
2661
|
}
|
|
@@ -2658,6 +2663,9 @@ class Server {
|
|
|
2658
2663
|
} catch (e) {
|
|
2659
2664
|
console.log(">>e", e)
|
|
2660
2665
|
}
|
|
2666
|
+
processes.sort((a, b) => {
|
|
2667
|
+
return b.external_port-a.external_port
|
|
2668
|
+
})
|
|
2661
2669
|
list.push({
|
|
2662
2670
|
host,
|
|
2663
2671
|
name: this.kernel.peer.info[host].name,
|
|
@@ -2782,8 +2790,6 @@ class Server {
|
|
|
2782
2790
|
}
|
|
2783
2791
|
}
|
|
2784
2792
|
|
|
2785
|
-
console.log("network", JSON.stringify(list, null, 2))
|
|
2786
|
-
|
|
2787
2793
|
res.render("network", {
|
|
2788
2794
|
ip: this.kernel.peer.current_ip,
|
|
2789
2795
|
peers,
|
package/server/views/index.ejs
CHANGED
|
@@ -228,7 +228,7 @@ body.dark .browser-options-row {
|
|
|
228
228
|
<!--
|
|
229
229
|
<a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
|
|
230
230
|
-->
|
|
231
|
-
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>
|
|
231
|
+
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
232
232
|
<a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
233
233
|
<% if (agent === "electron") { %>
|
|
234
234
|
<a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
|
package/server/views/network.ejs
CHANGED
|
@@ -159,12 +159,21 @@ body.dark .browser-options-row {
|
|
|
159
159
|
text-align: center;
|
|
160
160
|
text-transform: capitalize;
|
|
161
161
|
}
|
|
162
|
-
.header-label-sub {
|
|
162
|
+
.header-label-sub h1 {
|
|
163
163
|
font-size: 25px;
|
|
164
164
|
letter-spacing: -1px;
|
|
165
|
-
padding: 0 10px 10px;
|
|
166
165
|
font-weight: bold;
|
|
167
166
|
}
|
|
167
|
+
.header-label-sub {
|
|
168
|
+
text-align: center;
|
|
169
|
+
font-size: 14px;
|
|
170
|
+
padding: 10px;
|
|
171
|
+
border-bottom: 1px solid rgba(0,0,0,0.1);
|
|
172
|
+
}
|
|
173
|
+
.header-label-sub .s {
|
|
174
|
+
padding: 10px 0;
|
|
175
|
+
opacity: 0.7;
|
|
176
|
+
}
|
|
168
177
|
.header-container {
|
|
169
178
|
margin: 10px;
|
|
170
179
|
background: rgba(0, 0, 100, 0.04);
|
|
@@ -172,6 +181,7 @@ body.dark .browser-options-row {
|
|
|
172
181
|
box-sizing: border-box;
|
|
173
182
|
}
|
|
174
183
|
.container {
|
|
184
|
+
margin-top: 20px;
|
|
175
185
|
display: grid;
|
|
176
186
|
grid-template-columns: repeat(<%=list.length%>, 1fr);
|
|
177
187
|
}
|
|
@@ -179,9 +189,8 @@ body.dark .browser-options-row {
|
|
|
179
189
|
background: rgba(255, 255, 255, 0.04);
|
|
180
190
|
}
|
|
181
191
|
.container-row {
|
|
182
|
-
margin: 10px;
|
|
183
192
|
background: rgba(0, 0, 100, 0.04);
|
|
184
|
-
padding:
|
|
193
|
+
padding: 15px 30px;
|
|
185
194
|
box-sizing: border-box;
|
|
186
195
|
}
|
|
187
196
|
.desc {
|
|
@@ -190,6 +199,7 @@ body.dark .browser-options-row {
|
|
|
190
199
|
}
|
|
191
200
|
.container-row table {
|
|
192
201
|
width: 100%;
|
|
202
|
+
margin-top: 20px;
|
|
193
203
|
}
|
|
194
204
|
table a {
|
|
195
205
|
text-decoration: none;
|
|
@@ -201,13 +211,14 @@ td:first-child, th:first-child {
|
|
|
201
211
|
.container-row th {
|
|
202
212
|
text-align: left;
|
|
203
213
|
font-size: 18px;
|
|
204
|
-
padding:
|
|
214
|
+
padding: 2px;
|
|
205
215
|
text-transform: uppercase;
|
|
206
216
|
}
|
|
207
217
|
.container-row td.title {
|
|
208
218
|
overflow-wrap: break-word;
|
|
209
219
|
}
|
|
210
220
|
.container-row td {
|
|
221
|
+
vertical-align: top;
|
|
211
222
|
font-size: 14px;
|
|
212
223
|
padding: 2px;
|
|
213
224
|
}
|
|
@@ -233,6 +244,7 @@ td:first-child, th:first-child {
|
|
|
233
244
|
<a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
|
|
234
245
|
<div class='flexible'></div>
|
|
235
246
|
<div class='nav-btns'>
|
|
247
|
+
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
236
248
|
<a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-face-smile-beam"></i></div><div>Community</div></a>
|
|
237
249
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Debug</div></button>
|
|
238
250
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -242,7 +254,7 @@ td:first-child, th:first-child {
|
|
|
242
254
|
</h1>
|
|
243
255
|
</header>
|
|
244
256
|
<main>
|
|
245
|
-
<div class='header-label'><i class='fa-solid fa-wifi'></i>
|
|
257
|
+
<div class='header-label'><i class='fa-solid fa-wifi'></i> Network</div>
|
|
246
258
|
<div class='desc'>Serve Pinokio, installed apps, and even external apps to any device on the same network.</div>
|
|
247
259
|
<!--
|
|
248
260
|
<div class='header-container'>
|
|
@@ -255,12 +267,23 @@ td:first-child, th:first-child {
|
|
|
255
267
|
</div>
|
|
256
268
|
-->
|
|
257
269
|
<div class='container'>
|
|
258
|
-
<%
|
|
270
|
+
<% let brands = { win32: "windows", darwin: "apple", linux: "Linux" } %>
|
|
271
|
+
<% list.forEach(({ host, name, platform, processes }, index) => { %>
|
|
259
272
|
<div class='container-row'>
|
|
260
273
|
<!--
|
|
261
274
|
<div class='header-label-sub'><i class="fa-solid fa-microchip"></i> System</div>
|
|
262
275
|
-->
|
|
263
|
-
|
|
276
|
+
<% if (index === 0) { %>
|
|
277
|
+
<div class='header-label-sub'>
|
|
278
|
+
<h1><i class="fa-solid fa-podcast"></i> <%=name%></h1>
|
|
279
|
+
<div class='s'><i class="fa-brands fa-<%=brands[platform]%>"></i> <%=platform%> <%=host%> (this machine)</div>
|
|
280
|
+
</div>
|
|
281
|
+
<% } else { %>
|
|
282
|
+
<div class='header-label-sub'>
|
|
283
|
+
<h1><i class="fa-solid fa-wifi"></i> <%=name%></h1>
|
|
284
|
+
<div class='s'><i class="fa-brands fa-<%=brands[platform]%>"></i> <%=platform%> <%=host%> (remote)</div>
|
|
285
|
+
</div>
|
|
286
|
+
<% } %>
|
|
264
287
|
<table>
|
|
265
288
|
<tr>
|
|
266
289
|
<th>Server</th>
|
|
@@ -196,7 +196,7 @@ body.dark .browser-options-row {
|
|
|
196
196
|
<input type='search' class="flexible" placeholder='Filter downloaded apps'>
|
|
197
197
|
</form>
|
|
198
198
|
<div class='nav-btns'>
|
|
199
|
-
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>
|
|
199
|
+
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
200
200
|
<a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
201
201
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Debug</div></button>
|
|
202
202
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -239,6 +239,7 @@ hr {
|
|
|
239
239
|
<% }) %>
|
|
240
240
|
<div class='flexible'></div>
|
|
241
241
|
<div class='nav-btns'>
|
|
242
|
+
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
242
243
|
<a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
243
244
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Debug</div></button>
|
|
244
245
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|