Diff -- /var/www/vhosts/3dshawn.com/site1/TEMPLATES/named_releases.html
Diff
/var/www/vhosts/3dshawn.com/site1/TEMPLATES/named_releases.html
modified on local at 2026-07-12 00:48:50
Added
+102
lines
Removed
-16
lines
Context
103
unchanged
Blobs
from 2de1e6efad1f
to 61256b30cf27
to 61256b30cf27
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.| 1 | 1 | <div class="page-head"> |
| 2 | 2 | <span class="page-eyebrow"><span class="dot"></span> Bookmark</span> |
| 3 | 3 | <h1 class="page-title">Named releases</h1> |
| 4 | 4 | <p class="page-subtitle">Retroactively bookmark a moment. "Before the schema refactor." "Customer verified this worked." "Before I fired the intern." Every blob referenced by a named release is protected from auto-purge, so restore-to-moment always works — scoped portfolio-wide or to a single site.</p> |
| 5 | 5 | </div> |
| 6 | 6 | |
| 7 | 7 | <div class="ds-guide"> |
| 8 | 8 | <div class="dsg-icon">i</div> |
| 9 | 9 | <div> |
| 10 | 10 | <span class="dsg-title">Three ways to pin content:</span> |
| 11 | 11 | (1) <strong>Portfolio-wide</strong>: leave scope as "All monitored sites" — protects every blob captured up to <em>now</em>. (2) <strong>Per-site</strong>: pick a monitor — only that site's blobs are pinned. (3) <strong>Explicit pins</strong><span class="ds-help" data-help-title="Explicit pins" data-help-body="Instead of pinning "everything captured before this moment", explicit pins tie a release to specific <code>NAMED_RELEASE_PINS</code> rows — each pointing at a chosen <code>file_changes_id</code>. Auto-purge always keeps those specific blobs. Use <a href='/pin_hotspots.cgi'>Pin hotspots</a> to create one." data-help-link="/pin_hotspots.cgi" data-help-link-label="Pin hotspots"></span>: use <a href="/pin_hotspots.cgi">Pin hotspots</a> to freeze the current-latest blobs of the churniest files. Set a <strong>Drift alert URL</strong> below and DriftSense will page you when any pinned file's current SHA no longer matches its pinned SHA. |
| 12 | 12 | </div> |
| 13 | 13 | </div> |
| 14 | 14 | |
| 15 | 15 | <div class="module glow-emerald" style="margin-bottom:16px"> |
| 16 | 16 | <div class="module-head"><div class="left"> |
| 17 | 17 | <div class="module-icon"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 13V7a2 2 0 0 0-2-2h-4l-2-3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h5"/><path d="M14 19l2 2 4-4"/></svg></div> |
| 18 | 18 | <div class="module-title">Create a bookmark</div> |
| 19 | 19 | <span class="module-subtitle">Names the current moment. Everything captured up to now becomes restorable from this label forever.</span> |
| 20 | 20 | </div></div> |
| 21 | 21 | <div class="module-body"> |
| 22 | 22 | <form method="post" action="/named_releases.cgi" style="display:flex;flex-direction:column;gap:12px"> |
| 23 | 23 | <input type="hidden" name="save" value="1"> |
| 24 | 24 | |
| 25 | 25 | <div style="display:flex;gap:12px"> |
| 26 | 26 | <label style="flex:1;display:flex;flex-direction:column;gap:4px"> |
| 27 | <span class="rb-label">Name</span> | |
| 27 | <span class="rb-label">Internal name</span> | |
| 28 | 28 | <input type="text" name="name" required placeholder="e.g. before-schema-refactor" |
| 29 | 29 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-family:var(--mono);font-size:12.5px"> |
| 30 | 30 | </label> |
| 31 | <label style="flex:2;display:flex;flex-direction:column;gap:4px"> | |
| 32 | <span class="rb-label">Description</span> | |
| 33 | <input type="text" name="description" placeholder="Optional context" | |
| 34 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> | |
| 31 | <label style="flex:1;display:flex;flex-direction:column;gap:4px"> | |
| 32 | <span class="rb-label">Version label | |
| 33 | <span class="ds-help" data-help-title="What's a version label?" data-help-body="Display name shown across the UI (e.g. <code>v1.0</code>, <code>working v2.4</code>, <code>stable Nov-2026</code>). If left blank we fall back to the internal name."></span> | |
| 34 | </span> | |
| 35 | <input type="text" name="version_label" placeholder="e.g. v1.0 or Working 2.4" | |
| 36 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-family:var(--mono);font-size:12.5px"> | |
| 35 | 37 | </label> |
| 36 | <label style="width:160px;display:flex;flex-direction:column;gap:4px"> | |
| 38 | <label style="width:150px;display:flex;flex-direction:column;gap:4px"> | |
| 39 | <span class="rb-label">Tier | |
| 40 | <span class="ds-help" data-help-title="Tier decides how visible this release is" data-help-body="<strong>Draft</strong> = a plain bookmark. <strong>Working</strong> = a milestone you've verified but might revise. <strong>Stable</strong> = production-ready, elevated in the sidebar and dashboard, one-click rollback target."></span> | |
| 41 | </span> | |
| 42 | <select name="tier" style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> | |
| 43 | <option value="draft">Draft</option> | |
| 44 | <option value="working">Working</option> | |
| 45 | <option value="stable">Stable</option> | |
| 46 | </select> | |
| 47 | </label> | |
| 48 | <label style="width:140px;display:flex;flex-direction:column;gap:4px"> | |
| 37 | 49 | <span class="rb-label">By</span> |
| 38 | 50 | <input type="text" name="released_by" value="Operator" |
| 39 | 51 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> |
| 40 | 52 | </label> |
| 41 | 53 | </div> |
| 42 | 54 | |
| 43 | 55 | <label style="display:flex;flex-direction:column;gap:4px"> |
| 44 | <span class="rb-label">Scope <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">— leave "All monitored sites" for a portfolio-wide bookmark</span></span> | |
| 56 | <span class="rb-label">Description</span> | |
| 57 | <input type="text" name="description" placeholder="Optional context -- what this checkpoint represents" | |
| 58 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> | |
| 59 | </label> | |
| 60 | ||
| 61 | <label style="display:flex;flex-direction:column;gap:4px"> | |
| 62 | <span class="rb-label">Scope <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">— primary site (leave "All" for portfolio-wide)</span></span> | |
| 45 | 63 | <select name="scope_monitor_id" style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> |
| 46 | 64 | <option value="0">All monitored sites (portfolio-wide)</option> |
| 65 | [loop:@monitors] | |
| 66 | <option value="$mid">$label</option> | |
| 67 | [/loop] | |
| 68 | </select> | |
| 69 | </label> | |
| 70 | ||
| 71 | <label style="display:flex;flex-direction:column;gap:4px"> | |
| 72 | <span class="rb-label">Additional scopes | |
| 73 | <span class="ds-help" data-help-title="Cross-scope releases" data-help-body="A release can cover multiple sites at once. Ctrl+click / Cmd+click to add extra monitors. Great for "stable v1.0 across PTMatrix + AffSoft + ContactForge" without creating three separate releases."></span> | |
| 74 | <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">— Ctrl/Cmd-click to add more (optional)</span> | |
| 75 | </span> | |
| 76 | <select name="extra_monitor_ids" multiple size="4" | |
| 77 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> | |
| 47 | 78 | [loop:@monitors] |
| 48 | 79 | <option value="$mid">$label</option> |
| 49 | 80 | [/loop] |
| 50 | 81 | </select> |
| 51 | 82 | </label> |
| 52 | 83 | |
| 53 | 84 | <div style="display:flex;gap:12px"> |
| 54 | 85 | <label style="flex:1;display:flex;flex-direction:column;gap:4px"> |
| 55 | 86 | <span class="rb-label">Drift alerts <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">(optional)</span></span> |
| 56 | 87 | <select name="alert_delivery_kind" style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> |
| 57 | 88 | <option value="none">Off</option> |
| 58 | 89 | <option value="generic_webhook">Generic HTTP webhook</option> |
| 59 | 90 | <option value="slack">Slack webhook</option> |
| 60 | 91 | <option value="discord">Discord webhook</option> |
| 61 | 92 | </select> |
| 62 | 93 | </label> |
| 63 | 94 | <label style="flex:2;display:flex;flex-direction:column;gap:4px"> |
| 64 | 95 | <span class="rb-label">Delivery URL <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">— fires when any pinned file drifts from its pinned SHA</span></span> |
| 65 | 96 | <input type="text" name="alert_delivery_url" placeholder="https://hooks.slack.com/... (leave blank to disable)" |
| 66 | 97 | style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-family:var(--mono);font-size:11.5px"> |
| 67 | 98 | </label> |
| 68 | 99 | </div> |
| 69 | 100 | |
| 70 | 101 | <div style="display:flex;justify-content:flex-end"> |
| 71 | 102 | <button type="submit" class="tr-chip is-active" style="border:none;padding:8px 18px">Save bookmark</button> |
| 72 | 103 | </div> |
| 73 | 104 | </form> |
| 74 | 105 | </div> |
| 75 | 106 | </div> |
| 76 | 107 | |
| 77 | 108 | <div class="module glow-teal"> |
| 78 | 109 | <div class="module-head"><div class="left"> |
| 79 | 110 | <div class="module-icon"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><line x1="4" y1="9" x2="20" y2="9"/><line x1="4" y1="15" x2="20" y2="15"/><line x1="10" y1="3" x2="8" y2="21"/><line x1="16" y1="3" x2="14" y2="21"/></svg></div> |
| 80 | 111 | <div class="module-title">All bookmarks</div> |
| 81 | 112 | <span class="module-subtitle">$total bookmarks. Protected ones (default) survive auto-purge; unlocked ones are eligible for cleanup after the retention window.</span> |
| 82 | 113 | </div></div> |
| 83 | 114 | <div class="module-body tight"> |
| 84 | 115 | [if:$has_rows] |
| 85 | 116 | <table class="tbl"> |
| 86 | 117 | <thead><tr> |
| 87 | <th>Name</th> | |
| 88 | <th style="width:150px">Scope</th> | |
| 89 | <th style="width:110px">By</th> | |
| 90 | <th style="width:110px">Protection</th> | |
| 118 | <th>Version</th> | |
| 119 | <th style="width:90px">Tier</th> | |
| 120 | <th style="width:140px">Scope</th> | |
| 91 | 121 | <th style="width:130px">Moment</th> |
| 92 | <th style="width:150px">Actions</th> | |
| 122 | <th style="width:260px">Actions</th> | |
| 93 | 123 | </tr></thead> |
| 94 | 124 | <tbody> |
| 95 | 125 | [loop:@rows] |
| 96 | 126 | <tr> |
| 97 | <td><strong>$name</strong><div class="dim" style="font-size:11.5px;margin-top:2px">$description</div></td> | |
| 127 | <td> | |
| 128 | <strong>$display_label</strong> | |
| 129 | <div class="dim" style="font-size:11.5px;margin-top:2px">$description</div> | |
| 130 | <div class="mono dim" style="font-size:10.5px;margin-top:2px">by $released_by · internal: $name</div> | |
| 131 | </td> | |
| 132 | <td><span class="pill $tier_pill">$tier_lbl</span></td> | |
| 98 | 133 | <td> |
| 99 | 134 | <span class="pill $scope_pill" style="font-size:10px">$scope_lbl</span> |
| 100 | 135 | <div class="mono dim" style="font-size:10.5px;margin-top:3px">$scope_h</div> |
| 101 | 136 | </td> |
| 102 | <td class="dim">$released_by</td> | |
| 103 | <td><span class="pill $lock_pill">$lock_lbl</span></td> | |
| 104 | 137 | <td class="mono dim"><span class="ts" data-ts="$released_epoch" data-fmt="datetime">$released_h</span></td> |
| 105 | 138 | <td> |
| 106 | <a href="/restore_release.cgi?release_id=$id" class="tr-chip" style="padding:3px 10px;font-size:11px">Restore all</a> | |
| 139 | <a href="$restore_url" class="tr-chip" style="padding:3px 10px;font-size:11px">Restore all</a> | |
| 140 | [if:!$is_stable] | |
| 141 | <form method="post" action="/named_releases.cgi" style="display:inline"> | |
| 142 | <input type="hidden" name="promote" value="1"> | |
| 143 | <input type="hidden" name="release_id" value="$id"> | |
| 144 | <input type="hidden" name="to_tier" value="stable"> | |
| 145 | <button type="submit" class="tr-chip" style="padding:3px 10px;font-size:11px;background:rgba(52,211,153,.14);color:#86efac;border-color:rgba(52,211,153,.35)">↑ Mark stable</button> | |
| 146 | </form> | |
| 147 | [/if] | |
| 148 | <button type="button" onclick="dsTestAlert($id, this)" class="tr-chip" style="padding:3px 10px;font-size:11px" title="Send synthetic drift payload">Test alert</button> | |
| 149 | [if:$is_stable] | |
| 150 | <form method="post" action="/named_releases.cgi" style="display:inline"> | |
| 151 | <input type="hidden" name="promote" value="1"> | |
| 152 | <input type="hidden" name="release_id" value="$id"> | |
| 153 | <input type="hidden" name="to_tier" value="working"> | |
| 154 | <button type="submit" class="tr-chip" style="padding:3px 10px;font-size:11px">↓ Working</button> | |
| 155 | </form> | |
| 156 | [/if] | |
| 107 | 157 | </td> |
| 108 | 158 | </tr> |
| 109 | 159 | [/loop] |
| 110 | 160 | </tbody> |
| 111 | 161 | </table> |
| 112 | 162 | [/if] |
| 113 | 163 | [if:!$has_rows] |
| 114 | 164 | <div style="padding:36px 14px;text-align:center;color:var(--text-dim);font-size:13.5px"> |
| 115 | 165 | No bookmarks yet. Save your first one above. |
| 116 | 166 | </div> |
| 117 | 167 | [/if] |
| 118 | 168 | </div> |
| 119 | 169 | </div> |
| 170 | ||
| 171 | <script> | |
| 172 | window.dsTestAlert = async function (id, btn) { | |
| 173 | var orig = btn.textContent; | |
| 174 | btn.textContent = 'Sending...'; | |
| 175 | btn.disabled = true; | |
| 176 | try { | |
| 177 | var r = await fetch('/named_releases.cgi?op=test_alert&release_id=' + id, { cache: 'no-store' }); | |
| 178 | var j = await r.json(); | |
| 179 | if (j.ok) { | |
| 180 | btn.textContent = 'Sent ✓'; | |
| 181 | btn.style.background = 'rgba(52,211,153,.14)'; | |
| 182 | btn.style.color = '#86efac'; | |
| 183 | btn.style.borderColor = 'rgba(52,211,153,.35)'; | |
| 184 | alert('Test alert delivered\nHTTP ' + j.http_code); | |
| 185 | } else { | |
| 186 | btn.textContent = 'FAIL'; | |
| 187 | btn.style.background = 'rgba(244,63,94,.14)'; | |
| 188 | btn.style.color = '#fda4af'; | |
| 189 | btn.style.borderColor = 'rgba(244,63,94,.35)'; | |
| 190 | alert('Test alert failed:\n' + (j.message || 'unknown')); | |
| 191 | } | |
| 192 | } catch (e) { | |
| 193 | alert('Error: ' + e.message); | |
| 194 | btn.textContent = orig; | |
| 195 | } finally { | |
| 196 | setTimeout(function () { | |
| 197 | btn.disabled = false; | |
| 198 | btn.textContent = orig; | |
| 199 | btn.style.background = ''; | |
| 200 | btn.style.color = ''; | |
| 201 | btn.style.borderColor = ''; | |
| 202 | }, 3000); | |
| 203 | } | |
| 204 | }; | |
| 205 | </script> |