pinokiod 3.8.76 → 3.8.78

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.8.76",
3
+ "version": "3.8.78",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -2623,56 +2623,59 @@ class Server {
2623
2623
  }))
2624
2624
  this.app.get("/network", ex(async (req, res) => {
2625
2625
  let list = []
2626
- let peers_info = this.kernel.peer.info
2627
2626
  // let peers_info = await this.kernel.peer.refresh()
2628
- console.log({ peers_info })
2629
- let info = this.kernel.router.info()
2630
- console.log("33 info", info)
2631
- let remote_peers = Object.keys(this.kernel.peer.info).filter(x => x !== this.kernel.peer.host)
2632
- let nodes = [this.kernel.peer.host].concat(remote_peers)
2633
- for(let host of nodes) {
2634
- let processes = []
2635
- try {
2636
- let procs = this.kernel.peer.info[host].proc
2637
- let router = this.kernel.peer.info[host].router
2638
- console.log({ router })
2639
- let port_mapping = this.kernel.peer.info[host].port_mapping
2640
- for(let proc of procs) {
2641
- let internal_port = proc.ip.split(":")[1]
2642
- let external_port = port_mapping[internal_port]
2643
- if (external_port) {
2644
- let external_ip = `${host}:${external_port}`
2645
- console.log({ internal_port, external_port, external_ip })
2646
- processes.push({
2647
- //proxy: this.kernel.caddy.mapping[item.ip] || [],
2648
- router: router[external_ip] || [],
2649
- external_ip,
2650
- external_port: parseInt(external_port),
2651
- internal_port: parseInt(internal_port),
2652
- ...proc
2653
- })
2654
- } else {
2655
- processes.push({
2656
- router: [],
2657
- external_port: parseInt(external_port),
2658
- internal_port: parseInt(internal_port),
2659
- ...proc
2660
- })
2627
+ let peers_info = {}
2628
+ if (this.kernel.peer.info) {
2629
+ peers_info = this.kernel.peer.info
2630
+ // let info = this.kernel.router.info()
2631
+ // console.log("33 info", info)
2632
+ let remote_peers = Object.keys(this.kernel.peer.info).filter(x => x !== this.kernel.peer.host)
2633
+ let nodes = [this.kernel.peer.host].concat(remote_peers)
2634
+ for(let host of nodes) {
2635
+ let processes = []
2636
+ try {
2637
+ let procs = this.kernel.peer.info[host].proc
2638
+ let router = this.kernel.peer.info[host].router
2639
+ console.log({ router })
2640
+ let port_mapping = this.kernel.peer.info[host].port_mapping
2641
+ for(let proc of procs) {
2642
+ let internal_port = proc.ip.split(":")[1]
2643
+ let external_port = port_mapping[internal_port]
2644
+ if (external_port) {
2645
+ let external_ip = `${host}:${external_port}`
2646
+ console.log({ internal_port, external_port, external_ip })
2647
+ processes.push({
2648
+ //proxy: this.kernel.caddy.mapping[item.ip] || [],
2649
+ router: router[external_ip] || [],
2650
+ external_ip,
2651
+ external_port: parseInt(external_port),
2652
+ internal_port: parseInt(internal_port),
2653
+ ...proc
2654
+ })
2655
+ } else {
2656
+ processes.push({
2657
+ router: [],
2658
+ external_port: parseInt(external_port),
2659
+ internal_port: parseInt(internal_port),
2660
+ ...proc
2661
+ })
2662
+ }
2661
2663
  }
2664
+ } catch (e) {
2665
+ console.log(">>e", e)
2662
2666
  }
2663
- } catch (e) {
2664
- console.log(">>e", e)
2667
+ processes.sort((a, b) => {
2668
+ return b.external_port-a.external_port
2669
+ })
2670
+ list.push({
2671
+ host,
2672
+ name: this.kernel.peer.info[host].name,
2673
+ platform: this.kernel.peer.info[host].platform,
2674
+ processes
2675
+ })
2665
2676
  }
2666
- processes.sort((a, b) => {
2667
- return b.external_port-a.external_port
2668
- })
2669
- list.push({
2670
- host,
2671
- name: this.kernel.peer.info[host].name,
2672
- platform: this.kernel.peer.info[host].platform,
2673
- processes
2674
- })
2675
2677
  }
2678
+ console.log({ peers_info })
2676
2679
 
2677
2680
  // if (this.kernel.processes.info) {
2678
2681
  // console.log("proc info", this.kernel.processes.info)
@@ -2790,8 +2793,6 @@ class Server {
2790
2793
  }
2791
2794
  }
2792
2795
 
2793
- console.log("network", JSON.stringify(list, null, 2))
2794
-
2795
2796
  res.render("network", {
2796
2797
  ip: this.kernel.peer.current_ip,
2797
2798
  peers,
@@ -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>Wifi Sharing</div></a>
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>
@@ -165,8 +165,14 @@ body.dark .browser-options-row {
165
165
  font-weight: bold;
166
166
  }
167
167
  .header-label-sub {
168
+ text-align: center;
168
169
  font-size: 14px;
169
- padding: 0 4px;
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;
170
176
  }
171
177
  .header-container {
172
178
  margin: 10px;
@@ -175,6 +181,7 @@ body.dark .browser-options-row {
175
181
  box-sizing: border-box;
176
182
  }
177
183
  .container {
184
+ margin-top: 20px;
178
185
  display: grid;
179
186
  grid-template-columns: repeat(<%=list.length%>, 1fr);
180
187
  }
@@ -183,7 +190,7 @@ body.dark .browser-options-row {
183
190
  }
184
191
  .container-row {
185
192
  background: rgba(0, 0, 100, 0.04);
186
- padding: 20px;
193
+ padding: 15px 30px;
187
194
  box-sizing: border-box;
188
195
  }
189
196
  .desc {
@@ -211,6 +218,7 @@ td:first-child, th:first-child {
211
218
  overflow-wrap: break-word;
212
219
  }
213
220
  .container-row td {
221
+ vertical-align: top;
214
222
  font-size: 14px;
215
223
  padding: 2px;
216
224
  }
@@ -236,6 +244,7 @@ td:first-child, th:first-child {
236
244
  <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
237
245
  <div class='flexible'></div>
238
246
  <div class='nav-btns'>
247
+ <a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
239
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>
240
249
  <button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Debug</div></button>
241
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>
@@ -258,6 +267,7 @@ td:first-child, th:first-child {
258
267
  </div>
259
268
  -->
260
269
  <div class='container'>
270
+ <% let brands = { win32: "windows", darwin: "apple", linux: "Linux" } %>
261
271
  <% list.forEach(({ host, name, platform, processes }, index) => { %>
262
272
  <div class='container-row'>
263
273
  <!--
@@ -266,12 +276,12 @@ td:first-child, th:first-child {
266
276
  <% if (index === 0) { %>
267
277
  <div class='header-label-sub'>
268
278
  <h1><i class="fa-solid fa-podcast"></i> <%=name%></h1>
269
- <div><%=platform%> <%=host%> (this machine)</div>
279
+ <div class='s'><i class="fa-brands fa-<%=brands[platform]%>"></i> <%=platform%> <%=host%> (this machine)</div>
270
280
  </div>
271
281
  <% } else { %>
272
282
  <div class='header-label-sub'>
273
283
  <h1><i class="fa-solid fa-wifi"></i> <%=name%></h1>
274
- <div><%=platform%> <%=host%> (remote)</div>
284
+ <div class='s'><i class="fa-brands fa-<%=brands[platform]%>"></i> <%=platform%> <%=host%> (remote)</div>
275
285
  </div>
276
286
  <% } %>
277
287
  <table>
@@ -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>Wifi Sharing</div></a>
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>