pinokiod 3.52.0 → 3.54.0
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/index.js +65 -43
- package/kernel/peer.js +21 -8
- package/kernel/router/index.js +10 -10
- package/kernel/router/localhost_static_router.js +3 -0
- package/kernel/router/peer_static_router.js +1 -0
- package/package.json +1 -1
- package/server/index.js +137 -70
- package/server/public/common.js +0 -9
- package/server/public/style.css +4 -3
- package/server/public/urldropdown.css +95 -3
- package/server/public/urldropdown.js +245 -23
- package/server/views/app.ejs +0 -2
- package/server/views/connect.ejs +3 -0
- package/server/views/container.ejs +2 -1
- package/server/views/index.ejs +3 -0
- package/server/views/init/index.ejs +3 -0
- package/server/views/net.ejs +30 -27
- package/server/views/network.ejs +4 -148
- package/server/views/screenshots.ejs +3 -0
- package/server/views/settings.ejs +3 -0
- package/server/views/tools.ejs +3 -0
- package/3 +0 -1
package/server/views/network.ejs
CHANGED
|
@@ -984,6 +984,9 @@ body.dark .troubleshoot {
|
|
|
984
984
|
aside {
|
|
985
985
|
padding: 0 10px;
|
|
986
986
|
}
|
|
987
|
+
aside .tab.submenu {
|
|
988
|
+
padding: 10px;
|
|
989
|
+
}
|
|
987
990
|
aside .tab i {
|
|
988
991
|
width: 100%;
|
|
989
992
|
}
|
|
@@ -1098,22 +1101,13 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
1098
1101
|
</button>
|
|
1099
1102
|
</h1>
|
|
1100
1103
|
</header>
|
|
1101
|
-
<!--
|
|
1102
|
-
<form class='search'>
|
|
1103
|
-
<div class='app-btns'>
|
|
1104
|
-
<a class='btn create-new' href="/init"><i class="fa-solid fa-plus"></i> Build</a>
|
|
1105
|
-
<a class='btn' id='explore' href="/?mode=explore"><i class="fa-solid fa-magnifying-glass"></i> Discover</a>
|
|
1106
|
-
</div>
|
|
1107
|
-
<input type='search' class="flexible" placeholder='Filter network apps'>
|
|
1108
|
-
</form>
|
|
1109
|
-
-->
|
|
1110
1104
|
<main>
|
|
1111
1105
|
<div class='c'>
|
|
1112
1106
|
<div class='container'>
|
|
1113
1107
|
<div class='config'>
|
|
1114
1108
|
<div class='config-header'>
|
|
1115
1109
|
<div class='header-label'><i class='fa-solid fa-wifi'></i> Network Settings</div>
|
|
1116
|
-
<div class='desc'>
|
|
1110
|
+
<div class='desc'>Instantly add HTTPS + CORS + Peer Sharing for every app on your local network.</div>
|
|
1117
1111
|
</div>
|
|
1118
1112
|
<div class='config-body'>
|
|
1119
1113
|
<div class='config-row'>
|
|
@@ -1147,70 +1141,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
1147
1141
|
</div>
|
|
1148
1142
|
</div>
|
|
1149
1143
|
<div class='container'>
|
|
1150
|
-
<% if (!requirements_pending && peer_active && processes.length > 0) { %>
|
|
1151
|
-
<form class='search'>
|
|
1152
|
-
<input type='search' class="flexible" placeholder='Filter apps'>
|
|
1153
|
-
</form>
|
|
1154
|
-
<% } %>
|
|
1155
1144
|
<div class='running-apps'>
|
|
1156
|
-
<% if (!requirements_pending && peer_active && processes.length > 0) { %>
|
|
1157
|
-
<div class='section-header2'>
|
|
1158
|
-
<div class='blank'></div>
|
|
1159
|
-
<div class='col'>
|
|
1160
|
-
<div class='grid-3'>
|
|
1161
|
-
<div data-tippy-content="Use these URLs on this machine"><i class='fas fa-laptop-code'></i> This machine</div>
|
|
1162
|
-
<div data-tippy-content="Use these URLs from other machines on the same local network."><i class="fa-solid fa-wifi"></i> Local network</div>
|
|
1163
|
-
<div data-tippy-content="Use these URLs from other pinokio peers on the same local network"><i class="fa-solid fa-podcast"></i> Local HTTPS network</div>
|
|
1164
|
-
</div>
|
|
1165
|
-
</div>
|
|
1166
|
-
</div>
|
|
1167
|
-
<% } %>
|
|
1168
|
-
<!--
|
|
1169
|
-
<a class='explain' data-type='peer'>How to start a peer</a>
|
|
1170
|
-
-->
|
|
1171
1145
|
<% if (requirements_pending || peer_active && processes.length === 0) { %>
|
|
1172
1146
|
<div class='loader'>
|
|
1173
1147
|
<i class="fa-solid fa-circle-notch fa-spin"></i>
|
|
1174
1148
|
</div>
|
|
1175
1149
|
<% } %>
|
|
1176
|
-
<% processes.forEach((item, index) => { %>
|
|
1177
|
-
<div class='line align-top' data-index="<%=index%>" data-name="<%=item.name%>" data-title="<%=item.name%>" data-description="<%=item.internal_router.join(' ')%> <%=item.port%>">
|
|
1178
|
-
<h3>
|
|
1179
|
-
<div class='item-icon'>
|
|
1180
|
-
<% if (item.icon) { %>
|
|
1181
|
-
<div class='placeholder-icon'>
|
|
1182
|
-
<img src="<%=item.icon%>">
|
|
1183
|
-
</div>
|
|
1184
|
-
<% } else { %>
|
|
1185
|
-
<div class='placeholder-icon'>
|
|
1186
|
-
<i class="fa-solid fa-database"></i>
|
|
1187
|
-
</div>
|
|
1188
|
-
<% } %>
|
|
1189
|
-
</div>
|
|
1190
|
-
<div class='col'>
|
|
1191
|
-
<div class='title'><i class="fa-solid fa-circle"></i><span><%=item.title || item.name%></span></div>
|
|
1192
|
-
<div class='grid-3'>
|
|
1193
|
-
<div class='section'>
|
|
1194
|
-
<% item.internal_router.forEach((domain) => { %>
|
|
1195
|
-
<a class='net' target="_blank" href="https://<%=domain%>">https://<%=domain%></a>
|
|
1196
|
-
<% }) %>
|
|
1197
|
-
<a class='net' target="_blank" href="http://localhost:<%=item.port%>">http://localhost:<%=item.port%></a>
|
|
1198
|
-
</div>
|
|
1199
|
-
<div class='section'>
|
|
1200
|
-
<% if (item.external_ip) { %>
|
|
1201
|
-
<a class='net' target="_blank" href="http://<%=item.external_ip%>">http://<%=item.external_ip%></a>
|
|
1202
|
-
<% } %>
|
|
1203
|
-
</div>
|
|
1204
|
-
<div class='section'>
|
|
1205
|
-
<% item.external_router.forEach((domain) => { %>
|
|
1206
|
-
<a class='net' target="_blank" href="https://<%=domain%>">https://<%=domain%></a>
|
|
1207
|
-
<% }) %>
|
|
1208
|
-
</div>
|
|
1209
|
-
</div>
|
|
1210
|
-
</div>
|
|
1211
|
-
</h3>
|
|
1212
|
-
</div>
|
|
1213
|
-
<% }) %>
|
|
1214
1150
|
<% static_routes.forEach((route, index) => { %>
|
|
1215
1151
|
<div class='line align-top' data-index="<%=processes.length+index%>" data-name="<%=route.name%>" data-title="<%=route.name%>" data-description="<%=route.internal_router.join(' ')%>">
|
|
1216
1152
|
<h3>
|
|
@@ -1621,86 +1557,6 @@ setInterval(() => {
|
|
|
1621
1557
|
}, 2000)
|
|
1622
1558
|
<% } %>
|
|
1623
1559
|
|
|
1624
|
-
let list = []
|
|
1625
|
-
document.querySelectorAll(".line").forEach((el, index) => {
|
|
1626
|
-
list.push({
|
|
1627
|
-
index: parseInt(el.getAttribute("data-index")),
|
|
1628
|
-
name: el.getAttribute("data-name"),
|
|
1629
|
-
description: el.getAttribute("data-description"),
|
|
1630
|
-
uri: el.getAttribute("data-uri")
|
|
1631
|
-
})
|
|
1632
|
-
})
|
|
1633
|
-
const search = (items, value) => {
|
|
1634
|
-
let filtered = []
|
|
1635
|
-
for(let i=0; i<items.length; i++) {
|
|
1636
|
-
let item = items[i]
|
|
1637
|
-
let re = new RegExp(value, "i")
|
|
1638
|
-
if (re.test(item.name)) {
|
|
1639
|
-
filtered.push({ item })
|
|
1640
|
-
} else if (re.test(item.description)) {
|
|
1641
|
-
filtered.push({ item })
|
|
1642
|
-
} else if (re.test(item.uri)) {
|
|
1643
|
-
filtered.push({ item })
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
return filtered
|
|
1647
|
-
}
|
|
1648
|
-
let selectedIndex = -1
|
|
1649
|
-
let selectedBtnIndex = 0
|
|
1650
|
-
let filteredCount = list.length
|
|
1651
|
-
let filteredBtnsCount = 0
|
|
1652
|
-
const renderSearch = () => {
|
|
1653
|
-
let target = document.querySelector("form input[type=search]")
|
|
1654
|
-
let result
|
|
1655
|
-
if (target.value.trim().length === 0) {
|
|
1656
|
-
result = list.map((i, index) => {
|
|
1657
|
-
return { item: i }
|
|
1658
|
-
})
|
|
1659
|
-
} else {
|
|
1660
|
-
result = search(list, target.value)
|
|
1661
|
-
}
|
|
1662
|
-
let all = document.querySelectorAll(".line")
|
|
1663
|
-
for(let el of all) {
|
|
1664
|
-
el.classList.add("hidden")
|
|
1665
|
-
el.classList.remove("selected")
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
filteredCount = result.length
|
|
1669
|
-
for(let i=0; i<result.length; i++) {
|
|
1670
|
-
let selector = result[i]
|
|
1671
|
-
//let el = document.querySelector(".line[data-name='" + selector.item.name + "']")
|
|
1672
|
-
let el = document.querySelector(".line[data-index='" + selector.item.index + "']")
|
|
1673
|
-
el.classList.remove("hidden")
|
|
1674
|
-
if (i === selectedIndex) {
|
|
1675
|
-
el.classList.add("selected")
|
|
1676
|
-
let btns = el.querySelectorAll(".btns a")
|
|
1677
|
-
filteredBtnsCount = btns.length
|
|
1678
|
-
btns.forEach((_el, j) => {
|
|
1679
|
-
if (selectedBtnIndex === j) {
|
|
1680
|
-
_el.classList.add("selected")
|
|
1681
|
-
} else {
|
|
1682
|
-
_el.classList.remove("selected")
|
|
1683
|
-
}
|
|
1684
|
-
})
|
|
1685
|
-
} else {
|
|
1686
|
-
el.classList.remove("selected")
|
|
1687
|
-
let btns = el.querySelectorAll(".btns a")
|
|
1688
|
-
btns.forEach((_el, j) => {
|
|
1689
|
-
_el.classList.remove("selected")
|
|
1690
|
-
})
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
}
|
|
1695
|
-
if (document.querySelector("form input[type=search]")) {
|
|
1696
|
-
renderSearch()
|
|
1697
|
-
document.querySelector("form input[type=search]").addEventListener("input", (e) => {
|
|
1698
|
-
selectedIndex = 0
|
|
1699
|
-
selectedBtnIndex = 0
|
|
1700
|
-
renderSearch()
|
|
1701
|
-
})
|
|
1702
|
-
document.querySelector("form input[type=search]").focus()
|
|
1703
|
-
}
|
|
1704
1560
|
</script>
|
|
1705
1561
|
</body>
|
|
1706
1562
|
</html>
|
package/server/views/tools.ejs
CHANGED