pinokiod 3.85.0 → 3.86.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/api/index.js +7 -0
- package/kernel/bin/caddy.js +10 -4
- package/kernel/peer.js +0 -3
- package/kernel/prototype.js +1 -0
- package/kernel/shell.js +43 -2
- package/kernel/util.js +2 -0
- package/package.json +1 -1
- package/pipe/views/login.ejs +1 -1
- package/server/index.js +133 -83
- package/server/public/common.js +534 -0
- package/server/public/opener.js +12 -11
- package/server/public/serve/style.css +1 -1
- package/server/public/style.css +25 -24
- package/server/public/urldropdown.css +473 -4
- package/server/public/urldropdown.js +202 -8
- package/server/views/404.ejs +1 -1
- package/server/views/500.ejs +1 -1
- package/server/views/app.ejs +29 -33
- package/server/views/bookmarklet.ejs +197 -0
- package/server/views/connect/x.ejs +4 -4
- package/server/views/connect.ejs +10 -10
- package/server/views/container.ejs +2 -2
- package/server/views/d.ejs +3 -3
- package/server/views/download.ejs +1 -1
- package/server/views/editor.ejs +1 -1
- package/server/views/env_editor.ejs +3 -3
- package/server/views/explore.ejs +2 -2
- package/server/views/file_explorer.ejs +2 -2
- package/server/views/git.ejs +7 -7
- package/server/views/github.ejs +3 -3
- package/server/views/help.ejs +2 -2
- package/server/views/index.ejs +5 -5
- package/server/views/index2.ejs +3 -3
- package/server/views/init/index.ejs +11 -74
- package/server/views/install.ejs +3 -3
- package/server/views/keys.ejs +2 -2
- package/server/views/mini.ejs +2 -2
- package/server/views/net.ejs +6 -6
- package/server/views/network.ejs +21 -21
- package/server/views/network2.ejs +10 -10
- package/server/views/old_network.ejs +8 -8
- package/server/views/pro.ejs +369 -0
- package/server/views/prototype/index.ejs +2 -2
- package/server/views/required_env_editor.ejs +2 -2
- package/server/views/review.ejs +6 -6
- package/server/views/screenshots.ejs +5 -4
- package/server/views/settings.ejs +3 -3
- package/server/views/setup.ejs +2 -2
- package/server/views/setup_home.ejs +2 -2
- package/server/views/share_editor.ejs +4 -4
- package/server/views/shell.ejs +3 -3
- package/server/views/start.ejs +2 -2
- package/server/views/task.ejs +2 -2
- package/server/views/terminal.ejs +5 -4
- package/server/views/tools.ejs +13 -13
package/server/views/network.ejs
CHANGED
|
@@ -35,7 +35,7 @@ ol {
|
|
|
35
35
|
padding-inline-start: 15px;
|
|
36
36
|
}
|
|
37
37
|
a.explain {
|
|
38
|
-
color:
|
|
38
|
+
color: rgba(127, 91, 243, 0.9);
|
|
39
39
|
text-decoration: underline;
|
|
40
40
|
cursor: pointer;
|
|
41
41
|
}
|
|
@@ -126,12 +126,12 @@ header .runner {
|
|
|
126
126
|
margin-top: 5px;
|
|
127
127
|
}
|
|
128
128
|
a.badge {
|
|
129
|
-
color:
|
|
129
|
+
color: rgba(127, 91, 243, 0.9);
|
|
130
130
|
text-decoration: none;
|
|
131
131
|
cursor: pointer;
|
|
132
132
|
}
|
|
133
133
|
.badge a {
|
|
134
|
-
color:
|
|
134
|
+
color: rgba(127, 91, 243, 0.9);
|
|
135
135
|
text-decoration: none;
|
|
136
136
|
}
|
|
137
137
|
/*
|
|
@@ -147,7 +147,7 @@ body.dark .browser-options-row {
|
|
|
147
147
|
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
148
148
|
}
|
|
149
149
|
.description a {
|
|
150
|
-
color:
|
|
150
|
+
color: rgba(127, 91, 243, 0.9);
|
|
151
151
|
text-decoration: none;
|
|
152
152
|
}
|
|
153
153
|
a.ln[href^=https] {
|
|
@@ -215,11 +215,11 @@ a.ln:hover {
|
|
|
215
215
|
box-sizing: border-box;
|
|
216
216
|
}
|
|
217
217
|
.container-row.current .header-label-sub {
|
|
218
|
-
color:
|
|
218
|
+
color: rgba(127, 91, 243, 0.9);
|
|
219
219
|
}
|
|
220
220
|
/*
|
|
221
221
|
.container-row.current .header-label-sub {
|
|
222
|
-
color:
|
|
222
|
+
color: rgba(127, 91, 243, 0.9);
|
|
223
223
|
}
|
|
224
224
|
*/
|
|
225
225
|
.desc {
|
|
@@ -241,7 +241,7 @@ a.ln:hover {
|
|
|
241
241
|
padding-top: 5px;
|
|
242
242
|
padding-bottom: 0 !important;
|
|
243
243
|
text-decoration: none;
|
|
244
|
-
color:
|
|
244
|
+
color: rgba(127, 91, 243, 0.9);
|
|
245
245
|
cursor: pointer;
|
|
246
246
|
}
|
|
247
247
|
.container-row table {
|
|
@@ -250,7 +250,7 @@ a.ln:hover {
|
|
|
250
250
|
}
|
|
251
251
|
table a {
|
|
252
252
|
text-decoration: none;
|
|
253
|
-
color:
|
|
253
|
+
color: rgba(127, 91, 243, 0.9);
|
|
254
254
|
}
|
|
255
255
|
td:first-child, th:first-child {
|
|
256
256
|
max-width: 100px;
|
|
@@ -295,7 +295,7 @@ body.dark .config {
|
|
|
295
295
|
align-items: stretch;
|
|
296
296
|
}
|
|
297
297
|
body.dark .config .btn {
|
|
298
|
-
background:
|
|
298
|
+
background: rgba(127, 91, 243, 0.9);
|
|
299
299
|
}
|
|
300
300
|
.config .btn {
|
|
301
301
|
font-size: 16px;
|
|
@@ -303,7 +303,7 @@ body.dark .config .btn {
|
|
|
303
303
|
width: 100px;
|
|
304
304
|
/*
|
|
305
305
|
*/
|
|
306
|
-
background:
|
|
306
|
+
background: rgba(127, 91, 243, 0.9);
|
|
307
307
|
flex-shrink: 0;
|
|
308
308
|
}
|
|
309
309
|
.config-row {
|
|
@@ -380,7 +380,7 @@ input:checked + .slider {
|
|
|
380
380
|
background-color: #2196F3;
|
|
381
381
|
background: black;
|
|
382
382
|
*/
|
|
383
|
-
background-color:
|
|
383
|
+
background-color: rgba(127, 91, 243, 0.9);
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
input:focus + .slider {
|
|
@@ -468,7 +468,7 @@ body.dark aside .tab {
|
|
|
468
468
|
color: white;
|
|
469
469
|
}
|
|
470
470
|
body.dark aside .tab:hover, aside .tab:hover {
|
|
471
|
-
color:
|
|
471
|
+
color: rgba(127, 91, 243, 0.9) !important;
|
|
472
472
|
opacity: 1;
|
|
473
473
|
}
|
|
474
474
|
aside .tab {
|
|
@@ -515,8 +515,8 @@ aside .current.selected {
|
|
|
515
515
|
border-left: 10px solid transparent;
|
|
516
516
|
}
|
|
517
517
|
body.dark .net:hover, .net:hover {
|
|
518
|
-
color:
|
|
519
|
-
border-left: 4px solid
|
|
518
|
+
color: rgba(127, 91, 243, 0.9);
|
|
519
|
+
border-left: 4px solid rgba(127, 91, 243, 0.9);
|
|
520
520
|
}
|
|
521
521
|
body.dark .net {
|
|
522
522
|
border-left: 3px solid white;
|
|
@@ -630,12 +630,12 @@ header .runner {
|
|
|
630
630
|
margin-top: 5px;
|
|
631
631
|
}
|
|
632
632
|
a.badge {
|
|
633
|
-
color:
|
|
633
|
+
color: rgba(127, 91, 243, 0.9);
|
|
634
634
|
text-decoration: none;
|
|
635
635
|
cursor: pointer;
|
|
636
636
|
}
|
|
637
637
|
.badge a {
|
|
638
|
-
color:
|
|
638
|
+
color: rgba(127, 91, 243, 0.9);
|
|
639
639
|
text-decoration: none;
|
|
640
640
|
}
|
|
641
641
|
body.dark .btn {
|
|
@@ -766,7 +766,7 @@ body.dark .open-menu, body.dark .browse {
|
|
|
766
766
|
color: white !important;
|
|
767
767
|
}
|
|
768
768
|
.open-menu:hover, .browse:hover, body.dark .open-menu:hover, body.dark .browse:hover {
|
|
769
|
-
color:
|
|
769
|
+
color: rgba(127, 91, 243, 0.9) !important;
|
|
770
770
|
}
|
|
771
771
|
.open-menu, .browse {
|
|
772
772
|
width: 80px;
|
|
@@ -866,7 +866,7 @@ body.dark aside .tab {
|
|
|
866
866
|
color: white;
|
|
867
867
|
}
|
|
868
868
|
body.dark aside .tab:hover, aside .tab:hover {
|
|
869
|
-
color:
|
|
869
|
+
color: rgba(127, 91, 243, 0.9) !important;
|
|
870
870
|
opacity: 1;
|
|
871
871
|
}
|
|
872
872
|
aside .tab {
|
|
@@ -906,8 +906,8 @@ aside .selected {
|
|
|
906
906
|
padding: 0;
|
|
907
907
|
}
|
|
908
908
|
body.dark .net:hover, .net:hover {
|
|
909
|
-
color:
|
|
910
|
-
border-left: 4px solid
|
|
909
|
+
color: rgba(127, 91, 243, 0.9);
|
|
910
|
+
border-left: 4px solid rgba(127, 91, 243, 0.9);
|
|
911
911
|
}
|
|
912
912
|
body.dark .net {
|
|
913
913
|
border-left: 3px solid white;
|
|
@@ -1187,7 +1187,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
1187
1187
|
</div>
|
|
1188
1188
|
<aside>
|
|
1189
1189
|
<div class='btn-tab'>
|
|
1190
|
-
<
|
|
1190
|
+
<button type='button' class='btn' id='create-launcher-button'><i class="fa-solid fa-plus"></i><div class='caption'>Create</div></button>
|
|
1191
1191
|
<a class='btn' id='explore' href="/?mode=explore"><i class="fa-solid fa-globe"></i><div class='caption'>Discover</div></a>
|
|
1192
1192
|
</div>
|
|
1193
1193
|
<a href="/" class='tab'><i class='fas fa-laptop-code'></i><div class='caption'>This machine</div></a>
|
|
@@ -31,7 +31,7 @@ ol {
|
|
|
31
31
|
padding-inline-start: 15px;
|
|
32
32
|
}
|
|
33
33
|
a.explain {
|
|
34
|
-
color:
|
|
34
|
+
color: rgba(127, 91, 243, 0.9);
|
|
35
35
|
text-decoration: underline;
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
}
|
|
@@ -122,12 +122,12 @@ header .runner {
|
|
|
122
122
|
margin-top: 5px;
|
|
123
123
|
}
|
|
124
124
|
a.badge {
|
|
125
|
-
color:
|
|
125
|
+
color: rgba(127, 91, 243, 0.9);
|
|
126
126
|
text-decoration: none;
|
|
127
127
|
cursor: pointer;
|
|
128
128
|
}
|
|
129
129
|
.badge a {
|
|
130
|
-
color:
|
|
130
|
+
color: rgba(127, 91, 243, 0.9);
|
|
131
131
|
text-decoration: none;
|
|
132
132
|
}
|
|
133
133
|
body.dark .btn {
|
|
@@ -142,7 +142,7 @@ body.dark .browser-options-row {
|
|
|
142
142
|
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
143
143
|
}
|
|
144
144
|
.description a {
|
|
145
|
-
color:
|
|
145
|
+
color: rgba(127, 91, 243, 0.9);
|
|
146
146
|
text-decoration: none;
|
|
147
147
|
}
|
|
148
148
|
a.ln[href^=https] {
|
|
@@ -210,11 +210,11 @@ a.ln:hover {
|
|
|
210
210
|
box-sizing: border-box;
|
|
211
211
|
}
|
|
212
212
|
.container-row.current .header-label-sub {
|
|
213
|
-
color:
|
|
213
|
+
color: rgba(127, 91, 243, 0.9);
|
|
214
214
|
}
|
|
215
215
|
/*
|
|
216
216
|
.container-row.current .header-label-sub {
|
|
217
|
-
color:
|
|
217
|
+
color: rgba(127, 91, 243, 0.9);
|
|
218
218
|
}
|
|
219
219
|
*/
|
|
220
220
|
.desc {
|
|
@@ -229,7 +229,7 @@ a.ln:hover {
|
|
|
229
229
|
.link-label {
|
|
230
230
|
margin-right: 10px;
|
|
231
231
|
text-decoration: underline;
|
|
232
|
-
color:
|
|
232
|
+
color: rgba(127, 91, 243, 0.9);
|
|
233
233
|
cursor: pointer;
|
|
234
234
|
}
|
|
235
235
|
.container-row table {
|
|
@@ -238,7 +238,7 @@ a.ln:hover {
|
|
|
238
238
|
}
|
|
239
239
|
table a {
|
|
240
240
|
text-decoration: none;
|
|
241
|
-
color:
|
|
241
|
+
color: rgba(127, 91, 243, 0.9);
|
|
242
242
|
}
|
|
243
243
|
td:first-child, th:first-child {
|
|
244
244
|
max-width: 100px;
|
|
@@ -289,7 +289,7 @@ body.dark .config {
|
|
|
289
289
|
font-size: 16px;
|
|
290
290
|
font-weight: bold;
|
|
291
291
|
width: 100px;
|
|
292
|
-
background:
|
|
292
|
+
background: rgba(127, 91, 243, 0.9);
|
|
293
293
|
flex-shrink: 0;
|
|
294
294
|
}
|
|
295
295
|
.config-row {
|
|
@@ -351,7 +351,7 @@ input:checked + .slider {
|
|
|
351
351
|
/*
|
|
352
352
|
background-color: #2196F3;
|
|
353
353
|
*/
|
|
354
|
-
background-color:
|
|
354
|
+
background-color: rgba(127, 91, 243, 0.9);
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
input:focus + .slider {
|
|
@@ -114,12 +114,12 @@ header .runner {
|
|
|
114
114
|
margin-top: 5px;
|
|
115
115
|
}
|
|
116
116
|
a.badge {
|
|
117
|
-
color:
|
|
117
|
+
color: rgba(127, 91, 243, 0.9);
|
|
118
118
|
text-decoration: none;
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
}
|
|
121
121
|
.badge a {
|
|
122
|
-
color:
|
|
122
|
+
color: rgba(127, 91, 243, 0.9);
|
|
123
123
|
text-decoration: none;
|
|
124
124
|
}
|
|
125
125
|
body.dark .btn {
|
|
@@ -134,7 +134,7 @@ body.dark .browser-options-row {
|
|
|
134
134
|
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
135
135
|
}
|
|
136
136
|
.description a {
|
|
137
|
-
color:
|
|
137
|
+
color: rgba(127, 91, 243, 0.9);
|
|
138
138
|
text-decoration: none;
|
|
139
139
|
}
|
|
140
140
|
a.ln[href^=https] {
|
|
@@ -202,7 +202,7 @@ a.ln:hover {
|
|
|
202
202
|
box-sizing: border-box;
|
|
203
203
|
}
|
|
204
204
|
.container-row.current .header-label-sub {
|
|
205
|
-
color:
|
|
205
|
+
color: rgba(127, 91, 243, 0.9);
|
|
206
206
|
}
|
|
207
207
|
/*
|
|
208
208
|
.container-row.current .header-label-sub {
|
|
@@ -221,7 +221,7 @@ a.ln:hover {
|
|
|
221
221
|
.link-label {
|
|
222
222
|
margin-right: 10px;
|
|
223
223
|
text-decoration: underline;
|
|
224
|
-
color:
|
|
224
|
+
color: rgba(127, 91, 243, 0.9);
|
|
225
225
|
cursor: pointer;
|
|
226
226
|
}
|
|
227
227
|
.container-row table {
|
|
@@ -230,7 +230,7 @@ a.ln:hover {
|
|
|
230
230
|
}
|
|
231
231
|
table a {
|
|
232
232
|
text-decoration: none;
|
|
233
|
-
color:
|
|
233
|
+
color: rgba(127, 91, 243, 0.9);
|
|
234
234
|
}
|
|
235
235
|
td:first-child, th:first-child {
|
|
236
236
|
max-width: 100px;
|
|
@@ -281,7 +281,7 @@ body.dark .config {
|
|
|
281
281
|
font-size: 16px;
|
|
282
282
|
font-weight: bold;
|
|
283
283
|
width: 100px;
|
|
284
|
-
background:
|
|
284
|
+
background: rgba(127, 91, 243, 0.9);
|
|
285
285
|
flex-shrink: 0;
|
|
286
286
|
}
|
|
287
287
|
.config-row {
|
|
@@ -338,7 +338,7 @@ input:checked + .slider {
|
|
|
338
338
|
/*
|
|
339
339
|
background-color: #2196F3;
|
|
340
340
|
*/
|
|
341
|
-
background-color:
|
|
341
|
+
background-color: rgba(127, 91, 243, 0.9);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
input:focus + .slider {
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
|
4
|
+
<script src="/hotkeys.min.js"></script>
|
|
5
|
+
<script src="/ace/ace.js"></script>
|
|
6
|
+
<script src="/noty.js"></script>
|
|
7
|
+
<script src="/notyq.js"></script>
|
|
8
|
+
<script src="/xterm.js"></script>
|
|
9
|
+
<script src="/xterm-addon-fit.js"></script>
|
|
10
|
+
<script src="/xterm-addon-web-links.js"></script>
|
|
11
|
+
<script src="/xterm-theme.js"></script>
|
|
12
|
+
<script src="/xterm-addon-search.js"></script>
|
|
13
|
+
<script src="/xterm-addon-search-bar.js"></script>
|
|
14
|
+
<script src="/sweetalert2.js"></script>
|
|
15
|
+
<script src="/Socket.js"></script>
|
|
16
|
+
<script src="/common.js"></script>
|
|
17
|
+
<script src="/he.js"></script>
|
|
18
|
+
<script src="/opener.js"></script>
|
|
19
|
+
<!--
|
|
20
|
+
<script src="/nav.js"></script>
|
|
21
|
+
-->
|
|
22
|
+
<script src="/autoexpand.js"></script>
|
|
23
|
+
<script src="/modalinput.js"></script>
|
|
24
|
+
<script src="/simplemodal.js"></script>
|
|
25
|
+
<script src="/waitmodal.js"></script>
|
|
26
|
+
<script src="/notifyinput.js"></script>
|
|
27
|
+
<script src="/report.js"></script>
|
|
28
|
+
<script src="/mark.min.js"></script>
|
|
29
|
+
<link href="/xterm.min.css" rel="stylesheet" />
|
|
30
|
+
<link href="/css/fontawesome.min.css" rel="stylesheet">
|
|
31
|
+
<link href="/css/solid.min.css" rel="stylesheet">
|
|
32
|
+
<link href="/css/regular.min.css" rel="stylesheet">
|
|
33
|
+
<link href="/css/brands.min.css" rel="stylesheet">
|
|
34
|
+
<link href="/style.css" rel="stylesheet"/>
|
|
35
|
+
<link href="/noty.css" rel="stylesheet"/>
|
|
36
|
+
<!--
|
|
37
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
38
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
39
|
+
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
|
40
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
41
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
42
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
|
43
|
+
-->
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<% if (agent === "electron") { %>
|
|
47
|
+
<link href="/electron.css" rel="stylesheet"/>
|
|
48
|
+
<% } %>
|
|
49
|
+
<style>
|
|
50
|
+
.stopped-btn {
|
|
51
|
+
background: silver;
|
|
52
|
+
}
|
|
53
|
+
html {
|
|
54
|
+
scroll-behavior: smooth;
|
|
55
|
+
height: 100%;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
}
|
|
58
|
+
body {
|
|
59
|
+
height: 100%;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
}
|
|
64
|
+
#table > table {
|
|
65
|
+
border-left: 2px solid black;
|
|
66
|
+
padding-left: 5px;
|
|
67
|
+
margin: 10px 0;
|
|
68
|
+
}
|
|
69
|
+
.highlight {
|
|
70
|
+
background: yellow;
|
|
71
|
+
width: 100px;
|
|
72
|
+
}
|
|
73
|
+
th {
|
|
74
|
+
background: rgba(0,0,0,0.1);
|
|
75
|
+
padding: 10px;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
}
|
|
78
|
+
td {
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
padding: 10px;
|
|
81
|
+
}
|
|
82
|
+
td.val {
|
|
83
|
+
background: rgba(0,0,0,0.06);
|
|
84
|
+
}
|
|
85
|
+
td.key {
|
|
86
|
+
background: rgba(0,0,0,0.1);
|
|
87
|
+
}
|
|
88
|
+
.button {
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
background: rgba(0,0,0,0.8);
|
|
91
|
+
color: white;
|
|
92
|
+
padding: 5px 10px;
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
}
|
|
95
|
+
header {
|
|
96
|
+
position: relative;
|
|
97
|
+
padding: 10px 0;
|
|
98
|
+
}
|
|
99
|
+
.button:hover {
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
.terminal {
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
}
|
|
105
|
+
.xterm .xterm-viewport {
|
|
106
|
+
width: initial !important;
|
|
107
|
+
}
|
|
108
|
+
.navheader3 {
|
|
109
|
+
padding: 10px;
|
|
110
|
+
}
|
|
111
|
+
.navheader {
|
|
112
|
+
padding-bottom: 0;
|
|
113
|
+
}
|
|
114
|
+
.navheader h1 {
|
|
115
|
+
align-items: center;
|
|
116
|
+
}
|
|
117
|
+
/*
|
|
118
|
+
.navheader {
|
|
119
|
+
background: var(--dark-bg);
|
|
120
|
+
}
|
|
121
|
+
*/
|
|
122
|
+
/*
|
|
123
|
+
.btn {
|
|
124
|
+
background: rgba(127, 91, 243, 0.9);
|
|
125
|
+
}
|
|
126
|
+
*/
|
|
127
|
+
#del-bin {
|
|
128
|
+
color: rgba(127, 91, 243, 0.9);
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
font-weight: bold;
|
|
131
|
+
padding: 0 5px;
|
|
132
|
+
text-decoration: underline;
|
|
133
|
+
}
|
|
134
|
+
body.frozen {
|
|
135
|
+
overflow: auto !important;
|
|
136
|
+
}
|
|
137
|
+
.terminal-container {
|
|
138
|
+
padding: 0;
|
|
139
|
+
}
|
|
140
|
+
#status-window {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
/*
|
|
145
|
+
flex-grow: 1;
|
|
146
|
+
text-align: right;
|
|
147
|
+
*/
|
|
148
|
+
padding: 0 10px;
|
|
149
|
+
}
|
|
150
|
+
#status-window strong {
|
|
151
|
+
color: rgba(127, 91, 243, 0.9);
|
|
152
|
+
}
|
|
153
|
+
#status-window b {
|
|
154
|
+
color: black;
|
|
155
|
+
font-weight: normal;
|
|
156
|
+
}
|
|
157
|
+
body.dark #status-window b {
|
|
158
|
+
color: white;
|
|
159
|
+
}
|
|
160
|
+
#progress-window {
|
|
161
|
+
flex-shrink: 0;
|
|
162
|
+
width: 100px;
|
|
163
|
+
background: #eee;
|
|
164
|
+
height: 15px;
|
|
165
|
+
/*
|
|
166
|
+
border-radius: 5px;
|
|
167
|
+
*/
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
}
|
|
170
|
+
#progress-bar {
|
|
171
|
+
width: 0%;
|
|
172
|
+
height: 100%;
|
|
173
|
+
background: rgba(127, 91, 243, 0.9);
|
|
174
|
+
transition: width 0.2s;
|
|
175
|
+
}
|
|
176
|
+
</style>
|
|
177
|
+
<link href="/terminal.css" rel="stylesheet"/>
|
|
178
|
+
</head>
|
|
179
|
+
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
180
|
+
<% if (target === "_top") { %>
|
|
181
|
+
<header class='navheader grabbable'>
|
|
182
|
+
<% } else { %>
|
|
183
|
+
<header class='navheader3'>
|
|
184
|
+
<% } %>
|
|
185
|
+
<h1>
|
|
186
|
+
<% if (target === "_top") { %>
|
|
187
|
+
<a class='home' href="/"><img class='icon' src="/pinokio-black.png"></a>
|
|
188
|
+
<% } %>
|
|
189
|
+
<div class='hidden btn run play-btn'>
|
|
190
|
+
<span class='play'><i class="fa-solid fa-play"></i> Start</span>
|
|
191
|
+
</div>
|
|
192
|
+
<div class='hidden btn run starting-btn'>
|
|
193
|
+
<span class='starting'><i class="fa-solid fa-circle-notch fa-spin"></i> Starting...</span>
|
|
194
|
+
</div>
|
|
195
|
+
<div class='hidden btn run stop-btn'>
|
|
196
|
+
<span class='stop'><i class="fa-solid fa-stop"></i> Stop</span>
|
|
197
|
+
</div>
|
|
198
|
+
<div class='hidden btn stopped-btn'>
|
|
199
|
+
<span class='stopped'><i class="fa-solid fa-hand"></i> Stopped</span>
|
|
200
|
+
</div>
|
|
201
|
+
<div id='status-window'></div>
|
|
202
|
+
<div id='progress-window' class='hidden'><div id='progress-bar'></div></div>
|
|
203
|
+
</h1>
|
|
204
|
+
</header>
|
|
205
|
+
<div class='terminal-container'>
|
|
206
|
+
<div id='terminal'></div>
|
|
207
|
+
</div>
|
|
208
|
+
<footer><b>Ready</b></footer>
|
|
209
|
+
<script>
|
|
210
|
+
let shell_id
|
|
211
|
+
let socket = new Socket()
|
|
212
|
+
const createTerm = async (_theme) => {
|
|
213
|
+
const theme = Object.assign({ }, _theme, {
|
|
214
|
+
selectionBackground: "red",
|
|
215
|
+
selectionForeground: "white"
|
|
216
|
+
})
|
|
217
|
+
<% if (theme !== "dark") { %>
|
|
218
|
+
theme.foreground = "black"
|
|
219
|
+
<% } %>
|
|
220
|
+
let config = {
|
|
221
|
+
scrollback: 9999999,
|
|
222
|
+
fontSize: 14,
|
|
223
|
+
theme,
|
|
224
|
+
}
|
|
225
|
+
let res = await fetch("/xterm_config").then((res) => {
|
|
226
|
+
return res.json()
|
|
227
|
+
})
|
|
228
|
+
if (res && res.config) {
|
|
229
|
+
config = res.config
|
|
230
|
+
}
|
|
231
|
+
const term = new Terminal(config)
|
|
232
|
+
term.open(document.querySelector("#terminal"))
|
|
233
|
+
|
|
234
|
+
term.attachCustomKeyEventHandler(event => {
|
|
235
|
+
if (event.ctrlKey && event.key === 'c' && term.hasSelection()) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
if (event.ctrlKey && event.key === 'v' && this._options.pasteWithCtrlV) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
fitAddon = new FitAddon.FitAddon();
|
|
245
|
+
term.loadAddon(fitAddon);
|
|
246
|
+
<% if (agent === "electron") { %>
|
|
247
|
+
term.loadAddon(new WebLinksAddon.WebLinksAddon((event, uri) => {
|
|
248
|
+
window.open(uri, "_blank")
|
|
249
|
+
}))
|
|
250
|
+
<% } else { %>
|
|
251
|
+
term.loadAddon(new WebLinksAddon.WebLinksAddon());
|
|
252
|
+
<% } %>
|
|
253
|
+
fitAddon.fit();
|
|
254
|
+
|
|
255
|
+
term.onKey(({ key }) => {
|
|
256
|
+
console.log({ key, shell_id })
|
|
257
|
+
if (socket) {
|
|
258
|
+
if (shell_id) {
|
|
259
|
+
socket.run({
|
|
260
|
+
key,
|
|
261
|
+
id: shell_id
|
|
262
|
+
})
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
let observer = new ResizeObserver(() => {
|
|
268
|
+
fitAddon.fit()
|
|
269
|
+
console.log(`Resized to ${term.cols}x${term.rows}`);
|
|
270
|
+
// Trigger your custom handler here
|
|
271
|
+
if (socket) {
|
|
272
|
+
if (shell_id) {
|
|
273
|
+
console.log("RESIZE", { shell_id, cols: term.cols, rows: term.rows })
|
|
274
|
+
socket.run({
|
|
275
|
+
resize: {
|
|
276
|
+
cols: term.cols,
|
|
277
|
+
rows: term.rows,
|
|
278
|
+
},
|
|
279
|
+
id: shell_id
|
|
280
|
+
})
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
observer.observe(document.body)
|
|
285
|
+
|
|
286
|
+
term.focus()
|
|
287
|
+
console.log(`Resized to ${term.cols}x${term.rows}`);
|
|
288
|
+
return term
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
async function displayResults(config) {
|
|
292
|
+
<% if (theme === "dark") { %>
|
|
293
|
+
let term = await createTerm(xtermTheme.FrontEndDelight)
|
|
294
|
+
<% } else { %>
|
|
295
|
+
let term = await createTerm(xtermTheme.Tomorrow)
|
|
296
|
+
<% } %>
|
|
297
|
+
const write = (text) => {
|
|
298
|
+
if (text !== "\u0007") {
|
|
299
|
+
term.write(text)
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
socket.run({
|
|
303
|
+
id: "kernel.proto.create",
|
|
304
|
+
method: "kernel.proto.create",
|
|
305
|
+
cwd: config.cwd,
|
|
306
|
+
client: {
|
|
307
|
+
cols: term.cols,
|
|
308
|
+
rows: term.rows,
|
|
309
|
+
},
|
|
310
|
+
params: config
|
|
311
|
+
}, async (packet) => {
|
|
312
|
+
console.log('packet', packet)
|
|
313
|
+
if (packet.type === 'start') {
|
|
314
|
+
document.querySelector(".play-btn").classList.add("hidden")
|
|
315
|
+
document.querySelector(".starting-btn").classList.add("hidden")
|
|
316
|
+
document.querySelector(".stop-btn").classList.remove("hidden")
|
|
317
|
+
} else if (packet.type === "result") {
|
|
318
|
+
if (packet.data.success) {
|
|
319
|
+
location.href = packet.data.success
|
|
320
|
+
} else if (packet.data.error) {
|
|
321
|
+
alert(packet.data.error)
|
|
322
|
+
location.href = location.href
|
|
323
|
+
}
|
|
324
|
+
} else if (packet.type === "stream") {
|
|
325
|
+
// set the current shell id
|
|
326
|
+
if (packet.data.id) {
|
|
327
|
+
shell_id = packet.data.id
|
|
328
|
+
}
|
|
329
|
+
if (packet.data.raw) {
|
|
330
|
+
write(packet.data.raw)
|
|
331
|
+
} else if (packet.data.json) {
|
|
332
|
+
write(JSON.stringify(packet.data.json).replace(/\n/g, "\r\n"))
|
|
333
|
+
write("\r\n")
|
|
334
|
+
} else if (packet.data.json2) {
|
|
335
|
+
write(JSON.stringify(packet.data.json2, null, 2).replace(/\n/g, "\r\n"))
|
|
336
|
+
write("\r\n")
|
|
337
|
+
}
|
|
338
|
+
document.querySelector("#end").scrollIntoView({ behavior: 'smooth' });
|
|
339
|
+
} else if (packet.type === 'disconnect') {
|
|
340
|
+
term.write("\r\nDisconnected...\r\n")
|
|
341
|
+
socket.close()
|
|
342
|
+
} else if (packet.type === 'connect') {
|
|
343
|
+
if (packet.data) {
|
|
344
|
+
if (packet.data.shell) {
|
|
345
|
+
shell_id = packet.data.shell
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}).then((res) => {
|
|
350
|
+
console.log("Ended", res)
|
|
351
|
+
})
|
|
352
|
+
}
|
|
353
|
+
const url = new URL(window.location.href);
|
|
354
|
+
const searchParams = url.searchParams;
|
|
355
|
+
let cwd = searchParams.get("cwd")
|
|
356
|
+
let name = searchParams.get("name")
|
|
357
|
+
let tool = searchParams.get("tool")
|
|
358
|
+
let aiPrompt = searchParams.get("message")
|
|
359
|
+
displayResults({
|
|
360
|
+
cwd: "<%-JSON.stringify(cwd).slice(1, -1)%>",
|
|
361
|
+
name: name,
|
|
362
|
+
startType: "new",
|
|
363
|
+
projectType: "ai",
|
|
364
|
+
aiPrompt,
|
|
365
|
+
tool
|
|
366
|
+
})
|
|
367
|
+
</script>
|
|
368
|
+
</body>
|
|
369
|
+
</html>
|
|
@@ -107,7 +107,7 @@ body.dark .env-item label {
|
|
|
107
107
|
color: cornflowerblue;
|
|
108
108
|
}
|
|
109
109
|
.env-item label {
|
|
110
|
-
color:
|
|
110
|
+
color: rgba(127, 91, 243, 0.9);
|
|
111
111
|
display: block;
|
|
112
112
|
margin-bottom: 5px;
|
|
113
113
|
font-weight: bold;
|
|
@@ -133,7 +133,7 @@ body.dark .comment {
|
|
|
133
133
|
padding-left: 10px;
|
|
134
134
|
}
|
|
135
135
|
#save {
|
|
136
|
-
background:
|
|
136
|
+
background: rgba(127, 91, 243, 0.9);
|
|
137
137
|
width: 100%;
|
|
138
138
|
box-sizing: border-box;
|
|
139
139
|
text-align: center;
|