pinokiod 1.1.7 → 1.1.9

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.
@@ -74,8 +74,8 @@ class Conda {
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 --add create_default_packages python=3.10",
77
+ "conda install -y pip brotli brotlipy",
77
78
  "conda update -y --all",
78
- "conda install -y pip",
79
79
  ]
80
80
  }, (stream) => {
81
81
  ondata(stream)
package/kernel/index.js CHANGED
@@ -29,6 +29,7 @@ class Kernel {
29
29
  this.fetch = fetch
30
30
  this.store = store
31
31
  this.arch = os.arch()
32
+ this.os = os
32
33
  this.platform = os.platform()
33
34
  this.key = new Key()
34
35
  }
@@ -1,17 +1,16 @@
1
- const os = require("os")
2
1
  const system = require('systeminformation');
3
2
  const path = require("path")
4
- const si = require('systeminformation')
5
3
  const fs = require("fs")
6
4
  const _ = require("lodash")
7
5
  class Template {
8
6
  constructor(kernel) {
9
7
  this.kernel = kernel
10
- this.platform = os.platform()
11
- this.arch = os.arch()
8
+ this.platform = kernel.platform
9
+ this.arch = kernel.arch
10
+ this.os = kernel.os
12
11
  }
13
12
  async init() {
14
- let g = await si.graphics()
13
+ let g = await system.graphics()
15
14
  let gpus
16
15
  if (g && g.controllers && g.controllers.length > 0) {
17
16
  gpus = g.controllers.map((x) => { return x.vendor.toLowerCase() })
@@ -216,7 +215,7 @@ class Template {
216
215
  let fun = new Function("uri", "cwd", "key", "local", "global", "self", "input", "current", "next", "event", "_", "os", "path", "system", "pip", "platform", "arch", "gpu", "gpus", "kernel", `return ${o}`)
217
216
  try {
218
217
  console.log("fun", fun.toString())
219
- let response = fun(vars.uri, vars.cwd, vars.key, vars.local, vars.global, vars.self, vars.input, vars.current, vars.next, vars.event, _, os, path, system, vars.pip, this.platform, this.arch, this.gpu, this.gpus, this.kernel)
218
+ let response = fun(vars.uri, vars.cwd, vars.key, vars.local, vars.global, vars.self, vars.input, vars.current, vars.next, vars.event, _, this.os, path, system, vars.pip, this.platform, this.arch, this.gpu, this.gpus, this.kernel)
220
219
  console.log("response", response)
221
220
  if (typeof response === "undefined") {
222
221
  return `{{${o}}}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -1918,7 +1918,7 @@ class Server {
1918
1918
  if (req.body.name) {
1919
1919
  let folderPath = this.kernel.path("api", req.body.name)
1920
1920
  console.log("delete", folderPath)
1921
- await rimraf(folderPath)
1921
+ await fse.remove(folderPath)
1922
1922
  await new Promise((resolve, reject) => {
1923
1923
  setTimeout(() => {
1924
1924
  resolve()
@@ -952,17 +952,23 @@ document.querySelector("#new-tab").addEventListener("click", async (e) => {
952
952
  const u = prompt("url")
953
953
 
954
954
  if (u) {
955
- let o = {}
956
- if (/^[0-9.:]/.test(u)) {
957
- o.forceHttp = true
958
- } else if (/^localhost/.test(u)) {
959
- o.forceHttp = true
955
+ let url
956
+ if (/^[ ]*http:/i.test(u)) {
957
+ url = u
958
+ } else if (/^[ ]*https:/i.test(u)) {
959
+ url = u
960
960
  } else {
961
- o.forceHttps = true
961
+ let o = {}
962
+ if (/^[0-9.:]/.test(u)) {
963
+ o.forceHttp = true
964
+ } else if (/^localhost/.test(u)) {
965
+ o.forceHttp = true
966
+ } else {
967
+ o.forceHttps = true
968
+ }
969
+ url = normalizeURL(u, o)
962
970
  }
963
971
 
964
- const url = normalizeURL(u, o)
965
-
966
972
  if (url && url.trim().length > 0) {
967
973
  console.log("url", url)
968
974
  const { tab, frame } = await addTab(url)