pinokiod 3.9.22 → 3.9.24

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.
@@ -68,7 +68,8 @@ class Api {
68
68
  // }
69
69
  // }
70
70
 
71
- meta.iconpath = meta.icon ? path.resolve(api_path, meta.icon) : null
71
+ meta.iconpath = meta.icon ? meta.icon : null
72
+ //meta.iconpath = meta.icon ? path.resolve(api_path, meta.icon) : null
72
73
  meta.icon = meta.icon ? `/api/${api_name}/${meta.icon}?raw=true` : "/pinokio-black.png"
73
74
  meta.path = api_path
74
75
  meta.name = meta.title
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.9.22",
3
+ "version": "3.9.24",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -102,11 +102,7 @@ class Server {
102
102
  return new Promise(r=>fs.access(s, fs.constants.F_OK, e => r(!e)))
103
103
  }
104
104
  async updateMeta(formData, app_path) {
105
- if (formData.icon_dirty) {
106
- // write icon file
107
- let icon_path = this.kernel.path("api", formData.new_path, formData.icon_path)
108
- await fs.promises.writeFile(icon_path, formData.avatar)
109
- }
105
+ console.log("updateMeta", formData)
110
106
 
111
107
  // write title/description to pinokio.json
112
108
  let dirty
@@ -127,7 +123,18 @@ class Server {
127
123
  menu: []
128
124
  }
129
125
  }
126
+
127
+ if (formData.icon_dirty) {
128
+ //
129
+ // write icon file
130
+ let icon_path = this.kernel.path("api", formData.new_path, formData.icon_path)
131
+ console.log({ icon_path })
132
+ await fs.promises.writeFile(icon_path, formData.avatar)
133
+ meta.icon = formData.icon_path
134
+ dirty = true
135
+ }
130
136
  if (dirty) {
137
+ console.log("Save", meta_path, meta)
131
138
  await fs.promises.writeFile(meta_path, JSON.stringify(meta, null, 2))
132
139
  }
133
140
  }
@@ -4263,6 +4270,7 @@ class Server {
4263
4270
  // 1. copy first
4264
4271
  let old_path = this.kernel.path("api", formData.old_path)
4265
4272
  let new_path = this.kernel.path("api", formData.new_path)
4273
+
4266
4274
  console.log({ old_path, new_path })
4267
4275
  await fs.promises.cp(old_path, new_path, { recursive: true })
4268
4276
 
@@ -1075,7 +1075,7 @@ body.dark .line:hover {
1075
1075
  /*
1076
1076
  padding: 15px 15px;
1077
1077
  */
1078
- padding: 10px;
1078
+ padding: 7px;
1079
1079
  border-bottom: 1px solid var(--light-thin);
1080
1080
  }
1081
1081
  .thick.line {
@@ -1128,7 +1128,9 @@ body.dark .line i {
1128
1128
  /*
1129
1129
  padding: 10px;
1130
1130
  */
1131
+ /*
1131
1132
  padding: 8px;
1133
+ */
1132
1134
  /*
1133
1135
  width: 40px;
1134
1136
  height: 40px;
@@ -49,13 +49,18 @@
49
49
  display: flex;
50
50
  align-items: center;
51
51
  }
52
+ body.dark .btn {
53
+ background: none !important;
54
+ }
52
55
  .btn {
53
56
  margin-right: 5px;
54
57
  font-weight: normal;
55
58
  padding: 5px 15px;
56
59
  min-width: 100px;
57
60
  text-align: center;
61
+ /*
58
62
  background: rgba(0,0,0,0.9);
63
+ */
59
64
  border: 1px solid rgba(0,0,0,0.9);
60
65
  }
61
66
  .items {