pinokiod 1.0.56 → 1.0.57

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.
@@ -45,6 +45,7 @@ class Api {
45
45
  // stop all proxies for the script
46
46
  if (this.proxies[config.script]) {
47
47
  for(let p of this.proxies[config.script]) {
48
+ console.log("P", p)
48
49
  this.stopProxy({ uri: p.target })
49
50
  }
50
51
  }
@@ -54,18 +55,14 @@ class Api {
54
55
  this.lproxy.stop(config.uri)
55
56
 
56
57
  // remove the uri from the proxies array
57
- for(let key in this.proxies) {
58
- let p = this.proxies[key]
59
- if (p.includes(config.uri)) {
60
- let index;
61
- for(let i = 0; i<p.length; i++) {
62
- if (p[i].target === config.uri) {
63
- index = i
64
- break;
65
- }
66
- }
67
- this.proxies[key].splice(index, 1)
68
- }
58
+ for(let scriptPath in this.proxies) {
59
+ let p = this.proxies[scriptPath]
60
+ console.log("pp", p)
61
+ // iterate through p and find the one whose target matches config.uri
62
+ // and remove it
63
+ this.proxies[scriptPath] = this.proxies[scriptPath].filter((item) => {
64
+ return item.target !== config.uri
65
+ })
69
66
  }
70
67
  }
71
68
  console.log("stopped", { proxies: this.proxies })
@@ -94,6 +91,7 @@ class Api {
94
91
  return result
95
92
  }
96
93
  async stop(req, ondata) {
94
+ console.log("STOP")
97
95
  // 1. set the "stop" flag for the uri, so the next execution in the queue for the uri will NOT queue another task
98
96
  // 2. stream a message closing the socket
99
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -226,7 +226,9 @@ body.dark .frame-link.selected {
226
226
  background: rgba(0,0,0,0.7) !important;
227
227
  }
228
228
  .frame-link .loader {
229
+ /*
229
230
  padding: 5px;
231
+ */
230
232
  }
231
233
  .frame-link .tab {
232
234
  flex-grow: 1;
@@ -1070,42 +1072,44 @@ document.querySelector("aside").addEventListener("click", async (e) => {
1070
1072
 
1071
1073
 
1072
1074
  if (target) {
1073
-
1074
- if (target.classList.contains("reveal")) {
1075
- // nested menu
1076
- target.closest(".nested-menu").querySelector(".submenu").classList.toggle("hidden")
1077
- e.preventDefault()
1078
- e.stopPropagation()
1075
+ if (target.target === "_blank") {
1076
+ // nothing
1079
1077
  } else {
1080
- //location.hash = target.target
1078
+ if (target.classList.contains("reveal")) {
1079
+ // nested menu
1080
+ target.closest(".nested-menu").querySelector(".submenu").classList.toggle("hidden")
1081
+ e.preventDefault()
1082
+ e.stopPropagation()
1083
+ } else {
1084
+ //location.hash = target.target
1081
1085
 
1082
1086
 
1083
- // let id = getTarget(target.getAttribute("href"))
1084
- // console.log("ID", id, target.href)
1085
- // location.hash = id
1087
+ // let id = getTarget(target.getAttribute("href"))
1088
+ // console.log("ID", id, target.href)
1089
+ // location.hash = id
1086
1090
 
1087
- //location.hash = target.getAttribute("href")
1091
+ //location.hash = target.getAttribute("href")
1092
+
1093
+ if (target.closest(".h")) {
1094
+ location.hash = target.target
1095
+ } else {
1096
+ let index = target.getAttribute("data-index")
1097
+ let type = target.closest(".m").getAttribute("data-type")
1088
1098
 
1089
- if (target.closest(".h")) {
1090
- location.hash = target.target
1091
- } else {
1092
- let index = target.getAttribute("data-index")
1093
- let type = target.closest(".m").getAttribute("data-type")
1094
1099
 
1095
- console.log({ type, index })
1100
+ location.hash = type + index
1101
+ }
1096
1102
 
1097
- debugger
1103
+ document.querySelectorAll(".frame-link").forEach((el) => {
1104
+ el.classList.remove("selected")
1105
+ })
1106
+ target.classList.add("selected")
1098
1107
 
1099
- location.hash = type + index
1108
+ renderSelection(e)
1100
1109
  }
1110
+ }
1101
1111
 
1102
- document.querySelectorAll(".frame-link").forEach((el) => {
1103
- el.classList.remove("selected")
1104
- })
1105
- target.classList.add("selected")
1106
1112
 
1107
- renderSelection(e)
1108
- }
1109
1113
 
1110
1114
 
1111
1115
  }
@@ -10,17 +10,23 @@
10
10
  </div>
11
11
  <% } else { %>
12
12
  <% if (item.btn) { %>
13
- <!--
14
- <a data-index="<%=index%>" target="h<%=index%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link'>
15
- -->
16
- <a data-index="<%=index%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link'>
17
- <div class='tab'><%-item.btn%></div>
18
- <% if (item.running) { %>
13
+ <% if (item.target === "_blank") { %>
14
+ <a data-index="<%=index%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link'>
15
+ <div class='tab'><%-item.btn%></div>
19
16
  <div class='loader'>
20
- <i class='fa-solid fa-spin fa-circle-notch'></i>
17
+ <i class="fa-solid fa-up-right-from-square"></i>
21
18
  </div>
22
- <% } %>
23
- </a>
19
+ </a>
20
+ <% } else { %>
21
+ <a data-index="<%=index%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link'>
22
+ <div class='tab'><%-item.btn%></div>
23
+ <% if (item.running) { %>
24
+ <div class='loader'>
25
+ <i class='fa-solid fa-spin fa-circle-notch'></i>
26
+ </div>
27
+ <% } %>
28
+ </a>
29
+ <% } %>
24
30
  <% } %>
25
31
  <% } %>
26
32
  <% }) %>