|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="ko"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <title>{{TITLE}}</title> |
| 6 | + <meta |
| 7 | + name="viewport" |
| 8 | + content="width=device-width, initial-scale=1.0" |
| 9 | + /> |
| 10 | + <style> |
| 11 | + :root { |
| 12 | + --card-bg: #fafafa; |
| 13 | + --card-border: #ddd; |
| 14 | + --muted: #666; |
| 15 | + --thead: #f5f5f5; |
| 16 | + } |
| 17 | + body { |
| 18 | + font-family: Arial, sans-serif; |
| 19 | + margin: 20px; |
| 20 | + } |
| 21 | + h1 { |
| 22 | + margin: 0 0 4px 0; |
| 23 | + } |
| 24 | + .sub { |
| 25 | + color: var(--muted); |
| 26 | + font-size: 14px; |
| 27 | + margin-bottom: 16px; |
| 28 | + } |
| 29 | + |
| 30 | + .cards { |
| 31 | + display: flex; |
| 32 | + flex-wrap: wrap; |
| 33 | + gap: 8px; |
| 34 | + margin: 8px 0 16px; |
| 35 | + } |
| 36 | + .card { |
| 37 | + border: 1px solid var(--card-border); |
| 38 | + border-radius: 6px; |
| 39 | + padding: 10px 14px; |
| 40 | + background: var(--card-bg); |
| 41 | + min-width: 140px; |
| 42 | + } |
| 43 | + .card h3 { |
| 44 | + margin: 0 0 4px 0; |
| 45 | + font-size: 13px; |
| 46 | + color: #444; |
| 47 | + } |
| 48 | + .card .val { |
| 49 | + font-size: 18px; |
| 50 | + font-weight: 700; |
| 51 | + } |
| 52 | + |
| 53 | + .grid { |
| 54 | + display: grid; |
| 55 | + gap: 18px; |
| 56 | + grid-template-columns: 1fr; |
| 57 | + } |
| 58 | + @media (min-width: 900px) { |
| 59 | + .grid { |
| 60 | + grid-template-columns: 1.2fr 0.8fr; |
| 61 | + } |
| 62 | + } |
| 63 | + .panel h2 { |
| 64 | + margin: 8px 0; |
| 65 | + } |
| 66 | + |
| 67 | + table { |
| 68 | + border-collapse: collapse; |
| 69 | + width: 100%; |
| 70 | + } |
| 71 | + th, |
| 72 | + td { |
| 73 | + border: 1px solid #ddd; |
| 74 | + padding: 6px 8px; |
| 75 | + } |
| 76 | + th { |
| 77 | + background: var(--thead); |
| 78 | + } |
| 79 | + td.val-right { |
| 80 | + text-align: right; |
| 81 | + } |
| 82 | + </style> |
| 83 | + </head> |
| 84 | + <body> |
| 85 | + <h1>{{TITLE}}</h1> |
| 86 | + <div class="sub">{{NOTES}}</div> |
| 87 | + |
| 88 | + <div class="cards"> |
| 89 | + <div class="card"> |
| 90 | + <h3>커밋 수</h3> |
| 91 | + <div class="val">{{COMMITS}}</div> |
| 92 | + </div> |
| 93 | + <div class="card"> |
| 94 | + <h3>삽입 LOC</h3> |
| 95 | + <div class="val">{{INSERTIONS}}</div> |
| 96 | + </div> |
| 97 | + <div class="card"> |
| 98 | + <h3>삭제 LOC</h3> |
| 99 | + <div class="val">{{DELETIONS}}</div> |
| 100 | + </div> |
| 101 | + <div class="card"> |
| 102 | + <h3>Churn(±)</h3> |
| 103 | + <div class="val">{{CHURN}}</div> |
| 104 | + </div> |
| 105 | + <div class="card"> |
| 106 | + <h3>브랜치</h3> |
| 107 | + <div class="val">{{BRANCH}}</div> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + |
| 111 | + <div class="grid"> |
| 112 | + <div class="panel"> |
| 113 | + <h2>Commits vs Churn</h2> |
| 114 | + <canvas |
| 115 | + id="barChart" |
| 116 | + height="160" |
| 117 | + ></canvas> |
| 118 | + </div> |
| 119 | + <div class="panel"> |
| 120 | + <h2>Commit Type Mix</h2> |
| 121 | + <canvas |
| 122 | + id="donutChart" |
| 123 | + height="160" |
| 124 | + ></canvas> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + |
| 128 | + <div style="margin-top: 22px"> |
| 129 | + <h2>타입별 건수</h2> |
| 130 | + <table> |
| 131 | + <thead> |
| 132 | + <tr> |
| 133 | + <th style="width: 50%">Type</th> |
| 134 | + <th class="val-right">Count</th> |
| 135 | + </tr> |
| 136 | + </thead> |
| 137 | + <tbody> |
| 138 | + {{TYPE_TABLE_ROWS}} |
| 139 | + </tbody> |
| 140 | + </table> |
| 141 | + </div> |
| 142 | + |
| 143 | + <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> |
| 144 | + <script> |
| 145 | + const tooltipStyle = { |
| 146 | + backgroundColor: "#1e293b", |
| 147 | + borderColor: "#475569", |
| 148 | + borderWidth: 2, |
| 149 | + cornerRadius: 8, |
| 150 | + padding: 12, |
| 151 | + titleColor: "#f8fafc", |
| 152 | + bodyColor: "#f1f5f9", |
| 153 | + titleFont: { weight: "700" }, |
| 154 | + bodyFont: { weight: "600" }, |
| 155 | + }; |
| 156 | + |
| 157 | + const ctxBar = document.getElementById("barChart").getContext("2d"); |
| 158 | + new Chart(ctxBar, { |
| 159 | + type: "bar", |
| 160 | + data: { |
| 161 | + labels: JSON.parse("{{BAR_LABELS_JSON}}"), |
| 162 | + datasets: [ |
| 163 | + { |
| 164 | + label: "값", |
| 165 | + data: JSON.parse("{{BAR_VALUES_JSON}}"), |
| 166 | + backgroundColor: ["rgba(54, 162, 235, 0.85)", "rgba(255, 99, 132, 0.85)"], |
| 167 | + borderColor: ["rgba(54, 162, 235, 1)", "rgba(255, 99, 132, 1)"], |
| 168 | + borderWidth: 1, |
| 169 | + }, |
| 170 | + ], |
| 171 | + }, |
| 172 | + options: { |
| 173 | + responsive: true, |
| 174 | + plugins: { |
| 175 | + legend: { display: false }, |
| 176 | + title: { display: true, text: "Commits & Churn" }, |
| 177 | + tooltip: tooltipStyle, |
| 178 | + }, |
| 179 | + scales: { y: { beginAtZero: true } }, |
| 180 | + }, |
| 181 | + }); |
| 182 | + |
| 183 | + const ctxDonut = document.getElementById("donutChart").getContext("2d"); |
| 184 | + new Chart(ctxDonut, { |
| 185 | + type: "doughnut", |
| 186 | + data: { |
| 187 | + labels: JSON.parse("{{DONUT_LABELS_JSON}}"), |
| 188 | + datasets: [ |
| 189 | + { |
| 190 | + data: JSON.parse("{{DONUT_VALUES_JSON}}"), |
| 191 | + backgroundColor: JSON.parse("{{DONUT_COLORS_JSON}}"), |
| 192 | + borderWidth: 0, |
| 193 | + }, |
| 194 | + ], |
| 195 | + }, |
| 196 | + options: { |
| 197 | + responsive: true, |
| 198 | + plugins: { |
| 199 | + legend: { position: "right" }, |
| 200 | + tooltip: tooltipStyle, |
| 201 | + }, |
| 202 | + cutout: "55%", |
| 203 | + }, |
| 204 | + }); |
| 205 | + </script> |
| 206 | + </body> |
| 207 | +</html> |
0 commit comments