ADD download all function #2

This commit is contained in:
Caffeine Fueled 2026-01-05 19:00:19 +01:00
parent e7d33476ae
commit 20770f7cab
Signed by: cf7
GPG key ID: CA295D643074C68C
3 changed files with 44 additions and 1 deletions

View file

@ -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();