pinokiod 2.15.9 → 2.15.11
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/package.json +1 -1
- package/server/index.js +26 -1
- package/server/public/style.css +14 -1
- package/server/views/editor.ejs +3 -1
- package/server/views/fullscreen_editor.ejs +4 -2
- package/server/views/index.ejs +7 -1
- package/server/views/proxy.ejs +84 -42
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -2150,6 +2150,30 @@ class Server {
|
|
|
2150
2150
|
icon = "pinokio-black.png"
|
|
2151
2151
|
}
|
|
2152
2152
|
|
|
2153
|
+
|
|
2154
|
+
// App sharing
|
|
2155
|
+
let apipath = this.kernel.path("api")
|
|
2156
|
+
let files = await fs.promises.readdir(apipath, { withFileTypes: true })
|
|
2157
|
+
let folders = files.filter((f) => {
|
|
2158
|
+
return f.isDirectory()
|
|
2159
|
+
}).map((x) => {
|
|
2160
|
+
return x.name
|
|
2161
|
+
})
|
|
2162
|
+
let apps = []
|
|
2163
|
+
for(let folder of folders) {
|
|
2164
|
+
let p = path.resolve(apipath, folder, "pinokio.js")
|
|
2165
|
+
let pinokio = (await this.kernel.loader.load(p)).resolved
|
|
2166
|
+
if (pinokio) {
|
|
2167
|
+
apps.push({
|
|
2168
|
+
name: pinokio.title,
|
|
2169
|
+
description: pinokio.description,
|
|
2170
|
+
link: `/pinokio/browser/${folder}/browse#n1`,
|
|
2171
|
+
icon: pinokio.icon ? `/api/${folder}/${pinokio.icon}?raw=true` : null
|
|
2172
|
+
})
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
console.log({ apps })
|
|
2176
|
+
|
|
2153
2177
|
res.render("proxy", {
|
|
2154
2178
|
agent: this.agent,
|
|
2155
2179
|
theme: this.theme,
|
|
@@ -2157,7 +2181,8 @@ class Server {
|
|
|
2157
2181
|
qr,
|
|
2158
2182
|
proxy: home_proxy,
|
|
2159
2183
|
localhost: `http://localhost:${this.port}`,
|
|
2160
|
-
icon
|
|
2184
|
+
icon,
|
|
2185
|
+
apps
|
|
2161
2186
|
})
|
|
2162
2187
|
}))
|
|
2163
2188
|
this.app.post("/proxy", ex(async (req, res) => {
|
package/server/public/style.css
CHANGED
|
@@ -1630,9 +1630,22 @@ footer.status {
|
|
|
1630
1630
|
font-weight: bold;
|
|
1631
1631
|
width: 100%;
|
|
1632
1632
|
}
|
|
1633
|
+
/*
|
|
1634
|
+
#error-screen .btn i {
|
|
1635
|
+
padding: 5px 5px 10px;
|
|
1636
|
+
}
|
|
1637
|
+
*/
|
|
1638
|
+
#error-screen .btn {
|
|
1639
|
+
font-size: 14px;
|
|
1640
|
+
padding: 15px 30px;
|
|
1641
|
+
font-weight: bold;
|
|
1642
|
+
background: firebrick;
|
|
1643
|
+
border-radius: 50px;
|
|
1644
|
+
text-transform: uppercase;
|
|
1645
|
+
}
|
|
1633
1646
|
|
|
1634
1647
|
mark{
|
|
1635
|
-
background:
|
|
1648
|
+
background: firebrick;
|
|
1636
1649
|
color: white;
|
|
1637
1650
|
padding: 5px;
|
|
1638
1651
|
display: inline-block;
|
package/server/views/editor.ejs
CHANGED
|
@@ -888,7 +888,9 @@ const reloadMemory = async () => {
|
|
|
888
888
|
<div id='error-screen' class='hidden'>
|
|
889
889
|
<pre></pre>
|
|
890
890
|
<div id='error-screen-footer'>
|
|
891
|
-
<
|
|
891
|
+
<a class='btn' href="https://portal.pinokio.computer" target="_blank">
|
|
892
|
+
<div><i class="fa-solid fa-face-smile"></i> Ask Community</div>
|
|
893
|
+
</a>
|
|
892
894
|
</div>
|
|
893
895
|
</div>
|
|
894
896
|
</body>
|
|
@@ -825,8 +825,10 @@ const reloadMemory = async () => {
|
|
|
825
825
|
<% } %>
|
|
826
826
|
<div id='error-screen' class='hidden'>
|
|
827
827
|
<pre></pre>
|
|
828
|
-
<div id='error-screen-footer'
|
|
829
|
-
<
|
|
828
|
+
<div id='error-screen-footer'>
|
|
829
|
+
<a class='btn' href="https://portal.pinokio.computer" target="_blank">
|
|
830
|
+
<div><i class="fa-solid fa-face-smile"></i> Ask Community</div>
|
|
831
|
+
</a>
|
|
830
832
|
</div>
|
|
831
833
|
</div>
|
|
832
834
|
</body>
|
package/server/views/index.ejs
CHANGED
|
@@ -182,7 +182,6 @@ body.dark .browser-options-row {
|
|
|
182
182
|
</form>
|
|
183
183
|
<% if (ishome) { %>
|
|
184
184
|
<div class='nav-btns'>
|
|
185
|
-
<a class='btn2' href='/proxy'><div><i class="fa-solid fa-wifi"></i></div><div>Share</div></a>
|
|
186
185
|
<a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
|
|
187
186
|
<a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-face-smile-beam"></i></div><div>Community</div></a>
|
|
188
187
|
<% if (agent === "electron") { %>
|
|
@@ -236,6 +235,13 @@ body.dark .browser-options-row {
|
|
|
236
235
|
</div>
|
|
237
236
|
</div>
|
|
238
237
|
<% } %>
|
|
238
|
+
<div class='browser-options-row'>
|
|
239
|
+
<a href="/proxy" class='btn'><div><i class="fa-solid fa-gauge"></i> Configure</div></a>
|
|
240
|
+
<div class='flexible'>
|
|
241
|
+
<h3><i class="fa-solid fa-wifi"></i> Local Sharing</h3>
|
|
242
|
+
<div>Serve Pinokio, installed apps, and even external apps (example: Ollama) to any device on the same network.</div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
239
245
|
<!--
|
|
240
246
|
<div class='browser-options-row'>
|
|
241
247
|
<a href="/proxy" class='flexible'>
|
package/server/views/proxy.ejs
CHANGED
|
@@ -127,19 +127,48 @@ body.dark .browser-options-row {
|
|
|
127
127
|
text-decoration: none;
|
|
128
128
|
}
|
|
129
129
|
.line.align-top h3 {
|
|
130
|
+
/*
|
|
130
131
|
align-items: flex-start;
|
|
132
|
+
*/
|
|
133
|
+
align-items: center;
|
|
131
134
|
}
|
|
132
135
|
.line a:hover {
|
|
133
136
|
color: red;
|
|
134
137
|
}
|
|
138
|
+
.line img {
|
|
139
|
+
width: 40px;
|
|
140
|
+
height: 40px;
|
|
141
|
+
}
|
|
135
142
|
.btn-container {
|
|
136
143
|
margin-top: 10px;
|
|
137
144
|
}
|
|
138
145
|
.header-label {
|
|
139
|
-
font-
|
|
146
|
+
font-family: Georgia;
|
|
147
|
+
font-style: italic;
|
|
148
|
+
font-size: 50px;
|
|
140
149
|
letter-spacing: -1px;
|
|
141
|
-
padding:
|
|
150
|
+
padding: 50px;
|
|
142
151
|
text-align: center;
|
|
152
|
+
text-transform: capitalize;
|
|
153
|
+
}
|
|
154
|
+
.header-label-sub {
|
|
155
|
+
font-size: 25px;
|
|
156
|
+
letter-spacing: -1px;
|
|
157
|
+
padding: 15px;
|
|
158
|
+
font-weight: bold;
|
|
159
|
+
}
|
|
160
|
+
.container {
|
|
161
|
+
display: grid;
|
|
162
|
+
grid-template-columns: repeat(2, 1fr);
|
|
163
|
+
}
|
|
164
|
+
.dark .container-row {
|
|
165
|
+
background: rgba(255, 255, 255, 0.04);
|
|
166
|
+
}
|
|
167
|
+
.container-row {
|
|
168
|
+
margin: 10px;
|
|
169
|
+
background: rgba(0, 0, 100, 0.04);
|
|
170
|
+
padding: 20px;
|
|
171
|
+
box-sizing: border-box;
|
|
143
172
|
}
|
|
144
173
|
@media only screen and (max-width: 480px) {
|
|
145
174
|
.btn2 {
|
|
@@ -171,59 +200,72 @@ body.dark .browser-options-row {
|
|
|
171
200
|
</h1>
|
|
172
201
|
</header>
|
|
173
202
|
<main>
|
|
203
|
+
<div class='header-label'><i class='fa-solid fa-wifi'></i> Local Sharing</div>
|
|
174
204
|
<div class='container'>
|
|
175
|
-
<div class='
|
|
176
|
-
<div class='header-label'><i class=
|
|
177
|
-
<
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
205
|
+
<div class='container-row'>
|
|
206
|
+
<div class='header-label-sub'><i class="fa-solid fa-microchip"></i> System Programs</div>
|
|
207
|
+
<div class='line align-top'>
|
|
208
|
+
<h3>
|
|
209
|
+
<img class='icon' src="<%=icon%>">
|
|
210
|
+
<div class='col'>
|
|
211
|
+
<div class='title'>Pinokio</div>
|
|
212
|
+
<% if (proxy) { %>
|
|
213
|
+
<div class='description'><a href="<%=proxy.proxy%>" target="_blank"><%=proxy.proxy%></a> → <a href="<%=localhost%>" target="_blank"><%=localhost%></a></div>
|
|
214
|
+
<a class='wifi-qr badge' data-qr="<%=qr%>" data-url="<%=proxy.proxy%>"><i class="fa-solid fa-qrcode"></i> Scan QR Code</a>
|
|
215
|
+
<% } else { %>
|
|
216
|
+
<div class='description'>Share Pinokio <a href="<%=localhost%>" target="_blank"><%=localhost%></a> with other devices on the same network</div>
|
|
217
|
+
<% } %>
|
|
218
|
+
<div class='btn-container'>
|
|
219
|
+
<% if (proxy) { %>
|
|
220
|
+
<div id='wifi-stop' data-proxy="<%=proxy.proxy%>" class='btn'><div><i class="fa-solid fa-stop"></i> Stop</div></div>
|
|
221
|
+
<% } else { %>
|
|
222
|
+
<div id='wifi' class='btn'><div><i class="fa-solid fa-play"></i> Start</div></div>
|
|
223
|
+
<div id='wifi-starting' class='btn disabled hidden'><div><i class="fa-solid fa-circle-notch fa-spin"></i> Starting</div></div>
|
|
224
|
+
<% } %>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</h3>
|
|
228
|
+
</div>
|
|
229
|
+
<% items.forEach((item) => { %>
|
|
181
230
|
<div class='line align-top'>
|
|
182
231
|
<h3>
|
|
183
|
-
<img class='icon' src="<%=icon%>">
|
|
232
|
+
<img class='icon' src="<%=item.icon%>">
|
|
184
233
|
<div class='col'>
|
|
185
|
-
<div class='title'
|
|
186
|
-
<% if (proxy) { %>
|
|
187
|
-
<div class='description'><a href="<%=
|
|
188
|
-
<a class='wifi-qr badge' data-qr="<%=qr%>" data-url="<%=
|
|
234
|
+
<div class='title'><%=item.name%></div>
|
|
235
|
+
<% if (item.proxy) { %>
|
|
236
|
+
<div class='description'><a href="<%=item.proxy%>" target="_blank"><%=item.proxy%></a> → <a href="<%=item.target%>" target="_blank"><%=item.target%></a></div>
|
|
237
|
+
<a class='wifi-qr badge' data-qr="<%=item.qr%>" data-url="<%=item.proxy%>"><i class="fa-solid fa-qrcode"></i> Scan QR Code</a>
|
|
189
238
|
<% } else { %>
|
|
190
|
-
<div class='description'>Share
|
|
239
|
+
<div class='description'>Share <%=item.target%> with other devices on the same network</div>
|
|
191
240
|
<% } %>
|
|
192
241
|
<div class='btn-container'>
|
|
193
|
-
<% if (
|
|
194
|
-
<div
|
|
242
|
+
<% if (item.running) { %>
|
|
243
|
+
<div data-port="<%=item.port%>" data-name="<%=item.name%>" data-target="<%=item.target%>" class='stop btn'><i class="fa-solid fa-stop"></i> Stop</div>
|
|
195
244
|
<% } else { %>
|
|
196
|
-
<div
|
|
197
|
-
<div id='wifi-starting' class='btn disabled hidden'><div><i class="fa-solid fa-circle-notch fa-spin"></i> Starting</div></div>
|
|
245
|
+
<div data-port="<%=item.port%>" data-name="<%=item.name%>" data-target="<%=item.target%>" class='start btn'><i class="fa-solid fa-play"></i> Start</div>
|
|
198
246
|
<% } %>
|
|
199
247
|
</div>
|
|
200
248
|
</div>
|
|
201
249
|
</h3>
|
|
202
250
|
</div>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
</h3>
|
|
224
|
-
</div>
|
|
225
|
-
<% }) %>
|
|
226
|
-
</div>
|
|
251
|
+
<% }) %>
|
|
252
|
+
</div>
|
|
253
|
+
<div class='container-row'>
|
|
254
|
+
<div class='header-label-sub'><i class="fa-solid fa-dice-d6"></i> Application Programs</div>
|
|
255
|
+
<% apps.forEach((item) => { %>
|
|
256
|
+
<a class='line align-top' href="<%=item.link%>">
|
|
257
|
+
<h3>
|
|
258
|
+
<img class='icon' src="<%=item.icon%>">
|
|
259
|
+
<div class='col'>
|
|
260
|
+
<div class='title'><%=item.name%></div>
|
|
261
|
+
<div class='description'><%=item.description%></div>
|
|
262
|
+
</div>
|
|
263
|
+
<div class='spinner'>
|
|
264
|
+
<i class="fa-solid fa-chevron-right"></i>
|
|
265
|
+
</div>
|
|
266
|
+
</h3>
|
|
267
|
+
</a>
|
|
268
|
+
<% }) %>
|
|
227
269
|
</div>
|
|
228
270
|
</div>
|
|
229
271
|
</main>
|