pinokiod 1.3.11 → 1.3.13
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/kernel/api/index.js +0 -1
- package/kernel/bin/conda.js +1 -1
- package/kernel/shell.js +1 -4
- package/package.json +1 -1
- package/server/views/settings.ejs +25 -23
package/kernel/api/index.js
CHANGED
package/kernel/bin/conda.js
CHANGED
|
@@ -73,7 +73,7 @@ class Conda {
|
|
|
73
73
|
message: [
|
|
74
74
|
// (this.kernel.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
75
75
|
// (this.platform === 'win32' ? `activate base` : `conda activate base`),
|
|
76
|
-
|
|
76
|
+
`conda config --file ${this.kernel.bin.path('miniconda', 'condarc')} --add create_default_packages python=3.10`,
|
|
77
77
|
//"conda update -y conda",
|
|
78
78
|
"conda update -y --all",
|
|
79
79
|
// handling the conda-libmamba-solver bug here: https://github.com/conda/conda-libmamba-solver/issues/283
|
package/kernel/shell.js
CHANGED
|
@@ -125,6 +125,7 @@ class Shell {
|
|
|
125
125
|
this.env.XDG_STATE_HOME = path.resolve(this.kernel.homedir, "cache", "XDG_STATE_HOME")
|
|
126
126
|
this.env.GRADIO_TEMP_DIR = path.resolve(this.kernel.homedir, "cache", "GRADIO_TEMP_DIR")
|
|
127
127
|
this.env.PIP_CONFIG_FILE = path.resolve(this.kernel.homedir, "pipconfig")
|
|
128
|
+
this.env.CONDARC = path.resolve(this.kernel.homedir, "bin", "miniconda", "condarc")
|
|
128
129
|
|
|
129
130
|
this.env.PS1 = "<<PINOKIO SHELL>> "
|
|
130
131
|
// this.env.PROMPT_COMMAND = "export PS1=\"<<PINOKIO SHELL>> \""
|
|
@@ -147,8 +148,6 @@ class Shell {
|
|
|
147
148
|
}
|
|
148
149
|
// custom env was passed in
|
|
149
150
|
|
|
150
|
-
console.log("params", params)
|
|
151
|
-
|
|
152
151
|
// override cache folders if cache is specified
|
|
153
152
|
if (params.cache) {
|
|
154
153
|
// cache data files
|
|
@@ -168,7 +167,6 @@ class Shell {
|
|
|
168
167
|
]
|
|
169
168
|
for(let type of types) {
|
|
170
169
|
let p = path.resolve(cache_path, type)
|
|
171
|
-
console.log("setting", p)
|
|
172
170
|
this.env[type] = p
|
|
173
171
|
await fs.promises.mkdir(p, { recursive: true }).catch((e) => { })
|
|
174
172
|
}
|
|
@@ -232,7 +230,6 @@ class Shell {
|
|
|
232
230
|
// automatically add self to the shells registry
|
|
233
231
|
this.kernel.shell.add(this)
|
|
234
232
|
|
|
235
|
-
console.log("params", params)
|
|
236
233
|
if (params.sudo) {
|
|
237
234
|
let options = {
|
|
238
235
|
name: "Pinokio",
|
package/package.json
CHANGED
|
@@ -395,30 +395,32 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
395
395
|
})
|
|
396
396
|
<% } %>
|
|
397
397
|
<% if (agent === "electron") { %>
|
|
398
|
-
document.querySelector("#del-browser-cache")
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
398
|
+
if (document.querySelector("#del-browser-cache")) {
|
|
399
|
+
document.querySelector("#del-browser-cache").addEventListener("click", async (e) => {
|
|
400
|
+
console.log("del-browser-cache")
|
|
401
|
+
let proceed = confirm("Are you sure you wish to delete the browser cache? This will remove all cookies and site data")
|
|
402
|
+
if (proceed) {
|
|
403
|
+
document.querySelector(".reset-browser-cache-loading").classList.remove("hidden")
|
|
404
|
+
document.querySelector("#del-browser-cache").classList.add("hidden")
|
|
405
|
+
let res = await fetch("/pinokio/delete", {
|
|
406
|
+
method: "post",
|
|
407
|
+
headers: {
|
|
408
|
+
"Content-Type": "application/json"
|
|
409
|
+
},
|
|
410
|
+
body: JSON.stringify({ type: "browser-cache" })
|
|
411
|
+
}).then((res) => {
|
|
412
|
+
return res.json()
|
|
413
|
+
})
|
|
414
|
+
console.log(res)
|
|
415
|
+
document.querySelector(".reset-browser-cache-loading").classList.add("hidden")
|
|
416
|
+
if (res.error) {
|
|
417
|
+
alert(res.error)
|
|
418
|
+
} else {
|
|
419
|
+
location.href = location.href
|
|
420
|
+
}
|
|
419
421
|
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
+
})
|
|
423
|
+
}
|
|
422
424
|
<% } %>
|
|
423
425
|
document.querySelector("form").addEventListener("submit", async (e) => {
|
|
424
426
|
e.preventDefault()
|