ADD download all function #2
This commit is contained in:
parent
e7d33476ae
commit
20770f7cab
3 changed files with 44 additions and 1 deletions
|
|
@ -79,6 +79,12 @@
|
|||
</form>
|
||||
|
||||
<div id="configOutput" class="config-output" style="display: none;">
|
||||
<div class="config-section">
|
||||
<button class="download-btn" style="margin-bottom: 20px; font-size: 16px; padding: 12px 24px;" onclick="downloadAllConfigs()">
|
||||
Download All Configurations
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<h3>Server Configuration</h3>
|
||||
<div class="config-content" id="serverConfig"></div>
|
||||
|
|
|
|||
|
|
@ -75,6 +75,12 @@
|
|||
</form>
|
||||
|
||||
<div id="configOutput" class="config-output" style="display: none;">
|
||||
<div class="config-section">
|
||||
<button class="download-btn" style="margin-bottom: 20px; font-size: 16px; padding: 12px 24px;" onclick="downloadAllMeshConfigs()">
|
||||
Download All Configurations
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<h3>Mesh Network Configurations</h3>
|
||||
<div class="client-configs-row" id="meshConfigs"></div>
|
||||
|
|
|
|||
|
|
@ -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