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>
|
</form>
|
||||||
|
|
||||||
<div id="configOutput" class="config-output" style="display: none;">
|
<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">
|
<div class="config-section">
|
||||||
<h3>Server Configuration</h3>
|
<h3>Server Configuration</h3>
|
||||||
<div class="config-content" id="serverConfig"></div>
|
<div class="config-content" id="serverConfig"></div>
|
||||||
|
|
@ -86,7 +92,7 @@
|
||||||
Download Server Config
|
Download Server Config
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="config-section">
|
<div class="config-section">
|
||||||
<h3>Client Configurations</h3>
|
<h3>Client Configurations</h3>
|
||||||
<div class="client-configs-row" id="clientConfigs"></div>
|
<div class="client-configs-row" id="clientConfigs"></div>
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,12 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div id="configOutput" class="config-output" style="display: none;">
|
<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">
|
<div class="config-section">
|
||||||
<h3>Mesh Network Configurations</h3>
|
<h3>Mesh Network Configurations</h3>
|
||||||
<div class="client-configs-row" id="meshConfigs"></div>
|
<div class="client-configs-row" id="meshConfigs"></div>
|
||||||
|
|
|
||||||
|
|
@ -502,6 +502,37 @@ function downloadConfig(name, content) {
|
||||||
window.URL.revokeObjectURL(url);
|
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
|
// Seed management functions
|
||||||
function generateNewSeed() {
|
function generateNewSeed() {
|
||||||
const seed = crypto.generateSeed();
|
const seed = crypto.generateSeed();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue