pinokiod 3.8.148 → 3.8.149
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/bin/caddy.js +6 -5
- package/kernel/bin/conda.js +5 -1
- package/kernel/bin/index.js +244 -66
- package/kernel/bin/setup.js +130 -0
- package/kernel/environment.js +36 -1
- package/kernel/index.js +15 -4
- package/kernel/loader.js +6 -4
- package/kernel/procs.js +1 -0
- package/kernel/prototype.js +12 -9
- package/kernel/router/common.js +50 -41
- package/kernel/router/connector.js +38 -30
- package/kernel/router/index.js +51 -7
- package/kernel/router/peer_port_router.js +2 -3
- package/package.json +1 -1
- package/server/index.js +145 -317
- package/server/public/fscreator.js +1 -1
- package/server/views/network.ejs +3 -1
- package/server/views/prototypes.ejs +1 -1
- package/server/views/setup.ejs +254 -0
- package/server/views/setup_home.ejs +181 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="UTF-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
5
|
+
<link href="/xterm.min.css" rel="stylesheet" />
|
|
6
|
+
<link href="/css/fontawesome.min.css" rel="stylesheet">
|
|
7
|
+
<link href="/css/solid.min.css" rel="stylesheet">
|
|
8
|
+
<link href="/css/regular.min.css" rel="stylesheet">
|
|
9
|
+
<link href="/css/brands.min.css" rel="stylesheet">
|
|
10
|
+
<link href="/markdown.css" rel="stylesheet"/>
|
|
11
|
+
<link href="/noty.css" rel="stylesheet"/>
|
|
12
|
+
<link href="/style.css" rel="stylesheet"/>
|
|
13
|
+
<% if (agent === "electron") { %>
|
|
14
|
+
<link href="/electron.css" rel="stylesheet"/>
|
|
15
|
+
<% } %>
|
|
16
|
+
<style>
|
|
17
|
+
html {
|
|
18
|
+
scroll-behavior: smooth;
|
|
19
|
+
height: 100%;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
body.frozen {
|
|
23
|
+
overflow: auto !important;
|
|
24
|
+
}
|
|
25
|
+
#del-bin {
|
|
26
|
+
color: royalblue;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
body {
|
|
30
|
+
height: 100%;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
/*
|
|
33
|
+
background: rgb(44, 29, 22);
|
|
34
|
+
*/
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
}
|
|
38
|
+
body {
|
|
39
|
+
/*
|
|
40
|
+
background: white;
|
|
41
|
+
background: rgb(44, 29, 22);
|
|
42
|
+
background: var(--dark-bg);
|
|
43
|
+
*/
|
|
44
|
+
}
|
|
45
|
+
.line2 {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
background: rgba(0,0,100,0.04);
|
|
50
|
+
}
|
|
51
|
+
.line2 a {
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
color: black;
|
|
54
|
+
}
|
|
55
|
+
.status {
|
|
56
|
+
padding: 10px;
|
|
57
|
+
margin: 10px;
|
|
58
|
+
border-radius: 10px;
|
|
59
|
+
}
|
|
60
|
+
.status.offline {
|
|
61
|
+
background: silver;
|
|
62
|
+
}
|
|
63
|
+
.status.online {
|
|
64
|
+
background: yellowgreen;
|
|
65
|
+
}
|
|
66
|
+
.switch {
|
|
67
|
+
padding: 10px;
|
|
68
|
+
margin: 10px 0;
|
|
69
|
+
}
|
|
70
|
+
.switch[data-online=true] {
|
|
71
|
+
color: yellowgreen;
|
|
72
|
+
}
|
|
73
|
+
.button {
|
|
74
|
+
padding: 10px;
|
|
75
|
+
}
|
|
76
|
+
.on, .off {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
}
|
|
80
|
+
.btn {
|
|
81
|
+
font-weight: normal;
|
|
82
|
+
display: block;
|
|
83
|
+
}
|
|
84
|
+
.item {
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: flex-start;
|
|
87
|
+
margin: 10px;
|
|
88
|
+
background: rgba(0,0,0,0.04);
|
|
89
|
+
}
|
|
90
|
+
.item img {
|
|
91
|
+
width: 100px;
|
|
92
|
+
}
|
|
93
|
+
.item .title {
|
|
94
|
+
text-decoration: none;
|
|
95
|
+
color: royalblue;
|
|
96
|
+
}
|
|
97
|
+
.item .col {
|
|
98
|
+
padding: 10px;
|
|
99
|
+
}
|
|
100
|
+
.item .col > * {
|
|
101
|
+
margin: 5px 0;
|
|
102
|
+
}
|
|
103
|
+
.item .stat {
|
|
104
|
+
color: rgba(0,0,0,0.8);
|
|
105
|
+
display: flex;
|
|
106
|
+
}
|
|
107
|
+
.item .stat > * {
|
|
108
|
+
margin-right: 15px;
|
|
109
|
+
}
|
|
110
|
+
.timestamp {
|
|
111
|
+
color: rgba(0,0,0,0.5);
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
114
|
+
<script src="/hotkeys.min.js"></script>
|
|
115
|
+
<script src="/sweetalert2.js"></script>
|
|
116
|
+
<script src="/noty.js"></script>
|
|
117
|
+
<script src="/notyq.js"></script>
|
|
118
|
+
<script src="/xterm.js"></script>
|
|
119
|
+
<script src="/xterm-addon-fit.js"></script>
|
|
120
|
+
<script src="/xterm-addon-web-links.js"></script>
|
|
121
|
+
<script src="/xterm-theme.js"></script>
|
|
122
|
+
<script src="/sweetalert2.js"></script>
|
|
123
|
+
<script src="/Socket.js"></script>
|
|
124
|
+
<script src="/install.js"></script>
|
|
125
|
+
<script src="/timeago.min.js"></script>
|
|
126
|
+
<script src="/common.js"></script>
|
|
127
|
+
<script src="/report.js"></script>
|
|
128
|
+
</head>
|
|
129
|
+
<body class='<%=theme%>'>
|
|
130
|
+
<header class='grabbable'>
|
|
131
|
+
<h1>
|
|
132
|
+
<a class='path' href="/"><%-logo%></a>
|
|
133
|
+
<div class='flexible'></div>
|
|
134
|
+
<div class='nav-btns'>
|
|
135
|
+
<button class='btn2' id='report'><div><i class="fa-solid fa-bug"></i></div><div>Report Bug</div></button>
|
|
136
|
+
<a class='btn2' href='https://discord.gg/TQdNwadtE4' target="_blank"><div><i class="fa-brands fa-discord"></i></div><div>Discord</div></a>
|
|
137
|
+
<a class='btn2' href='https://twitter.com/cocktailpeanut' target="_blank"><div><i class="fa-brands fa-twitter"></i></div><div>Twitter</div></a>
|
|
138
|
+
<a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
|
|
139
|
+
<button id='new-window' title='open a new window' class='btn2'><i class="fa-solid fa-plus"></i></button>
|
|
140
|
+
</div>
|
|
141
|
+
</h1>
|
|
142
|
+
</h1>
|
|
143
|
+
</header>
|
|
144
|
+
<% if (requirements_pending) { %>
|
|
145
|
+
<div class='requirements'>
|
|
146
|
+
<div class='content'>
|
|
147
|
+
<div class='loading'>
|
|
148
|
+
<i class="fa-solid fa-circle-notch fa-spin"></i>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<% } else { %>
|
|
153
|
+
<% if (true || install_required) { %>
|
|
154
|
+
<div class='requirements'>
|
|
155
|
+
<div class='content'>
|
|
156
|
+
<% if (install_required) { %>
|
|
157
|
+
<div class='title'><i class="fa-solid fa-circle-exclamation"></i> Installation required</div>
|
|
158
|
+
<% } else { %>
|
|
159
|
+
<div class='title'><i class="fa-solid fa-circle-exclamation"></i> Installation complete</div>
|
|
160
|
+
<% } %>
|
|
161
|
+
<div class='btn-group'>
|
|
162
|
+
<% requirements.map((r) => { %>
|
|
163
|
+
<div class='requirement-item'>
|
|
164
|
+
<% if (r.installed) { %>
|
|
165
|
+
<div class='name'><%=r.name%></div>
|
|
166
|
+
<div class='flexible'></div>
|
|
167
|
+
<div class='label'>Installed</div>
|
|
168
|
+
<% } else { %>
|
|
169
|
+
<div class='name highlighted'><%=r.name%></div>
|
|
170
|
+
<div class='flexible'></div>
|
|
171
|
+
<div class='label highlighted'>Not Installed</div>
|
|
172
|
+
<% } %>
|
|
173
|
+
</div>
|
|
174
|
+
<% }) %>
|
|
175
|
+
</div>
|
|
176
|
+
<% if (!install_required) { %>
|
|
177
|
+
<a class='btn' href="/">Return home</a>
|
|
178
|
+
<% } %>
|
|
179
|
+
<form class="<%= install_required ? '' : 'hidden'%>" id='install-form' method="post" action="/pinokio/install">
|
|
180
|
+
<input type='hidden' name="requirements" value="<%=JSON.stringify(requirements)%>">
|
|
181
|
+
<input type='hidden' name='callback' value="<%=current%>">
|
|
182
|
+
<button class='btn'>Install</button>
|
|
183
|
+
</form>
|
|
184
|
+
<div class='item'>
|
|
185
|
+
<div class='d'>Not working? <a id='del-bin'>Try a fresh install</a></div>
|
|
186
|
+
<div class='reset-bin-loading hidden'>
|
|
187
|
+
<i class="fa-solid fa-circle-notch fa-spin"></i> Stand by. Do not close this window..
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
<% } else { %>
|
|
193
|
+
<main>
|
|
194
|
+
<div id='terminal'>all installed</div>
|
|
195
|
+
<a href="/" class='btn'>Home</a>
|
|
196
|
+
</main>
|
|
197
|
+
<% } %>
|
|
198
|
+
<% } %>
|
|
199
|
+
<script>
|
|
200
|
+
document.addEventListener("DOMContentLoaded", async () => {
|
|
201
|
+
Reporter()
|
|
202
|
+
<% if (error) { %>
|
|
203
|
+
document.querySelector(".requirements .content").innerHTML = '<div class="loading"><i class="fa-solid fa-circle-exclamation"></i> <%=error%></div>'
|
|
204
|
+
<% } %>
|
|
205
|
+
<% if (requirements_pending) { %>
|
|
206
|
+
await new Promise((resolve, reject) => {
|
|
207
|
+
let interval = setInterval(() => {
|
|
208
|
+
fetch("/pinokio/requirements_ready").then((res) => {
|
|
209
|
+
return res.json()
|
|
210
|
+
}).then((res) => {
|
|
211
|
+
console.log(res)
|
|
212
|
+
if (res.error) {
|
|
213
|
+
alert(res.error)
|
|
214
|
+
clearInterval(interval)
|
|
215
|
+
} else if (!res.requirements_pending) {
|
|
216
|
+
clearInterval(interval)
|
|
217
|
+
resolve()
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
}, 500)
|
|
221
|
+
})
|
|
222
|
+
location.href = location.href
|
|
223
|
+
<% } %>
|
|
224
|
+
if (document.querySelector("#del-bin")) {
|
|
225
|
+
document.querySelector("#del-bin").addEventListener("click", async (e) => {
|
|
226
|
+
console.log("del-bin")
|
|
227
|
+
let proceed = confirm("Are you sure you wish to delete the bin folder?")
|
|
228
|
+
if (proceed) {
|
|
229
|
+
document.querySelector(".reset-bin-loading").classList.remove("hidden")
|
|
230
|
+
document.querySelector("#del-bin").classList.add("hidden")
|
|
231
|
+
let res = await fetch("/pinokio/delete", {
|
|
232
|
+
method: "post",
|
|
233
|
+
headers: {
|
|
234
|
+
"Content-Type": "application/json"
|
|
235
|
+
},
|
|
236
|
+
body: JSON.stringify({ type: "bin" })
|
|
237
|
+
}).then((res) => {
|
|
238
|
+
return res.json()
|
|
239
|
+
})
|
|
240
|
+
console.log(res)
|
|
241
|
+
document.querySelector(".reset-bin-loading").classList.add("hidden")
|
|
242
|
+
if (res.error) {
|
|
243
|
+
alert(res.error)
|
|
244
|
+
} else {
|
|
245
|
+
//location.href = location.href
|
|
246
|
+
document.querySelector("#install-form").submit()
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
</script>
|
|
253
|
+
</body>
|
|
254
|
+
</html>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="UTF-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
5
|
+
<link href="/xterm.min.css" rel="stylesheet" />
|
|
6
|
+
<link href="/css/fontawesome.min.css" rel="stylesheet">
|
|
7
|
+
<link href="/css/solid.min.css" rel="stylesheet">
|
|
8
|
+
<link href="/css/regular.min.css" rel="stylesheet">
|
|
9
|
+
<link href="/css/brands.min.css" rel="stylesheet">
|
|
10
|
+
<link href="/markdown.css" rel="stylesheet"/>
|
|
11
|
+
<link href="/noty.css" rel="stylesheet"/>
|
|
12
|
+
<link href="/style.css" rel="stylesheet"/>
|
|
13
|
+
<% if (agent === "electron") { %>
|
|
14
|
+
<link href="/electron.css" rel="stylesheet"/>
|
|
15
|
+
<% } %>
|
|
16
|
+
<style>
|
|
17
|
+
html {
|
|
18
|
+
scroll-behavior: smooth;
|
|
19
|
+
height: 100%;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
height: 100%;
|
|
24
|
+
overflow: auto;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
}
|
|
28
|
+
.line2 {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
background: rgba(0,0,100,0.04);
|
|
33
|
+
}
|
|
34
|
+
.line2 a {
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
color: black;
|
|
37
|
+
}
|
|
38
|
+
.status {
|
|
39
|
+
padding: 10px;
|
|
40
|
+
margin: 10px;
|
|
41
|
+
border-radius: 10px;
|
|
42
|
+
}
|
|
43
|
+
.status.offline {
|
|
44
|
+
background: silver;
|
|
45
|
+
}
|
|
46
|
+
.status.online {
|
|
47
|
+
background: yellowgreen;
|
|
48
|
+
}
|
|
49
|
+
.switch {
|
|
50
|
+
padding: 10px;
|
|
51
|
+
margin: 10px 0;
|
|
52
|
+
}
|
|
53
|
+
.switch[data-online=true] {
|
|
54
|
+
color: yellowgreen;
|
|
55
|
+
}
|
|
56
|
+
.button {
|
|
57
|
+
padding: 10px;
|
|
58
|
+
}
|
|
59
|
+
.on, .off {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
}
|
|
63
|
+
.btn {
|
|
64
|
+
margin: 5px;
|
|
65
|
+
width: 100px;
|
|
66
|
+
text-align: center;
|
|
67
|
+
padding: 10px;
|
|
68
|
+
background: black;
|
|
69
|
+
color: white;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
font-weight: normal;
|
|
72
|
+
}
|
|
73
|
+
.item {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: flex-start;
|
|
76
|
+
margin: 10px;
|
|
77
|
+
background: rgba(0,0,0,0.04);
|
|
78
|
+
}
|
|
79
|
+
.item img {
|
|
80
|
+
width: 100px;
|
|
81
|
+
}
|
|
82
|
+
.item .title {
|
|
83
|
+
text-decoration: none;
|
|
84
|
+
color: royalblue;
|
|
85
|
+
}
|
|
86
|
+
.item .col {
|
|
87
|
+
padding: 10px;
|
|
88
|
+
}
|
|
89
|
+
.item .col > * {
|
|
90
|
+
margin: 5px 0;
|
|
91
|
+
}
|
|
92
|
+
.item .stat {
|
|
93
|
+
color: rgba(0,0,0,0.8);
|
|
94
|
+
display: flex;
|
|
95
|
+
}
|
|
96
|
+
.item .stat > * {
|
|
97
|
+
margin-right: 15px;
|
|
98
|
+
}
|
|
99
|
+
.timestamp {
|
|
100
|
+
color: rgba(0,0,0,0.5);
|
|
101
|
+
}
|
|
102
|
+
main {
|
|
103
|
+
flex-grow: 1;
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
}
|
|
107
|
+
.setup-items {
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
}
|
|
111
|
+
.head {
|
|
112
|
+
padding: 80px;
|
|
113
|
+
text-align: center;
|
|
114
|
+
}
|
|
115
|
+
.head .desc {
|
|
116
|
+
opacity: 0.7;
|
|
117
|
+
padding: 10px;
|
|
118
|
+
}
|
|
119
|
+
.head h3 {
|
|
120
|
+
font-size: 50px;
|
|
121
|
+
margin: 0;
|
|
122
|
+
}
|
|
123
|
+
body.dark .card {
|
|
124
|
+
color: white;
|
|
125
|
+
}
|
|
126
|
+
.card {
|
|
127
|
+
text-decoration: none;
|
|
128
|
+
width: 200px;
|
|
129
|
+
color: rgba(0,0,0,0.9);
|
|
130
|
+
text-align: center;
|
|
131
|
+
height: 400px;
|
|
132
|
+
margin: 20px;
|
|
133
|
+
}
|
|
134
|
+
.card:hover {
|
|
135
|
+
color: royalblue !important;
|
|
136
|
+
}
|
|
137
|
+
.card .desc {
|
|
138
|
+
text-align: left;
|
|
139
|
+
opacity: 0.7;
|
|
140
|
+
}
|
|
141
|
+
.card h3 {
|
|
142
|
+
font-size: 30px;
|
|
143
|
+
letter-spacing: -1px;
|
|
144
|
+
}
|
|
145
|
+
.card i {
|
|
146
|
+
font-size: 50px;
|
|
147
|
+
}
|
|
148
|
+
</style>
|
|
149
|
+
</head>
|
|
150
|
+
<body class='<%=theme%>'>
|
|
151
|
+
<header class='grabbable'>
|
|
152
|
+
<h1>
|
|
153
|
+
<a class='path' href="/"><%-logo%></a>
|
|
154
|
+
<div class='flexible'></div>
|
|
155
|
+
<div class='nav-btns'>
|
|
156
|
+
<button class='btn2' id='report'><div><i class="fa-solid fa-bug"></i></div><div>Report Bug</div></button>
|
|
157
|
+
<a class='btn2' href='https://discord.gg/TQdNwadtE4' target="_blank"><div><i class="fa-brands fa-discord"></i></div><div>Discord</div></a>
|
|
158
|
+
<a class='btn2' href='https://twitter.com/cocktailpeanut' target="_blank"><div><i class="fa-brands fa-twitter"></i></div><div>Twitter</div></a>
|
|
159
|
+
<a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
|
|
160
|
+
<button id='new-window' title='open a new window' class='btn2'><i class="fa-solid fa-plus"></i></button>
|
|
161
|
+
</div>
|
|
162
|
+
</h1>
|
|
163
|
+
</h1>
|
|
164
|
+
</header>
|
|
165
|
+
<main>
|
|
166
|
+
<div class='head'>
|
|
167
|
+
<h3>Setup</h3>
|
|
168
|
+
<div class='desc'>Select a setup option (You can set up multiple options).</div>
|
|
169
|
+
</div>
|
|
170
|
+
<div class='setup-items'>
|
|
171
|
+
<% items.forEach((item) => { %>
|
|
172
|
+
<a class='card' href="/setup/<%=item.id%>">
|
|
173
|
+
<i class="<%=item.icon%>"></i>
|
|
174
|
+
<h3><%=item.title%></h3>
|
|
175
|
+
<div class='desc'><%=item.description%></div>
|
|
176
|
+
</a>
|
|
177
|
+
<% }) %>
|
|
178
|
+
</div>
|
|
179
|
+
</main>
|
|
180
|
+
</body>
|
|
181
|
+
</html>
|