Add confirmation dialog for restoring default config

- Add Restore Default confirmation modal to settings.html
- Add translation strings to store.js
- Update claude-config.js to trigger modal instead of immediate restore

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
simon-ami
2026-01-11 16:43:25 +01:00
parent cd594f6e82
commit f3b494ebe8
3 changed files with 41 additions and 1 deletions

View File

@@ -144,7 +144,11 @@ window.Components.claudeConfig = () => ({
}
},
async restoreDefaultClaudeConfig() {
restoreDefaultClaudeConfig() {
document.getElementById('restore_defaults_modal').showModal();
},
async executeRestore() {
this.restoring = true;
const password = Alpine.store('global').webuiPassword;
try {
@@ -157,6 +161,9 @@ window.Components.claudeConfig = () => ({
if (!response.ok) throw new Error(`HTTP ${response.status}`);
Alpine.store('global').showToast(Alpine.store('global').t('claudeConfigRestored'), 'success');
// Close modal
document.getElementById('restore_defaults_modal').close();
// Reload the config to reflect the changes
await this.fetchConfig();
} catch (e) {