wukong-gitlog-cli 1.0.38 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +1 -0
- package/.prettierrc +2 -1
- package/CHANGELOG.md +103 -0
- package/README.md +93 -173
- package/README.zh-CN.md +85 -137
- package/doc//347/233/256/345/275/225/347/273/223/346/236/204.md +2871 -0
- package/package.json +33 -29
- package/rc/.wukonggitlogrc +53 -0
- package/scripts/compareHourlyCounts.mjs +42 -0
- package/scripts/compareLatest.mjs +106 -0
- package/src/app/analyzeAction.mjs +120 -0
- package/src/app/exportAction.mjs +215 -0
- package/src/app/exportActionProgress.mjs +37 -0
- package/src/app/helpers.mjs +292 -0
- package/src/app/initAction.mjs +110 -0
- package/src/app/initActionWithTemp.mjs +192 -0
- package/src/app/journalAction.mjs +117 -0
- package/src/app/overtimeAction.mjs +100 -0
- package/src/app/runProfileEnd.mjs +0 -0
- package/src/app/serveAction.mjs +73 -0
- package/src/app/versionAction.mjs +7 -0
- package/src/cli/defineOptions.mjs +209 -0
- package/src/cli/index.mjs +0 -0
- package/src/cli/parseOptions.mjs +126 -8
- package/src/constants/index.mjs +16 -2
- package/src/domain/author/analyze.mjs +6 -0
- package/src/domain/author/map.mjs +0 -0
- package/src/domain/export/exportAuthor.mjs +28 -0
- package/src/domain/export/exportAuthorChanges.mjs +27 -0
- package/src/domain/export/exportAuthorChangesJson.mjs +31 -0
- package/src/domain/export/exportByMonth.mjs +157 -0
- package/src/domain/export/exportByWeek.mjs +121 -0
- package/src/domain/export/exportCommits.mjs +26 -0
- package/src/domain/export/exportCommitsExcel.mjs +45 -0
- package/src/domain/export/exportCommitsJson.mjs +31 -0
- package/src/domain/export/index.mjs +91 -0
- package/src/domain/git/ensureGitAvailable.mjs +66 -0
- package/src/domain/git/ensureGitRepo.mjs +41 -0
- package/src/domain/git/getGitFeatures.mjs +59 -0
- package/src/domain/git/getGitLogs.mjs +326 -0
- package/src/domain/git/getGitUser.mjs +44 -0
- package/src/domain/git/getRepoRoot.mjs +32 -0
- package/src/domain/git/gitCapability.mjs +119 -0
- package/src/domain/git/index.mjs +96 -0
- package/src/domain/git/resolveGerrit.mjs +102 -0
- package/src/domain/overtime/analyze.mjs +48 -0
- package/src/domain/overtime/index.mjs +3 -0
- package/src/domain/overtime/perPeriod.mjs +15 -0
- package/src/domain/overtime/render.mjs +15 -0
- package/src/i18n/index.mjs +38 -0
- package/src/i18n/resources.mjs +252 -0
- package/src/index.mjs +132 -649
- package/src/infra/cache.mjs +0 -0
- package/src/infra/configStore.mjs +128 -0
- package/src/infra/fs.mjs +0 -0
- package/src/infra/path.mjs +0 -0
- package/src/output/csv/overtime.mjs +12 -0
- package/src/output/csv.mjs +0 -0
- package/src/output/data/readData.mjs +54 -0
- package/src/output/data/writeData.mjs +145 -0
- package/src/output/excel/commits.mjs +9 -0
- package/src/output/excel/outputExcelDayReport.mjs +92 -0
- package/src/output/excel/perPeriod.mjs +24 -0
- package/src/{excel.mjs → output/excel.mjs} +3 -2
- package/src/output/index.mjs +79 -0
- package/src/output/json/overtime.mjs +9 -0
- package/src/output/tab/overtime.mjs +12 -0
- package/src/output/tab.mjs +0 -0
- package/src/output/text/commits.mjs +9 -0
- package/src/output/text/index.mjs +3 -0
- package/src/output/text/outputTxtDayReport.mjs +74 -0
- package/src/output/text/overtime.mjs +18 -0
- package/src/output/utils/getEsmJs.mjs +10 -0
- package/src/output/utils/index.mjs +14 -0
- package/src/output/utils/outputPath.mjs +19 -0
- package/src/output/utils/writeFile.mjs +10 -0
- package/src/serve/index.mjs +0 -0
- package/src/{server.mjs → serve/startServer.mjs} +21 -3
- package/src/serve/writeData.mjs +0 -0
- package/src/utils/authorNormalizer.mjs +28 -2
- package/src/utils/buildAuthorChangeStats.mjs +44 -0
- package/src/utils/deepMerge.mjs +13 -0
- package/src/utils/getPackage.mjs +11 -0
- package/src/utils/getProfileDirFile.mjs +12 -0
- package/src/utils/{file.mjs → groupRecords.mjs} +8 -9
- package/src/utils/index.mjs +5 -2
- package/src/utils/logger.mjs +28 -17
- package/src/utils/profiler.mjs +0 -101
- package/src/utils/resolve.mjs +11 -0
- package/src/utils/showVersionInfo.mjs +6 -2
- package/src/utils/time.mjs +0 -0
- package/src/utils/wait.mjs +2 -0
- package/web/app.js +3233 -260
- package/web/index.html +175 -22
- package/web/revoke/alpha1/app.js +4324 -0
- package/web/revoke/alpha1/index.html +266 -0
- package/web/revoke/app.before.js +3139 -0
- package/web/revoke/index-before.html +181 -0
- package/web/static/style.css +155 -9
- package/src/git.mjs +0 -256
- package/src/handlers/handleServe.mjs +0 -203
- package/src/lib/configStore.mjs +0 -11
- package/src/lib/memoize.mjs +0 -14
- package/src/utils/analyzeOvertimeCached.mjs +0 -7
- package/src/utils/checkUpdate.mjs +0 -130
- package/src/utils/exitWithTime.mjs +0 -17
- package/src/utils/handleSuccess.mjs +0 -9
- package/src/utils/logDev.mjs +0 -19
- package/src/utils/output.mjs +0 -26
- package/src/utils/profiler/diff.mjs +0 -26
- package/src/utils/profiler/format.mjs +0 -11
- package/src/utils/profiler/index.mjs +0 -144
- package/src/utils/profiler/trace.mjs +0 -26
- package/src/utils/time/scopeTimer.mjs +0 -37
- package/src/utils/time/timer.mjs +0 -33
- package/src/utils/time/withTimer.mjs +0 -11
- package/src/utils/timer.mjs +0 -35
- /package/src/{overtime → domain/overtime}/createOvertimeStats.mjs +0 -0
- /package/src/{overtime → domain/overtime}/overtime.mjs +0 -0
- /package/src/{json.mjs → output/json.mjs} +0 -0
- /package/src/{renderAuthorMapText.mjs → output/renderAuthorMapText.mjs} +0 -0
- /package/src/{stats-text.mjs → output/stats-text.mjs} +0 -0
- /package/src/{stats.mjs → output/stats.mjs} +0 -0
- /package/src/{text.mjs → output/text.mjs} +0 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
6
|
+
<title>wukong-gitlog-cli — Overtime Dashboard</title>
|
|
7
|
+
<link rel="stylesheet" href="./static/style.css" />
|
|
8
|
+
<script src="./static/echarts.min.js"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<header>
|
|
12
|
+
<h1>Wukong Gitlog Overtime Dashboard</h1>
|
|
13
|
+
<div id="samplingInfo" class="sampling-info"></div>
|
|
14
|
+
</header>
|
|
15
|
+
<main>
|
|
16
|
+
<section id="chartsHalf">
|
|
17
|
+
<div class="chart-card">
|
|
18
|
+
<h2>下班时间 vs 工作时间提交占比</h2>
|
|
19
|
+
<div id="outsideVsInsideChart" class="echart"></div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="chart-card" id="kpiCard">
|
|
22
|
+
<h2>关键指标</h2>
|
|
23
|
+
<div id="kpiContent"></div>
|
|
24
|
+
</div>
|
|
25
|
+
</section>
|
|
26
|
+
<section id="charts">
|
|
27
|
+
<div class="chart-card">
|
|
28
|
+
<h2>每小时加班分布 (小时 -> 提交数)</h2>
|
|
29
|
+
<div
|
|
30
|
+
id="hourlyOvertimeChart"
|
|
31
|
+
data-title="每小时加班分布"
|
|
32
|
+
class="echart"
|
|
33
|
+
></div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="chart-card">
|
|
37
|
+
<h2>按日提交趋势(次数)</h2>
|
|
38
|
+
<div
|
|
39
|
+
id="dailyTrendChart"
|
|
40
|
+
data-title="按日提交趋势(次数)"
|
|
41
|
+
class="echart"
|
|
42
|
+
></div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="chart-card">
|
|
45
|
+
<h2>按日提交趋势(次数)</h2>
|
|
46
|
+
<div
|
|
47
|
+
id="dailyTrendChartDog"
|
|
48
|
+
data-title="按日提交趋势"
|
|
49
|
+
class="echart"
|
|
50
|
+
></div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="chart-card">
|
|
53
|
+
<h2>每日最晚提交时间(小时)</h2>
|
|
54
|
+
<div
|
|
55
|
+
id="latestHourDailyChart"
|
|
56
|
+
data-title="每日最晚提交时间(小时)"
|
|
57
|
+
class="echart"
|
|
58
|
+
></div>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="chart-card">
|
|
61
|
+
<h2>每日超过下班的小时数</h2>
|
|
62
|
+
<div
|
|
63
|
+
id="dailySeverityChart"
|
|
64
|
+
data-title="每日超过下班的小时数"
|
|
65
|
+
class="echart"
|
|
66
|
+
></div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="chart-card">
|
|
70
|
+
<h2>每周趋势(加班占比)</h2>
|
|
71
|
+
<div
|
|
72
|
+
id="weeklyTrendChart"
|
|
73
|
+
data-title="每周趋势(加班占比)"
|
|
74
|
+
class="echart"
|
|
75
|
+
></div>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="chart-card">
|
|
78
|
+
<h2>每月趋势(加班占比)</h2>
|
|
79
|
+
<div
|
|
80
|
+
id="monthlyTrendChart"
|
|
81
|
+
data-title="每月趋势(加班占比)"
|
|
82
|
+
class="echart"
|
|
83
|
+
></div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="chart-card">
|
|
87
|
+
<div id="mostTiredDay"></div>
|
|
88
|
+
<div id="mostTiredWeek"></div>
|
|
89
|
+
<div id="mostTiredMonth"></div>
|
|
90
|
+
<div id="latestOvertimeDay"></div>
|
|
91
|
+
<div id="latestOvertimeWeek"></div>
|
|
92
|
+
<div id="latestOvertimeMonth"></div>
|
|
93
|
+
</div>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<div class="chart-card">
|
|
97
|
+
<h2>开发者 Changed 工作量趋势(行数)</h2>
|
|
98
|
+
|
|
99
|
+
<div id="tabs" class="tabs">
|
|
100
|
+
<button data-type="daily" class="active">按日</button>
|
|
101
|
+
<button data-type="weekly">按周</button>
|
|
102
|
+
<button data-type="monthly">按月</button>
|
|
103
|
+
</div>
|
|
104
|
+
<div id="chartAuthorChanges" class="echart"></div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="chart-card">
|
|
108
|
+
<h2>开发者 加班最晚趋势(小时</h2>
|
|
109
|
+
<div class="tabs" id="tabsLatestOvertime">
|
|
110
|
+
<button data-type="daily" class="active">按日</button>
|
|
111
|
+
<button data-type="weekly">按周</button>
|
|
112
|
+
<button data-type="monthly">按月</button>
|
|
113
|
+
</div>
|
|
114
|
+
<div id="chartAuthorLatestOvertime" class="echart"></div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="chart-card">
|
|
118
|
+
<h2>开发者 加班趋势(次数)</h2>
|
|
119
|
+
<div class="tabs" id="tabsOvertime">
|
|
120
|
+
<button data-type="daily" class="active">按日</button>
|
|
121
|
+
<button data-type="weekly">按周</button>
|
|
122
|
+
<button data-type="monthly">按月</button>
|
|
123
|
+
</div>
|
|
124
|
+
<div id="chartAuthorOvertime" class="echart"></div>
|
|
125
|
+
<div id="weeklyRiskSummary" class="risk-summary-box"></div>
|
|
126
|
+
<div id="monthlyRiskSummary" class="risk-summary-box"></div>
|
|
127
|
+
<div id="weeklyDurationRankSummary" class="risk-summary-box"></div>
|
|
128
|
+
<div id="weeklyDurationRiskSummary" class="risk-summary-box"></div>
|
|
129
|
+
<div id="monthlyDurationRankSummary" class="risk-summary-box"></div>
|
|
130
|
+
<div id="monthlyDurationRiskSummary" class="risk-summary-box"></div>
|
|
131
|
+
<div id="rolling30DurationRiskSummary" class="risk-summary-box"></div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div class="chart-card">
|
|
135
|
+
<h2>开发者 午休最晚提交(小时)</h2>
|
|
136
|
+
<div class="tabs" id="tabsLunch">
|
|
137
|
+
<button data-type="daily" class="active">按日</button>
|
|
138
|
+
<button data-type="weekly">按周</button>
|
|
139
|
+
<button data-type="monthly">按月</button>
|
|
140
|
+
</div>
|
|
141
|
+
<div id="chartAuthorLunch" class="echart"></div>
|
|
142
|
+
<div id="lunchWeeklyRankSummary" class="risk-summary-box"></div>
|
|
143
|
+
<div id="lunchWeeklyRiskSummary" class="risk-summary-box"></div>
|
|
144
|
+
<div id="lunchMonthlyRankSummary" class="risk-summary-box"></div>
|
|
145
|
+
<div id="lunchMonthlyRiskSummary" class="risk-summary-box"></div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="chart-card">
|
|
149
|
+
<h2>开发者 累计加班时长</h2>
|
|
150
|
+
<div class="tabs" id="tabsTotalOvertime">
|
|
151
|
+
<button data-type="daily" class="active">按日</button>
|
|
152
|
+
<button data-type="weekly">按周</button>
|
|
153
|
+
<button data-type="monthly">按月</button>
|
|
154
|
+
<button data-type="yearly">按年</button>
|
|
155
|
+
</div>
|
|
156
|
+
<div id="chartAuthorTotalOvertime" class="echart"></div>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<div class="chart-card">
|
|
160
|
+
<h2>开发者加班时长统计</h2>
|
|
161
|
+
|
|
162
|
+
<!-- 加班类型切换 -->
|
|
163
|
+
<div class="tabs" id="tabsOvertimeType">
|
|
164
|
+
<button data-ot="lunch" class="active">午休加班</button>
|
|
165
|
+
<button data-ot="after">下班后加班</button>
|
|
166
|
+
<button data-ot="night">凌晨加班</button>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<!-- 统计周期切换 -->
|
|
170
|
+
<div class="tabs" id="tabsTotalLunchOvertime">
|
|
171
|
+
<button data-type="daily" class="active">按日</button>
|
|
172
|
+
<button data-type="weekly">按周</button>
|
|
173
|
+
<button data-type="monthly">按月</button>
|
|
174
|
+
<button data-type="yearly">按年</button>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<!-- 图表 -->
|
|
178
|
+
<div
|
|
179
|
+
id="chartAuthorTotalLunchOvertime"
|
|
180
|
+
class="echart"
|
|
181
|
+
style="width: 100%; height: 420px"
|
|
182
|
+
></div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<section class="chartsHalf">
|
|
186
|
+
<div class="chart-card">
|
|
187
|
+
<h2>开发者 加班总时长</h2>
|
|
188
|
+
<div id="authorTotalOvertimeRank" class="rank-list"></div>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="chart-card">
|
|
191
|
+
<h2>开发者 加班总时长</h2>
|
|
192
|
+
<div id="authorTotalOvertimeRankSummary"></div>
|
|
193
|
+
</div>
|
|
194
|
+
</section>
|
|
195
|
+
|
|
196
|
+
<!-- <div class="chart-card">
|
|
197
|
+
<h2>开发者 加班总时长</h2>
|
|
198
|
+
<div class="box-flex">
|
|
199
|
+
<div id="authorTotalOvertimeRank" class="rank-list"></div>
|
|
200
|
+
<div id="authorTotalOvertimeRankSummary"></div>
|
|
201
|
+
</div>
|
|
202
|
+
</div> -->
|
|
203
|
+
|
|
204
|
+
<section class="table-card">
|
|
205
|
+
<h2>提交清单</h2>
|
|
206
|
+
<div id="tableControls">
|
|
207
|
+
<input
|
|
208
|
+
id="searchInput"
|
|
209
|
+
type="search"
|
|
210
|
+
placeholder="搜索作者/信息/Hash/Date"
|
|
211
|
+
/>
|
|
212
|
+
<input type="date" id="startDate" />
|
|
213
|
+
<span>~</span>
|
|
214
|
+
<input type="date" id="endDate" />
|
|
215
|
+
<button id="clearDate">清除</button>
|
|
216
|
+
<label for="pageSize">每页显示</label>
|
|
217
|
+
<select id="pageSize">
|
|
218
|
+
<option value="10">10</option>
|
|
219
|
+
<option value="20">20</option>
|
|
220
|
+
<option value="50">50</option>
|
|
221
|
+
<option value="100">100</option>
|
|
222
|
+
</select>
|
|
223
|
+
<label id="commitsTotal"></label>
|
|
224
|
+
<div class="pager">
|
|
225
|
+
<button id="prevPage">上一页</button>
|
|
226
|
+
<span id="pageInfo"></span>
|
|
227
|
+
<button id="nextPage">下一页</button>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
<table id="commitsTable">
|
|
231
|
+
<thead>
|
|
232
|
+
<tr>
|
|
233
|
+
<th>Hash</th>
|
|
234
|
+
<th>Author</th>
|
|
235
|
+
<th>Email</th>
|
|
236
|
+
<th>Date</th>
|
|
237
|
+
<th>Message</th>
|
|
238
|
+
<th>CherryPick</th>
|
|
239
|
+
<th>Changed</th>
|
|
240
|
+
</tr>
|
|
241
|
+
</thead>
|
|
242
|
+
<tbody></tbody>
|
|
243
|
+
</table>
|
|
244
|
+
</section>
|
|
245
|
+
</main>
|
|
246
|
+
<footer>
|
|
247
|
+
<small
|
|
248
|
+
>Local dashboard generated by wukong-gitlog-cli. Data served from
|
|
249
|
+
<code>/data/</code>.</small
|
|
250
|
+
>
|
|
251
|
+
</footer>
|
|
252
|
+
<!-- 通用:右侧滑出的详情侧栏(小时 / 天 / 周 复用同一个 DOM) -->
|
|
253
|
+
<!-- 背景遮罩,点击可关闭侧栏 -->
|
|
254
|
+
<div id="sidebarBackdrop" class="sidebar-backdrop"></div>
|
|
255
|
+
<div id="dayDetailSidebar" class="sidebar">
|
|
256
|
+
<div class="sidebar-header">
|
|
257
|
+
<span id="sidebarDrawerTitle"></span>
|
|
258
|
+
<button id="sidebarClose">×</button>
|
|
259
|
+
</div>
|
|
260
|
+
<div id="sidebarTitle"></div>
|
|
261
|
+
<div id="sidebarContent" class="sidebar-content"></div>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<script type="module" src="/app.js"></script>
|
|
265
|
+
</body>
|
|
266
|
+
</html>
|