@shiqyka/dsh-git-graph 0.0.0-stage → 0.26.2
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/LICENSE +21 -0
- package/README.md +139 -2
- package/README_EN.md +140 -0
- package/client.js +64 -0
- package/cordis.patch.yml +21 -0
- package/index.js +1545 -0
- package/package.json +64 -4
- package/web/app.css +1194 -0
- package/web/app.js +4374 -0
- package/web/index.html +258 -0
package/web/index.html
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Git 图谱</title>
|
|
6
|
+
<link rel="stylesheet" href="app.css">
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<!-- Shown until app.js boots and confirms the stylesheet applied. Covers the
|
|
10
|
+
case where the page is newer than the running index.js (which happens
|
|
11
|
+
after an update but before dsh web is restarted): index.html is read from
|
|
12
|
+
disk on every request, but the route for app.css/app.js only exists in the
|
|
13
|
+
new server code, so both 404 and the page renders unstyled and inert.
|
|
14
|
+
Kept as plain markup with no style attribute on purpose — it must remain
|
|
15
|
+
readable precisely when the stylesheet did NOT load. -->
|
|
16
|
+
<div id="bootFail">
|
|
17
|
+
<b>Git 图谱未能加载</b>
|
|
18
|
+
<p>页面骨架已返回,但样式表或脚本没有取到。最常见的原因是插件已更新、而 <code>dsh web</code> 还在运行旧的服务端代码(新版本才注册 <code>app.css</code> / <code>app.js</code> 的路由)。<b>重启 dsh web 即可恢复。</b></p>
|
|
19
|
+
<p>如果重启后仍是这个页面,请检查浏览器控制台里这两个请求是否 404。</p>
|
|
20
|
+
</div>
|
|
21
|
+
<div id="ggDeco" aria-hidden="true"></div>
|
|
22
|
+
<header>
|
|
23
|
+
<div class="hd-left">
|
|
24
|
+
<span class="title">Git 图谱</span>
|
|
25
|
+
<span class="repo" id="repoLabel" title=""></span>
|
|
26
|
+
<select id="repoSwitch" title="切换仓库"></select>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="hd-center">
|
|
30
|
+
<div class="filterWrap">
|
|
31
|
+
<button id="btnFilter" class="pill-btn" title="选择显示哪些分支" aria-label="分支过滤" aria-haspopup="true" aria-expanded="false" aria-controls="filterMenu">
|
|
32
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
33
|
+
<path d="M4 6h16M7 12h10M10 18h4"/>
|
|
34
|
+
</svg>
|
|
35
|
+
<span>分支过滤</span>
|
|
36
|
+
</button>
|
|
37
|
+
<div id="filterMenu">
|
|
38
|
+
<label class="fm-all"><input type="checkbox" id="fAll" checked> 全选(显示全部提交)</label>
|
|
39
|
+
<div class="fm-hint">勾选 = 显示该分支 · 不勾 = 隐藏</div>
|
|
40
|
+
<div id="fmBranches"></div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="dateWrap">
|
|
44
|
+
<button id="btnDate" class="pill-btn" title="按提交日期筛选" aria-label="日期筛选" aria-haspopup="dialog" aria-expanded="false" aria-controls="dateMenu">
|
|
45
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
46
|
+
<rect x="3.5" y="5" width="17" height="15.5" rx="2.5"/><path d="M3.5 10h17M8 3v4M16 3v4"/>
|
|
47
|
+
</svg>
|
|
48
|
+
<span>日期</span>
|
|
49
|
+
</button>
|
|
50
|
+
<div id="dateMenu">
|
|
51
|
+
<div class="dm-title">
|
|
52
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
53
|
+
<rect x="3.5" y="5" width="17" height="15.5" rx="2.5"/><path d="M3.5 10h17M8 3v4M16 3v4"/>
|
|
54
|
+
</svg>
|
|
55
|
+
<span>按提交日期筛选</span>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="dm-fields">
|
|
58
|
+
<button type="button" class="dm-chip" id="dateFromChip" aria-label="设置起始日期" aria-pressed="true">
|
|
59
|
+
<span class="dm-chip-k">从</span>
|
|
60
|
+
<span class="dm-chip-v" id="dateFromVal">不限</span>
|
|
61
|
+
</button>
|
|
62
|
+
<button type="button" class="dm-chip" id="dateToChip" aria-label="设置结束日期" aria-pressed="false">
|
|
63
|
+
<span class="dm-chip-k">到</span>
|
|
64
|
+
<span class="dm-chip-v" id="dateToVal">不限</span>
|
|
65
|
+
</button>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="dm-cal">
|
|
68
|
+
<div class="dm-cal-head">
|
|
69
|
+
<button type="button" class="dm-nav" id="dmPrevY" aria-label="上一年">
|
|
70
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 6l-6 6 6 6M19 6l-6 6 6 6"/></svg>
|
|
71
|
+
</button>
|
|
72
|
+
<button type="button" class="dm-nav" id="dmPrev" aria-label="上个月">
|
|
73
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 5l-7 7 7 7"/></svg>
|
|
74
|
+
</button>
|
|
75
|
+
<span class="dm-cal-title" id="dmTitle" aria-live="polite"></span>
|
|
76
|
+
<button type="button" class="dm-nav" id="dmNext" aria-label="下个月">
|
|
77
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 5l7 7-7 7"/></svg>
|
|
78
|
+
</button>
|
|
79
|
+
<button type="button" class="dm-nav" id="dmNextY" aria-label="下一年">
|
|
80
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 6l6 6-6 6M5 6l6 6-6 6"/></svg>
|
|
81
|
+
</button>
|
|
82
|
+
<button type="button" class="dm-today" id="dmToday">今天</button>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="dm-cal-wd" aria-hidden="true">
|
|
85
|
+
<span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span><span>日</span>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="dm-cal-grid" id="dmGrid" role="group" aria-label="日期"></div>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="dm-quick">
|
|
90
|
+
<button type="button" data-days="7">近 7 天</button>
|
|
91
|
+
<button type="button" data-days="30">近 30 天</button>
|
|
92
|
+
<button type="button" data-days="90">近 90 天</button>
|
|
93
|
+
<button type="button" data-days="365">近一年</button>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="dm-hint">只填一端 = 单侧边界;都空 = 不限时间</div>
|
|
96
|
+
<div class="dm-foot">
|
|
97
|
+
<button id="dateClear">清除</button>
|
|
98
|
+
<button id="dateApply">关闭</button>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="searchWrap">
|
|
103
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" focusable="false" aria-hidden="true">
|
|
104
|
+
<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>
|
|
105
|
+
</svg>
|
|
106
|
+
<input id="searchBox" type="text" placeholder="搜索提交(消息/作者/哈希)…" aria-label="搜索提交">
|
|
107
|
+
</div>
|
|
108
|
+
<span id="searchCount"></span>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div class="hd-right">
|
|
112
|
+
<button id="btnOpenDir" class="icon-btn" title="打开文件夹:浏览磁盘,把任意 Git 仓库添加进来" aria-label="打开文件夹">
|
|
113
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
114
|
+
<path d="M3 7.5A2 2 0 0 1 5 5.5h3.6a2 2 0 0 1 1.5.7l.9 1.1H19a2 2 0 0 1 2 2v7.2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
|
|
115
|
+
</svg>
|
|
116
|
+
</button>
|
|
117
|
+
<button id="btnFetch" class="icon-btn" title="拉取远程更新(git fetch --all --prune)" aria-label="拉取">
|
|
118
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
119
|
+
<path d="M12 4v10.5M7.5 10.5L12 15l4.5-4.5M4.5 19h15"/>
|
|
120
|
+
</svg>
|
|
121
|
+
</button>
|
|
122
|
+
<button id="btnPush" class="icon-btn" title="推送当前分支到远程(git push)" aria-label="推送">
|
|
123
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
124
|
+
<path d="M12 20V9.5M7.5 13.5L12 9l4.5 4.5M4.5 5h15"/>
|
|
125
|
+
</svg>
|
|
126
|
+
</button>
|
|
127
|
+
<button id="btnRefresh" class="icon-btn" title="重新加载(刷新仓库数据)" aria-label="刷新">
|
|
128
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
129
|
+
<path d="M20 12a8 8 0 1 1-2.6-5.9"/>
|
|
130
|
+
<path d="M20 4.5V9h-4.5"/>
|
|
131
|
+
</svg>
|
|
132
|
+
</button>
|
|
133
|
+
<button id="btnUpdate" class="icon-btn gg-none" title="检查插件新版本" aria-label="检查更新">
|
|
134
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
135
|
+
<path d="M12 2.8 4 7.1v9.8L12 21.2l8-4.3V7.1z"/>
|
|
136
|
+
<path d="M4 7.1 12 11.4l8-4.3M12 11.4v9.8"/>
|
|
137
|
+
</svg>
|
|
138
|
+
</button>
|
|
139
|
+
<span class="hd-sep" aria-hidden="true"></span>
|
|
140
|
+
<button id="btnSettings" class="icon-btn" title="设置(视图、主题、快捷键)" aria-label="设置">
|
|
141
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
|
|
142
|
+
<circle cx="12" cy="12" r="3.1"/>
|
|
143
|
+
<path d="M12.6 2.6h-1.2a1.9 1.9 0 0 0-1.9 1.9v.5a1.5 1.5 0 0 1-.8 1.3 1.5 1.5 0 0 1-1.5-.1l-.4-.2a1.9 1.9 0 0 0-2.6.7l-.6 1a1.9 1.9 0 0 0 .7 2.6l.4.3a1.5 1.5 0 0 1 0 2.6l-.4.3a1.9 1.9 0 0 0-.7 2.6l.6 1a1.9 1.9 0 0 0 2.6.7l.4-.2a1.5 1.5 0 0 1 1.5-.1 1.5 1.5 0 0 1 .8 1.3v.5a1.9 1.9 0 0 0 1.9 1.9h1.2a1.9 1.9 0 0 0 1.9-1.9v-.5a1.5 1.5 0 0 1 .8-1.3 1.5 1.5 0 0 1 1.5.1l.4.2a1.9 1.9 0 0 0 2.6-.7l.6-1a1.9 1.9 0 0 0-.7-2.6l-.4-.3a1.5 1.5 0 0 1 0-2.6l.4-.3a1.9 1.9 0 0 0 .7-2.6l-.6-1a1.9 1.9 0 0 0-2.6-.7l-.4.2a1.5 1.5 0 0 1-1.5.1 1.5 1.5 0 0 1-.8-1.3v-.5a1.9 1.9 0 0 0-1.9-1.9z"/>
|
|
144
|
+
</svg>
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
147
|
+
</header>
|
|
148
|
+
<div id="statsBar"></div>
|
|
149
|
+
<div id="main">
|
|
150
|
+
<div id="graphWrap">
|
|
151
|
+
<div id="legend"></div>
|
|
152
|
+
<div id="loading">加载中…</div>
|
|
153
|
+
<div id="emptyState" class="hidden">
|
|
154
|
+
<div class="es-ico">🗂️</div>
|
|
155
|
+
<div class="es-title" id="esTitle">当前对话区域不是 Git 仓库</div>
|
|
156
|
+
<div class="es-sub" id="esSub">该对话的工作区没有 git 仓库。可以点击下方按钮浏览并打开其他文件夹的 Git 仓库。</div>
|
|
157
|
+
<button id="btnOpenDirEmpty" class="es-open" title="浏览磁盘,选择任意文件夹作为 Git 仓库显示">📂 打开文件夹</button>
|
|
158
|
+
<button id="btnScanDir" class="es-open es-scan gg-none" title="在当前对话目录及其子目录中查找 Git 仓库">🖥 在当前对话目录下查找 Git 仓库</button>
|
|
159
|
+
<div id="scanResults" class="es-scan-list"></div>
|
|
160
|
+
<div class="es-path" id="emptyPath"></div>
|
|
161
|
+
</div>
|
|
162
|
+
<div id="wdPanel"></div>
|
|
163
|
+
<div id="commitList"></div>
|
|
164
|
+
</div>
|
|
165
|
+
<div id="detailGrip" title="拖动调整详情宽度(双击恢复默认)" role="separator" aria-orientation="vertical" tabindex="-1"></div>
|
|
166
|
+
<div id="detail">
|
|
167
|
+
<div class="dhead">
|
|
168
|
+
<span class="dtitle" id="dTitle">提交详情</span>
|
|
169
|
+
<button class="dclose" id="dClose" title="关闭">✕</button>
|
|
170
|
+
</div>
|
|
171
|
+
<div id="dContent"></div>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
<div id="statusLine"></div>
|
|
175
|
+
<div id="ctxMenu"></div>
|
|
176
|
+
<div id="ggDlg">
|
|
177
|
+
<div class="dlg-box">
|
|
178
|
+
<div class="dlg-head"><span class="dlg-ico">⚠️</span><span id="ggDlgTitle">确认操作</span></div>
|
|
179
|
+
<div class="dlg-body" id="ggDlgBody"></div>
|
|
180
|
+
<div class="dlg-foot"><button id="ggDlgCancel">取消</button><button id="ggDlgOk" class="primary">确认</button></div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
<div id="commitDlg">
|
|
184
|
+
<div class="dlg-box">
|
|
185
|
+
<div class="dlg-head"><span class="dlg-ico">📝</span>提交更改</div>
|
|
186
|
+
<div class="dlg-body" id="commitDlgBody"></div>
|
|
187
|
+
<div class="dlg-foot"><button id="commitDlgCancel">取消</button><button id="commitDlgOk" class="primary">提交</button></div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
<div id="tagDlg">
|
|
191
|
+
<div class="dlg-box">
|
|
192
|
+
<div class="dlg-head"><span class="dlg-ico">🏷️</span>打标签</div>
|
|
193
|
+
<div class="dlg-body" id="tagDlgBody"></div>
|
|
194
|
+
<div class="dlg-foot"><button id="tagDlgCancel">取消</button><button id="tagDlgOk" class="primary">创建标签</button></div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
<div id="branchDlg">
|
|
198
|
+
<div class="dlg-box">
|
|
199
|
+
<div class="dlg-head"><span class="dlg-ico">🌿</span>从此提交新建分支</div>
|
|
200
|
+
<div class="dlg-body" id="branchDlgBody"></div>
|
|
201
|
+
<div class="dlg-foot"><button id="branchDlgCancel">取消</button><button id="branchDlgOk" class="primary">创建分支</button></div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
<div id="shortcutDlg">
|
|
205
|
+
<div class="dlg-box">
|
|
206
|
+
<div class="dlg-head"><span class="dlg-ico">⌨️</span>快捷键</div>
|
|
207
|
+
<div class="dlg-body" id="shortcutDlgBody"></div>
|
|
208
|
+
<div class="dlg-foot"><button id="shortcutDlgClose">关闭</button></div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
<div id="pickdirDlg">
|
|
212
|
+
<div class="dlg-box pd-box">
|
|
213
|
+
<div class="dlg-head"><span class="dlg-ico">📂</span>打开文件夹<span class="pd-path" id="pdPath"></span></div>
|
|
214
|
+
<div class="dlg-body">
|
|
215
|
+
<div class="pd-bar">
|
|
216
|
+
<button id="pdUp" title="上一级目录">⬆ 上一级</button>
|
|
217
|
+
<span class="pd-spacer"></span>
|
|
218
|
+
<span id="pdHint"></span>
|
|
219
|
+
<button id="pdOpen" class="primary" title="把该文件夹添加为 Git 仓库并显示其图谱" disabled>打开此文件夹</button>
|
|
220
|
+
</div>
|
|
221
|
+
<div class="pd-list" id="pdList"></div>
|
|
222
|
+
<div class="pd-tip">绿色的 <span class="pd-tip-git">git</span> 标记表示该文件夹本身是 Git 仓库;选中仓库内的子文件夹也会自动定位到仓库根。</div>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="dlg-foot"><button id="pdClose">关闭</button></div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
<div id="settingsDlg">
|
|
228
|
+
<div class="dlg-box">
|
|
229
|
+
<div class="dlg-head"><span class="dlg-ico">⚙️</span>设置</div>
|
|
230
|
+
<div class="dlg-body">
|
|
231
|
+
<div class="st-section">
|
|
232
|
+
<div class="st-label">视图</div>
|
|
233
|
+
<div class="st-seg" id="stView">
|
|
234
|
+
<button type="button" data-view="grouped">
|
|
235
|
+
<span class="se-t">按分支分组</span>
|
|
236
|
+
<span class="se-d">组头可折叠,不画泳道</span>
|
|
237
|
+
</button>
|
|
238
|
+
<button type="button" data-view="flat">
|
|
239
|
+
<span class="se-t">平铺</span>
|
|
240
|
+
<span class="se-d">按时间线排列,左侧画泳道</span>
|
|
241
|
+
</button>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div class="st-section">
|
|
245
|
+
<div class="st-label">主题</div>
|
|
246
|
+
<div class="st-themes" id="stThemes"></div>
|
|
247
|
+
<div class="st-note">「自动」跟随 DSH 界面的深浅色;8 种风格方案各带专属动态背景。</div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
<div class="dlg-foot">
|
|
251
|
+
<button id="stShortcut">快捷键</button>
|
|
252
|
+
<button id="stClose">关闭</button>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
<script src="app.js"></script>
|
|
257
|
+
</body>
|
|
258
|
+
</html>
|