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.
Files changed (67) hide show
  1. package/Dockerfile +61 -0
  2. package/docker-entrypoint.sh +75 -0
  3. package/kernel/api/hf/index.js +1 -1
  4. package/kernel/api/index.js +1 -1
  5. package/kernel/api/shell/index.js +6 -0
  6. package/kernel/api/terminal/index.js +166 -0
  7. package/kernel/bin/conda.js +3 -2
  8. package/kernel/bin/index.js +53 -2
  9. package/kernel/bin/setup.js +32 -0
  10. package/kernel/bin/vs.js +11 -2
  11. package/kernel/index.js +42 -2
  12. package/kernel/info.js +36 -0
  13. package/kernel/peer.js +42 -15
  14. package/kernel/router/index.js +23 -15
  15. package/kernel/router/localhost_static_router.js +0 -3
  16. package/kernel/router/pinokio_domain_router.js +333 -0
  17. package/kernel/shells.js +21 -1
  18. package/kernel/util.js +2 -2
  19. package/package.json +2 -1
  20. package/script/install-mode.js +33 -0
  21. package/script/pinokio.json +7 -0
  22. package/server/index.js +513 -173
  23. package/server/public/Socket.js +48 -0
  24. package/server/public/common.js +1441 -276
  25. package/server/public/fseditor.js +71 -12
  26. package/server/public/install.js +1 -1
  27. package/server/public/layout.js +740 -0
  28. package/server/public/modalinput.js +0 -1
  29. package/server/public/style.css +97 -105
  30. package/server/public/tab-idle-notifier.js +629 -0
  31. package/server/public/terminal_input_tracker.js +63 -0
  32. package/server/public/urldropdown.css +319 -53
  33. package/server/public/urldropdown.js +615 -159
  34. package/server/public/window_storage.js +97 -28
  35. package/server/socket.js +40 -9
  36. package/server/views/500.ejs +2 -2
  37. package/server/views/app.ejs +3136 -1367
  38. package/server/views/bookmarklet.ejs +1 -1
  39. package/server/views/bootstrap.ejs +1 -1
  40. package/server/views/columns.ejs +2 -13
  41. package/server/views/connect.ejs +3 -4
  42. package/server/views/container.ejs +1 -2
  43. package/server/views/d.ejs +223 -53
  44. package/server/views/editor.ejs +1 -1
  45. package/server/views/file_explorer.ejs +1 -1
  46. package/server/views/index.ejs +12 -11
  47. package/server/views/index2.ejs +4 -4
  48. package/server/views/init/index.ejs +4 -5
  49. package/server/views/install.ejs +1 -1
  50. package/server/views/layout.ejs +105 -0
  51. package/server/views/net.ejs +39 -7
  52. package/server/views/network.ejs +20 -6
  53. package/server/views/network2.ejs +1 -1
  54. package/server/views/old_network.ejs +2 -2
  55. package/server/views/partials/dynamic.ejs +3 -5
  56. package/server/views/partials/menu.ejs +3 -5
  57. package/server/views/partials/running.ejs +1 -1
  58. package/server/views/pro.ejs +1 -1
  59. package/server/views/prototype/index.ejs +1 -1
  60. package/server/views/review.ejs +11 -23
  61. package/server/views/rows.ejs +2 -13
  62. package/server/views/screenshots.ejs +293 -138
  63. package/server/views/settings.ejs +3 -4
  64. package/server/views/setup.ejs +1 -2
  65. package/server/views/shell.ejs +277 -26
  66. package/server/views/terminal.ejs +322 -49
  67. 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="image/png, image/jpeg, image/gif" />
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
- if (iconpath) {
109
- formData.append("icon_path", iconpath)
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.href = redirect(new_path)
205
+ location.replace(redirect(new_path))
148
206
  } else {
149
- location.href = location.href
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
- // make sure the image mime type is transformed into the same type as the existing image
227
+ const mimeType = file.fileType || file.type
228
+ const canTransform = mimeType && rasterMimeTypes.has(mimeType)
170
229
  pond.setOptions({
171
- //imageTransformOutputMimeType: initial_file.fileType
172
- imageTransformOutputMimeType: "image/png"
230
+ allowImageTransform: canTransform,
231
+ imageTransformOutputMimeType: canTransform ? mimeType : null
173
232
  })
174
233
  }
175
234
  initial_file = file
@@ -120,7 +120,7 @@ const createTerm = async (_theme) => {
120
120
  })
121
121
  let config = {
122
122
  scrollback: 9999999,
123
- fontSize: 14,
123
+ fontSize: 12,
124
124
  theme,
125
125
  }
126
126
  let res = await fetch("/xterm_config").then((res) => {