zen-gitsync 2.11.11 → 2.11.12
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/package.json +1 -1
- package/src/config.js +9 -3
- package/src/ui/public/assets/{index-DqUSf7QD.css → index-BVWHnypR.css} +1 -1
- package/src/ui/public/assets/index-BWl1xzuJ.js +108 -0
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/routes/config.js +1 -1
- package/src/ui/server/routes/gitOps.js +17 -0
- package/src/ui/public/assets/index-E1drpG4m.js +0 -108
package/src/ui/public/index.html
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
11
11
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
12
12
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-BWl1xzuJ.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/vendor-BtihdyTS.js">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/vendor-CeElb63i.css">
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BVWHnypR.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="app"></div>
|
|
@@ -937,6 +937,23 @@ export function registerGitOpsRoutes({
|
|
|
937
937
|
}
|
|
938
938
|
});
|
|
939
939
|
|
|
940
|
+
// 获取提交完整 diff(用于复制提交内容)
|
|
941
|
+
app.get('/api/commit-diff-full', async (req, res) => {
|
|
942
|
+
try {
|
|
943
|
+
const hash = req.query.hash;
|
|
944
|
+
if (!hash) {
|
|
945
|
+
return res.status(400).json({ success: false, error: '缺少提交哈希参数' });
|
|
946
|
+
}
|
|
947
|
+
const { stdout } = await execGitCommand(`git show ${hash}`);
|
|
948
|
+
// 限制最大 200KB 防止内容过大
|
|
949
|
+
const MAX = 200 * 1024;
|
|
950
|
+
const content = stdout.length > MAX ? stdout.slice(0, MAX) + '\n\n[内容过大,已截断]' : stdout;
|
|
951
|
+
res.json({ success: true, content });
|
|
952
|
+
} catch (error) {
|
|
953
|
+
res.status(500).json({ success: false, error: `获取提交内容失败: ${error.message}` });
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
|
|
940
957
|
// 添加清理Git锁定文件的接口
|
|
941
958
|
app.post('/api/remove-lock', async (req, res) => {
|
|
942
959
|
try {
|