@eui/tools 6.5.1 → 6.5.2
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/.version.properties +1 -1
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/scripts/app/public/index.html +28 -1
- package/scripts/app/routes/index.js +25 -0
- package/scripts/csdr/config/global.js +14 -0
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.5.
|
|
1
|
+
6.5.2
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 6.5.2 (2023-03-02)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* enhanced csdr-app for custom installation of MWP - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([f457624e](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/f457624e91b20020bc47704e5a5fd27589026f35))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
1
10
|
## 6.5.1 (2023-03-01)
|
|
2
11
|
|
|
3
12
|
##### Chores
|
package/package.json
CHANGED
|
@@ -156,7 +156,8 @@
|
|
|
156
156
|
<button
|
|
157
157
|
class="btn btn-primary"
|
|
158
158
|
type="button"
|
|
159
|
-
:disabled="selectedRemotes.length === 0"
|
|
159
|
+
:disabled="selectedRemotes.length === 0"
|
|
160
|
+
@click="saveConfig()">
|
|
160
161
|
Save configuration
|
|
161
162
|
</button>
|
|
162
163
|
|
|
@@ -202,6 +203,7 @@
|
|
|
202
203
|
},
|
|
203
204
|
created() {
|
|
204
205
|
this.getRemotes();
|
|
206
|
+
this.getConfig();
|
|
205
207
|
},
|
|
206
208
|
methods: {
|
|
207
209
|
async getRemotes() {
|
|
@@ -212,6 +214,18 @@
|
|
|
212
214
|
this.remotes = finalRes;
|
|
213
215
|
this.getRemotesToInstall();
|
|
214
216
|
},
|
|
217
|
+
async getConfig() {
|
|
218
|
+
const res = await fetch(
|
|
219
|
+
"http://localhost:3000/api/config"
|
|
220
|
+
);
|
|
221
|
+
const finalRes = await res.json();
|
|
222
|
+
if (finalRes.selectedRemotes) {
|
|
223
|
+
this.selectedRemotes = finalRes.selectedRemotes;
|
|
224
|
+
this.deps = finalRes.deps;
|
|
225
|
+
this.packages = finalRes.packages;
|
|
226
|
+
this.remotesToInstall = finalRes.remotesToInstall;
|
|
227
|
+
}
|
|
228
|
+
},
|
|
215
229
|
async getPackages() {
|
|
216
230
|
const res = await fetch(
|
|
217
231
|
"http://localhost:3000/api/remotes/packages",
|
|
@@ -237,6 +251,19 @@
|
|
|
237
251
|
return !this.selectedRemotes.includes(r);
|
|
238
252
|
});
|
|
239
253
|
},
|
|
254
|
+
async saveConfig() {
|
|
255
|
+
console.log('Saving configuration...');
|
|
256
|
+
const res = await fetch(
|
|
257
|
+
"http://localhost:3000/api/config",
|
|
258
|
+
getRequestBody({
|
|
259
|
+
selectedRemotes: this.selectedRemotes,
|
|
260
|
+
deps: this.deps,
|
|
261
|
+
packages: this.packages,
|
|
262
|
+
remotesToInstall: this.remotesToInstall
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
const finalRes = await res.json();
|
|
266
|
+
},
|
|
240
267
|
},
|
|
241
268
|
});
|
|
242
269
|
</script>
|
|
@@ -60,6 +60,31 @@ router.post('/remotes/stats', function (req, res) {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
router.get('/config', function (req, res) {
|
|
64
|
+
return Promise.resolve()
|
|
65
|
+
.then(() => {
|
|
66
|
+
return configUtils.global.getCustomConfig();
|
|
67
|
+
})
|
|
68
|
+
.then((customConfig) => {
|
|
69
|
+
res.send(customConfig);
|
|
70
|
+
})
|
|
71
|
+
.catch((e) => {
|
|
72
|
+
console.log(e);
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
router.post('/config', function (req, res) {
|
|
79
|
+
return Promise.resolve()
|
|
80
|
+
.then(() => {
|
|
81
|
+
return configUtils.global.generateCustomConfig(req.body);
|
|
82
|
+
})
|
|
83
|
+
.catch((e) => {
|
|
84
|
+
console.log(e);
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
|
|
63
88
|
|
|
64
89
|
// Export API routes
|
|
65
90
|
module.exports = router;
|
|
@@ -405,3 +405,17 @@ module.exports.getLocalEuiVersion = () => {
|
|
|
405
405
|
return null;
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
module.exports.generateCustomConfig = (customConfig) => {
|
|
411
|
+
const configFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-custom.json');
|
|
412
|
+
|
|
413
|
+
return tools.writeJsonFileSync(configFile, customConfig);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
module.exports.getCustomConfig = () => {
|
|
418
|
+
const configFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-custom.json');
|
|
419
|
+
|
|
420
|
+
return tools.getJsonFileContent(configFile) || null;
|
|
421
|
+
}
|