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

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

added on local at 2026-07-13 16:25:55

Added
+98
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to b9b66076f8a9
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> Monitor</span>
3 <h1 class="page-title">File changes</h1>
4 <p class="page-subtitle">Every file change captured on every watched path. Click a row to view the full diff and restore point.</p>
5</div>
6
7<div class="ds-guide">
8 <div class="dsg-icon">i</div>
9 <div>
10 <span class="dsg-title">Reading the list:</span>
11 Each row is one captured change. Click the <strong>filename</strong> or <strong>blob SHA</strong> to open the diff viewer, or the <strong>Restore</strong><span class="ds-help" data-help-title="What Restore does" data-help-body="Writes this captured version's content back to its original path. Current on-disk content is backed up to <code>&lt;path&gt;.drift_restore_backup_&lt;epoch&gt;</code> before the overwrite. Post-write SHA is verified. Every attempt is logged to <code>RESTORE_LOG</code> whether it succeeded or failed."></span> chip to write it back to disk. The <strong>30-day rhythm</strong><span class="ds-help" data-help-title="Sparkline" data-help-body="A tiny bar chart of how often this file changed over the last 30 days. Files with a busy sparkline are likely <em>live-config</em> files &mdash; consider pinning them via <a href='/pin_hotspots.cgi'>Pin hotspots</a>."></span> sparkline shows the file's activity pattern. The <strong>ts</strong> pill means &quot;timestamp only&quot; (mtime touched but bytes identical) &mdash; usually noise.
12 </div>
13</div>
14
15$picker_html
16
17<form method="get" action="/file_changes.cgi" style="display:flex;gap:8px;align-items:center;margin-bottom:16px">
18 <input type="hidden" name="days" value="7">
19 <span class="rb-label" style="font-size:11px;letter-spacing:1.4px;text-transform:uppercase;color:var(--text-muted);font-weight:700">Path filter</span>
20 <input type="text" name="q" value="$q" placeholder="e.g. /etc/nginx or file.conf" style="flex:1;background:var(--bg-2);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:6px 12px;font-size:12.5px;font-family:inherit">
21 <button type="submit" class="tr-chip is-active" style="border:none">Apply</button>
22 [if:$q]<a class="tr-chip" href="/file_changes.cgi">Clear</a>[/if]
23</form>
24
25<div class="module glow-teal">
26 <div class="module-head"><div class="left">
27 <div class="module-icon"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg></div>
28 <div class="module-title">Changes captured[if:$show_baseline] <span class="pill pill-mute" style="font-size:10px;margin-left:6px">baseline shown</span>[/if]</div>
29 <span class="module-subtitle">
30 Content dedup via SHA-256 in BLOB_STORE. Timestamp-only changes marked so you can filter noise. $total match this window.
31 [if:$has_baseline_hidden]
32 &middot; <a href="?baseline=1" style="color:var(--accent-hi);text-decoration:none">$baseline_hidden baseline capture[if:$has_baseline_hidden]s[/if] hidden</a> <span class="ds-help" data-help-title="Baseline captures" data-help-body="When a monitor is first added (or after a fresh DB wipe), every file it currently sees is captured as an initial inventory. Those rows are marked <code>is_baseline=1</code> and hidden from the change list by default because they aren't real changes -- they're the starting state. Click the link to see them anyway."></span>
33 [/if]
34 [if:$show_baseline]
35 &middot; <a href="?" style="color:var(--accent-hi);text-decoration:none">Hide baseline</a>
36 [/if]
37 </span>
38 </div></div>
39 <div class="module-body tight">
40 [if:$has_rows]
41 <form method="get" action="/restore_batch.cgi" id="fcBatchForm">
42 <div style="display:flex;gap:10px;align-items:center;padding:8px 12px;background:var(--bg-2);border-bottom:1px solid var(--border);font-size:12px">
43 <label style="display:flex;gap:6px;align-items:center;cursor:pointer">
44 <input type="checkbox" id="fcSelectAll" onclick="Array.from(document.querySelectorAll('.fc-cb')).forEach(function(cb){cb.checked=this.checked}.bind(this))">
45 <span class="dim">Select all restorable</span>
46 </label>
47 <span id="fcSelectionCount" class="dim" style="font-size:11px">0 selected</span>
48 <div style="flex:1"></div>
49 <button type="submit" class="tr-chip is-active" style="border:none;padding:5px 14px;font-size:12px">Batch restore selected &rarr;</button>
50 </div>
51 <style>
52 .site-badge { display:inline-grid; place-items:center; width:32px; height:24px; border-radius:6px; font-family:var(--sans); font-size:10.5px; font-weight:700; letter-spacing:.04em; text-decoration:none; box-shadow:0 0 0 1px rgba(255,255,255,.08); flex:0 0 auto; }
53 .site-cell { display:flex; align-items:center; gap:8px; min-width:0; }
54 .site-cell .site-name { font-size:11.5px; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
55 </style>
56 <table class="tbl">
57 <thead><tr>
58 <th style="width:34px"></th>
59 <th style="width:100px">Status</th>
60 <th style="width:130px">Site</th>
61 <th>File</th>
62 <th style="width:110px">30-day rhythm</th>
63 <th style="width:90px">Blob</th>
64 <th style="width:180px">When</th>
65 <th style="width:110px">Actions</th>
66 </tr></thead>
67 <tbody>
68 [loop:@rows]
69 <tr>
70 <td>[if:$can_restore]<input type="checkbox" class="fc-cb" name="cid" value="$id" onchange="var n=document.querySelectorAll('.fc-cb:checked').length;document.getElementById('fcSelectionCount').textContent=n+' selected'">[/if]</td>
71 <td><span class="pill $status_pill">$status</span>[if:$is_ts_only] <span class="pill pill-mute" style="font-size:9px">ts</span>[/if]</td>
72 <td>
73 <a href="$site_link" class="site-cell" title="Filter to just $site_label" style="text-decoration:none">
74 <span class="site-badge" style="background:$site_badge_bg;color:$site_badge_fg">$site_badge</span>
75 <span class="site-name">$site_label</span>
76 </a>
77 </td>
78 <td class="mono" style="font-size:12px"><a href="$diff_url" style="color:var(--accent-hi);text-decoration:none" title="$file_name">$file_name_h</a></td>
79 <td>$sparkline_svg</td>
80 <td class="mono dim"><a href="$diff_url" style="color:var(--accent-hi);text-decoration:none">$blob_short</a></td>
81 <td class="mono dim"><span class="ts" data-ts="$ts_epoch" data-fmt="datetime">$date_time</span></td>
82 <td>
83 [if:$can_restore]<a href="$restore_url" class="tr-chip" style="padding:3px 8px;font-size:11px">Restore</a>[/if]
84 <a href="$bio_url" class="tr-chip" style="padding:3px 8px;font-size:11px" title="File biography">Bio</a>
85 </td>
86 </tr>
87 [/loop]
88 </tbody>
89 </table>
90 </form>
91 [/if]
92 [if:!$has_rows]
93 <div style="padding:36px 14px;text-align:center;color:var(--text-dim);font-size:13.5px">
94 No file changes captured in this window. Try widening the range with the chips above, or configure a file monitor in <a href="[url:file_monitors]" style="color:var(--accent-hi)">File monitors</a>.
95 </div>
96 [/if]
97 </div>
98</div>
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help