pinokiod 7.1.74 → 7.1.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.
package/kernel/shells.js CHANGED
@@ -301,6 +301,7 @@ class Shells {
301
301
  let liveEventBuffer = ""
302
302
  let liveEventOffset = 0
303
303
  let liveEventAnsiCarry = ""
304
+ let liveEventHandlersClosed = false
304
305
 
305
306
  // Keep cross-chunk event matching, but normalize terminal styling away first.
306
307
  // Preserve line boundaries so later shell banners cannot fuse onto prior matches.
@@ -428,7 +429,7 @@ class Shells {
428
429
  liveEventOffset += normalizedChunk.length
429
430
  }
430
431
  const liveEventBufferStart = Math.max(0, liveEventOffset - liveEventBuffer.length)
431
- if (params.on && Array.isArray(params.on)) {
432
+ if (!liveEventHandlersClosed && params.on && Array.isArray(params.on)) {
432
433
  for(let i=0; i<params.on.length; i++) {
433
434
  let handler = params.on[i]
434
435
  if (handler.once && onceHandlers.has(i)) {
@@ -476,11 +477,18 @@ class Shells {
476
477
  }
477
478
  const lastMatch = rendered_event[rendered_event.length - 1]
478
479
  handlerLastMatchEnd.set(i, liveEventBufferStart + lastMatch.index + lastMatch[0].length)
479
- stream.matches = rendered_event
480
- m = rendered_event[0]
481
- matched_index = i
482
- if (typeof handler.trigger === "string" && handler.trigger.trim()) {
483
- const triggerAction = handler.trigger.trim()
480
+ const triggerAction = typeof handler.trigger === "string" ? handler.trigger.trim() : ""
481
+ const shouldCaptureEvent =
482
+ handler.break !== false
483
+ || handler.done
484
+ || handler.kill
485
+ || !!triggerAction
486
+ if (shouldCaptureEvent) {
487
+ stream.matches = rendered_event
488
+ m = rendered_event[0]
489
+ matched_index = i
490
+ }
491
+ if (triggerAction) {
484
492
  queueTriggerAction(triggerAction, rendered_event[0]).catch((e) => {
485
493
  console.log("Trigger error", e)
486
494
  if (ondata) {
@@ -490,9 +498,13 @@ class Shells {
490
498
  }
491
499
  if (handler.kill) {
492
500
  sh.kill()
501
+ liveEventHandlersClosed = true
502
+ break
493
503
  }
494
504
  if (handler.done) {
495
505
  sh.continue()
506
+ liveEventHandlersClosed = true
507
+ break
496
508
  }
497
509
  }
498
510
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "7.1.74",
3
+ "version": "7.1.76",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5266,7 +5266,7 @@ header.navheader .mode-selector .community-mode-toggle {
5266
5266
  <% if (config.menu) { %>
5267
5267
  <%- include('./partials/menu', { menu: config.menu, }) %>
5268
5268
  <% } %>
5269
- <a id='settings-tab' data-mode="refresh" target="env-settings" href="/env/api/<%=name%>" class="btn header-item frame-link" data-index="settings" data-static="retain">
5269
+ <a id='settings-tab' data-mode="refresh" target="env-settings" href="/env/api/<%=name%>?host=app" class="btn header-item frame-link" data-index="settings" data-static="retain">
5270
5270
  <div class='tab'>
5271
5271
  <i class="fa-solid fa-gear"></i>
5272
5272
  <div class='display'>Settings</div>
@@ -363,6 +363,16 @@ body.dark .toggle-slider {
363
363
  <script>
364
364
  document.addEventListener("DOMContentLoaded", async () => {
365
365
  const n = new N()
366
+ const navigateHome = () => {
367
+ const isAppHost = new URLSearchParams(window.location.search || "").get("host") === "app"
368
+ if (isAppHost && window.parent && window.parent !== window) {
369
+ try {
370
+ window.parent.location.assign("/home")
371
+ return
372
+ } catch (_) {}
373
+ }
374
+ window.location.assign("/home")
375
+ }
366
376
  const protectionInput = document.querySelector("#protection-enabled")
367
377
  const protectionState = document.querySelector("[data-protection-state]")
368
378
  const syncProtectionState = () => {
@@ -446,7 +456,7 @@ document.addEventListener("DOMContentLoaded", async () => {
446
456
  }).then((response) => response.json())
447
457
  Swal.close()
448
458
  if (res && res.success) {
449
- location.href = "/home"
459
+ navigateHome()
450
460
  } else if (res && res.error) {
451
461
  alert(res.error)
452
462
  } else {