pinokiod 3.86.0 → 3.87.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/Dockerfile +61 -0
- package/docker-entrypoint.sh +75 -0
- package/kernel/api/hf/index.js +1 -1
- package/kernel/api/index.js +1 -1
- package/kernel/api/shell/index.js +6 -0
- package/kernel/api/terminal/index.js +166 -0
- package/kernel/bin/conda.js +3 -2
- package/kernel/bin/index.js +53 -2
- package/kernel/bin/setup.js +32 -0
- package/kernel/bin/vs.js +11 -2
- package/kernel/index.js +42 -2
- package/kernel/info.js +36 -0
- package/kernel/peer.js +42 -15
- package/kernel/router/index.js +23 -15
- package/kernel/router/localhost_static_router.js +0 -3
- package/kernel/router/pinokio_domain_router.js +333 -0
- package/kernel/shells.js +21 -1
- package/kernel/util.js +2 -2
- package/package.json +2 -1
- package/script/install-mode.js +33 -0
- package/script/pinokio.json +7 -0
- package/server/index.js +513 -173
- package/server/public/Socket.js +48 -0
- package/server/public/common.js +1441 -276
- package/server/public/fseditor.js +71 -12
- package/server/public/install.js +1 -1
- package/server/public/layout.js +740 -0
- package/server/public/modalinput.js +0 -1
- package/server/public/style.css +97 -105
- package/server/public/tab-idle-notifier.js +629 -0
- package/server/public/terminal_input_tracker.js +63 -0
- package/server/public/urldropdown.css +319 -53
- package/server/public/urldropdown.js +615 -159
- package/server/public/window_storage.js +97 -28
- package/server/socket.js +40 -9
- package/server/views/500.ejs +2 -2
- package/server/views/app.ejs +3136 -1367
- package/server/views/bookmarklet.ejs +1 -1
- package/server/views/bootstrap.ejs +1 -1
- package/server/views/columns.ejs +2 -13
- package/server/views/connect.ejs +3 -4
- package/server/views/container.ejs +1 -2
- package/server/views/d.ejs +223 -53
- package/server/views/editor.ejs +1 -1
- package/server/views/file_explorer.ejs +1 -1
- package/server/views/index.ejs +12 -11
- package/server/views/index2.ejs +4 -4
- package/server/views/init/index.ejs +4 -5
- package/server/views/install.ejs +1 -1
- package/server/views/layout.ejs +105 -0
- package/server/views/net.ejs +39 -7
- package/server/views/network.ejs +20 -6
- package/server/views/network2.ejs +1 -1
- package/server/views/old_network.ejs +2 -2
- package/server/views/partials/dynamic.ejs +3 -5
- package/server/views/partials/menu.ejs +3 -5
- package/server/views/partials/running.ejs +1 -1
- package/server/views/pro.ejs +1 -1
- package/server/views/prototype/index.ejs +1 -1
- package/server/views/review.ejs +11 -23
- package/server/views/rows.ejs +2 -13
- package/server/views/screenshots.ejs +293 -138
- package/server/views/settings.ejs +3 -4
- package/server/views/setup.ejs +1 -2
- package/server/views/shell.ejs +277 -26
- package/server/views/terminal.ejs +322 -49
- package/server/views/tools.ejs +448 -4
|
@@ -10,6 +10,64 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
10
10
|
}
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
+
const allowedIconMimeTypes = [
|
|
14
|
+
'image/png',
|
|
15
|
+
'image/jpeg',
|
|
16
|
+
'image/gif',
|
|
17
|
+
'image/webp',
|
|
18
|
+
'image/svg+xml',
|
|
19
|
+
'image/x-icon',
|
|
20
|
+
'image/vnd.microsoft.icon'
|
|
21
|
+
]
|
|
22
|
+
const iconMimeToExtension = {
|
|
23
|
+
'image/png': 'png',
|
|
24
|
+
'image/jpeg': 'jpg',
|
|
25
|
+
'image/gif': 'gif',
|
|
26
|
+
'image/webp': 'webp',
|
|
27
|
+
'image/svg+xml': 'svg',
|
|
28
|
+
'image/x-icon': 'ico',
|
|
29
|
+
'image/vnd.microsoft.icon': 'ico'
|
|
30
|
+
}
|
|
31
|
+
const rasterMimeTypes = new Set([
|
|
32
|
+
'image/png',
|
|
33
|
+
'image/jpeg',
|
|
34
|
+
'image/gif',
|
|
35
|
+
'image/webp'
|
|
36
|
+
])
|
|
37
|
+
const inferExtensionFromFile = (file, fallback) => {
|
|
38
|
+
if (!file) {
|
|
39
|
+
return fallback
|
|
40
|
+
}
|
|
41
|
+
const type = file.type || file.fileType
|
|
42
|
+
if (type && iconMimeToExtension[type]) {
|
|
43
|
+
return iconMimeToExtension[type]
|
|
44
|
+
}
|
|
45
|
+
const name = file.name || file.filename
|
|
46
|
+
if (name) {
|
|
47
|
+
const nameMatch = name.match(/\.([\w-]+)$/)
|
|
48
|
+
if (nameMatch) {
|
|
49
|
+
return nameMatch[1].toLowerCase()
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return fallback
|
|
53
|
+
}
|
|
54
|
+
const buildIconPath = (existingPath, file) => {
|
|
55
|
+
const fallbackExt = (() => {
|
|
56
|
+
if (!existingPath) {
|
|
57
|
+
return 'png'
|
|
58
|
+
}
|
|
59
|
+
const match = existingPath.match(/\.([\w-]+)$/)
|
|
60
|
+
return match ? match[1].toLowerCase() : 'png'
|
|
61
|
+
})()
|
|
62
|
+
const ext = inferExtensionFromFile(file, fallbackExt)
|
|
63
|
+
const basePath = existingPath || `icon.${ext}`
|
|
64
|
+
const lastSlash = basePath.lastIndexOf('/')
|
|
65
|
+
const dir = lastSlash >= 0 ? basePath.slice(0, lastSlash + 1) : ''
|
|
66
|
+
const filename = lastSlash >= 0 ? basePath.slice(lastSlash + 1) : basePath
|
|
67
|
+
const dotIndex = filename.lastIndexOf('.')
|
|
68
|
+
const nameWithoutExt = dotIndex > 0 ? filename.slice(0, dotIndex) : filename
|
|
69
|
+
return `${dir}${nameWithoutExt}.${ext}`
|
|
70
|
+
}
|
|
13
71
|
let dirty
|
|
14
72
|
let mode
|
|
15
73
|
let new_path
|
|
@@ -41,7 +99,7 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
41
99
|
title: title_label,
|
|
42
100
|
html: `<div class='filepond-wrapper'>
|
|
43
101
|
<div class='avatar-field'>
|
|
44
|
-
<input id='new-folder-image' type="file" class="filepond" name="avatar" accept="
|
|
102
|
+
<input id='new-folder-image' type="file" class="filepond" name="avatar" accept="${allowedIconMimeTypes.join(', ')}" />
|
|
45
103
|
</div>
|
|
46
104
|
<div class='folder-rows'>
|
|
47
105
|
${folderpath_html}
|
|
@@ -82,6 +140,8 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
82
140
|
allowRevert: true,
|
|
83
141
|
allowRemove: true,
|
|
84
142
|
|
|
143
|
+
allowFileTypeValidation: true,
|
|
144
|
+
acceptedFileTypes: allowedIconMimeTypes,
|
|
85
145
|
allowImageCrop: true,
|
|
86
146
|
allowImageEdit: true,
|
|
87
147
|
allowImageTransform: true,
|
|
@@ -105,11 +165,8 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
105
165
|
if (dirty) {
|
|
106
166
|
formData.append("icon_dirty", true)
|
|
107
167
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} else {
|
|
111
|
-
formData.append("icon_path", "icon.png")
|
|
112
|
-
}
|
|
168
|
+
const iconTargetPath = dirty ? buildIconPath(iconpath, file) : (iconpath || "icon.png")
|
|
169
|
+
formData.append("icon_path", iconTargetPath)
|
|
113
170
|
let title = Swal.getPopup().querySelector('#new-folder-title').value
|
|
114
171
|
let description = Swal.getPopup().querySelector('#new-folder-description').value
|
|
115
172
|
let folder_path_el = Swal.getPopup().querySelector('#new-folder-path')
|
|
@@ -142,11 +199,12 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
142
199
|
if (response.error) {
|
|
143
200
|
alert(response.error)
|
|
144
201
|
} else {
|
|
145
|
-
Swal.close()
|
|
202
|
+
//Swal.close()
|
|
203
|
+
debugger
|
|
146
204
|
if (new_path) {
|
|
147
|
-
location.
|
|
205
|
+
location.replace(redirect(new_path))
|
|
148
206
|
} else {
|
|
149
|
-
location.
|
|
207
|
+
location.reload()
|
|
150
208
|
}
|
|
151
209
|
}
|
|
152
210
|
} catch (e) {
|
|
@@ -166,10 +224,11 @@ const FSEditor = async ({title, description, old_path, icon, iconpath, redirect,
|
|
|
166
224
|
// don't do anything
|
|
167
225
|
} else {
|
|
168
226
|
dirty = true
|
|
169
|
-
|
|
227
|
+
const mimeType = file.fileType || file.type
|
|
228
|
+
const canTransform = mimeType && rasterMimeTypes.has(mimeType)
|
|
170
229
|
pond.setOptions({
|
|
171
|
-
|
|
172
|
-
imageTransformOutputMimeType:
|
|
230
|
+
allowImageTransform: canTransform,
|
|
231
|
+
imageTransformOutputMimeType: canTransform ? mimeType : null
|
|
173
232
|
})
|
|
174
233
|
}
|
|
175
234
|
initial_file = file
|