pinokiod 3.55.0 → 3.57.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.55.0",
3
+ "version": "3.57.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -654,7 +654,7 @@ class Server {
654
654
  review_tab,
655
655
  // paths,
656
656
  theme: this.theme,
657
- agent: this.agent,
657
+ agent: req.agent,
658
658
  src: "/_api/" + name,
659
659
  //asset: "/asset/api/" + name,
660
660
  asset: "/files/api/" + name,
@@ -784,7 +784,7 @@ class Server {
784
784
  schema: this.kernel.schema,
785
785
  logo: this.logo,
786
786
  theme: this.theme,
787
- agent: this.agent,
787
+ agent: req.agent,
788
788
  stars_selected: (req.query.sort === "stars" || !req.query.sort ? "selected" : ""),
789
789
  forks_selected: (req.query.sort === "forks" ? "selected" : ""),
790
790
  updated_selected: (req.query.sort === "updated" ? "selected" : ""),
@@ -806,7 +806,7 @@ class Server {
806
806
  requirements_pending,
807
807
  logo: this.logo,
808
808
  theme: this.theme,
809
- agent: this.agent,
809
+ agent: req.agent,
810
810
  userdir: this.kernel.api.userdir,
811
811
  display: ["form"],
812
812
  query: req.query
@@ -868,7 +868,7 @@ class Server {
868
868
  version: this.version,
869
869
  logo: this.logo,
870
870
  theme: this.theme,
871
- agent: this.agent,
871
+ agent: req.agent,
872
872
  paths,
873
873
  config: configArray,
874
874
  query: req.query,
@@ -1079,7 +1079,7 @@ class Server {
1079
1079
  console.log({ cwd, api_path, root, root_path })
1080
1080
  res.render("required_env_editor", {
1081
1081
  portal: this.portal,
1082
- agent: this.agent,
1082
+ agent: req.agent,
1083
1083
  theme: this.theme,
1084
1084
  filename,
1085
1085
  filepath: root_path,
@@ -1116,7 +1116,7 @@ class Server {
1116
1116
  stop: (req.query && req.query.stop ? true : false),
1117
1117
  pinokioPath,
1118
1118
  runnable,
1119
- agent: this.agent,
1119
+ agent: req.agent,
1120
1120
  rawpath,
1121
1121
  gitRemote,
1122
1122
  filename,
@@ -1156,7 +1156,7 @@ class Server {
1156
1156
  portal: this.portal,
1157
1157
  logo: this.logo,
1158
1158
  theme: this.theme,
1159
- agent: this.agent,
1159
+ agent: req.agent,
1160
1160
  rawpath: rawpath + "?frame=true",
1161
1161
  paths,
1162
1162
  filepath
@@ -1596,7 +1596,7 @@ class Server {
1596
1596
  pinokioPath,
1597
1597
  config,
1598
1598
  display,
1599
- agent: this.agent,
1599
+ agent: req.agent,
1600
1600
  // folder,
1601
1601
  paths,
1602
1602
  uri,
@@ -1629,7 +1629,7 @@ class Server {
1629
1629
  pinokioPath,
1630
1630
  config,
1631
1631
  display,
1632
- agent: this.agent,
1632
+ agent: req.agent,
1633
1633
  // folder,
1634
1634
  paths,
1635
1635
  uri,
@@ -2068,7 +2068,7 @@ class Server {
2068
2068
 
2069
2069
 
2070
2070
  if (config.menu[i].href && config.menu[i].href.startsWith("http")) {
2071
- if (this.agent !== "electron") {
2071
+ if (req.agent !== "electron") {
2072
2072
  config.menu[i].target = "_blank"
2073
2073
  }
2074
2074
  }
@@ -2300,11 +2300,11 @@ class Server {
2300
2300
 
2301
2301
  // when loaded in electron but in minimal mode,
2302
2302
  // the app is loaded in the web so the agent should be "web"
2303
- if (this.agent === "electron") {
2304
- if (this.mode === "minimal" || this.mode === "background") {
2305
- this.agent = "web"
2306
- }
2307
- }
2303
+ // if (this.agent === "electron") {
2304
+ // if (this.mode === "minimal" || this.mode === "background") {
2305
+ // this.agent = "web"
2306
+ // }
2307
+ // }
2308
2308
 
2309
2309
  if (this.theme === "dark") {
2310
2310
  this.colors = {
@@ -2943,6 +2943,16 @@ class Server {
2943
2943
  origin: '*'
2944
2944
  }));
2945
2945
 
2946
+ this.app.use((req, res, next) => {
2947
+ const userAgent = req.get('User-Agent') || '';
2948
+ if (userAgent.includes("Pinokio")) {
2949
+ req.agent = "electron"
2950
+ } else {
2951
+ req.agent = "browser"
2952
+ }
2953
+ next();
2954
+ })
2955
+
2946
2956
  if (this.kernel.homedir) {
2947
2957
  this.app.use(express.static(this.kernel.path("web/public")))
2948
2958
  this.app.use('/prototype', express.static(this.kernel.path("prototype")))
@@ -3069,7 +3079,7 @@ class Server {
3069
3079
  portal: this.portal,
3070
3080
  logo: this.logo,
3071
3081
  theme: this.theme,
3072
- agent: this.agent,
3082
+ agent: req.agent,
3073
3083
  list,
3074
3084
  })
3075
3085
  }))
@@ -3081,21 +3091,21 @@ class Server {
3081
3091
  portal: this.portal,
3082
3092
  logo: this.logo,
3083
3093
  theme: this.theme,
3084
- agent: this.agent,
3094
+ agent: req.agent,
3085
3095
  list,
3086
3096
  })
3087
3097
  }))
3088
3098
  this.app.get("/columns", ex(async (req, res) => {
3089
3099
  res.render("columns", {
3090
3100
  theme: this.theme,
3091
- agent: this.agent,
3101
+ agent: req.agent,
3092
3102
  src: req.get('Referrer')
3093
3103
  })
3094
3104
  }))
3095
3105
  this.app.get("/rows", ex(async (req, res) => {
3096
3106
  res.render("rows", {
3097
3107
  theme: this.theme,
3098
- agent: this.agent,
3108
+ agent: req.agent,
3099
3109
  src: req.get('Referrer')
3100
3110
  })
3101
3111
  }))
@@ -3104,7 +3114,7 @@ class Server {
3104
3114
  this.app.get("/container", ex(async (req, res) => {
3105
3115
  res.render("container", {
3106
3116
  theme: this.theme,
3107
- agent: this.agent,
3117
+ agent: req.agent,
3108
3118
  src: req.query.url
3109
3119
  })
3110
3120
  }))
@@ -3207,7 +3217,7 @@ class Server {
3207
3217
  autolaunch,
3208
3218
  logo: this.logo,
3209
3219
  theme: this.theme,
3210
- agent: this.agent,
3220
+ agent: req.agent,
3211
3221
  name: meta.title,
3212
3222
  image: meta.icon,
3213
3223
  link: `/p/${name}?autolaunch=${autolaunch ? "1" : "0"}`,
@@ -3221,7 +3231,7 @@ class Server {
3221
3231
  autolaunch,
3222
3232
  logo: this.logo,
3223
3233
  theme: this.theme,
3224
- agent: this.agent,
3234
+ agent: req.agent,
3225
3235
  name: "Does not exist",
3226
3236
  image: "/pinokio-black.png",
3227
3237
  link: null
@@ -3260,7 +3270,7 @@ class Server {
3260
3270
  version: this.version,
3261
3271
  logo: this.logo,
3262
3272
  theme: this.theme,
3263
- agent: this.agent,
3273
+ agent: req.agent,
3264
3274
  ...folders
3265
3275
  })
3266
3276
  return
@@ -3335,7 +3345,7 @@ class Server {
3335
3345
  portal: this.portal,
3336
3346
  logo: this.logo,
3337
3347
  theme: this.theme,
3338
- agent: this.agent,
3348
+ agent: req.agent,
3339
3349
  paths: [],
3340
3350
  config: configArray,
3341
3351
  query: req.query,
@@ -3409,7 +3419,7 @@ class Server {
3409
3419
  logo: this.logo,
3410
3420
  platform: this.kernel.platform,
3411
3421
  theme: this.theme,
3412
- agent: this.agent,
3422
+ agent: req.agent,
3413
3423
  kernel: this.kernel,
3414
3424
  })
3415
3425
  /*
@@ -3508,7 +3518,7 @@ class Server {
3508
3518
  portal: this.portal,
3509
3519
  logo: this.logo,
3510
3520
  theme: this.theme,
3511
- agent: this.agent,
3521
+ agent: req.agent,
3512
3522
  items,
3513
3523
  })
3514
3524
  }))
@@ -3582,7 +3592,7 @@ class Server {
3582
3592
  portal: this.portal,
3583
3593
  logo: this.logo,
3584
3594
  theme: this.theme,
3585
- agent: this.agent,
3595
+ agent: req.agent,
3586
3596
  id,
3587
3597
  readme
3588
3598
  })
@@ -3713,7 +3723,7 @@ class Server {
3713
3723
  res.render("keys", {
3714
3724
  filepath: p,
3715
3725
  theme: this.theme,
3716
- agent: this.agent,
3726
+ agent: req.agent,
3717
3727
  items
3718
3728
  })
3719
3729
  }))
@@ -3821,7 +3831,7 @@ class Server {
3821
3831
  portal: this.portal,
3822
3832
  logo: this.logo,
3823
3833
  theme: this.theme,
3824
- agent: this.agent,
3834
+ agent: req.agent,
3825
3835
  items
3826
3836
  // items: [{
3827
3837
  // icon: "fa-solid fa-key",
@@ -3984,7 +3994,7 @@ class Server {
3984
3994
  target,
3985
3995
  filepath: cwd,
3986
3996
  theme: this.theme,
3987
- agent: this.agent,
3997
+ agent: req.agent,
3988
3998
  id,
3989
3999
  cwd,
3990
4000
  message,
@@ -4038,7 +4048,7 @@ class Server {
4038
4048
  portal: this.portal,
4039
4049
  logo: this.logo,
4040
4050
  theme: this.theme,
4041
- agent: this.agent,
4051
+ agent: req.agent,
4042
4052
  })
4043
4053
  }))
4044
4054
  this.app.get("/setup/:mode", ex(async (req, res) => {
@@ -4093,7 +4103,7 @@ class Server {
4093
4103
  requirements_pending,
4094
4104
  logo: this.logo,
4095
4105
  theme: this.theme,
4096
- agent: this.agent,
4106
+ agent: req.agent,
4097
4107
  })
4098
4108
  }))
4099
4109
  this.app.post("/plugin/update_spec", ex(async (req, res) => {
@@ -4204,7 +4214,7 @@ class Server {
4204
4214
  docs: this.docs,
4205
4215
  portal: this.portal,
4206
4216
  install: this.install,
4207
- agent: this.agent,
4217
+ agent: req.agent,
4208
4218
  theme: this.theme,
4209
4219
  processes,
4210
4220
  installed,
@@ -4384,7 +4394,7 @@ class Server {
4384
4394
  // port_mapping: this.kernel.caddy.port_mapping,
4385
4395
  // ip_mapping: this.kernel.caddy.ip_mapping,
4386
4396
  lan: this.kernel.router.local_network_mapping,
4387
- agent: this.agent,
4397
+ agent: req.agent,
4388
4398
  theme: this.theme,
4389
4399
  items: proxies,
4390
4400
  qr,
@@ -4744,7 +4754,7 @@ class Server {
4744
4754
  items,
4745
4755
  theme: this.theme,
4746
4756
  filepath,
4747
- agent: this.agent,
4757
+ agent: req.agent,
4748
4758
  })
4749
4759
  }))
4750
4760
  this.app.get("/env/*", ex(async (req, res) => {
@@ -4801,7 +4811,7 @@ class Server {
4801
4811
  items,
4802
4812
  theme: this.theme,
4803
4813
  filepath,
4804
- agent: this.agent,
4814
+ agent: req.agent,
4805
4815
  path: "/api/" + name + "/pinokio.js",
4806
4816
  _path: "/_api/" + name,
4807
4817
  str: configStr
@@ -4833,7 +4843,7 @@ class Server {
4833
4843
  items,
4834
4844
  theme: this.theme,
4835
4845
  filepath,
4836
- agent: this.agent,
4846
+ agent: req.agent,
4837
4847
  })
4838
4848
  }
4839
4849
  //res.render("env_editor", {
@@ -4867,7 +4877,7 @@ class Server {
4867
4877
  res.render("pre", {
4868
4878
  name: req.params.name,
4869
4879
  theme: this.theme,
4870
- agent: this.agent,
4880
+ agent: req.agent,
4871
4881
  name: req.params.name,
4872
4882
  items: config.pre,
4873
4883
  env
@@ -4947,7 +4957,7 @@ class Server {
4947
4957
  config,
4948
4958
  theme: this.theme,
4949
4959
  filepath,
4950
- agent: this.agent,
4960
+ agent: req.agent,
4951
4961
  })
4952
4962
  }))
4953
4963
  this.app.get("/xterm_config", ex(async (req, res) => {
@@ -4984,7 +4994,7 @@ class Server {
4984
4994
  theme: this.theme,
4985
4995
  filepath,
4986
4996
  content,
4987
- agent: this.agent,
4997
+ agent: req.agent,
4988
4998
  })
4989
4999
  }))
4990
5000
  this.app.get("/script/:name", ex((req, res) => {
@@ -5198,7 +5208,7 @@ class Server {
5198
5208
  dir,
5199
5209
  theme: this.theme,
5200
5210
  platform: this.kernel.platform,
5201
- agent: this.agent,
5211
+ agent: req.agent,
5202
5212
  })
5203
5213
  }))
5204
5214
  this.app.get("/d/*", ex(async (req, res) => {
@@ -5287,7 +5297,7 @@ class Server {
5287
5297
  docs: this.docs,
5288
5298
  portal: this.portal,
5289
5299
  install: this.install,
5290
- agent: this.agent,
5300
+ agent: req.agent,
5291
5301
  theme: this.theme,
5292
5302
  //dynamic: plugin_menu
5293
5303
  dynamic,
@@ -5326,7 +5336,7 @@ class Server {
5326
5336
  dynamic_content: null,
5327
5337
  home: req.originalUrl,
5328
5338
  theme: this.theme,
5329
- agent: this.agent,
5339
+ agent: req.agent,
5330
5340
  }
5331
5341
  res.render("mini", result)
5332
5342
  }))
@@ -5763,7 +5773,7 @@ class Server {
5763
5773
  redirect_uri: "https://app-7pt7.onrender.com/apps/redirect?git=" + gitRemote,
5764
5774
  platform: this.kernel.platform,
5765
5775
  theme: this.theme,
5766
- agent: this.agent,
5776
+ agent: req.agent,
5767
5777
  })
5768
5778
  }))
5769
5779
  this.app.get("/p/:name/dev", ex(async (req, res) => {
@@ -5898,7 +5908,7 @@ class Server {
5898
5908
  res.render("install", {
5899
5909
  logo: this.logo,
5900
5910
  theme: this.theme,
5901
- agent: this.agent,
5911
+ agent: req.agent,
5902
5912
  userdir: this.kernel.api.userdir,
5903
5913
  display: ["form"],
5904
5914
  // query: req.query,
@@ -15,6 +15,8 @@ document.addEventListener("DOMContentLoaded", () => {
15
15
  if (document.querySelector("#new-window")) {
16
16
  document.querySelector("#new-window").addEventListener("click", (e) => {
17
17
  let agent = document.body.getAttribute("data-agent")
18
+ window.open("/", "_blank", "self")
19
+ /*
18
20
  if (agent === "electron") {
19
21
  window.open("/", "_blank", "self")
20
22
  } else {
@@ -30,6 +32,7 @@ document.addEventListener("DOMContentLoaded", () => {
30
32
  console.log(res)
31
33
  })
32
34
  }
35
+ */
33
36
  })
34
37
  }
35
38
  })
@@ -1043,7 +1043,9 @@ header {
1043
1043
  background: white;
1044
1044
  */
1045
1045
  position: sticky;
1046
+ /*
1046
1047
  padding: 10px 10px 0;
1048
+ */
1047
1049
  top: 0;
1048
1050
  box-sizing: border-box;
1049
1051
  z-index: 1000;
@@ -2451,68 +2453,7 @@ body.minimized #dragger {
2451
2453
  body.minimized aside .tab.submenu {
2452
2454
  padding: 10px;
2453
2455
  }
2454
- /*
2455
- body.minimized aside {
2456
- display: none;
2457
- }
2458
- */
2459
2456
 
2460
- /*
2461
- @media only screen and (max-width: 800px) {
2462
- header .dropdown-content {
2463
- position: relative;
2464
- min-width: unset;
2465
- top: unset;
2466
- left: unset;
2467
- }
2468
- header h1 #close-window {
2469
- order: 0;
2470
- }
2471
- header {
2472
- padding: 10px 0 0;
2473
- overflow: auto;
2474
- flex-shrink: 0;
2475
- }
2476
- header .home {
2477
- display: block;
2478
- }
2479
- header h1 .btn2 {
2480
- padding: 10px;
2481
- width: 100%;
2482
- box-sizing: border-box;
2483
- }
2484
- header h1 {
2485
- height: 100%;
2486
- overflow: auto;
2487
- display: block;
2488
- }
2489
- .mode-selector {
2490
- flex-direction: column;
2491
- padding: 0;
2492
- margin: 0;
2493
- border-radius: 0;
2494
- align-items: stretch;
2495
- gap: 0;
2496
- }
2497
- .mode-selector .btn2 {
2498
- width: unset;
2499
- padding: 10px;
2500
- border-radius: 0 !important;
2501
- }
2502
- .mode-selector .caption {
2503
- display: none;
2504
- }
2505
- main {
2506
- padding-top: 10px;
2507
- }
2508
- .appcanvas {
2509
- padding-top: 20px;
2510
- }
2511
- main .container {
2512
- margin-left: 0;
2513
- }
2514
- .app-icon {
2515
- display: block;
2516
- }
2457
+ body[data-agent='electron'] {
2458
+ padding-top: 16px;
2517
2459
  }
2518
- */
@@ -137,7 +137,7 @@ body {
137
137
  <div id='dragger'></div>
138
138
  <header class='grabbable'>
139
139
  <h1>
140
- <a class='path' href="/"><%-logo%></a>
140
+ <a class='home' href="/"><%-logo%></a>
141
141
  <button class='btn2' id='screenshot' data-tippy-content="take a screenshot"><i class="fa-solid fa-camera"></i></button>
142
142
  <div class='flexible'></div>
143
143
  <a class='btn2' href="/columns" data-tippy-content="split into 2 columns">