pinokiod 3.2.149 → 3.2.150

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.
@@ -22,7 +22,7 @@ class Python {
22
22
  } else {
23
23
  console.log("request unsuccessful. retrying in 3 seconds...")
24
24
  ondata({
25
- raw: "\r\nrequest successful. retrying in 3 seconds...\r\n"
25
+ raw: "\r\nrequest unsuccessful. retrying in 3 seconds...\r\n"
26
26
  })
27
27
  await new Promise((resolve, reject) => {
28
28
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.149",
3
+ "version": "3.2.150",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -226,6 +226,18 @@ class Server {
226
226
  let rawpath = "/api/" + name
227
227
  let config = (await this.kernel.loader.load(app_path)).resolved
228
228
 
229
+ let error = null
230
+ if (config && config.version) {
231
+ let coerced = semver.coerce(config.version)
232
+ console.log("version", { coerced, v: config.version })
233
+ if (semver.satisfies(coerced, this.kernel.schema)) {
234
+ console.log("semver satisfied", config.version, this.kernel.schema)
235
+ } else {
236
+ console.log("semver NOT satisfied", config.version, this.kernel.schema)
237
+ error = `Please update Pinokio to the latest version (current script version: ${config.version}, supported: ${this.kernel.schema}`
238
+ }
239
+ }
240
+
229
241
 
230
242
 
231
243
  // let requires_instantiation = false
@@ -316,6 +328,7 @@ class Server {
316
328
  const env = await this.kernel.env("api/" + name)
317
329
 
318
330
  res.render("app", {
331
+ error,
319
332
  env,
320
333
  mode,
321
334
  port: this.port,
@@ -398,6 +411,7 @@ class Server {
398
411
  } catch (e) {
399
412
  // console.log("ERROR", e)
400
413
  }
414
+
401
415
  }
402
416
 
403
417
  // if (pathComponents.length > 1) {
@@ -1159,6 +1173,7 @@ class Server {
1159
1173
  let p = path.resolve(uri, item.name, "pinokio.js")
1160
1174
  let config = (await this.kernel.loader.load(p)).resolved
1161
1175
  if (config) {
1176
+ /*
1162
1177
  if (config.version) {
1163
1178
  let coerced = semver.coerce(config.version)
1164
1179
  console.log("version", { coerced, v: config.version })
@@ -1169,6 +1184,7 @@ class Server {
1169
1184
  error = `Please update Pinokio to the latest version (current script version: ${config.version}, supported: ${this.kernel.schema}`
1170
1185
  }
1171
1186
  }
1187
+ */
1172
1188
  // if (config.run) {
1173
1189
  // items[i].run = config.run
1174
1190
  // }
@@ -399,6 +399,20 @@ nav .logo {
399
399
  font-size: 14px;
400
400
  padding: 10px;
401
401
  }
402
+ nav.error-message .btn {
403
+ letter-spacing: 0px;
404
+ background: royalblue;
405
+ font-size: 20px;
406
+ padding: 10px 20px;
407
+ }
408
+ nav.error-message {
409
+ background: yellow !important;
410
+ flex-grow: 1;
411
+ padding: 50px;
412
+ font-size: 40px;
413
+ color: black;
414
+ letter-spacing: -2px;
415
+ }
402
416
  body.dark #location {
403
417
  color: white;
404
418
  }
@@ -550,14 +564,6 @@ body.dark .loader-container {
550
564
  </head>
551
565
  <body class='<%=theme%>' data-platform="<%=platform%>">
552
566
  <aside class='active'>
553
- <!--
554
- <div class='footer'>
555
- <button class='btn header-item' id='clone-tab'><i class='fa-regular fa-copy'></i></button>
556
- <a class='btn header-item' id='open-browser' target="_blank" href="" features="browser"><i class="fa-solid fa-square-arrow-up-right"></i></a>
557
- <button class='btn header-item' id='reload'><i class="fa-solid fa-rotate-right"></i></button>
558
- <div id='new-tab' class='btn header-item'><i class="fa-solid fa-plus"></i></div>
559
- </div>
560
- -->
561
567
  <div class='header-top header-item'>
562
568
  <div class='app-info'>
563
569
  <% if (config.icon) { %>
@@ -622,41 +628,49 @@ body.dark .loader-container {
622
628
  </div>
623
629
  -->
624
630
  </aside>
625
- <div class='container'>
626
- <nav>
627
- <div class='bar'>
628
- <button class='btn2' id='menu-mobile'><i class="fa-solid fa-bars"></i></button>
629
- <button class='btn2' id='menu'>
630
- <img src="<%=rawpath%>/<%=config.icon%>?raw=true"/>
631
- <i class="fa-solid fa-arrow-right-to-bracket fa-rotate-180"></i>
632
- </button>
633
- <% if (agent === "electron") { %>
634
- <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
635
- <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
636
- <% } %>
637
- <button class='btn2' id='reload'><i class="fa-solid fa-rotate-right"></i> Refresh</button>
638
- <% if (agent === "electron") { %>
639
- <a class='btn2' id='open-browser' target="_blank" href="" features="browser"><i class="fa-solid fa-square-arrow-up-right"></i> Popout</a>
640
- <% } else { %>
641
- <a class='btn2' id='open-browser' target="_blank" href=""><i class="fa-solid fa-square-arrow-up-right"></i> Popout</a>
642
- <% } %>
643
- <button class='btn2' id='clone-tab'><i class='fa-regular fa-copy'></i> Clone</button>
644
- <div id='new-tab' class='btn2'><i class="fa-solid fa-plus"></i> Tab</div>
645
- <input type='url' id='location' readonly>
646
- </div>
631
+ <% if (error) { %>
632
+ <nav class='error-message'>
633
+ <div><i class="fa-solid fa-rotate"></i> <%=error%></div>
634
+ <div class='flexible'></div>
635
+ <a class='btn' target="_blank" href="https://program.pinokio.computer/#/?id=install">Download</a>
647
636
  </nav>
648
- <main class='browserview'>
649
- <% if (false) { %>
650
- <% if (config.menu) { %>
651
- <% config.menu.forEach((item) => { %>
652
- <% if (item.btn && item.src) { %>
653
- <iframe name='<%=item.src%>' class='hidden'></iframe>
654
- <% } %>
655
- <% }) %>
637
+ <% } else { %>
638
+ <div class='container'>
639
+ <nav>
640
+ <div class='bar'>
641
+ <button class='btn2' id='menu-mobile'><i class="fa-solid fa-bars"></i></button>
642
+ <button class='btn2' id='menu'>
643
+ <img src="<%=rawpath%>/<%=config.icon%>?raw=true"/>
644
+ <i class="fa-solid fa-arrow-right-to-bracket fa-rotate-180"></i>
645
+ </button>
646
+ <% if (agent === "electron") { %>
647
+ <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
648
+ <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
649
+ <% } %>
650
+ <button class='btn2' id='reload'><i class="fa-solid fa-rotate-right"></i> Refresh</button>
651
+ <% if (agent === "electron") { %>
652
+ <a class='btn2' id='open-browser' target="_blank" href="" features="browser"><i class="fa-solid fa-square-arrow-up-right"></i> Popout</a>
653
+ <% } else { %>
654
+ <a class='btn2' id='open-browser' target="_blank" href=""><i class="fa-solid fa-square-arrow-up-right"></i> Popout</a>
655
+ <% } %>
656
+ <button class='btn2' id='clone-tab'><i class='fa-regular fa-copy'></i> Clone</button>
657
+ <div id='new-tab' class='btn2'><i class="fa-solid fa-plus"></i> Tab</div>
658
+ <input type='url' id='location' readonly>
659
+ </div>
660
+ </nav>
661
+ <main class='browserview'>
662
+ <% if (false) { %>
663
+ <% if (config.menu) { %>
664
+ <% config.menu.forEach((item) => { %>
665
+ <% if (item.btn && item.src) { %>
666
+ <iframe name='<%=item.src%>' class='hidden'></iframe>
667
+ <% } %>
668
+ <% }) %>
669
+ <% } %>
656
670
  <% } %>
657
- <% } %>
658
- </main>
659
- </div>
671
+ </main>
672
+ </div>
673
+ <% } %>
660
674
  <script>
661
675
  let loaded = {}
662
676
  let cursorIndex = 0;