pinokiod 1.0.55 → 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.
- package/kernel/api/index.js +10 -12
- package/package.json +1 -1
- package/server/index.js +1 -2
- package/server/views/browser.ejs +29 -25
- package/server/views/partials/menu.ejs +15 -9
package/kernel/api/index.js
CHANGED
|
@@ -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
|
|
58
|
-
let p = this.proxies[
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
package/server/index.js
CHANGED
|
@@ -1211,7 +1211,7 @@ class Server {
|
|
|
1211
1211
|
proxyMenu.push({
|
|
1212
1212
|
btn: `<i class="fa-solid fa-bolt-lightning"></i> [Proxy] ${proxy.name}`,
|
|
1213
1213
|
target: "_blank",
|
|
1214
|
-
href: proxy.
|
|
1214
|
+
href: proxy.proxy
|
|
1215
1215
|
})
|
|
1216
1216
|
}
|
|
1217
1217
|
console.log({ proxyMenu })
|
|
@@ -1900,7 +1900,6 @@ class Server {
|
|
|
1900
1900
|
agent: this.agent,
|
|
1901
1901
|
src: "/_api/" + name,
|
|
1902
1902
|
rawpath,
|
|
1903
|
-
proxies: this.kernel.api
|
|
1904
1903
|
})
|
|
1905
1904
|
})
|
|
1906
1905
|
this.app.post("/pinokio/delete", async (req, res) => {
|
package/server/views/browser.ejs
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1100
|
+
location.hash = type + index
|
|
1101
|
+
}
|
|
1096
1102
|
|
|
1097
|
-
|
|
1103
|
+
document.querySelectorAll(".frame-link").forEach((el) => {
|
|
1104
|
+
el.classList.remove("selected")
|
|
1105
|
+
})
|
|
1106
|
+
target.classList.add("selected")
|
|
1098
1107
|
|
|
1099
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
+
<i class="fa-solid fa-up-right-from-square"></i>
|
|
21
18
|
</div>
|
|
22
|
-
|
|
23
|
-
|
|
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
|
<% }) %>
|