ADD download all function #2
This commit is contained in:
parent
e7d33476ae
commit
20770f7cab
3 changed files with 44 additions and 1 deletions
|
|
@ -502,6 +502,37 @@ function downloadConfig(name, content) {
|
|||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
function downloadAllConfigs() {
|
||||
if (!currentConfigs) {
|
||||
alert('No configurations to download. Please generate configurations first.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Download server config first
|
||||
downloadConfig('server', currentConfigs.server);
|
||||
|
||||
// Download each client config with a small delay to prevent browser blocking
|
||||
currentConfigs.clients.forEach((client, index) => {
|
||||
setTimeout(() => {
|
||||
downloadConfig(client.name, client.config);
|
||||
}, (index + 1) * 100); // 100ms delay between each download
|
||||
});
|
||||
}
|
||||
|
||||
function downloadAllMeshConfigs() {
|
||||
if (!currentMeshConfigs) {
|
||||
alert('No configurations to download. Please generate configurations first.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Download each peer config with a small delay to prevent browser blocking
|
||||
currentMeshConfigs.forEach((peerConfig, index) => {
|
||||
setTimeout(() => {
|
||||
downloadConfig(peerConfig.name, peerConfig.config);
|
||||
}, index * 100); // 100ms delay between each download
|
||||
});
|
||||
}
|
||||
|
||||
// Seed management functions
|
||||
function generateNewSeed() {
|
||||
const seed = crypto.generateSeed();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue