pinokiod 3.147.0 → 3.150.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/prototype.js +0 -1
- package/kernel/shell.js +14 -14
- package/kernel/util.js +0 -1
- package/package.json +1 -1
- package/server/index.js +17 -4
- package/server/public/files-app/app.css +317 -0
- package/server/public/files-app/app.js +686 -0
- package/server/public/style.css +5 -5
- package/server/public/tab-idle-notifier.js +48 -6
- package/server/public/terminal_input_tracker.js +5 -3
- package/server/routes/files.js +284 -0
- package/server/views/app.ejs +75 -33
- package/server/views/file_browser.ejs +130 -0
- package/server/views/terminal.ejs +6 -4
package/kernel/prototype.js
CHANGED
package/kernel/shell.js
CHANGED
|
@@ -1061,20 +1061,20 @@ class Shell {
|
|
|
1061
1061
|
this.monitor = this.monitor + data
|
|
1062
1062
|
this.monitor = this.monitor.slice(-300) // last 300
|
|
1063
1063
|
|
|
1064
|
-
let notifications = this.parser.processData(data)
|
|
1065
|
-
if (notifications.length > 0) {
|
|
1066
|
-
console.log({ notifications })
|
|
1067
|
-
for(let notif of notifications) {
|
|
1068
|
-
if (notif.type !== "bell") {
|
|
1069
|
-
Util.push({
|
|
1070
|
-
image: path.resolve(__dirname, "../server/public/pinokio-black.png"),
|
|
1071
|
-
message: notif.title,
|
|
1072
|
-
sound: true,
|
|
1073
|
-
timeout: 30,
|
|
1074
|
-
})
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1064
|
+
// let notifications = this.parser.processData(data)
|
|
1065
|
+
// if (notifications.length > 0) {
|
|
1066
|
+
// console.log({ notifications })
|
|
1067
|
+
// for(let notif of notifications) {
|
|
1068
|
+
// if (notif.type !== "bell") {
|
|
1069
|
+
// Util.push({
|
|
1070
|
+
// image: path.resolve(__dirname, "../server/public/pinokio-black.png"),
|
|
1071
|
+
// message: notif.title,
|
|
1072
|
+
// sound: true,
|
|
1073
|
+
// timeout: 30,
|
|
1074
|
+
// })
|
|
1075
|
+
// }
|
|
1076
|
+
// }
|
|
1077
|
+
// }
|
|
1078
1078
|
|
|
1079
1079
|
if (!this.done) {
|
|
1080
1080
|
|
package/kernel/util.js
CHANGED
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const QRCode = require('qrcode')
|
|
|
25
25
|
const axios = require('axios')
|
|
26
26
|
const crypto = require('crypto')
|
|
27
27
|
const serveIndex = require('./serveIndex')
|
|
28
|
+
const registerFileRoutes = require('./routes/files')
|
|
28
29
|
|
|
29
30
|
const git = require('isomorphic-git')
|
|
30
31
|
const http = require('isomorphic-git/http/node')
|
|
@@ -812,6 +813,12 @@ class Server {
|
|
|
812
813
|
let dev_tab = "/p/" + name + "/dev"
|
|
813
814
|
let review_tab = "/p/" + name + "/review"
|
|
814
815
|
|
|
816
|
+
let editor_tab = `/pinokio/fileview/${encodeURIComponent(name)}`
|
|
817
|
+
let savedTabs = []
|
|
818
|
+
if (Array.isArray(this.tabs[name])) {
|
|
819
|
+
savedTabs = this.tabs[name].filter((url) => url !== editor_tab)
|
|
820
|
+
}
|
|
821
|
+
|
|
815
822
|
let dynamic_url = "/pinokio/dynamic/" + name;
|
|
816
823
|
if (Object.values(req.query).length > 0) {
|
|
817
824
|
let index = 0
|
|
@@ -852,7 +859,8 @@ class Server {
|
|
|
852
859
|
name,
|
|
853
860
|
// profile,
|
|
854
861
|
// feed,
|
|
855
|
-
tabs:
|
|
862
|
+
tabs: savedTabs,
|
|
863
|
+
editor_tab: editor_tab,
|
|
856
864
|
config,
|
|
857
865
|
// sidebar_url: "/pinokio/sidebar/" + name,
|
|
858
866
|
home: req.originalUrl,
|
|
@@ -3267,14 +3275,14 @@ class Server {
|
|
|
3267
3275
|
}
|
|
3268
3276
|
terminal = {
|
|
3269
3277
|
icon: "fa-solid fa-terminal",
|
|
3270
|
-
title: "Terminal",
|
|
3278
|
+
title: "User Terminal",
|
|
3271
3279
|
subtitle: "Open the terminal in the browser",
|
|
3272
3280
|
menu: terminals
|
|
3273
3281
|
}
|
|
3274
3282
|
} else {
|
|
3275
3283
|
terminal = {
|
|
3276
3284
|
icon: "fa-solid fa-terminal",
|
|
3277
|
-
title: "Terminal",
|
|
3285
|
+
title: "User Terminal",
|
|
3278
3286
|
subtitle: "Work with the terminal directly in the browser",
|
|
3279
3287
|
menu: [this.renderShell(filepath, 0, 0, {
|
|
3280
3288
|
icon: "fa-solid fa-terminal",
|
|
@@ -3730,6 +3738,11 @@ class Server {
|
|
|
3730
3738
|
};
|
|
3731
3739
|
next();
|
|
3732
3740
|
});
|
|
3741
|
+
registerFileRoutes(this.app, {
|
|
3742
|
+
kernel: this.kernel,
|
|
3743
|
+
getTheme: () => this.theme,
|
|
3744
|
+
exists: (target) => this.exists(target),
|
|
3745
|
+
});
|
|
3733
3746
|
/*
|
|
3734
3747
|
this.app.get("/asset/*", ex((req, res) => {
|
|
3735
3748
|
let pathComponents = req.params[0].split("/")
|
|
@@ -4527,7 +4540,6 @@ class Server {
|
|
|
4527
4540
|
}
|
|
4528
4541
|
}))
|
|
4529
4542
|
this.app.post("/push", ex(async (req, res) => {
|
|
4530
|
-
console.log("Push", req.body)
|
|
4531
4543
|
try {
|
|
4532
4544
|
const payload = { ...(req.body || {}) }
|
|
4533
4545
|
const resolveAssetPath = (raw) => {
|
|
@@ -6222,6 +6234,7 @@ class Server {
|
|
|
6222
6234
|
menu: exec_menus
|
|
6223
6235
|
},
|
|
6224
6236
|
]
|
|
6237
|
+
|
|
6225
6238
|
let spec = ""
|
|
6226
6239
|
try {
|
|
6227
6240
|
spec = await fs.promises.readFile(path.resolve(filepath, "SPEC.md"), "utf8")
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
.files-app {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
background: var(--background-color, #f7f7f7);
|
|
6
|
+
color: var(--text-color, #111);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.files-app[data-theme='dark'] {
|
|
10
|
+
--background-color: var(--dark-bg);
|
|
11
|
+
--surface-color: #222327;
|
|
12
|
+
--sidebar-color: var(--dark-nav-bg);
|
|
13
|
+
--border-color: var(--dark-thin);
|
|
14
|
+
--text-color: var(--dark-color);
|
|
15
|
+
--muted-color: var(--dark-fade);
|
|
16
|
+
--accent-color: var(--dark-link-color);
|
|
17
|
+
--accent-color-soft: rgba(183, 161, 255, 0.18);
|
|
18
|
+
--accent-color-shadow: rgba(183, 161, 255, 0.35);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.files-app:not([data-theme='dark']) {
|
|
22
|
+
--background-color: #f7f7f7;
|
|
23
|
+
--surface-color: #ffffff;
|
|
24
|
+
--sidebar-color: #ffffff;
|
|
25
|
+
--border-color: rgba(15, 23, 42, 0.08);
|
|
26
|
+
--text-color: #111827;
|
|
27
|
+
--muted-color: #6b7280;
|
|
28
|
+
--accent-color: var(--light-link-color);
|
|
29
|
+
--accent-color-soft: rgba(127, 91, 243, 0.12);
|
|
30
|
+
--accent-color-shadow: rgba(127, 91, 243, 0.35);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.files-app__header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
padding: 12px 18px;
|
|
38
|
+
background: var(--surface-color);
|
|
39
|
+
border-bottom: 1px solid var(--border-color);
|
|
40
|
+
gap: 12px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.files-app__header-title {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 12px;
|
|
47
|
+
font-size: 15px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.files-app__header-title i {
|
|
51
|
+
font-size: 18px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.files-app__header-text {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 2px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.files-app__header-primary {
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.files-app__header-sub {
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
color: var(--muted-color);
|
|
67
|
+
word-break: break-all;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.files-app__header-actions {
|
|
71
|
+
display: flex;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.files-app__save {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 6px;
|
|
79
|
+
padding: 6px 12px;
|
|
80
|
+
border-radius: 6px;
|
|
81
|
+
border: 1px solid transparent;
|
|
82
|
+
background: var(--accent-color);
|
|
83
|
+
color: #ffffff;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.files-app__meta {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 6px;
|
|
93
|
+
padding: 6px 12px;
|
|
94
|
+
border-radius: 6px;
|
|
95
|
+
border: 1px solid var(--border-color);
|
|
96
|
+
background: transparent;
|
|
97
|
+
color: var(--text-color);
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
transition: transform 0.15s ease, background 0.15s ease;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.files-app__meta:focus-visible {
|
|
104
|
+
outline: 2px solid var(--accent-color);
|
|
105
|
+
outline-offset: 2px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.files-app__meta:hover {
|
|
109
|
+
background: var(--accent-color-soft);
|
|
110
|
+
transform: translateY(-1px);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.files-app__save[disabled] {
|
|
114
|
+
opacity: 0.55;
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.files-app__save:not([disabled]):hover {
|
|
119
|
+
box-shadow: 0 8px 18px var(--accent-color-shadow);
|
|
120
|
+
transform: translateY(-1px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.files-app__body {
|
|
124
|
+
flex: 1;
|
|
125
|
+
display: flex;
|
|
126
|
+
min-height: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.files-app__sidebar {
|
|
130
|
+
width: 280px;
|
|
131
|
+
background: var(--sidebar-color);
|
|
132
|
+
border-right: 1px solid var(--border-color);
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.files-app__sidebar-scroll {
|
|
138
|
+
flex: 1;
|
|
139
|
+
overflow: auto;
|
|
140
|
+
padding: 12px 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.files-app__main {
|
|
144
|
+
flex: 1;
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
background: var(--surface-color);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.files-app__tabs:empty {
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
.files-app__tabs {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 4px;
|
|
157
|
+
padding: 8px 10px;
|
|
158
|
+
border-bottom: 1px solid var(--border-color);
|
|
159
|
+
overflow-x: auto;
|
|
160
|
+
white-space: nowrap;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.files-app__tab {
|
|
164
|
+
position: relative;
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: 6px;
|
|
168
|
+
padding: 6px 12px;
|
|
169
|
+
border-radius: 6px;
|
|
170
|
+
border: 1px solid transparent;
|
|
171
|
+
background: transparent;
|
|
172
|
+
color: var(--text-color);
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
font-size: 13px;
|
|
175
|
+
transition: background 0.15s ease, border 0.15s ease;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.files-app__tab:hover {
|
|
179
|
+
background: rgba(127, 91, 243, 0.08);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.files-app__tab--active {
|
|
183
|
+
background: rgba(127, 91, 243, 0.14);
|
|
184
|
+
border-color: rgba(127, 91, 243, 0.25);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.files-app__tab--stale {
|
|
188
|
+
border-color: rgba(249, 115, 22, 0.45);
|
|
189
|
+
background: rgba(249, 115, 22, 0.18);
|
|
190
|
+
}
|
|
191
|
+
.files-app__tab--stale .files-app__tab-label::after {
|
|
192
|
+
content: ' •';
|
|
193
|
+
color: #f97316;
|
|
194
|
+
font-weight: 600;
|
|
195
|
+
}
|
|
196
|
+
body.dark .files-app__tab--stale {
|
|
197
|
+
border-color: rgba(250, 204, 21, 0.45);
|
|
198
|
+
background: rgba(250, 204, 21, 0.18);
|
|
199
|
+
}
|
|
200
|
+
body.dark .files-app__tab--stale .files-app__tab-label::after {
|
|
201
|
+
color: #facc15;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.files-app__tab-close {
|
|
205
|
+
border: none;
|
|
206
|
+
background: none;
|
|
207
|
+
color: inherit;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
font-size: 13px;
|
|
210
|
+
padding: 0;
|
|
211
|
+
line-height: 1;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.files-app__tab--dirty::after {
|
|
215
|
+
content: '•';
|
|
216
|
+
color: var(--accent-color);
|
|
217
|
+
margin-left: 4px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.files-app__editor {
|
|
221
|
+
position: relative;
|
|
222
|
+
flex: 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.files-app__editor .ace_editor {
|
|
226
|
+
position: absolute;
|
|
227
|
+
inset: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.files-app__status {
|
|
231
|
+
padding: 6px 12px;
|
|
232
|
+
font-size: 12px;
|
|
233
|
+
color: var(--muted-color);
|
|
234
|
+
border-top: 1px solid var(--border-color);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.files-app__tree {
|
|
238
|
+
list-style: none;
|
|
239
|
+
padding: 0 12px;
|
|
240
|
+
margin: 0;
|
|
241
|
+
font-size: 13px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.files-app__tree-item {
|
|
245
|
+
margin: 0;
|
|
246
|
+
padding: 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.files-app__tree-row {
|
|
250
|
+
width: 100%;
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
gap: 8px;
|
|
254
|
+
padding: 4px 8px;
|
|
255
|
+
border-radius: 4px;
|
|
256
|
+
background: none;
|
|
257
|
+
border: none;
|
|
258
|
+
color: inherit;
|
|
259
|
+
text-align: left;
|
|
260
|
+
cursor: pointer;
|
|
261
|
+
transition: background 0.1s ease;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.files-app__tree-row:hover,
|
|
265
|
+
.files-app__tree-row:focus-visible {
|
|
266
|
+
background: rgba(127, 91, 243, 0.12);
|
|
267
|
+
outline: none;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.files-app__tree-row[data-selected='true'] {
|
|
271
|
+
background: rgba(127, 91, 243, 0.2);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.files-app__tree-row i {
|
|
275
|
+
width: 16px;
|
|
276
|
+
text-align: center;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.files-app__tree-children {
|
|
280
|
+
list-style: none;
|
|
281
|
+
margin: 0;
|
|
282
|
+
padding: 0 0 0 16px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.files-app__tree-item[data-type='directory'] > .files-app__tree-children {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.files-app__tree-item[data-expanded='true'] > .files-app__tree-children {
|
|
290
|
+
display: block;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.files-app__empty-state {
|
|
294
|
+
padding: 16px;
|
|
295
|
+
font-size: 13px;
|
|
296
|
+
color: var(--muted-color);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@media (max-width: 900px) {
|
|
300
|
+
.files-app__body {
|
|
301
|
+
flex-direction: column;
|
|
302
|
+
}
|
|
303
|
+
.files-app__sidebar {
|
|
304
|
+
width: 100%;
|
|
305
|
+
max-height: 260px;
|
|
306
|
+
border-right: none;
|
|
307
|
+
border-bottom: 1px solid var(--border-color);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.files-app__status[data-state='error'] {
|
|
312
|
+
color: #ef4444;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.files-app__status[data-state='success'] {
|
|
316
|
+
color: #10b981;
|
|
317
|
+
}
|