[release] v0.10.0-unstable21
This commit is contained in:
parent
3f7527b6ef
commit
1f7c588a2b
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.10.0-unstable20",
|
||||
"version": "0.10.0-unstable21",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
|
Loading…
Reference in a new issue