[release] v0.10.0-unstable21

This commit is contained in:
Yann Stepienik 2023-10-06 13:34:03 +01:00
parent 3f7527b6ef
commit 1f7c588a2b
3 changed files with 31 additions and 9 deletions

View file

@ -57,13 +57,33 @@ function getLogs() {
}
function connect(file) {
return wrap(fetch('/cosmos/api/constellation/connect', {
method: 'POST',
headers: {
'Content-Type': 'application/yaml'
},
body: file,
}))
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
fetch('/cosmos/api/constellation/connect', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
body: reader.result,
})
.then(response => {
// Add additional response handling here if needed.
resolve(response);
})
.catch(error => {
// Handle the error.
reject(error);
});
};
reader.onerror = () => {
reject(new Error('Failed to read the file.'));
};
reader.readAsText(file);
});
}
function block(nickname, devicename, block) {

View file

@ -147,7 +147,9 @@ export const ConstellationVPN = () => {
OnChange={async (e) => {
let file = e.target.files[0];
await API.constellation.connect(file);
refreshConfig();
setTimeout(() => {
refreshConfig();
}, 1000);
}}
/>
</Stack>

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.10.0-unstable20",
"version": "0.10.0-unstable21",
"description": "",
"main": "test-server.js",
"bugs": {