Diff -- /var/www/vhosts/3dshawn.com/site1/TEMPLATES/restore.html

O Operator
Diff

/var/www/vhosts/3dshawn.com/site1/TEMPLATES/restore.html

added on local at 2026-07-11 23:34:32

Added
+116
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 20c09ee2a28d
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1<div class="page-head">
2 <span class="page-eyebrow"><span class="dot"></span> Restore</span>
3 <h1 class="page-title">Restore file to captured state</h1>
4 <p class="page-subtitle">Every captured change carries its SHA-256-addressed content in BLOB_STORE. Restoring writes that content back to the original path &mdash; current file gets backed up to <code>&lt;path&gt;.drift_restore_backup_&lt;epoch&gt;</code> before overwrite.</p>
5</div>
6
7[if:$has_error]
8<div class="module glow-rose">
9 <div class="module-head"><div class="left">
10 <div class="module-title">Cannot proceed</div>
11 <span class="module-subtitle">Restore rejected on safety grounds.</span>
12 </div></div>
13 <div class="module-body" style="color:var(--accent-danger-hi)">
14 $error_msg
15 </div>
16</div>
17[/if]
18
19[if:$did_restore]
20 [if:$result_ok]
21 <div class="module glow-emerald">
22 <div class="module-head"><div class="left">
23 <div class="module-icon"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg></div>
24 <div class="module-title">Restore succeeded</div>
25 <span class="module-subtitle">Content at <code>$target_file</code> now matches captured SHA <code>$source_sha</code>. Prior content is safe in the backup file.</span>
26 </div></div>
27 <div class="module-body">
28 <table class="tbl">
29 <tbody>
30 <tr><td style="width:200px"><strong>Target</strong></td><td class="mono">$target_file</td></tr>
31 <tr><td><strong>Server</strong></td><td class="mono">$server_name (<span class="dim">$server_kind</span>)</td></tr>
32 <tr><td><strong>Restored content SHA</strong></td><td class="mono">$source_sha</td></tr>
33 <tr><td><strong>Captured at</strong></td><td class="mono dim"><span class="ts" data-ts="$captured_epoch" data-fmt="datetime">$captured_h</span></td></tr>
34 <tr><td><strong>Backup file</strong></td><td class="mono dim">[if:$backup_path]$backup_path[/if][if:!$backup_path](no prior content to back up)[/if]</td></tr>
35 <tr><td><strong>Result</strong></td><td>$result_msg</td></tr>
36 </tbody>
37 </table>
38 <div style="margin-top:14px">
39 <a href="/file_changes.cgi" class="tr-chip">Back to file changes</a>
40 <a href="/diff.cgi?kind=file&id=$id" class="tr-chip">See diff</a>
41 </div>
42 </div>
43 </div>
44 [/if]
45 [if:!$result_ok]
46 <div class="module glow-rose">
47 <div class="module-head"><div class="left">
48 <div class="module-title">Restore failed</div>
49 <span class="module-subtitle">See RESTORE_LOG for full audit trail.</span>
50 </div></div>
51 <div class="module-body">
52 <p style="color:var(--accent-danger-hi)">$result_msg</p>
53 <p class="dim" style="font-size:12.5px;margin-top:8px">Backup path: <code>$backup_path</code></p>
54 </div>
55 </div>
56 [/if]
57[/if]
58
59[if:!$did_restore][if:!$has_error]
60<div class="dash-grid" style="grid-template-columns:1fr 1fr">
61 <div class="module glow-teal">
62 <div class="module-head"><div class="left">
63 <div class="module-title">What will change</div>
64 <span class="module-subtitle">Preview -- nothing has been written yet.</span>
65 </div></div>
66 <div class="module-body">
67 <table class="tbl">
68 <tbody>
69 <tr><td style="width:170px"><strong>Target file</strong></td><td class="mono">$target_file</td></tr>
70 <tr><td><strong>Site</strong></td><td>$scan_name <span class="dim">on $server_name</span></td></tr>
71 <tr><td><strong>Kind</strong></td><td>$server_kind</td></tr>
72 <tr><td><strong>Captured at</strong></td><td class="mono dim"><span class="ts" data-ts="$captured_epoch" data-fmt="datetime">$captured_h</span></td></tr>
73 <tr><td><strong>Captured SHA</strong></td><td class="mono">$source_sha_full</td></tr>
74 </tbody>
75 </table>
76 </div>
77 </div>
78 <div class="module glow-amber">
79 <div class="module-head"><div class="left">
80 <div class="module-title">Current state on disk</div>
81 <span class="module-subtitle">Live check just now. If SHAs match, the restore is a no-op.</span>
82 </div></div>
83 <div class="module-body">
84 <table class="tbl">
85 <tbody>
86 <tr><td style="width:170px"><strong>File present</strong></td><td>[if:$current_exists]<span class="pill pill-ok">yes</span>[/if][if:!$current_exists]<span class="pill pill-mute">no (new file)</span>[/if]</td></tr>
87 <tr><td><strong>Size</strong></td><td class="mono dim">$current_size</td></tr>
88 <tr><td><strong>Current SHA</strong></td><td class="mono">$current_sha</td></tr>
89 <tr><td><strong>Same as captured?</strong></td><td>[if:$same_content]<span class="pill pill-ok">yes -- no-op</span>[/if][if:!$same_content]<span class="pill pill-warn">no -- restore will change it</span>[/if]</td></tr>
90 </tbody>
91 </table>
92 <div style="margin-top:14px">
93 <a href="$diff_url" class="tr-chip">See exactly what's different &rarr;</a>
94 </div>
95 </div>
96 </div>
97</div>
98
99<div class="module glow-rose" style="margin-top:20px">
100 <div class="module-head"><div class="left">
101 <div class="module-title">Confirm restore</div>
102 <span class="module-subtitle">Backs current content to <code>&lt;target&gt;.drift_restore_backup_&lt;epoch&gt;</code>, writes the captured content, verifies SHA post-write.</span>
103 </div></div>
104 <div class="module-body">
105 <form method="post" action="/restore.cgi" style="display:flex;gap:12px;align-items:center">
106 <input type="hidden" name="id" value="$id">
107 <input type="hidden" name="confirm" value="1">
108 <button type="submit" class="tr-chip is-active" style="border:none;padding:8px 22px;background:var(--accent-danger);border-color:var(--accent-danger);color:#fff">
109 Yes, restore this file
110 </button>
111 <a href="/file_changes.cgi" class="tr-chip">Cancel</a>
112 <span class="dim" style="margin-left:auto;font-size:12px">Logged to RESTORE_LOG regardless of outcome.</span>
113 </form>
114 </div>
115</div>
116[/if][/if]