Import/export

This commit is contained in:
Joey Yakimowich-Payne 2025-04-18 07:36:41 -06:00
commit 9ad62d9d61
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
2 changed files with 153 additions and 1 deletions

View file

@ -332,6 +332,33 @@
</div>
</details>
<!-- Import/Export Section -->
<details class="config-section">
<summary class="config-summary">Import/Export Settings</summary>
<div class="config-content space-y-4 pt-2">
<div>
<button onclick="exportSettings()" class="w-full bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded">
Export Current Settings
</button>
</div>
<div>
<label for="settings-file-input" class="block text-sm font-medium text-gray-700">Or Load Settings from File:</label>
<input type="file" id="settings-file-input" name="settings-file-input" accept=".json, .txt" class="mt-1 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-purple-50 file:text-purple-700 hover:file:bg-purple-100">
<p class="mt-1 text-xs text-gray-500">Select a previously exported settings file (.json or .txt).</p>
</div>
<div>
<label for="settings-json" class="block text-sm font-medium text-gray-700">Settings Data (JSON):</label>
<textarea id="settings-json" rows="8" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm font-mono text-xs" placeholder="Click 'Export' to view settings here, or paste exported settings to import."></textarea>
<p class="mt-1 text-xs text-gray-500">Copy this text to save your settings, or paste previously exported settings here and click 'Import'.</p>
</div>
<div>
<button onclick="importSettings()" class="w-full bg-purple-500 hover:bg-purple-600 text-white font-bold py-2 px-4 rounded">
Import Settings from Above
</button>
</div>
</div>
</details>
<!-- Dangerous Reset All Button -->
<div class="border-t border-red-300 pt-4 mt-6">
<button onclick="resetAllSettings()" class="w-full bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2">
@ -339,7 +366,7 @@
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.008v.008H12v-.008Z" />
</svg>
Reset ALL Settings to Defaults
</button>
</button>
<p class="mt-2 text-xs text-red-600 text-center">Warning: This will clear all saved customizations and board content.</p>
</div>