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 23:13:03

Added
+10
lines
Removed
-0
lines
Context
215
unchanged
Blobs
from 4dd060b9c058
to ea09a1ccd492
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
11<div class="page-head">
22 <span class="page-eyebrow"><span class="dot"></span> Bookmark</span>
33 <h1 class="page-title">Named releases</h1>
44 <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 &mdash; scoped portfolio-wide or to a single site.</p>
55</div>
66
77<div class="ds-guide">
88 <div class="dsg-icon">i</div>
99 <div>
1010 <span class="dsg-title">Three ways to pin content:</span>
1111 (1) <strong>Portfolio-wide</strong>: leave scope as "All monitored sites" &mdash; protects every blob captured up to <em>now</em>. (2) <strong>Per-site</strong>: pick a monitor &mdash; 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 &quot;everything captured before this moment&quot;, explicit pins tie a release to specific <code>NAMED_RELEASE_PINS</code> rows &mdash; 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.
1212 </div>
1313</div>
1414
1515<div class="module glow-emerald" style="margin-bottom:16px">
1616 <div class="module-head"><div class="left">
1717 <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>
1818 <div class="module-title">Create a bookmark</div>
1919 <span class="module-subtitle">Names the current moment. Everything captured up to now becomes restorable from this label forever.</span>
2020 </div></div>
2121 <div class="module-body">
2222 <form method="post" action="/named_releases.cgi" style="display:flex;flex-direction:column;gap:12px">
2323 <input type="hidden" name="save" value="1">
2424
2525 <div style="display:flex;gap:12px">
2626 <label style="flex:1;display:flex;flex-direction:column;gap:4px">
2727 <span class="rb-label">Internal name</span>
2828 <input type="text" name="name" required placeholder="e.g. before-schema-refactor"
2929 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">
3030 </label>
3131 <label style="flex:1;display:flex;flex-direction:column;gap:4px">
3232 <span class="rb-label">Version label
3333 <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>
3434 </span>
3535 <input type="text" name="version_label" placeholder="e.g. v1.0 or Working 2.4"
3636 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">
3737 </label>
3838 <label style="width:150px;display:flex;flex-direction:column;gap:4px">
3939 <span class="rb-label">Tier
4040 <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>
4141 </span>
4242 <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">
4343 <option value="draft">Draft</option>
4444 <option value="working">Working</option>
4545 <option value="stable">Stable</option>
4646 </select>
4747 </label>
4848 <label style="width:140px;display:flex;flex-direction:column;gap:4px">
4949 <span class="rb-label">By</span>
5050 <input type="text" name="released_by" value="Operator"
5151 style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px">
5252 </label>
5353 <label style="width:170px;display:flex;flex-direction:column;gap:4px">
5454 <span class="rb-label">Auto-promote to stable
5555 <span class="ds-help" data-help-title="Auto-promote-to-stable" data-help-body="Only meaningful for <strong>Working</strong>-tier releases. When this many days pass with (a) zero new drift on any pinned file AND (b) compile-check still green, the hourly cron promotes this release to Stable automatically. Set 0 to disable."></span>
5656 </span>
5757 <input type="number" name="auto_promote_stable_days" min="0" max="365" value="0"
5858 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">
5959 </label>
6060 </div>
6161
6262 <label style="display:flex;flex-direction:column;gap:4px">
6363 <span class="rb-label">Description</span>
6464 <input type="text" name="description" placeholder="Optional context -- what this checkpoint represents"
6565 style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px">
66 </label>
67
68 <label style="display:flex;flex-direction:column;gap:4px">
69 <span class="rb-label">Annotation
70 <span class="ds-help" data-help-title="Annotation" data-help-body="Long-form note about this release &mdash; known issues, why it was cut, rollback plan, etc. Shown in the release list and via tooltip in the sidebar. Multi-line OK, capped at 4000 chars."></span>
71 <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">(optional, up to 4000 chars)</span>
72 </span>
73 <textarea name="annotation" rows="3" placeholder="Known issues, why cut, rollback plan..."
74 style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-family:var(--sans);font-size:12.5px;resize:vertical;min-height:64px"></textarea>
6675 </label>
6776
6877 <label style="display:flex;flex-direction:column;gap:4px">
6978 <span class="rb-label">Scope <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">&mdash; primary site (leave "All" for portfolio-wide)</span></span>
7079 <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">
7180 <option value="0">All monitored sites (portfolio-wide)</option>
7281 [loop:@monitors]
7382 <option value="$mid">$label</option>
7483 [/loop]
7584 </select>
7685 </label>
7786
7887 <label style="display:flex;flex-direction:column;gap:4px">
7988 <span class="rb-label">Additional scopes
8089 <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 &quot;stable v1.0 across PTMatrix + AffSoft + ContactForge&quot; without creating three separate releases."></span>
8190 <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">&mdash; Ctrl/Cmd-click to add more (optional)</span>
8291 </span>
8392 <select name="extra_monitor_ids" multiple size="4"
8493 style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px">
8594 [loop:@monitors]
8695 <option value="$mid">$label</option>
8796 [/loop]
8897 </select>
8998 </label>
9099
91100 <div style="display:flex;gap:12px">
92101 <label style="flex:1;display:flex;flex-direction:column;gap:4px">
93102 <span class="rb-label">Drift alerts <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">(optional)</span></span>
94103 <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">
95104 <option value="none">Off</option>
96105 <option value="generic_webhook">Generic HTTP webhook</option>
97106 <option value="slack">Slack webhook</option>
98107 <option value="discord">Discord webhook</option>
99108 </select>
100109 </label>
101110 <label style="flex:2;display:flex;flex-direction:column;gap:4px">
102111 <span class="rb-label">Delivery URL <span class="dim" style="text-transform:none;letter-spacing:0;font-size:10.5px">&mdash; fires when any pinned file drifts from its pinned SHA</span></span>
103112 <input type="text" name="alert_delivery_url" placeholder="https://hooks.slack.com/... (leave blank to disable)"
104113 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">
105114 </label>
106115 </div>
107116
108117 <div style="display:flex;justify-content:flex-end">
109118 <button type="submit" class="tr-chip is-active" style="border:none;padding:8px 18px">Save bookmark</button>
110119 </div>
111120 </form>
112121 </div>
113122</div>
114123
115124<div class="module glow-teal">
116125 <div class="module-head"><div class="left">
117126 <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>
118127 <div class="module-title">All bookmarks</div>
119128 <span class="module-subtitle">$total bookmarks. Protected ones (default) survive auto-purge; unlocked ones are eligible for cleanup after the retention window.</span>
120129 </div></div>
121130 <div class="module-body tight">
122131 [if:$has_rows]
123132 <table class="tbl">
124133 <thead><tr>
125134 <th>Version</th>
126135 <th style="width:90px">Tier</th>
127136 <th style="width:140px">Scope</th>
128137 <th style="width:130px">Moment</th>
129138 <th style="width:260px">Actions</th>
130139 </tr></thead>
131140 <tbody>
132141 [loop:@rows]
133142 <tr>
134143 <td>
135144 <strong>$display_label</strong>
136145 <div class="dim" style="font-size:11.5px;margin-top:2px">$description</div>
146 [if:$has_annotation]<details style="margin-top:4px"><summary style="font-size:10.5px;color:var(--accent-hi);cursor:pointer;user-select:none">Annotation</summary><pre style="margin:4px 0 0;padding:8px 10px;background:var(--bg-2);border-radius:6px;font-family:var(--sans);font-size:11.5px;color:var(--text-dim);white-space:pre-wrap;max-width:560px">$annotation</pre></details>[/if]
137147 <div class="mono dim" style="font-size:10.5px;margin-top:2px">by $released_by &middot; internal: $name</div>
138148 </td>
139149 <td>
140150 <span class="pill $tier_pill">$tier_lbl</span>
141151 [if:$has_auto_promote][if:!$is_stable]<div class="dim" style="font-size:10.5px;margin-top:3px" title="auto-promotes to stable after $auto_promote_days days with no drift">[if:$ap_ready]<span style="color:var(--accent-ok)">auto&rarr;stable ready</span>[/if][if:!$ap_ready]auto in $ap_days_left d[/if]</div>[/if][/if]
142152 </td>
143153 <td>
144154 <span class="pill $scope_pill" style="font-size:10px">$scope_lbl</span>
145155 <div class="mono dim" style="font-size:10.5px;margin-top:3px">$scope_h</div>
146156 </td>
147157 <td class="mono dim"><span class="ts" data-ts="$released_epoch" data-fmt="datetime">$released_h</span></td>
148158 <td>
149159 <a href="$restore_url" class="tr-chip" style="padding:3px 10px;font-size:11px">Restore all</a>
150160 [if:!$is_stable]
151161 <form method="post" action="/named_releases.cgi" style="display:inline">
152162 <input type="hidden" name="promote" value="1">
153163 <input type="hidden" name="release_id" value="$id">
154164 <input type="hidden" name="to_tier" value="stable">
155165 <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)">&uarr; Mark stable</button>
156166 </form>
157167 [/if]
158168 <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>
159169 [if:$is_stable]
160170 <form method="post" action="/named_releases.cgi" style="display:inline">
161171 <input type="hidden" name="promote" value="1">
162172 <input type="hidden" name="release_id" value="$id">
163173 <input type="hidden" name="to_tier" value="working">
164174 <button type="submit" class="tr-chip" style="padding:3px 10px;font-size:11px">&darr; Working</button>
165175 </form>
166176 [/if]
167177 </td>
168178 </tr>
169179 [/loop]
170180 </tbody>
171181 </table>
172182 [/if]
173183 [if:!$has_rows]
174184 <div style="padding:36px 14px;text-align:center;color:var(--text-dim);font-size:13.5px">
175185 No bookmarks yet. Save your first one above.
176186 </div>
177187 [/if]
178188 </div>
179189</div>
180190
181191<script>
182192window.dsTestAlert = async function (id, btn) {
183193 var orig = btn.textContent;
184194 btn.textContent = 'Sending...';
185195 btn.disabled = true;
186196 try {
187197 var r = await fetch('/named_releases.cgi?op=test_alert&release_id=' + id, { cache: 'no-store' });
188198 var j = await r.json();
189199 if (j.ok) {
190200 btn.textContent = 'Sent ✓';
191201 btn.style.background = 'rgba(52,211,153,.14)';
192202 btn.style.color = '#86efac';
193203 btn.style.borderColor = 'rgba(52,211,153,.35)';
194204 alert('Test alert delivered\nHTTP ' + j.http_code);
195205 } else {
196206 btn.textContent = 'FAIL';
197207 btn.style.background = 'rgba(244,63,94,.14)';
198208 btn.style.color = '#fda4af';
199209 btn.style.borderColor = 'rgba(244,63,94,.35)';
200210 alert('Test alert failed:\n' + (j.message || 'unknown'));
201211 }
202212 } catch (e) {
203213 alert('Error: ' + e.message);
204214 btn.textContent = orig;
205215 } finally {
206216 setTimeout(function () {
207217 btn.disabled = false;
208218 btn.textContent = orig;
209219 btn.style.background = '';
210220 btn.style.color = '';
211221 btn.style.borderColor = '';
212222 }, 3000);
213223 }
214224};
215225</script>
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help