pinokiod 3.56.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 +1 -1
- package/server/index.js +50 -56
- package/server/public/nav.js +3 -0
- package/server/public/style.css +2 -63
package/package.json
CHANGED
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 (
|
|
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 = {
|
|
@@ -2945,17 +2945,11 @@ class Server {
|
|
|
2945
2945
|
|
|
2946
2946
|
this.app.use((req, res, next) => {
|
|
2947
2947
|
const userAgent = req.get('User-Agent') || '';
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
isElectron: clientType === 'electron' || customUA,
|
|
2954
|
-
isBrowser: !clientType === 'electron' && !customUA,
|
|
2955
|
-
userAgent: userAgent,
|
|
2956
|
-
clientType: clientType || 'unknown'
|
|
2957
|
-
};
|
|
2958
|
-
console.log("clientInfo", req.clientInfo)
|
|
2948
|
+
if (userAgent.includes("Pinokio")) {
|
|
2949
|
+
req.agent = "electron"
|
|
2950
|
+
} else {
|
|
2951
|
+
req.agent = "browser"
|
|
2952
|
+
}
|
|
2959
2953
|
next();
|
|
2960
2954
|
})
|
|
2961
2955
|
|
|
@@ -3085,7 +3079,7 @@ class Server {
|
|
|
3085
3079
|
portal: this.portal,
|
|
3086
3080
|
logo: this.logo,
|
|
3087
3081
|
theme: this.theme,
|
|
3088
|
-
agent:
|
|
3082
|
+
agent: req.agent,
|
|
3089
3083
|
list,
|
|
3090
3084
|
})
|
|
3091
3085
|
}))
|
|
@@ -3097,21 +3091,21 @@ class Server {
|
|
|
3097
3091
|
portal: this.portal,
|
|
3098
3092
|
logo: this.logo,
|
|
3099
3093
|
theme: this.theme,
|
|
3100
|
-
agent:
|
|
3094
|
+
agent: req.agent,
|
|
3101
3095
|
list,
|
|
3102
3096
|
})
|
|
3103
3097
|
}))
|
|
3104
3098
|
this.app.get("/columns", ex(async (req, res) => {
|
|
3105
3099
|
res.render("columns", {
|
|
3106
3100
|
theme: this.theme,
|
|
3107
|
-
agent:
|
|
3101
|
+
agent: req.agent,
|
|
3108
3102
|
src: req.get('Referrer')
|
|
3109
3103
|
})
|
|
3110
3104
|
}))
|
|
3111
3105
|
this.app.get("/rows", ex(async (req, res) => {
|
|
3112
3106
|
res.render("rows", {
|
|
3113
3107
|
theme: this.theme,
|
|
3114
|
-
agent:
|
|
3108
|
+
agent: req.agent,
|
|
3115
3109
|
src: req.get('Referrer')
|
|
3116
3110
|
})
|
|
3117
3111
|
}))
|
|
@@ -3120,7 +3114,7 @@ class Server {
|
|
|
3120
3114
|
this.app.get("/container", ex(async (req, res) => {
|
|
3121
3115
|
res.render("container", {
|
|
3122
3116
|
theme: this.theme,
|
|
3123
|
-
agent:
|
|
3117
|
+
agent: req.agent,
|
|
3124
3118
|
src: req.query.url
|
|
3125
3119
|
})
|
|
3126
3120
|
}))
|
|
@@ -3223,7 +3217,7 @@ class Server {
|
|
|
3223
3217
|
autolaunch,
|
|
3224
3218
|
logo: this.logo,
|
|
3225
3219
|
theme: this.theme,
|
|
3226
|
-
agent:
|
|
3220
|
+
agent: req.agent,
|
|
3227
3221
|
name: meta.title,
|
|
3228
3222
|
image: meta.icon,
|
|
3229
3223
|
link: `/p/${name}?autolaunch=${autolaunch ? "1" : "0"}`,
|
|
@@ -3237,7 +3231,7 @@ class Server {
|
|
|
3237
3231
|
autolaunch,
|
|
3238
3232
|
logo: this.logo,
|
|
3239
3233
|
theme: this.theme,
|
|
3240
|
-
agent:
|
|
3234
|
+
agent: req.agent,
|
|
3241
3235
|
name: "Does not exist",
|
|
3242
3236
|
image: "/pinokio-black.png",
|
|
3243
3237
|
link: null
|
|
@@ -3276,7 +3270,7 @@ class Server {
|
|
|
3276
3270
|
version: this.version,
|
|
3277
3271
|
logo: this.logo,
|
|
3278
3272
|
theme: this.theme,
|
|
3279
|
-
agent:
|
|
3273
|
+
agent: req.agent,
|
|
3280
3274
|
...folders
|
|
3281
3275
|
})
|
|
3282
3276
|
return
|
|
@@ -3351,7 +3345,7 @@ class Server {
|
|
|
3351
3345
|
portal: this.portal,
|
|
3352
3346
|
logo: this.logo,
|
|
3353
3347
|
theme: this.theme,
|
|
3354
|
-
agent:
|
|
3348
|
+
agent: req.agent,
|
|
3355
3349
|
paths: [],
|
|
3356
3350
|
config: configArray,
|
|
3357
3351
|
query: req.query,
|
|
@@ -3425,7 +3419,7 @@ class Server {
|
|
|
3425
3419
|
logo: this.logo,
|
|
3426
3420
|
platform: this.kernel.platform,
|
|
3427
3421
|
theme: this.theme,
|
|
3428
|
-
agent:
|
|
3422
|
+
agent: req.agent,
|
|
3429
3423
|
kernel: this.kernel,
|
|
3430
3424
|
})
|
|
3431
3425
|
/*
|
|
@@ -3524,7 +3518,7 @@ class Server {
|
|
|
3524
3518
|
portal: this.portal,
|
|
3525
3519
|
logo: this.logo,
|
|
3526
3520
|
theme: this.theme,
|
|
3527
|
-
agent:
|
|
3521
|
+
agent: req.agent,
|
|
3528
3522
|
items,
|
|
3529
3523
|
})
|
|
3530
3524
|
}))
|
|
@@ -3598,7 +3592,7 @@ class Server {
|
|
|
3598
3592
|
portal: this.portal,
|
|
3599
3593
|
logo: this.logo,
|
|
3600
3594
|
theme: this.theme,
|
|
3601
|
-
agent:
|
|
3595
|
+
agent: req.agent,
|
|
3602
3596
|
id,
|
|
3603
3597
|
readme
|
|
3604
3598
|
})
|
|
@@ -3729,7 +3723,7 @@ class Server {
|
|
|
3729
3723
|
res.render("keys", {
|
|
3730
3724
|
filepath: p,
|
|
3731
3725
|
theme: this.theme,
|
|
3732
|
-
agent:
|
|
3726
|
+
agent: req.agent,
|
|
3733
3727
|
items
|
|
3734
3728
|
})
|
|
3735
3729
|
}))
|
|
@@ -3837,7 +3831,7 @@ class Server {
|
|
|
3837
3831
|
portal: this.portal,
|
|
3838
3832
|
logo: this.logo,
|
|
3839
3833
|
theme: this.theme,
|
|
3840
|
-
agent:
|
|
3834
|
+
agent: req.agent,
|
|
3841
3835
|
items
|
|
3842
3836
|
// items: [{
|
|
3843
3837
|
// icon: "fa-solid fa-key",
|
|
@@ -4000,7 +3994,7 @@ class Server {
|
|
|
4000
3994
|
target,
|
|
4001
3995
|
filepath: cwd,
|
|
4002
3996
|
theme: this.theme,
|
|
4003
|
-
agent:
|
|
3997
|
+
agent: req.agent,
|
|
4004
3998
|
id,
|
|
4005
3999
|
cwd,
|
|
4006
4000
|
message,
|
|
@@ -4054,7 +4048,7 @@ class Server {
|
|
|
4054
4048
|
portal: this.portal,
|
|
4055
4049
|
logo: this.logo,
|
|
4056
4050
|
theme: this.theme,
|
|
4057
|
-
agent:
|
|
4051
|
+
agent: req.agent,
|
|
4058
4052
|
})
|
|
4059
4053
|
}))
|
|
4060
4054
|
this.app.get("/setup/:mode", ex(async (req, res) => {
|
|
@@ -4109,7 +4103,7 @@ class Server {
|
|
|
4109
4103
|
requirements_pending,
|
|
4110
4104
|
logo: this.logo,
|
|
4111
4105
|
theme: this.theme,
|
|
4112
|
-
agent:
|
|
4106
|
+
agent: req.agent,
|
|
4113
4107
|
})
|
|
4114
4108
|
}))
|
|
4115
4109
|
this.app.post("/plugin/update_spec", ex(async (req, res) => {
|
|
@@ -4220,7 +4214,7 @@ class Server {
|
|
|
4220
4214
|
docs: this.docs,
|
|
4221
4215
|
portal: this.portal,
|
|
4222
4216
|
install: this.install,
|
|
4223
|
-
agent:
|
|
4217
|
+
agent: req.agent,
|
|
4224
4218
|
theme: this.theme,
|
|
4225
4219
|
processes,
|
|
4226
4220
|
installed,
|
|
@@ -4400,7 +4394,7 @@ class Server {
|
|
|
4400
4394
|
// port_mapping: this.kernel.caddy.port_mapping,
|
|
4401
4395
|
// ip_mapping: this.kernel.caddy.ip_mapping,
|
|
4402
4396
|
lan: this.kernel.router.local_network_mapping,
|
|
4403
|
-
agent:
|
|
4397
|
+
agent: req.agent,
|
|
4404
4398
|
theme: this.theme,
|
|
4405
4399
|
items: proxies,
|
|
4406
4400
|
qr,
|
|
@@ -4760,7 +4754,7 @@ class Server {
|
|
|
4760
4754
|
items,
|
|
4761
4755
|
theme: this.theme,
|
|
4762
4756
|
filepath,
|
|
4763
|
-
agent:
|
|
4757
|
+
agent: req.agent,
|
|
4764
4758
|
})
|
|
4765
4759
|
}))
|
|
4766
4760
|
this.app.get("/env/*", ex(async (req, res) => {
|
|
@@ -4817,7 +4811,7 @@ class Server {
|
|
|
4817
4811
|
items,
|
|
4818
4812
|
theme: this.theme,
|
|
4819
4813
|
filepath,
|
|
4820
|
-
agent:
|
|
4814
|
+
agent: req.agent,
|
|
4821
4815
|
path: "/api/" + name + "/pinokio.js",
|
|
4822
4816
|
_path: "/_api/" + name,
|
|
4823
4817
|
str: configStr
|
|
@@ -4849,7 +4843,7 @@ class Server {
|
|
|
4849
4843
|
items,
|
|
4850
4844
|
theme: this.theme,
|
|
4851
4845
|
filepath,
|
|
4852
|
-
agent:
|
|
4846
|
+
agent: req.agent,
|
|
4853
4847
|
})
|
|
4854
4848
|
}
|
|
4855
4849
|
//res.render("env_editor", {
|
|
@@ -4883,7 +4877,7 @@ class Server {
|
|
|
4883
4877
|
res.render("pre", {
|
|
4884
4878
|
name: req.params.name,
|
|
4885
4879
|
theme: this.theme,
|
|
4886
|
-
agent:
|
|
4880
|
+
agent: req.agent,
|
|
4887
4881
|
name: req.params.name,
|
|
4888
4882
|
items: config.pre,
|
|
4889
4883
|
env
|
|
@@ -4963,7 +4957,7 @@ class Server {
|
|
|
4963
4957
|
config,
|
|
4964
4958
|
theme: this.theme,
|
|
4965
4959
|
filepath,
|
|
4966
|
-
agent:
|
|
4960
|
+
agent: req.agent,
|
|
4967
4961
|
})
|
|
4968
4962
|
}))
|
|
4969
4963
|
this.app.get("/xterm_config", ex(async (req, res) => {
|
|
@@ -5000,7 +4994,7 @@ class Server {
|
|
|
5000
4994
|
theme: this.theme,
|
|
5001
4995
|
filepath,
|
|
5002
4996
|
content,
|
|
5003
|
-
agent:
|
|
4997
|
+
agent: req.agent,
|
|
5004
4998
|
})
|
|
5005
4999
|
}))
|
|
5006
5000
|
this.app.get("/script/:name", ex((req, res) => {
|
|
@@ -5214,7 +5208,7 @@ class Server {
|
|
|
5214
5208
|
dir,
|
|
5215
5209
|
theme: this.theme,
|
|
5216
5210
|
platform: this.kernel.platform,
|
|
5217
|
-
agent:
|
|
5211
|
+
agent: req.agent,
|
|
5218
5212
|
})
|
|
5219
5213
|
}))
|
|
5220
5214
|
this.app.get("/d/*", ex(async (req, res) => {
|
|
@@ -5303,7 +5297,7 @@ class Server {
|
|
|
5303
5297
|
docs: this.docs,
|
|
5304
5298
|
portal: this.portal,
|
|
5305
5299
|
install: this.install,
|
|
5306
|
-
agent:
|
|
5300
|
+
agent: req.agent,
|
|
5307
5301
|
theme: this.theme,
|
|
5308
5302
|
//dynamic: plugin_menu
|
|
5309
5303
|
dynamic,
|
|
@@ -5342,7 +5336,7 @@ class Server {
|
|
|
5342
5336
|
dynamic_content: null,
|
|
5343
5337
|
home: req.originalUrl,
|
|
5344
5338
|
theme: this.theme,
|
|
5345
|
-
agent:
|
|
5339
|
+
agent: req.agent,
|
|
5346
5340
|
}
|
|
5347
5341
|
res.render("mini", result)
|
|
5348
5342
|
}))
|
|
@@ -5779,7 +5773,7 @@ class Server {
|
|
|
5779
5773
|
redirect_uri: "https://app-7pt7.onrender.com/apps/redirect?git=" + gitRemote,
|
|
5780
5774
|
platform: this.kernel.platform,
|
|
5781
5775
|
theme: this.theme,
|
|
5782
|
-
agent:
|
|
5776
|
+
agent: req.agent,
|
|
5783
5777
|
})
|
|
5784
5778
|
}))
|
|
5785
5779
|
this.app.get("/p/:name/dev", ex(async (req, res) => {
|
|
@@ -5914,7 +5908,7 @@ class Server {
|
|
|
5914
5908
|
res.render("install", {
|
|
5915
5909
|
logo: this.logo,
|
|
5916
5910
|
theme: this.theme,
|
|
5917
|
-
agent:
|
|
5911
|
+
agent: req.agent,
|
|
5918
5912
|
userdir: this.kernel.api.userdir,
|
|
5919
5913
|
display: ["form"],
|
|
5920
5914
|
// query: req.query,
|
package/server/public/nav.js
CHANGED
|
@@ -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
|
})
|
package/server/public/style.css
CHANGED
|
@@ -2453,68 +2453,7 @@ body.minimized #dragger {
|
|
|
2453
2453
|
body.minimized aside .tab.submenu {
|
|
2454
2454
|
padding: 10px;
|
|
2455
2455
|
}
|
|
2456
|
-
/*
|
|
2457
|
-
body.minimized aside {
|
|
2458
|
-
display: none;
|
|
2459
|
-
}
|
|
2460
|
-
*/
|
|
2461
2456
|
|
|
2462
|
-
|
|
2463
|
-
|
|
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
|
-
}
|
|
2457
|
+
body[data-agent='electron'] {
|
|
2458
|
+
padding-top: 16px;
|
|
2519
2459
|
}
|
|
2520
|
-
*/
|