pinokiod 3.8.74 → 3.8.76

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.
@@ -31,7 +31,7 @@ class Caddy {
31
31
  let resolved
32
32
  await new Promise((resolve, reject) => {
33
33
  this.kernel.exec({
34
- message: `caddy run --watch --log-file ${this.kernel.path('logs/caddy.log')}`,
34
+ message: `caddy run --watch`,
35
35
  path: this.kernel.homedir,
36
36
  }, (e) => {
37
37
  console.log("[CADDY] " + e.cleaned)
@@ -324,7 +324,7 @@ class Caddy {
324
324
  let resolved
325
325
  await new Promise((resolve, reject) => {
326
326
  this.kernel.exec({
327
- message: `caddy run --watch --log-file ${kernel.path('logs/caddy.log')}`,
327
+ message: `caddy run --watch`,
328
328
  path: this.kernel.homedir,
329
329
  }, (e) => {
330
330
  resolve()
@@ -54,6 +54,17 @@ class LocalhostHomeRouter {
54
54
  }
55
55
  }
56
56
  }
57
+ },
58
+ "logging": {
59
+ "logs": {
60
+ "default": {
61
+ "writer": {
62
+ "output": "file",
63
+ "filename": this.router.kernel.path("logs/caddy.log")
64
+ },
65
+ "level": "INFO"
66
+ }
67
+ }
57
68
  }
58
69
  }
59
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.8.74",
3
+ "version": "3.8.76",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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 = await this.kernel.peer.refresh()
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,
@@ -159,12 +159,15 @@ 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
+ font-size: 14px;
169
+ padding: 0 4px;
170
+ }
168
171
  .header-container {
169
172
  margin: 10px;
170
173
  background: rgba(0, 0, 100, 0.04);
@@ -179,7 +182,6 @@ body.dark .browser-options-row {
179
182
  background: rgba(255, 255, 255, 0.04);
180
183
  }
181
184
  .container-row {
182
- margin: 10px;
183
185
  background: rgba(0, 0, 100, 0.04);
184
186
  padding: 20px;
185
187
  box-sizing: border-box;
@@ -190,6 +192,7 @@ body.dark .browser-options-row {
190
192
  }
191
193
  .container-row table {
192
194
  width: 100%;
195
+ margin-top: 20px;
193
196
  }
194
197
  table a {
195
198
  text-decoration: none;
@@ -201,7 +204,7 @@ td:first-child, th:first-child {
201
204
  .container-row th {
202
205
  text-align: left;
203
206
  font-size: 18px;
204
- padding: 5px;
207
+ padding: 2px;
205
208
  text-transform: uppercase;
206
209
  }
207
210
  .container-row td.title {
@@ -242,7 +245,7 @@ td:first-child, th:first-child {
242
245
  </h1>
243
246
  </header>
244
247
  <main>
245
- <div class='header-label'><i class='fa-solid fa-wifi'></i> Networking</div>
248
+ <div class='header-label'><i class='fa-solid fa-wifi'></i> Network</div>
246
249
  <div class='desc'>Serve Pinokio, installed apps, and even external apps to any device on the same network.</div>
247
250
  <!--
248
251
  <div class='header-container'>
@@ -255,12 +258,22 @@ td:first-child, th:first-child {
255
258
  </div>
256
259
  -->
257
260
  <div class='container'>
258
- <% list.forEach(({ host, name, platform, processes }) => { %>
261
+ <% list.forEach(({ host, name, platform, processes }, index) => { %>
259
262
  <div class='container-row'>
260
263
  <!--
261
264
  <div class='header-label-sub'><i class="fa-solid fa-microchip"></i> System</div>
262
265
  -->
263
- <div class='header-label-sub'><%=name%> (<%=platform%>, <%=host%>)</div>
266
+ <% if (index === 0) { %>
267
+ <div class='header-label-sub'>
268
+ <h1><i class="fa-solid fa-podcast"></i> <%=name%></h1>
269
+ <div><%=platform%> <%=host%> (this machine)</div>
270
+ </div>
271
+ <% } else { %>
272
+ <div class='header-label-sub'>
273
+ <h1><i class="fa-solid fa-wifi"></i> <%=name%></h1>
274
+ <div><%=platform%> <%=host%> (remote)</div>
275
+ </div>
276
+ <% } %>
264
277
  <table>
265
278
  <tr>
266
279
  <th>Server</th>