pinokiod 3.56.0 → 3.58.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.56.0",
3
+ "version": "3.58.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
@@ -1574,6 +1574,7 @@ class Server {
1574
1574
  // let list = this.getPeerInfo()
1575
1575
  let list = this.getPeers()
1576
1576
 
1577
+ console.log("agent", req.agent)
1577
1578
  if (meta) {
1578
1579
  items = running.concat(notRunning)
1579
1580
  res.render("index", {
@@ -1596,7 +1597,7 @@ class Server {
1596
1597
  pinokioPath,
1597
1598
  config,
1598
1599
  display,
1599
- agent: this.agent,
1600
+ agent: req.agent,
1600
1601
  // folder,
1601
1602
  paths,
1602
1603
  uri,
@@ -1629,7 +1630,7 @@ class Server {
1629
1630
  pinokioPath,
1630
1631
  config,
1631
1632
  display,
1632
- agent: this.agent,
1633
+ agent: req.agent,
1633
1634
  // folder,
1634
1635
  paths,
1635
1636
  uri,
@@ -2068,7 +2069,7 @@ class Server {
2068
2069
 
2069
2070
 
2070
2071
  if (config.menu[i].href && config.menu[i].href.startsWith("http")) {
2071
- if (this.agent !== "electron") {
2072
+ if (req.agent !== "electron") {
2072
2073
  config.menu[i].target = "_blank"
2073
2074
  }
2074
2075
  }
@@ -2300,11 +2301,11 @@ class Server {
2300
2301
 
2301
2302
  // when loaded in electron but in minimal mode,
2302
2303
  // 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
- }
2304
+ // if (this.agent === "electron") {
2305
+ // if (this.mode === "minimal" || this.mode === "background") {
2306
+ // this.agent = "web"
2307
+ // }
2308
+ // }
2308
2309
 
2309
2310
  if (this.theme === "dark") {
2310
2311
  this.colors = {
@@ -2945,17 +2946,12 @@ class Server {
2945
2946
 
2946
2947
  this.app.use((req, res, next) => {
2947
2948
  const userAgent = req.get('User-Agent') || '';
2948
- const clientType = req.get('X-Client-Type');
2949
- const customUA = userAgent.includes('MyApp-Electron');
2950
- req.clientInfo = {
2951
- userAgent,
2952
- clientType,
2953
- isElectron: clientType === 'electron' || customUA,
2954
- isBrowser: !clientType === 'electron' && !customUA,
2955
- userAgent: userAgent,
2956
- clientType: clientType || 'unknown'
2957
- };
2958
- console.log("clientInfo", req.clientInfo)
2949
+ if (userAgent.includes("Pinokio")) {
2950
+ req.agent = "electron"
2951
+ } else {
2952
+ req.agent = "web"
2953
+ }
2954
+ console.log("req.agent", req.agent)
2959
2955
  next();
2960
2956
  })
2961
2957
 
@@ -3085,7 +3081,7 @@ class Server {
3085
3081
  portal: this.portal,
3086
3082
  logo: this.logo,
3087
3083
  theme: this.theme,
3088
- agent: this.agent,
3084
+ agent: req.agent,
3089
3085
  list,
3090
3086
  })
3091
3087
  }))
@@ -3097,21 +3093,21 @@ class Server {
3097
3093
  portal: this.portal,
3098
3094
  logo: this.logo,
3099
3095
  theme: this.theme,
3100
- agent: this.agent,
3096
+ agent: req.agent,
3101
3097
  list,
3102
3098
  })
3103
3099
  }))
3104
3100
  this.app.get("/columns", ex(async (req, res) => {
3105
3101
  res.render("columns", {
3106
3102
  theme: this.theme,
3107
- agent: this.agent,
3103
+ agent: req.agent,
3108
3104
  src: req.get('Referrer')
3109
3105
  })
3110
3106
  }))
3111
3107
  this.app.get("/rows", ex(async (req, res) => {
3112
3108
  res.render("rows", {
3113
3109
  theme: this.theme,
3114
- agent: this.agent,
3110
+ agent: req.agent,
3115
3111
  src: req.get('Referrer')
3116
3112
  })
3117
3113
  }))
@@ -3120,7 +3116,7 @@ class Server {
3120
3116
  this.app.get("/container", ex(async (req, res) => {
3121
3117
  res.render("container", {
3122
3118
  theme: this.theme,
3123
- agent: this.agent,
3119
+ agent: req.agent,
3124
3120
  src: req.query.url
3125
3121
  })
3126
3122
  }))
@@ -3223,7 +3219,7 @@ class Server {
3223
3219
  autolaunch,
3224
3220
  logo: this.logo,
3225
3221
  theme: this.theme,
3226
- agent: this.agent,
3222
+ agent: req.agent,
3227
3223
  name: meta.title,
3228
3224
  image: meta.icon,
3229
3225
  link: `/p/${name}?autolaunch=${autolaunch ? "1" : "0"}`,
@@ -3237,7 +3233,7 @@ class Server {
3237
3233
  autolaunch,
3238
3234
  logo: this.logo,
3239
3235
  theme: this.theme,
3240
- agent: this.agent,
3236
+ agent: req.agent,
3241
3237
  name: "Does not exist",
3242
3238
  image: "/pinokio-black.png",
3243
3239
  link: null
@@ -3276,7 +3272,7 @@ class Server {
3276
3272
  version: this.version,
3277
3273
  logo: this.logo,
3278
3274
  theme: this.theme,
3279
- agent: this.agent,
3275
+ agent: req.agent,
3280
3276
  ...folders
3281
3277
  })
3282
3278
  return
@@ -3351,7 +3347,7 @@ class Server {
3351
3347
  portal: this.portal,
3352
3348
  logo: this.logo,
3353
3349
  theme: this.theme,
3354
- agent: this.agent,
3350
+ agent: req.agent,
3355
3351
  paths: [],
3356
3352
  config: configArray,
3357
3353
  query: req.query,
@@ -3425,7 +3421,7 @@ class Server {
3425
3421
  logo: this.logo,
3426
3422
  platform: this.kernel.platform,
3427
3423
  theme: this.theme,
3428
- agent: this.agent,
3424
+ agent: req.agent,
3429
3425
  kernel: this.kernel,
3430
3426
  })
3431
3427
  /*
@@ -3524,7 +3520,7 @@ class Server {
3524
3520
  portal: this.portal,
3525
3521
  logo: this.logo,
3526
3522
  theme: this.theme,
3527
- agent: this.agent,
3523
+ agent: req.agent,
3528
3524
  items,
3529
3525
  })
3530
3526
  }))
@@ -3598,7 +3594,7 @@ class Server {
3598
3594
  portal: this.portal,
3599
3595
  logo: this.logo,
3600
3596
  theme: this.theme,
3601
- agent: this.agent,
3597
+ agent: req.agent,
3602
3598
  id,
3603
3599
  readme
3604
3600
  })
@@ -3729,7 +3725,7 @@ class Server {
3729
3725
  res.render("keys", {
3730
3726
  filepath: p,
3731
3727
  theme: this.theme,
3732
- agent: this.agent,
3728
+ agent: req.agent,
3733
3729
  items
3734
3730
  })
3735
3731
  }))
@@ -3837,7 +3833,7 @@ class Server {
3837
3833
  portal: this.portal,
3838
3834
  logo: this.logo,
3839
3835
  theme: this.theme,
3840
- agent: this.agent,
3836
+ agent: req.agent,
3841
3837
  items
3842
3838
  // items: [{
3843
3839
  // icon: "fa-solid fa-key",
@@ -4000,7 +3996,7 @@ class Server {
4000
3996
  target,
4001
3997
  filepath: cwd,
4002
3998
  theme: this.theme,
4003
- agent: this.agent,
3999
+ agent: req.agent,
4004
4000
  id,
4005
4001
  cwd,
4006
4002
  message,
@@ -4054,7 +4050,7 @@ class Server {
4054
4050
  portal: this.portal,
4055
4051
  logo: this.logo,
4056
4052
  theme: this.theme,
4057
- agent: this.agent,
4053
+ agent: req.agent,
4058
4054
  })
4059
4055
  }))
4060
4056
  this.app.get("/setup/:mode", ex(async (req, res) => {
@@ -4109,7 +4105,7 @@ class Server {
4109
4105
  requirements_pending,
4110
4106
  logo: this.logo,
4111
4107
  theme: this.theme,
4112
- agent: this.agent,
4108
+ agent: req.agent,
4113
4109
  })
4114
4110
  }))
4115
4111
  this.app.post("/plugin/update_spec", ex(async (req, res) => {
@@ -4220,7 +4216,7 @@ class Server {
4220
4216
  docs: this.docs,
4221
4217
  portal: this.portal,
4222
4218
  install: this.install,
4223
- agent: this.agent,
4219
+ agent: req.agent,
4224
4220
  theme: this.theme,
4225
4221
  processes,
4226
4222
  installed,
@@ -4400,7 +4396,7 @@ class Server {
4400
4396
  // port_mapping: this.kernel.caddy.port_mapping,
4401
4397
  // ip_mapping: this.kernel.caddy.ip_mapping,
4402
4398
  lan: this.kernel.router.local_network_mapping,
4403
- agent: this.agent,
4399
+ agent: req.agent,
4404
4400
  theme: this.theme,
4405
4401
  items: proxies,
4406
4402
  qr,
@@ -4760,7 +4756,7 @@ class Server {
4760
4756
  items,
4761
4757
  theme: this.theme,
4762
4758
  filepath,
4763
- agent: this.agent,
4759
+ agent: req.agent,
4764
4760
  })
4765
4761
  }))
4766
4762
  this.app.get("/env/*", ex(async (req, res) => {
@@ -4817,7 +4813,7 @@ class Server {
4817
4813
  items,
4818
4814
  theme: this.theme,
4819
4815
  filepath,
4820
- agent: this.agent,
4816
+ agent: req.agent,
4821
4817
  path: "/api/" + name + "/pinokio.js",
4822
4818
  _path: "/_api/" + name,
4823
4819
  str: configStr
@@ -4849,7 +4845,7 @@ class Server {
4849
4845
  items,
4850
4846
  theme: this.theme,
4851
4847
  filepath,
4852
- agent: this.agent,
4848
+ agent: req.agent,
4853
4849
  })
4854
4850
  }
4855
4851
  //res.render("env_editor", {
@@ -4883,7 +4879,7 @@ class Server {
4883
4879
  res.render("pre", {
4884
4880
  name: req.params.name,
4885
4881
  theme: this.theme,
4886
- agent: this.agent,
4882
+ agent: req.agent,
4887
4883
  name: req.params.name,
4888
4884
  items: config.pre,
4889
4885
  env
@@ -4963,7 +4959,7 @@ class Server {
4963
4959
  config,
4964
4960
  theme: this.theme,
4965
4961
  filepath,
4966
- agent: this.agent,
4962
+ agent: req.agent,
4967
4963
  })
4968
4964
  }))
4969
4965
  this.app.get("/xterm_config", ex(async (req, res) => {
@@ -5000,7 +4996,7 @@ class Server {
5000
4996
  theme: this.theme,
5001
4997
  filepath,
5002
4998
  content,
5003
- agent: this.agent,
4999
+ agent: req.agent,
5004
5000
  })
5005
5001
  }))
5006
5002
  this.app.get("/script/:name", ex((req, res) => {
@@ -5214,7 +5210,7 @@ class Server {
5214
5210
  dir,
5215
5211
  theme: this.theme,
5216
5212
  platform: this.kernel.platform,
5217
- agent: this.agent,
5213
+ agent: req.agent,
5218
5214
  })
5219
5215
  }))
5220
5216
  this.app.get("/d/*", ex(async (req, res) => {
@@ -5303,7 +5299,7 @@ class Server {
5303
5299
  docs: this.docs,
5304
5300
  portal: this.portal,
5305
5301
  install: this.install,
5306
- agent: this.agent,
5302
+ agent: req.agent,
5307
5303
  theme: this.theme,
5308
5304
  //dynamic: plugin_menu
5309
5305
  dynamic,
@@ -5342,7 +5338,7 @@ class Server {
5342
5338
  dynamic_content: null,
5343
5339
  home: req.originalUrl,
5344
5340
  theme: this.theme,
5345
- agent: this.agent,
5341
+ agent: req.agent,
5346
5342
  }
5347
5343
  res.render("mini", result)
5348
5344
  }))
@@ -5779,7 +5775,7 @@ class Server {
5779
5775
  redirect_uri: "https://app-7pt7.onrender.com/apps/redirect?git=" + gitRemote,
5780
5776
  platform: this.kernel.platform,
5781
5777
  theme: this.theme,
5782
- agent: this.agent,
5778
+ agent: req.agent,
5783
5779
  })
5784
5780
  }))
5785
5781
  this.app.get("/p/:name/dev", ex(async (req, res) => {
@@ -5914,7 +5910,7 @@ class Server {
5914
5910
  res.render("install", {
5915
5911
  logo: this.logo,
5916
5912
  theme: this.theme,
5917
- agent: this.agent,
5913
+ agent: req.agent,
5918
5914
  userdir: this.kernel.api.userdir,
5919
5915
  display: ["form"],
5920
5916
  // 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
  })
@@ -2393,9 +2393,6 @@ body.minimized header .home {
2393
2393
  top: 0;
2394
2394
  }
2395
2395
  body.minimized header {
2396
- /*
2397
- padding: 26px 0 0 !important;
2398
- */
2399
2396
  overflow: auto;
2400
2397
  flex-shrink: 0;
2401
2398
  position: fixed;
@@ -2453,68 +2450,7 @@ body.minimized #dragger {
2453
2450
  body.minimized aside .tab.submenu {
2454
2451
  padding: 10px;
2455
2452
  }
2456
- /*
2457
- body.minimized aside {
2458
- display: none;
2459
- }
2460
- */
2461
2453
 
2462
- /*
2463
- @media only screen and (max-width: 800px) {
2464
- header .dropdown-content {
2465
- position: relative;
2466
- min-width: unset;
2467
- top: unset;
2468
- left: unset;
2469
- }
2470
- header h1 #close-window {
2471
- order: 0;
2472
- }
2473
- header {
2474
- padding: 10px 0 0;
2475
- overflow: auto;
2476
- flex-shrink: 0;
2477
- }
2478
- header .home {
2479
- display: block;
2480
- }
2481
- header h1 .btn2 {
2482
- padding: 10px;
2483
- width: 100%;
2484
- box-sizing: border-box;
2485
- }
2486
- header h1 {
2487
- height: 100%;
2488
- overflow: auto;
2489
- display: block;
2490
- }
2491
- .mode-selector {
2492
- flex-direction: column;
2493
- padding: 0;
2494
- margin: 0;
2495
- border-radius: 0;
2496
- align-items: stretch;
2497
- gap: 0;
2498
- }
2499
- .mode-selector .btn2 {
2500
- width: unset;
2501
- padding: 10px;
2502
- border-radius: 0 !important;
2503
- }
2504
- .mode-selector .caption {
2505
- display: none;
2506
- }
2507
- main {
2508
- padding-top: 10px;
2509
- }
2510
- .appcanvas {
2511
- padding-top: 20px;
2512
- }
2513
- main .container {
2514
- margin-left: 0;
2515
- }
2516
- .app-icon {
2517
- display: block;
2518
- }
2454
+ body[data-agent='electron'] {
2455
+ padding-top: 16px;
2519
2456
  }
2520
- */