| 1 | <html> |
| 2 | <head> |
| 3 | <title>Create Backup</title> |
| 4 | <script type="module"> |
| 5 | import { store } from "/components/settings/backup/backup-store.js"; |
| 6 | </script> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div x-data> |
| 10 | <template x-if="$store.backupStore"> |
| 11 | <div x-init="$store.backupStore.initBackup()" x-destroy="$store.backupStore.onClose()"> |
| 12 | |
| 13 | <!-- Header with buttons (following MCP servers pattern) --> |
| 14 | <h3>Backup Configuration JSON |
| 15 | <button class="btn slim" style="margin-left: 0.5em;" |
| 16 | @click="$store.backupStore.formatJson()">Format</button> |
| 17 | <button class="btn slim" style="margin-left: 0.5em;" |
| 18 | @click="$store.backupStore.resetToDefaults()">Reset</button> |
| 19 | <button class="btn slim" style="margin-left: 0.5em;" |
| 20 | @click="$store.backupStore.dryRun()" :disabled="$store.backupStore.loading">Dry Run</button> |
| 21 | <button class="btn slim primary" style="margin-left: 0.5em;" |
| 22 | @click="$store.backupStore.createBackup()" :disabled="$store.backupStore.loading">Create Backup</button> |
| 23 | </h3> |
| 24 | |
| 25 | <!-- JSON Editor (upper part) --> |
| 26 | <div id="backup-metadata-editor"></div> |
| 27 | |
| 28 | <!-- File Operations Display (lower part) --> |
| 29 | <h3 id="backup-operations">File Operations</h3> |
| 30 | |
| 31 | <!-- File listing textarea --> |
| 32 | <div class="file-operations-container"> |
| 33 | <textarea id="backup-file-list" |
| 34 | x-model="$store.backupStore.fileOperationsLog" |
| 35 | readonly |
| 36 | placeholder="File operations will be displayed here..."></textarea> |
| 37 | </div> |
| 38 | |
| 39 | <!-- Loading indicator --> |
| 40 | <div x-show="$store.backupStore.loading" class="backup-loading"> |
| 41 | <span x-text="$store.backupStore.loadingMessage || 'Processing...'"></span> |
| 42 | </div> |
| 43 | |
| 44 | <!-- Error display --> |
| 45 | <div x-show="$store.backupStore.error" class="backup-error"> |
| 46 | <span x-text="$store.backupStore.error"></span> |
| 47 | </div> |
| 48 | |
| 49 | </div> |
| 50 | </template> |
| 51 | </div> |
| 52 | |
| 53 | <style> |
| 54 | .backup-loading { |
| 55 | width: 100%; |
| 56 | text-align: center; |
| 57 | margin-top: 2rem; |
| 58 | margin-bottom: 2rem; |
| 59 | color: var(--color-text-secondary); |
| 60 | } |
| 61 | |
| 62 | #backup-metadata-editor { |
| 63 | width: 100%; |
| 64 | height: 25em; |
| 65 | } |
| 66 | |
| 67 | .file-operations-container { |
| 68 | margin-top: 0.5em; |
| 69 | margin-bottom: 1em; |
| 70 | } |
| 71 | |
| 72 | #backup-file-list { |
| 73 | width: 100%; |
| 74 | height: 15em; |
| 75 | font-family: monospace; |
| 76 | font-size: 0.85em; |
| 77 | background: var(--color-bg-primary); |
| 78 | color: var(--color-text-primary); |
| 79 | border: 1px solid var(--color-border); |
| 80 | border-radius: 4px; |
| 81 | padding: 0.5em; |
| 82 | resize: vertical; |
| 83 | } |
| 84 | |
| 85 | .backup-error { |
| 86 | color: var(--color-error); |
| 87 | margin: 0.5rem 0; |
| 88 | padding: 0.5rem; |
| 89 | background: var(--color-error-bg); |
| 90 | border-radius: 4px; |
| 91 | } |
| 92 | </style> |
| 93 | </body> |
| 94 | </html> |