pinokiod 3.9.0 → 3.9.2
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/filepicker/index.js +59 -0
- package/kernel/api/fs/index.js +6 -4
- package/kernel/api/index.js +123 -37
- package/kernel/api/input/index.js +2 -0
- package/kernel/api/web/index.js +6 -0
- package/kernel/bin/caddy.js +127 -0
- package/kernel/bin/cloudflared.js +1 -0
- package/kernel/bin/conda.js +10 -2
- package/kernel/bin/cuda.js +0 -16
- package/kernel/bin/ffmpeg.js +4 -6
- package/kernel/bin/git.js +55 -29
- package/kernel/bin/gxx.js +8 -6
- package/kernel/bin/huggingface.js +4 -5
- package/kernel/bin/index.js +347 -88
- package/kernel/bin/node.js +13 -6
- package/kernel/bin/py.js +1 -1
- package/kernel/bin/setup.js +146 -0
- package/kernel/bin/uv.js +4 -5
- package/kernel/bin/zip.js +7 -8
- package/kernel/connect/index.js +25 -0
- package/kernel/connect/providers/github/README.md +11 -0
- package/kernel/connect/providers/x/README.md +96 -0
- package/kernel/connect/providers/x/index.js +152 -0
- package/kernel/environment.js +50 -1
- package/kernel/index.js +152 -32
- package/kernel/info.js +4 -2
- package/kernel/kv.js +38 -0
- package/kernel/loader.js +13 -3
- package/kernel/peer.js +161 -0
- package/kernel/procs.js +116 -0
- package/kernel/prototype.js +62 -0
- package/kernel/router/common.js +42 -0
- package/kernel/router/connector.js +81 -0
- package/kernel/router/index.js +235 -0
- package/kernel/router/localhost_home_router.js +84 -0
- package/kernel/router/localhost_port_router.js +15 -0
- package/kernel/router/localhost_variable_router.js +37 -0
- package/kernel/router/peer_home_router.js +15 -0
- package/kernel/router/peer_peer_router.js +26 -0
- package/kernel/router/peer_port_router.js +45 -0
- package/kernel/router/peer_variable_router.js +46 -0
- package/kernel/router/processor.js +31 -0
- package/kernel/shell.js +141 -60
- package/kernel/shells.js +32 -17
- package/kernel/store.js +58 -0
- package/kernel/sysinfo.js +0 -1
- package/kernel/util.js +143 -36
- package/package.json +4 -1
- package/pipe/index.js +0 -2
- package/script/index.js +12 -0
- package/server/index.js +1473 -553
- package/server/public/Socket.js +5 -1
- package/server/public/SourceCodePro-Regular.ttf +0 -0
- package/server/public/SpaceMono-Bold.ttf +0 -0
- package/server/public/SpaceMono-BoldItalic.ttf +0 -0
- package/server/public/SpaceMono-Italic.ttf +0 -0
- package/server/public/SpaceMono-Regular.ttf +0 -0
- package/server/public/commander.js +40 -0
- package/server/public/common.js +60 -0
- package/server/public/dropzone-min.js +2 -0
- package/server/public/dropzone.css +1 -0
- package/server/public/filepond-plugin-file-validate-type.min.js +9 -0
- package/server/public/filepond-plugin-image-crop.min.js +9 -0
- package/server/public/filepond-plugin-image-edit.min.css +8 -0
- package/server/public/filepond-plugin-image-edit.min.js +9 -0
- package/server/public/filepond-plugin-image-exif-orientation.min.js +9 -0
- package/server/public/filepond-plugin-image-preview.min.css +8 -0
- package/server/public/filepond-plugin-image-preview.min.js +9 -0
- package/server/public/filepond-plugin-image-resize.min.js +9 -0
- package/server/public/filepond-plugin-image-transform.min.js +9 -0
- package/server/public/filepond.min.css +8 -0
- package/server/public/filepond.min.js +9 -0
- package/server/public/fscreator.js +174 -0
- package/server/public/fseditor.js +212 -0
- package/server/public/github.png +0 -0
- package/server/public/highlight-js.js +81 -0
- package/server/public/highlight.css +9 -0
- package/server/public/highlight.js +1244 -0
- package/server/public/install.js +17 -20
- package/server/public/modalinput.js +105 -9
- package/server/public/opener.js +3 -1
- package/server/public/pinokio-black.png +0 -0
- package/server/public/pinokio-black2.png +0 -0
- package/server/public/redoc.standalone.js +1832 -0
- package/server/public/style.css +211 -17
- package/server/public/swagger-ui-bundle.js +2 -0
- package/server/public/swagger-ui.css +3 -0
- package/server/public/x.js +63 -0
- package/server/socket.js +136 -39
- package/server/views/404.ejs +0 -1
- package/server/views/app.ejs +356 -90
- package/server/views/bootstrap.ejs +22 -19
- package/server/views/connect/x.ejs +324 -0
- package/server/views/connect.ejs +197 -0
- package/server/views/download.ejs +7 -1
- package/server/views/editor.ejs +68 -9
- package/server/views/explore.ejs +13 -10
- package/server/views/file_explorer.ejs +10 -37
- package/server/views/github.ejs +218 -0
- package/server/views/help.ejs +4 -3
- package/server/views/index.ejs +268 -118
- package/server/views/install.ejs +56 -29
- package/server/views/keys.ejs +276 -0
- package/server/views/network.ejs +889 -0
- package/server/views/partials/dynamic.ejs +9 -0
- package/server/views/partials/menu.ejs +7 -1
- package/server/views/prototype/index.ejs +311 -0
- package/server/views/prototype/show.ejs +383 -0
- package/server/views/redoc.ejs +18 -0
- package/server/views/required_env_editor.ejs +11 -2
- package/server/views/settings.ejs +38 -10
- package/server/views/setup.ejs +254 -0
- package/server/views/setup_home.ejs +192 -0
- package/server/views/shell.ejs +781 -0
- package/server/views/swaggerui.ejs +19 -0
- package/server/views/terminal.ejs +174 -42
- package/LICENSE +0 -7
- package/server/views/proxy.ejs +0 -405
package/server/views/index.ejs
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
<link href="/css/brands.min.css" rel="stylesheet">
|
|
11
11
|
<link href="/markdown.css" rel="stylesheet"/>
|
|
12
12
|
<link href="/noty.css" rel="stylesheet"/>
|
|
13
|
+
<link href="/filepond.min.css" rel="stylesheet" />
|
|
14
|
+
<link href="/filepond-plugin-image-preview.min.css" rel="stylesheet" />
|
|
15
|
+
<link href="/filepond-plugin-image-edit.min.css" rel="stylesheet" />
|
|
13
16
|
<link href="/style.css" rel="stylesheet"/>
|
|
14
17
|
<% if (agent === "electron") { %>
|
|
15
18
|
<link href="/electron.css" rel="stylesheet"/>
|
|
@@ -125,6 +128,55 @@ body.dark .browser-options-row {
|
|
|
125
128
|
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
126
129
|
}
|
|
127
130
|
*/
|
|
131
|
+
.context-menu-wrapper {
|
|
132
|
+
padding: 2px 0;
|
|
133
|
+
background: rgba(0,0,0,0.9);
|
|
134
|
+
}
|
|
135
|
+
.context-menu {
|
|
136
|
+
/*
|
|
137
|
+
max-height: 10000px;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
transition: max-height 1s ease-in-out;
|
|
140
|
+
*/
|
|
141
|
+
display: flex;
|
|
142
|
+
}
|
|
143
|
+
.context-menu .btn:hover {
|
|
144
|
+
color: cornflowerblue !important;
|
|
145
|
+
}
|
|
146
|
+
.context-menu .btn {
|
|
147
|
+
background: none !important;
|
|
148
|
+
border: none !important;
|
|
149
|
+
display: block;
|
|
150
|
+
width: 80px;
|
|
151
|
+
padding: 6px 10px !important;
|
|
152
|
+
text-align: left;
|
|
153
|
+
}
|
|
154
|
+
.context-menu.collapsed {
|
|
155
|
+
/*
|
|
156
|
+
max-height: 0;
|
|
157
|
+
*/
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
body.dark .open-menu {
|
|
161
|
+
background: black !important;
|
|
162
|
+
color: white !important;
|
|
163
|
+
}
|
|
164
|
+
.open-menu {
|
|
165
|
+
width: 80px;
|
|
166
|
+
border-radius: 0 !important;
|
|
167
|
+
background: white !important;
|
|
168
|
+
color: black !important;
|
|
169
|
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
|
170
|
+
}
|
|
171
|
+
.open-menu.selected {
|
|
172
|
+
border: none !important;
|
|
173
|
+
/*
|
|
174
|
+
background: none !important;
|
|
175
|
+
*/
|
|
176
|
+
}
|
|
177
|
+
.open-menu.selected span {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
128
180
|
@media only screen and (max-width: 480px) {
|
|
129
181
|
.btn2 {
|
|
130
182
|
padding: 5px;
|
|
@@ -152,6 +204,16 @@ body.dark .browser-options-row {
|
|
|
152
204
|
<script src="/nav.js"></script>
|
|
153
205
|
<script src="/fuse.js"></script>
|
|
154
206
|
<script src="/report.js"></script>
|
|
207
|
+
<script src="/filepond-plugin-file-validate-type.min.js"></script>
|
|
208
|
+
<script src="/filepond-plugin-image-exif-orientation.min.js"></script>
|
|
209
|
+
<script src="/filepond-plugin-image-preview.min.js"></script>
|
|
210
|
+
<script src="/filepond-plugin-image-edit.min.js"></script>
|
|
211
|
+
<script src="/filepond-plugin-image-crop.min.js"></script>
|
|
212
|
+
<script src="/filepond-plugin-image-resize.min.js"></script>
|
|
213
|
+
<script src="/filepond-plugin-image-transform.min.js"></script>
|
|
214
|
+
<script src="/filepond.min.js"></script>
|
|
215
|
+
<script src="/fscreator.js"></script>
|
|
216
|
+
<script src="/fseditor.js"></script>
|
|
155
217
|
</head>
|
|
156
218
|
<body class='<%=theme%>'>
|
|
157
219
|
<% if (error) { %>
|
|
@@ -168,8 +230,18 @@ body.dark .browser-options-row {
|
|
|
168
230
|
<h1>
|
|
169
231
|
<% if (ishome) { %>
|
|
170
232
|
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
171
|
-
<button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
|
|
172
|
-
<button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
|
|
233
|
+
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
234
|
+
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
235
|
+
<a class='btn2 create-new' id='create-new-folder'><div><i class='fa-solid fa-plus'></i></div><div>New</div></a>
|
|
236
|
+
<!--
|
|
237
|
+
<a href="/new" class='btn2'><div><i class='fa-solid fa-folder-plus'></i></div><div>Create</div></a>
|
|
238
|
+
-->
|
|
239
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
|
|
240
|
+
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
241
|
+
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
242
|
+
<!--
|
|
243
|
+
<button id='newfolder' class='btn2'><div><i class="fa-solid fa-folder-plus"></i></div><div>New Folder</div></button>
|
|
244
|
+
-->
|
|
173
245
|
<% } %>
|
|
174
246
|
<% paths.forEach((path) => { %>
|
|
175
247
|
<% if (path.action) { %>
|
|
@@ -186,14 +258,18 @@ body.dark .browser-options-row {
|
|
|
186
258
|
</form>
|
|
187
259
|
<% if (ishome) { %>
|
|
188
260
|
<div class='nav-btns'>
|
|
189
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
|
|
190
261
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
191
262
|
<% if (agent === "electron") { %>
|
|
192
263
|
<a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
|
|
193
264
|
<% } %>
|
|
194
|
-
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>
|
|
265
|
+
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
195
266
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
196
267
|
<a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
|
|
268
|
+
<% if (agent === "electron") { %>
|
|
269
|
+
<a href="/" target="_blank" class='btn2' features="browser"><div><i class="fa-solid fa-square-up-right"></i></div><div>Open</div></a>
|
|
270
|
+
<% } else { %>
|
|
271
|
+
<a href="/" target="_blank" class='btn2'><div><i class="fa-solid fa-square-up-right"></i></div><div>Open</div></a>
|
|
272
|
+
<% } %>
|
|
197
273
|
<button id='new-window' title='open a new window' class='btn2'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
|
|
198
274
|
</div>
|
|
199
275
|
<% } %>
|
|
@@ -203,7 +279,7 @@ body.dark .browser-options-row {
|
|
|
203
279
|
<button class='btn' id='open-fs' data-filepath="<%=filepath%>"><i class="fa-solid fa-eye"></i> View Folder</button>
|
|
204
280
|
</div>
|
|
205
281
|
<% } %>
|
|
206
|
-
<% if (display.includes("dependencies")) { %>
|
|
282
|
+
<% if (display.includes("dependencies") && config) { %>
|
|
207
283
|
<div class='dependencies'>
|
|
208
284
|
<h2>Prerequisites</h2>
|
|
209
285
|
<div class='item'>Download and install the following dependencies first</div>
|
|
@@ -225,6 +301,7 @@ body.dark .browser-options-row {
|
|
|
225
301
|
<% if (ishome) { %>
|
|
226
302
|
<% if (running.length === 0 && notRunning.length === 0) { %>
|
|
227
303
|
<% } else { %>
|
|
304
|
+
<% if (false) { %>
|
|
228
305
|
<div class='browser-options'>
|
|
229
306
|
<% if (agent === "electron") { %>
|
|
230
307
|
<div class='browser-options-row'>
|
|
@@ -240,38 +317,12 @@ body.dark .browser-options-row {
|
|
|
240
317
|
</div>
|
|
241
318
|
<% } %>
|
|
242
319
|
<div class='browser-options-row'>
|
|
243
|
-
<a href="/
|
|
320
|
+
<a href="/network" class='btn'><div><i class="fa-solid fa-gauge"></i> Configure</div></a>
|
|
244
321
|
<div class='flexible'>
|
|
245
322
|
<h3><i class="fa-solid fa-wifi"></i> Local Sharing</h3>
|
|
246
323
|
<div>Serve Pinokio, installed apps, and even external apps (example: Ollama) to any device on the same network.</div>
|
|
247
324
|
</div>
|
|
248
325
|
</div>
|
|
249
|
-
<!--
|
|
250
|
-
<div class='browser-options-row'>
|
|
251
|
-
<a href="/proxy" class='flexible'>
|
|
252
|
-
<h3><i class="fa-solid fa-wifi"></i> Local Share</h3>
|
|
253
|
-
<div>Access Pinokio, Ollama, and other 3rd party apps from any device on the same network. By default it's off.</div>
|
|
254
|
-
</a>
|
|
255
|
-
<% if (false) { %>
|
|
256
|
-
<% if (proxy) { %>
|
|
257
|
-
<a id='wifi-stop' data-proxy="<%=proxy.proxy%>" class='btn'><div><i class="fa-solid fa-stop"></i> Stop</div></a>
|
|
258
|
-
<div class='flexible'>
|
|
259
|
-
<h3><i class="fa-solid fa-wifi"></i> Local Share</h3>
|
|
260
|
-
<div>Access Pinokio from any device on the same network. By default it's off.</div>
|
|
261
|
-
<span class='badge'><i class="fa-solid fa-circle-notch fa-spin"></i> Running at <a href="<%=proxy.proxy%>" target="_blank" features="browser"><%=proxy.proxy%></a></span>
|
|
262
|
-
<a id='wifi-qr' class='badge'><i class="fa-solid fa-qrcode"></i> Scan QR Code</a>
|
|
263
|
-
</div>
|
|
264
|
-
<% } else { %>
|
|
265
|
-
<a id='wifi' class='btn'><div><i class="fa-solid fa-play"></i> Start</div></a>
|
|
266
|
-
<a id='wifi-starting' class='btn disabled hidden'><div><i class="fa-solid fa-circle-notch fa-spin"></i> Starting</div></a>
|
|
267
|
-
<div class='flexible'>
|
|
268
|
-
<h3><i class="fa-solid fa-wifi"></i> Local Share</h3>
|
|
269
|
-
<div>Access Pinokio from any device on the same network. By default it's off.</div>
|
|
270
|
-
</div>
|
|
271
|
-
<% } %>
|
|
272
|
-
<% } %>
|
|
273
|
-
</div>
|
|
274
|
-
-->
|
|
275
326
|
<div class='browser-options-row hidden'>
|
|
276
327
|
<% if (cloudflare_pub) { %>
|
|
277
328
|
<a id='cloudflare-stop' class='btn'><div><i class="fa-solid fa-stop"></i> Stop</div></a>
|
|
@@ -291,49 +342,46 @@ body.dark .browser-options-row {
|
|
|
291
342
|
<% } %>
|
|
292
343
|
</div>
|
|
293
344
|
</div>
|
|
294
|
-
<% } %>
|
|
295
|
-
<!--
|
|
296
|
-
<div class='type-tabs'>
|
|
297
|
-
<% if (mode === "task") { %>
|
|
298
|
-
<a class='type-tab' href="/"><img src='/pinokio-<%=theme=='dark' ? 'white' : 'black'%>.png'> Apps</a>
|
|
299
|
-
<a class='type-tab selected' href="/?mode=task"> <img src='/<%=theme=='dark' ? 'term-dark.png' : 'term-white.png'%>'> Tasks</a>
|
|
300
|
-
<% } else { %>
|
|
301
|
-
<a class='type-tab selected' href="/"><img src='/pinokio-<%=theme=='dark' ? 'white' : 'black'%>.png'> Apps</a>
|
|
302
|
-
<a class='type-tab' href="/?mode=task"> <img src='/<%=theme=='dark' ? 'term-dark.png' : 'term-white.png'%>'> Tasks</a>
|
|
303
345
|
<% } %>
|
|
304
|
-
|
|
305
|
-
-->
|
|
346
|
+
<% } %>
|
|
306
347
|
<% if (running.length > 0) { %>
|
|
307
348
|
<div class='running-apps'>
|
|
349
|
+
<!--
|
|
308
350
|
<div class='header-label'>Running</div>
|
|
351
|
+
-->
|
|
309
352
|
<% running.forEach((item) => { %>
|
|
310
|
-
<a href="<%=item.browser_url%>" data-description="<%=item.description%>" data-index="<%=item.index%>" data-name="<%=item.name%>" data-uri="<%=item.uri%>" class='line align-top'>
|
|
353
|
+
<a href="<%=item.browser_url%>" data-description="<%=item.description%>" data-index="<%=item.index%>" data-name="<%=item.name%>" data-title="<%=item.name%>" data-uri="<%=item.uri%>" data-icon="<%=item.icon%>" data-path="<%=item.path%>" data-iconpath="<%=item.iconpath ? item.iconpath : ''%>" class='line align-top'>
|
|
311
354
|
<h3>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
<% if (theme === 'dark') { %>
|
|
316
|
-
<img src="/pinokio-white.png">
|
|
355
|
+
<div class='item-icon'>
|
|
356
|
+
<% if (item.icon) { %>
|
|
357
|
+
<img src="<%=item.icon%>">
|
|
317
358
|
<% } else { %>
|
|
318
|
-
|
|
359
|
+
<% if (theme === 'dark') { %>
|
|
360
|
+
<img src="/pinokio-white.png">
|
|
361
|
+
<% } else { %>
|
|
362
|
+
<img src="/pinokio-black.png">
|
|
363
|
+
<% } %>
|
|
319
364
|
<% } %>
|
|
320
|
-
|
|
321
|
-
<div class='avatar'>
|
|
322
|
-
<i class="fa-regular fa-circle-dot"></i>
|
|
323
|
-
</div>
|
|
324
|
-
-->
|
|
325
|
-
<% } %>
|
|
365
|
+
</div>
|
|
326
366
|
<div class='col'>
|
|
327
367
|
<div class='uri'><i class="fa-regular fa-folder"></i><%=item.url%></div>
|
|
328
368
|
<div class='title'><%=item.name%></div>
|
|
329
369
|
<div class='description'><%=item.description%></div>
|
|
330
370
|
<div>
|
|
331
|
-
<button class='btn
|
|
332
|
-
<i class=
|
|
333
|
-
</button>
|
|
334
|
-
<button class='btn del' data-src="<%=item.url%>">
|
|
335
|
-
<i class="fa-solid fa-trash-can"></i>
|
|
371
|
+
<button class='btn open-menu'>
|
|
372
|
+
<i class="fa-solid fa-bars"></i><span> Menu</span>
|
|
336
373
|
</button>
|
|
374
|
+
<div class='context-menu collapsed'>
|
|
375
|
+
<div class='context-menu-wrapper'>
|
|
376
|
+
<button class='btn browse' data-src="<%=item.browser_url%>/browse">
|
|
377
|
+
<i class='fa-regular fa-folder-open'></i> View
|
|
378
|
+
</button>
|
|
379
|
+
<button class='btn copy-menu' data-src="<%=item.browser_url%>/browse">
|
|
380
|
+
<i class='fa-solid fa-copy'></i> Copy
|
|
381
|
+
</button>
|
|
382
|
+
</div>
|
|
383
|
+
<div class='flexible'></div>
|
|
384
|
+
</div>
|
|
337
385
|
<% if (item.running_scripts) { %>
|
|
338
386
|
<% item.running_scripts.forEach((s) => { %>
|
|
339
387
|
<button class='btn shutdown' data-src="<%=s.path%>">
|
|
@@ -353,12 +401,11 @@ body.dark .browser-options-row {
|
|
|
353
401
|
</div>
|
|
354
402
|
<% } %>
|
|
355
403
|
</div>
|
|
404
|
+
<!--
|
|
356
405
|
<div class='spinner'>
|
|
357
406
|
<i class="fa-solid fa-chevron-right"></i>
|
|
358
|
-
<!--
|
|
359
|
-
<i class="fa-solid fa-circle-notch fa-spin"></i>
|
|
360
|
-
-->
|
|
361
407
|
</div>
|
|
408
|
+
-->
|
|
362
409
|
</h3>
|
|
363
410
|
</a>
|
|
364
411
|
<% }) %>
|
|
@@ -366,34 +413,50 @@ body.dark .browser-options-row {
|
|
|
366
413
|
<% } %>
|
|
367
414
|
<% if (notRunning.length > 0) { %>
|
|
368
415
|
<div class='not-running-apps'>
|
|
416
|
+
<!--
|
|
369
417
|
<div class='header-label'>Not Running</div>
|
|
418
|
+
-->
|
|
370
419
|
<% notRunning.forEach((item) => { %>
|
|
371
|
-
<a href="<%=item.browser_url%>" data-description="<%=item.description%>" data-index="<%=item.index%>" data-name="<%=item.name%>" data-uri="<%=item.uri%>" class='line align-top'>
|
|
420
|
+
<a href="<%=item.browser_url%>" data-description="<%=item.description%>" data-index="<%=item.index%>" data-name="<%=item.name%>" data-title="<%=item.name%>" data-uri="<%=item.uri%>" data-icon="<%=item.icon%>" data-path="<%=item.path%>" data-iconpath="<%=item.iconpath ? item.iconpath : ''%>" class='line align-top'>
|
|
372
421
|
<h3>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
<!--
|
|
377
|
-
<div class='avatar'>
|
|
378
|
-
<i class="fa-regular fa-circle-dot"></i>
|
|
379
|
-
</div>
|
|
380
|
-
-->
|
|
381
|
-
<% if (theme === 'dark') { %>
|
|
382
|
-
<img src="/pinokio-white.png">
|
|
422
|
+
<div class='item-icon'>
|
|
423
|
+
<% if (item.icon) { %>
|
|
424
|
+
<img src="<%=item.icon%>">
|
|
383
425
|
<% } else { %>
|
|
384
|
-
|
|
426
|
+
<% if (theme === 'dark') { %>
|
|
427
|
+
<img src="/pinokio-white.png">
|
|
428
|
+
<% } else { %>
|
|
429
|
+
<img src="/pinokio-black.png">
|
|
430
|
+
<% } %>
|
|
385
431
|
<% } %>
|
|
386
|
-
|
|
432
|
+
</div>
|
|
387
433
|
<div class='col'>
|
|
388
434
|
<div class='uri'><i class="fa-regular fa-folder"></i><%=item.url%></div>
|
|
389
435
|
<div class='title'><%=item.name%></div>
|
|
390
436
|
<div class='description'><%=item.description%></div>
|
|
391
|
-
<button class='btn
|
|
392
|
-
<i class=
|
|
393
|
-
</button>
|
|
394
|
-
<button class='btn del' data-src="<%=item.url%>">
|
|
395
|
-
<i class="fa-solid fa-trash-can"></i>
|
|
437
|
+
<button class='btn open-menu'>
|
|
438
|
+
<i class="fa-solid fa-bars"></i><span> Menu</span>
|
|
396
439
|
</button>
|
|
440
|
+
<div class='context-menu collapsed'>
|
|
441
|
+
<div class='context-menu-wrapper'>
|
|
442
|
+
<button class='btn browse' data-src="<%=item.browser_url%>/browse">
|
|
443
|
+
<i class='fa-regular fa-folder-open'></i> View
|
|
444
|
+
</button>
|
|
445
|
+
<button class='btn copy-menu' data-src="<%=item.browser_url%>/browse">
|
|
446
|
+
<i class='fa-solid fa-copy'></i> Copy
|
|
447
|
+
</button>
|
|
448
|
+
<button class='btn move-menu' data-src="<%=item.browser_url%>/browse">
|
|
449
|
+
<i class="fa-solid fa-pencil"></i> Move
|
|
450
|
+
</button>
|
|
451
|
+
<button class='btn edit-menu' data-src="<%=item.browser_url%>/browse">
|
|
452
|
+
<i class='fa-solid fa-pen-to-square'></i> Edit
|
|
453
|
+
</button>
|
|
454
|
+
<button class='btn del' data-src="<%=item.url%>">
|
|
455
|
+
<i class="fa-solid fa-trash-can"></i> Delete
|
|
456
|
+
</button>
|
|
457
|
+
</div>
|
|
458
|
+
<div class='fiexible'></div>
|
|
459
|
+
</div>
|
|
397
460
|
<% if (item.shortcuts && item.shortcuts.length > 0) { %>
|
|
398
461
|
<div class='btns'>
|
|
399
462
|
<% item.shortcuts.forEach((btn) => { %>
|
|
@@ -404,9 +467,11 @@ body.dark .browser-options-row {
|
|
|
404
467
|
</div>
|
|
405
468
|
<% } %>
|
|
406
469
|
</div>
|
|
470
|
+
<!--
|
|
407
471
|
<div class='spinner'>
|
|
408
472
|
<i class="fa-solid fa-chevron-right"></i>
|
|
409
473
|
</div>
|
|
474
|
+
-->
|
|
410
475
|
</h3>
|
|
411
476
|
</a>
|
|
412
477
|
<% }) %>
|
|
@@ -460,7 +525,13 @@ var term
|
|
|
460
525
|
const n = new N()
|
|
461
526
|
let socket = new Socket()
|
|
462
527
|
const pull = async () => {
|
|
463
|
-
if (!term)
|
|
528
|
+
if (!term) {
|
|
529
|
+
<% if (theme === "dark") { %>
|
|
530
|
+
term = await createTerm(xtermTheme.FrontEndDelight)
|
|
531
|
+
<% } else { %>
|
|
532
|
+
term = await createTerm(xtermTheme.Tomorrow)
|
|
533
|
+
<% } %>
|
|
534
|
+
}
|
|
464
535
|
socket.close()
|
|
465
536
|
await new Promise((resolve, reject) => {
|
|
466
537
|
let cwd
|
|
@@ -608,6 +679,7 @@ const renderSearch = () => {
|
|
|
608
679
|
|
|
609
680
|
renderSearch()
|
|
610
681
|
|
|
682
|
+
|
|
611
683
|
document.querySelector("form input[type=search]").addEventListener("input", (e) => {
|
|
612
684
|
selectedIndex = 0
|
|
613
685
|
selectedBtnIndex = 0
|
|
@@ -787,9 +859,6 @@ document.addEventListener("keydown", (e) => {
|
|
|
787
859
|
}
|
|
788
860
|
});
|
|
789
861
|
document.addEventListener("click", async (e) => {
|
|
790
|
-
|
|
791
|
-
let target
|
|
792
|
-
|
|
793
862
|
if (e.target.classList.contains("shutdown")) {
|
|
794
863
|
target = e.target
|
|
795
864
|
} else {
|
|
@@ -818,14 +887,114 @@ document.addEventListener("click", async (e) => {
|
|
|
818
887
|
})
|
|
819
888
|
setTimeout(() => {
|
|
820
889
|
location.href = location.href
|
|
821
|
-
},
|
|
890
|
+
}, 500)
|
|
891
|
+
}
|
|
892
|
+
})
|
|
893
|
+
|
|
894
|
+
return
|
|
895
|
+
}
|
|
896
|
+
if (e.target.classList.contains("open-menu")) {
|
|
897
|
+
target = e.target
|
|
898
|
+
} else {
|
|
899
|
+
target = e.target.closest(".open-menu")
|
|
900
|
+
}
|
|
901
|
+
if (target) {
|
|
902
|
+
e.preventDefault()
|
|
903
|
+
e.stopPropagation()
|
|
904
|
+
let contextMenu = target.closest(".col").querySelector(".context-menu").classList.toggle("collapsed")
|
|
905
|
+
target.classList.toggle("selected")
|
|
906
|
+
return
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
if (e.target.classList.contains("move-menu")) {
|
|
910
|
+
target = e.target
|
|
911
|
+
} else {
|
|
912
|
+
target = e.target.closest(".move-menu")
|
|
913
|
+
}
|
|
914
|
+
if (target) {
|
|
915
|
+
e.preventDefault()
|
|
916
|
+
e.stopPropagation()
|
|
917
|
+
let line = target.closest(".line")
|
|
918
|
+
let title = line.getAttribute("data-title")
|
|
919
|
+
let icon = line.getAttribute("data-icon")
|
|
920
|
+
let iconpath = line.getAttribute("data-iconpath")
|
|
921
|
+
let path = line.getAttribute("data-path")
|
|
922
|
+
let description = line.getAttribute("data-description")
|
|
923
|
+
await FSEditor({
|
|
924
|
+
title,
|
|
925
|
+
description,
|
|
926
|
+
old_path: path,
|
|
927
|
+
icon,
|
|
928
|
+
iconpath,
|
|
929
|
+
move: true,
|
|
930
|
+
edit: true,
|
|
931
|
+
redirect: (new_path) => {
|
|
932
|
+
return location.href
|
|
933
|
+
}
|
|
934
|
+
})
|
|
935
|
+
return
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
if (e.target.classList.contains("copy-menu")) {
|
|
939
|
+
target = e.target
|
|
940
|
+
} else {
|
|
941
|
+
target = e.target.closest(".copy-menu")
|
|
942
|
+
}
|
|
943
|
+
if (target) {
|
|
944
|
+
e.preventDefault()
|
|
945
|
+
e.stopPropagation()
|
|
946
|
+
let line = target.closest(".line")
|
|
947
|
+
let title = line.getAttribute("data-title")
|
|
948
|
+
let icon = line.getAttribute("data-icon")
|
|
949
|
+
let iconpath = line.getAttribute("data-iconpath")
|
|
950
|
+
let path = line.getAttribute("data-path")
|
|
951
|
+
let description = line.getAttribute("data-description")
|
|
952
|
+
await FSEditor({
|
|
953
|
+
title,
|
|
954
|
+
description,
|
|
955
|
+
old_path: path,
|
|
956
|
+
icon,
|
|
957
|
+
iconpath,
|
|
958
|
+
copy: true,
|
|
959
|
+
edit: true,
|
|
960
|
+
redirect: (new_path) => {
|
|
961
|
+
return location.href
|
|
822
962
|
}
|
|
823
963
|
})
|
|
964
|
+
return
|
|
965
|
+
}
|
|
824
966
|
|
|
967
|
+
if (e.target.classList.contains("edit-menu")) {
|
|
968
|
+
target = e.target
|
|
969
|
+
} else {
|
|
970
|
+
target = e.target.closest(".edit-menu")
|
|
971
|
+
}
|
|
972
|
+
if (target) {
|
|
973
|
+
e.preventDefault()
|
|
974
|
+
e.stopPropagation()
|
|
975
|
+
let line = target.closest(".line")
|
|
976
|
+
let title = line.getAttribute("data-title")
|
|
977
|
+
let icon = line.getAttribute("data-icon")
|
|
978
|
+
let iconpath = line.getAttribute("data-iconpath")
|
|
979
|
+
let path = line.getAttribute("data-path")
|
|
980
|
+
let description = line.getAttribute("data-description")
|
|
981
|
+
await FSEditor({
|
|
982
|
+
title,
|
|
983
|
+
description,
|
|
984
|
+
old_path: path,
|
|
985
|
+
icon,
|
|
986
|
+
iconpath,
|
|
987
|
+
edit: true,
|
|
988
|
+
redirect: (new_path) => {
|
|
989
|
+
return location.href
|
|
990
|
+
}
|
|
991
|
+
})
|
|
825
992
|
return
|
|
826
993
|
}
|
|
827
994
|
|
|
828
995
|
|
|
996
|
+
|
|
997
|
+
|
|
829
998
|
if (e.target.classList.contains("browse")) {
|
|
830
999
|
target = e.target
|
|
831
1000
|
} else {
|
|
@@ -891,9 +1060,18 @@ document.addEventListener("click", async (e) => {
|
|
|
891
1060
|
|
|
892
1061
|
if (document.querySelector(".container")) {
|
|
893
1062
|
document.querySelector(".container").addEventListener("click", async (e) => {
|
|
894
|
-
let el = e.target.closest(".menu-btn")
|
|
895
|
-
if (!el) {
|
|
896
|
-
|
|
1063
|
+
//let el = e.target.closest(".menu-btn")
|
|
1064
|
+
//if (!el) {
|
|
1065
|
+
// if (el.classList.contains("menu-btn")) {
|
|
1066
|
+
// el = e.target
|
|
1067
|
+
// }
|
|
1068
|
+
//}
|
|
1069
|
+
|
|
1070
|
+
let el
|
|
1071
|
+
if (e.target.classList.contains("menu-btn")) {
|
|
1072
|
+
el = e.target
|
|
1073
|
+
} else {
|
|
1074
|
+
if (e.target.closest(".menu-btn")) {
|
|
897
1075
|
el = e.target
|
|
898
1076
|
}
|
|
899
1077
|
}
|
|
@@ -1059,34 +1237,6 @@ if (document.querySelector("#cloudflare")) {
|
|
|
1059
1237
|
})
|
|
1060
1238
|
}
|
|
1061
1239
|
<% } %>
|
|
1062
|
-
if (document.querySelector("#back")) {
|
|
1063
|
-
document.querySelector("#back").addEventListener("click", (e) => {
|
|
1064
|
-
history.back()
|
|
1065
|
-
})
|
|
1066
|
-
}
|
|
1067
|
-
if (document.querySelector("#forward")) {
|
|
1068
|
-
document.querySelector("#forward").addEventListener("click", (e) => {
|
|
1069
|
-
history.forward()
|
|
1070
|
-
})
|
|
1071
|
-
}
|
|
1072
|
-
if (document.querySelector("#genlog")) {
|
|
1073
|
-
document.querySelector("#genlog").addEventListener("click", (e) => {
|
|
1074
|
-
e.preventDefault()
|
|
1075
|
-
e.stopPropagation()
|
|
1076
|
-
e.target.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i>'
|
|
1077
|
-
fetch("/pinokio/log", {
|
|
1078
|
-
method: "post",
|
|
1079
|
-
}).then((res) => {
|
|
1080
|
-
console.log("RES", res)
|
|
1081
|
-
let btn = document.querySelector("#genlog")
|
|
1082
|
-
let btn2 = document.querySelector("#downloadlogs")
|
|
1083
|
-
btn2.classList.remove("hidden")
|
|
1084
|
-
btn.classList.add("hidden")
|
|
1085
|
-
btn.innerHTML = '<i class="fa-solid fa-circle-check"></i> Generated!'
|
|
1086
|
-
//btn.classList.add("hidden")
|
|
1087
|
-
})
|
|
1088
|
-
})
|
|
1089
|
-
}
|
|
1090
1240
|
|
|
1091
1241
|
</script>
|
|
1092
1242
|
</body>
|