Diff -- /var/www/vhosts/3dshawn.com/site1/TEMPLATES/sync.html
Diff
/var/www/vhosts/3dshawn.com/site1/TEMPLATES/sync.html
added on local at 2026-07-12 00:02:17
Added
+83
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 3fc563b9cd30
to 3fc563b9cd30
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> Cross-site sync</span> | |
| 3 | <h1 class="page-title">Sync <code>$basename</code> across sites</h1> | |
| 4 | <p class="page-subtitle">Fan the source content out to other sites that have a same-basename file with different content. Each target gets its current version backed up to <code><target>.drift_restore_backup_<epoch></code> before overwrite. Every write is logged to <code>RESTORE_LOG</code>.</p> | |
| 5 | </div> | |
| 6 | ||
| 7 | [if:$has_error] | |
| 8 | <div class="module glow-rose"> | |
| 9 | <div class="module-body">$error_msg</div> | |
| 10 | </div> | |
| 11 | [/if] | |
| 12 | ||
| 13 | [if:$has_result] | |
| 14 | <div class="banner banner-ok" style="margin:0 0 16px;padding:10px 14px;border-radius:10px;background:rgba(52,211,153,.10);border:1px solid rgba(52,211,153,.35);color:#a7f3d0;font-size:13px"> | |
| 15 | Sync complete: <strong>$ok_ct</strong> succeeded, <strong>$fail_ct</strong> failed. See RESTORE_LOG for per-target detail. | |
| 16 | </div> | |
| 17 | [/if] | |
| 18 | ||
| 19 | <div class="module glow-teal" style="margin-bottom:16px"> | |
| 20 | <div class="module-head"><div class="left"> | |
| 21 | <div class="module-title">Canonical version</div> | |
| 22 | <span class="module-subtitle">Source content that will be written to every selected target.</span> | |
| 23 | </div></div> | |
| 24 | <div class="module-body"> | |
| 25 | <table class="tbl"> | |
| 26 | <tbody> | |
| 27 | <tr><td style="width:150px"><strong>File</strong></td><td class="mono">$src_file</td></tr> | |
| 28 | <tr><td><strong>Site</strong></td><td>$src_scan <span class="dim">on $src_server</span></td></tr> | |
| 29 | <tr><td><strong>Blob SHA</strong></td><td class="mono">$src_sha_full</td></tr> | |
| 30 | <tr><td><strong>Preview</strong></td><td><a href="$src_diff_url" style="color:var(--accent-hi);text-decoration:none">See diff →</a></td></tr> | |
| 31 | </tbody> | |
| 32 | </table> | |
| 33 | </div> | |
| 34 | </div> | |
| 35 | ||
| 36 | [if:$has_targets] | |
| 37 | <form method="post" action="/sync.cgi"> | |
| 38 | <input type="hidden" name="id" value="$src_id"> | |
| 39 | <input type="hidden" name="confirm" value="1"> | |
| 40 | ||
| 41 | <div class="module glow-amber"> | |
| 42 | <div class="module-head"><div class="left"> | |
| 43 | <div class="module-title">$total_targets targets found</div> | |
| 44 | <span class="module-subtitle">Same basename, different content. Uncheck any you don't want to sync.</span> | |
| 45 | </div></div> | |
| 46 | <div class="module-body tight"> | |
| 47 | <table class="tbl"> | |
| 48 | <thead><tr> | |
| 49 | <th style="width:50px"><input type="checkbox" onclick="document.querySelectorAll('input[name=targets]').forEach(function(el){el.checked=this.checked}.bind(this))" checked></th> | |
| 50 | <th>Target file</th> | |
| 51 | <th style="width:150px">Site</th> | |
| 52 | <th style="width:110px">Current SHA</th> | |
| 53 | </tr></thead> | |
| 54 | <tbody> | |
| 55 | [loop:@targets] | |
| 56 | <tr> | |
| 57 | <td><input type="checkbox" name="targets" value="$latest_id" checked></td> | |
| 58 | <td class="mono" style="font-size:11.5px"><a href="$diff_url" style="color:var(--accent-hi);text-decoration:none">$file_short</a></td> | |
| 59 | <td class="dim">$scan_name <span class="pill $kind_pill" style="font-size:9.5px">$server_kind</span></td> | |
| 60 | <td class="mono dim" style="font-size:11.5px">$sha_short</td> | |
| 61 | </tr> | |
| 62 | [/loop] | |
| 63 | </tbody> | |
| 64 | </table> | |
| 65 | </div> | |
| 66 | </div> | |
| 67 | ||
| 68 | <div style="display:flex;gap:8px;justify-content:flex-end;margin-top:12px"> | |
| 69 | <a href="/dashboard.cgi" class="tr-chip">Cancel</a> | |
| 70 | <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"> | |
| 71 | Sync selected targets → | |
| 72 | </button> | |
| 73 | </div> | |
| 74 | </form> | |
| 75 | [/if] | |
| 76 | ||
| 77 | [if:!$has_targets] | |
| 78 | <div class="module glow-mute"> | |
| 79 | <div class="module-body"> | |
| 80 | <p class="dim">No other sites have a file with basename <code>$basename</code> that differs from this source. Nothing to sync.</p> | |
| 81 | </div> | |
| 82 | </div> | |
| 83 | [/if] |