wukong-gitlog-cli 1.0.38 → 1.0.39

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.39](https://github.com/tomatobybike/wukong-gitlog-cli/compare/v1.0.38...v1.0.39) (2025-12-29)
6
+
7
+
8
+ ### Features
9
+
10
+ * 🎸 web report add date filter ([d5968d8](https://github.com/tomatobybike/wukong-gitlog-cli/commit/d5968d8222aa1129e60894234ac9fca6c91e5a73))
11
+ * 🎸 wukong-gitlog command entry ([48b5698](https://github.com/tomatobybike/wukong-gitlog-cli/commit/48b569842114cd11336ee23580104048342e085b))
12
+
5
13
  ### [1.0.38](https://github.com/tomatobybike/wukong-gitlog-cli/compare/v1.0.37...v1.0.38) (2025-12-27)
6
14
 
7
15
 
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wukong-gitlog-cli",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Advanced Git commit log exporter with Excel/JSON/TXT output, grouping, stats and CLI.",
5
5
  "keywords": [
6
6
  "git",
@@ -34,6 +34,7 @@
34
34
  "author": "Tom <tomatobybike@gmail.com>",
35
35
  "type": "module",
36
36
  "bin": {
37
+ "wukong-gitlog": "./bin/wukong-gitlog-cli",
37
38
  "wukong-gitlog-cli": "./bin/wukong-gitlog-cli"
38
39
  },
39
40
  "scripts": {
@@ -105,7 +106,7 @@
105
106
  "ora": "9.0.0",
106
107
  "semver": "6.3.1",
107
108
  "string-width": "5.1.2",
108
- "wukong-profiler": "^1.0.5",
109
+ "wukong-profiler": "^1.0.6",
109
110
  "zx": "7.2.4"
110
111
  },
111
112
  "devDependencies": {
package/web/app.js CHANGED
@@ -3,6 +3,22 @@
3
3
  /* global echarts */
4
4
  const formatDate = (d) => new Date(d).toLocaleString()
5
5
 
6
+ function filterByDate(commits) {
7
+ const start = document.getElementById('startDate')?.value
8
+ const end = document.getElementById('endDate')?.value
9
+
10
+ if (!start && !end) return commits
11
+
12
+ const startTime = start ? new Date(`${start}T00:00:00`).getTime() : -Infinity
13
+
14
+ const endTime = end ? new Date(`${end}T23:59:59`).getTime() : Infinity
15
+
16
+ return commits.filter((c) => {
17
+ const t = new Date(c.date).getTime()
18
+ return t >= startTime && t <= endTime
19
+ })
20
+ }
21
+
6
22
  // ISO 周 key:YYYY-Www
7
23
  function getIsoWeekKey(dStr) {
8
24
  const d = new Date(dStr)
@@ -100,7 +116,8 @@ function renderCommitsTablePage() {
100
116
  tr.innerHTML = `<td>${c.hash.slice(0, 8)}</td><td>${c.author}</td><td>${c.email}</td><td>${formatDate(c.date)}</td><td>${c.message}</td><td>${c.changed}</td>`
101
117
  tbody.appendChild(tr)
102
118
  })
103
- document.getElementById('commitsTotal').textContent = `共${filtered.length}条记录`
119
+ document.getElementById('commitsTotal').textContent =
120
+ `共${filtered.length}条记录`
104
121
  }
105
122
 
106
123
  function updatePager() {
@@ -115,16 +132,25 @@ function updatePager() {
115
132
  function applySearch() {
116
133
  const q = document.getElementById('searchInput').value.trim().toLowerCase()
117
134
 
135
+ // ① 先做日期过滤
136
+ const base = filterByDate(commitsAll)
137
+
118
138
  if (!q) {
119
- filtered = commitsAll.slice()
139
+ filtered = base.slice()
120
140
  } else {
121
- filtered = commitsAll.filter((c) => {
141
+ filtered = base.filter((c) => {
122
142
  const h = c.hash.toLowerCase()
123
143
  const a = String(c.author || '').toLowerCase()
124
144
  const e = String(c.email || '').toLowerCase()
125
145
  const m = String(c.message || '').toLowerCase()
126
146
  const d = formatDate(c.date).toLowerCase()
127
- return h.includes(q) || a.includes(q)|| e.includes(q) || m.includes(q) || d.includes(q)
147
+ return (
148
+ h.includes(q) ||
149
+ a.includes(q) ||
150
+ e.includes(q) ||
151
+ m.includes(q) ||
152
+ d.includes(q)
153
+ )
128
154
  })
129
155
  }
130
156
  page = 1
@@ -134,6 +160,13 @@ function applySearch() {
134
160
 
135
161
  function initTableControls() {
136
162
  document.getElementById('searchInput').addEventListener('input', applySearch)
163
+ document.getElementById('startDate')?.addEventListener('change', applySearch)
164
+ document.getElementById('endDate')?.addEventListener('change', applySearch)
165
+ document.getElementById('clearDate')?.addEventListener('click', () => {
166
+ document.getElementById('startDate').value = ''
167
+ document.getElementById('endDate').value = ''
168
+ applySearch()
169
+ })
137
170
  document.getElementById('pageSize').addEventListener('change', (e) => {
138
171
  pageSize = parseInt(e.target.value, 10) || 10
139
172
  page = 1
package/web/index.html CHANGED
@@ -109,6 +109,10 @@
109
109
  type="search"
110
110
  placeholder="搜索作者/信息/Hash/Date"
111
111
  />
112
+ <input type="date" id="startDate" />
113
+ <span>~</span>
114
+ <input type="date" id="endDate" />
115
+ <button id="clearDate">清除</button>
112
116
  <label for="pageSize">每页显示</label>
113
117
  <select id="pageSize">
114
118
  <option value="10">10</option>
@@ -139,6 +139,45 @@ td {
139
139
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
140
140
  outline: none;
141
141
  }
142
+ #tableControls input[type='date'] {
143
+ padding: 9px 12px;
144
+ border-radius: 8px;
145
+ border: 1px solid #ccc;
146
+ background: #fafafa;
147
+ font-size: 13px;
148
+ color: #111827;
149
+ transition:
150
+ border-color 0.2s,
151
+ box-shadow 0.2s;
152
+ }
153
+
154
+ #tableControls input[type='date']:focus {
155
+ border-color: #1976d2;
156
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
157
+ outline: none;
158
+ }
159
+ /* 清除日期按钮 ------------------------------------------ */
160
+ #clearDate {
161
+ padding: 8px 10px;
162
+ border-radius: 8px;
163
+ border: none;
164
+ background: transparent;
165
+ color: #64748b; /* slate-500 */
166
+ font-size: 13px;
167
+ cursor: pointer;
168
+ transition:
169
+ color 0.2s ease,
170
+ background 0.2s ease;
171
+ }
172
+
173
+ #clearDate:hover {
174
+ color: #ef4444; /* red-500 */
175
+ background: rgba(239, 68, 68, 0.08);
176
+ }
177
+
178
+ #clearDate:active {
179
+ background: rgba(239, 68, 68, 0.16);
180
+ }
142
181
 
143
182
  /* 按钮 — MUI Button 风格 */
144
183
  .pager button {