Diff -- /var/www/vhosts/3dshawn.com/ptmatrix.3dshawn.com/TEMPLATES/tf_cycle_time.html
Diff

/var/www/vhosts/3dshawn.com/ptmatrix.3dshawn.com/TEMPLATES/tf_cycle_time.html

added on local at 2026-07-01 12:34:54

Added
+79
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 843a04fc903d
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-header">
2 <div>
3 <h1>Cycle Time</h1>
4 <p class="subtitle">How long tasks take from creation to done. <span class="text-muted" style="font-size:13px">&middot; $range_label</span></p>
5 </div>
6 <div class="flex-end">
7 <form method="GET" action="/cycle_time.cgi" style="display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap">
8 <div class="field" style="margin:0"><label style="font-size:11px">Project</label>
9 <select class="input" name="project" style="padding:6px 10px">
10 <option value="">All projects</option>
11 [loop:@projects]<option value="$loop1.id" $loop1.is_selected>$loop1.label</option>[/loop]
12 </select>
13 </div>
14 <div class="field" style="margin:0"><label style="font-size:11px">Start</label><input class="input" type="date" name="start" value="$range_start" style="padding:6px 10px"></div>
15 <div class="field" style="margin:0"><label style="font-size:11px">End</label><input class="input" type="date" name="end" value="$range_end" style="padding:6px 10px"></div>
16 <button type="submit" class="btn btn-ghost btn-sm" style="height:36px">Apply</button>
17 </form>
18 </div>
19</div>
20
21<div class="kpi-grid mb-3" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px">
22 <div class="kpi"><div class="kpi-label">Completed (last $window_days d)</div><div class="kpi-value">$total_completed</div></div>
23 <div class="kpi"><div class="kpi-label">Median lead time</div><div class="kpi-value">$median<small> days</small></div></div>
24 <div class="kpi warn"><div class="kpi-label">P90 lead time</div><div class="kpi-value">$p90<small> days</small></div></div>
25 <div class="kpi"><div class="kpi-label">Average</div><div class="kpi-value">$avg<small> days</small></div></div>
26</div>
27
28[if:!$has_data]
29<div class="card mb-3" style="border-left:3px solid var(--col-warn);padding:18px">
30 <strong>No completed tasks in this window.</strong> Mark some tasks done (or widen the window) to see lead-time stats.
31</div>
32[/if]
33
34[if:$has_data]
35<div class="card mb-3">
36 <div class="card-header"><h3 style="margin:0">Lead-time distribution</h3><span class="text-muted" style="font-size:13px">$current_project_label &middot; last $window_days days</span></div>
37 <div style="display:flex;align-items:flex-end;gap:18px;padding:24px 28px;height:240px">
38 [loop:@buckets]
39 <div style="flex:1;display:flex;flex-direction:column;align-items:center;height:100%">
40 <div style="font-size:12px;color:var(--col-text-muted);margin-bottom:4px">$loop1.n</div>
41 <div style="flex:1;display:flex;align-items:flex-end;width:100%;justify-content:center">
42 <div style="background:linear-gradient(180deg,#5aa9ff,#22c55e);width:60%;height:[$loop1.height_px]px;border-radius:4px 4px 0 0;min-height:2px"></div>
43 </div>
44 <div style="margin-top:6px;font-size:12px;color:var(--col-text-muted)">$loop1.label</div>
45 <div style="font-size:11px;color:var(--col-text-dim)">$loop1.pct%</div>
46 </div>
47 [/loop]
48 </div>
49</div>
50
51<div class="card">
52 <div class="card-header" style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px">
53 <h3 style="margin:0">Lead-time scatter &mdash; each dot is one completed task</h3>
54 <div style="display:flex;gap:12px;font-size:12px;flex-wrap:wrap">
55 <span><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:#5aa9ff;vertical-align:-1px"></span> Low</span>
56 <span><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:#22c55e;vertical-align:-1px"></span> Medium</span>
57 <span><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:#f59e0b;vertical-align:-1px"></span> High</span>
58 <span><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:#ef4444;vertical-align:-1px"></span> Urgent</span>
59 <span><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:#a855f7;vertical-align:-1px"></span> Critical</span>
60 </div>
61 </div>
62 <svg viewBox="0 0 $chart_w $chart_h" style="width:100%;height:auto;display:block">
63 [loop:@y_labels]
64 <line x1="50" x2="$chart_w" y1="$loop1.y" y2="$loop1.y" stroke="rgba(255,255,255,.06)" stroke-width="1"/>
65 <text x="44" y="$loop1.y" dy="4" text-anchor="end" fill="var(--col-text-dim)" font-size="11">$loop1.text</text>
66 [/loop]
67 <line x1="50" x2="$chart_w" y1="$median_y" y2="$median_y" stroke="#22c55e" stroke-width="1.2" stroke-dasharray="5,4" opacity="0.8"/>
68 <text x="$chart_w" y="$median_y" dx="-4" dy="-4" text-anchor="end" fill="#22c55e" font-size="11" font-weight="600">median $median d</text>
69 <line x1="50" x2="$chart_w" y1="$p90_y" y2="$p90_y" stroke="#f59e0b" stroke-width="1.2" stroke-dasharray="5,4" opacity="0.8"/>
70 <text x="$chart_w" y="$p90_y" dx="-4" dy="-4" text-anchor="end" fill="#f59e0b" font-size="11" font-weight="600">p90 $p90 d</text>
71 [loop:@dots]
72 <circle cx="$loop1.x" cy="$loop1.y" r="3.5" fill="$loop1.c" fill-opacity="0.7"><title>$loop1.ld days</title></circle>
73 [/loop]
74 [loop:@x_labels]
75 <text x="$loop1.x" y="$loop1.y" text-anchor="middle" fill="var(--col-text-dim)" font-size="11">$loop1.text</text>
76 [/loop]
77 </svg>
78</div>
79[/if]
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help