pinokiod 2.1.27 → 2.1.28

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": "2.1.27",
3
+ "version": "2.1.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -1827,7 +1827,6 @@ class Server {
1827
1827
  }
1828
1828
  }
1829
1829
  async start(options) {
1830
- console.log("** start", options)
1831
1830
  this.debug = false
1832
1831
  if (options) {
1833
1832
  this.debug = options.debug
@@ -2365,10 +2364,21 @@ class Server {
2365
2364
  }))
2366
2365
  this.app.get("/api/*", ex(async (req, res) => {
2367
2366
  let pathComponents = req.params[0].split("/")
2368
- try {
2369
- await this.render(req, res, pathComponents)
2370
- } catch (e) {
2371
- res.status(404).send(e.message)
2367
+ console.log("req.query", req.query)
2368
+ if (req.query && 'fs' in req.query) {
2369
+ // open in file system
2370
+ let full_filepath = this.kernel.path("api", ...pathComponents)
2371
+ console.log("openfs", full_filepath)
2372
+ Util.openfs(full_filepath)
2373
+ res.render("fs", {
2374
+ path: full_filepath
2375
+ })
2376
+ } else {
2377
+ try {
2378
+ await this.render(req, res, pathComponents)
2379
+ } catch (e) {
2380
+ res.status(404).send(e.message)
2381
+ }
2372
2382
  }
2373
2383
  }))
2374
2384
  this.app.get("/pinokio/sidebar/:name", ex(async (req, res) => {
@@ -1,5 +1,7 @@
1
1
  <html>
2
2
  <head>
3
+ <meta charset="UTF-8">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
3
5
  <style>
4
6
  body {
5
7
  width: 100%;
@@ -296,19 +296,21 @@ body.dark .grid-btns {
296
296
  border-top: 1px solid rgba(0,0,0,0.04);
297
297
  border-bottom: 1px solid rgba(0,0,0,0.04);
298
298
  display: grid;
299
+ /*
299
300
  grid-template-columns: repeat(2, 1fr);
300
301
  grid-template-rows: repeat(2, 1fr);
301
- /*
302
+ */
302
303
  grid-template-columns: repeat(3, 1fr);
303
304
  grid-template-rows: repeat(1, 1fr);
304
- */
305
305
  box-sizing: border-box;
306
306
  }
307
307
  .grid-btns .btn2 {
308
- padding: 10px;
308
+ padding: 20px 10px;
309
309
  color: var(--light-color);
310
310
  border-radius: 0;
311
311
  cursor: pointer;
312
+ font-family: Menlo, monaco,monospace;
313
+ font-size: 11px;
312
314
  }
313
315
  body.dark .grid-btns .btn2 {
314
316
  /*
@@ -589,9 +591,8 @@ body.dark .loader-container {
589
591
  </div>
590
592
  -->
591
593
  <div class='grid-btns'>
592
- <a class='btn2' href="/?mode=help"><div><i class="fa-regular fa-face-smile"></i></div><div>Community</div></a>
593
- <a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
594
594
  <a class='btn2' href="/"><div><i class="fa-solid fa-house"></i></div><div>Home</div></a>
595
+ <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>
595
596
  <button class='btn2' id='new-window' title='open a new window'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
596
597
  </div>
597
598
  <!--
@@ -114,11 +114,14 @@ body main iframe {
114
114
  }
115
115
  </style>
116
116
  <script src="/hotkeys.min.js"></script>
117
+ <script src="/nav.js"></script>
117
118
  </head>
118
119
  <body class='<%=theme%>'>
119
120
  <header class='navheader grabbable'>
120
121
  <h1>
121
122
  <a class='home' href="/"><i class="fa-solid fa-house"></i></a>
123
+ <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
124
+ <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
122
125
  <% paths.forEach((path) => { %>
123
126
  <% if (path.action) { %>
124
127
  <a class='path nav-button' id="<%=path.id%>" onclick="<%=path.action%>"><%-path.name%></a>
@@ -126,15 +129,16 @@ body main iframe {
126
129
  <a class='path' href="<%=path.path%>"><%-path.name%></a>
127
130
  <% } %>
128
131
  <% }) %>
129
- <!--
130
- <form class='search'>
131
- <% if (display.includes("form")) { %>
132
- <input type='search' placeholder='enter git url'>
133
- <button class='btn clone'><i class="fa-solid fa-download"></i> Download</button>
134
- <% } %>
135
- </form>
136
- -->
137
132
  <div class='flexible'></div>
133
+ <div class='nav-btns'>
134
+ <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
135
+ <a class='btn2' href="/?mode=help"><div><i class="fa-regular fa-face-smile"></i></div><div>Community</div></a>
136
+ <% if (agent === "electron") { %>
137
+ <a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
138
+ <% } %>
139
+ <a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
140
+ <button id='new-window' title='open a new window' class='btn2'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
141
+ </div>
138
142
  <!--
139
143
  <div class='nav-btns'>
140
144
  <a class='btn2' href='https://discord.gg/TQdNwadtE4' target="_blank"><div><i class="fa-brands fa-discord"></i></div><div>Discord</div></a>
@@ -173,6 +177,17 @@ document.querySelector("form").addEventListener("submit", (e) => {
173
177
  }
174
178
  })
175
179
  */
180
+ document.querySelector("#explore").addEventListener("click", async (e) => {
181
+ e.preventDefault()
182
+ e.stopPropagation()
183
+ location.href = "/?mode=explore"
184
+ })
185
+ document.querySelector("#back").addEventListener("click", (e) => {
186
+ history.back()
187
+ })
188
+ document.querySelector("#forward").addEventListener("click", (e) => {
189
+ history.forward()
190
+ })
176
191
  </script>
177
192
  </body>
178
193
  </html>
@@ -0,0 +1,36 @@
1
+ <html>
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
5
+ <style>
6
+ body {
7
+ width: 100%;
8
+ margin: 0;
9
+ background: white;
10
+ color: black;
11
+ box-sizing: border-box;
12
+ font-family: sans-serif;
13
+ font-size: 14px;
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ }
18
+ main {
19
+ }
20
+ h1 {
21
+ font-size: 40px;
22
+ letter-spacing: -1px;
23
+ }
24
+ </style>
25
+ <link href="/css/fontawesome.min.css" rel="stylesheet">
26
+ <link href="/css/solid.min.css" rel="stylesheet">
27
+ <link href="/css/regular.min.css" rel="stylesheet">
28
+ <link href="/css/brands.min.css" rel="stylesheet">
29
+ </head>
30
+ <body>
31
+ <main>
32
+ <h1><i class="fa-regular fa-folder-closed"></i> File System</h1>
33
+ <div>Opened <strong><%=path%></strong></div>
34
+ </main>
35
+ </body>
36
+ </html>
@@ -252,10 +252,21 @@ body.dark .item .tile .badge {
252
252
  <script src="/report.js"></script>
253
253
  </head>
254
254
  <body class='<%=theme%>'>
255
- <header class='grabbable'>
255
+ <header class='navheader grabbable'>
256
256
  <h1>
257
257
  <a class='home' href="/"><i class="fa-solid fa-house"></i></a>
258
+ <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
259
+ <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
258
260
  <div class='flexible'></div>
261
+ <div class='nav-btns'>
262
+ <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
263
+ <a class='btn2' href="/?mode=help"><div><i class="fa-regular fa-face-smile"></i></div><div>Community</div></a>
264
+ <% if (agent === "electron") { %>
265
+ <a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
266
+ <% } %>
267
+ <a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
268
+ <button id='new-window' title='open a new window' class='btn2'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
269
+ </div>
259
270
  </h1>
260
271
  </header>
261
272
  <main>
@@ -297,6 +308,17 @@ body.dark .item .tile .badge {
297
308
  <script>
298
309
  document.addEventListener("DOMContentLoaded", async () => {
299
310
  //Reporter()
311
+ document.querySelector("#explore").addEventListener("click", async (e) => {
312
+ e.preventDefault()
313
+ e.stopPropagation()
314
+ location.href = "/?mode=explore"
315
+ })
316
+ document.querySelector("#back").addEventListener("click", (e) => {
317
+ history.back()
318
+ })
319
+ document.querySelector("#forward").addEventListener("click", (e) => {
320
+ history.forward()
321
+ })
300
322
 
301
323
  document.querySelector("#genlog").addEventListener("click", (e) => {
302
324
  e.preventDefault()
@@ -164,6 +164,8 @@ body.dark .browser-options-row {
164
164
  <h1>
165
165
  <% if (ishome) { %>
166
166
  <a class='home' href="/"><i class="fa-solid fa-house"></i></a>
167
+ <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
168
+ <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
167
169
  <% } %>
168
170
  <% paths.forEach((path) => { %>
169
171
  <% if (path.action) { %>
@@ -181,7 +183,7 @@ body.dark .browser-options-row {
181
183
  <% if (ishome) { %>
182
184
  <div class='nav-btns'>
183
185
  <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
184
- <a class='btn2' href="/?mode=help"><div><i class="fa-regular fa-face-smile"></i></div><div>Community</div></a>
186
+ <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>
185
187
  <% if (agent === "electron") { %>
186
188
  <a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
187
189
  <% } %>
@@ -1002,6 +1004,12 @@ if (document.querySelector("#cloudflare")) {
1002
1004
  })
1003
1005
  }
1004
1006
  <% } %>
1007
+ document.querySelector("#back").addEventListener("click", (e) => {
1008
+ history.back()
1009
+ })
1010
+ document.querySelector("#forward").addEventListener("click", (e) => {
1011
+ history.forward()
1012
+ })
1005
1013
 
1006
1014
  </script>
1007
1015
  </body>
@@ -226,10 +226,10 @@ document.addEventListener("DOMContentLoaded", async () => {
226
226
  }
227
227
  })
228
228
  })
229
- let ok = confirm("Install Complete! Click OK to Proceed.")
230
- if (ok) {
229
+ // let ok = confirm("Install Complete! Click OK to Proceed.")
230
+ // if (ok) {
231
231
  location.href = document.querySelector("#callback").value
232
- }
232
+ // }
233
233
  })
234
234
  </script>
235
235
  </body>
@@ -222,6 +222,8 @@ hr {
222
222
  <header class='navheader grabbable'>
223
223
  <h1>
224
224
  <a class='home' href="/"><i class="fa-solid fa-house"></i></a>
225
+ <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
226
+ <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
225
227
  <% paths.forEach((path) => { %>
226
228
  <% if (path.action) { %>
227
229
  <a class='path nav-button' id="<%=path.id%>" onclick="<%=path.action%>"><%-path.name%></a>
@@ -230,6 +232,15 @@ hr {
230
232
  <% } %>
231
233
  <% }) %>
232
234
  <div class='flexible'></div>
235
+ <div class='nav-btns'>
236
+ <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
237
+ <a class='btn2' href="/?mode=help"><div><i class="fa-regular fa-face-smile"></i></div><div>Community</div></a>
238
+ <% if (agent === "electron") { %>
239
+ <a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
240
+ <% } %>
241
+ <a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
242
+ <button id='new-window' title='open a new window' class='btn2'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
243
+ </div>
233
244
  <!--
234
245
  <div class='nav-btns'>
235
246
  <button class='btn2' id='report'><div><i class="fa-solid fa-bug"></i></div><div>Report Bug</div></button>
@@ -442,6 +453,17 @@ document.addEventListener("DOMContentLoaded", async () => {
442
453
  // let sep = "<%=platform === 'win32' ? '\\' : '/'%>"
443
454
  // document.querySelector("[name=drive]").value = e.target.value + sep + "drive"
444
455
  // })
456
+ document.querySelector("#back").addEventListener("click", (e) => {
457
+ history.back()
458
+ })
459
+ document.querySelector("#forward").addEventListener("click", (e) => {
460
+ history.forward()
461
+ })
462
+ document.querySelector("#explore").addEventListener("click", async (e) => {
463
+ e.preventDefault()
464
+ e.stopPropagation()
465
+ location.href = "/?mode=explore"
466
+ })
445
467
  document.querySelector("form").addEventListener("submit", async (e) => {
446
468
  e.preventDefault()
447
469
  e.stopPropagation()