zen-gitsync 2.8.3 → 2.8.4
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/ui/public/assets/index-BvQ7ApK7.css +1 -0
- package/src/ui/public/assets/index-DG746PgG.js +78 -0
- package/src/ui/public/assets/{vendor-BZoR2k4d.js → vendor-DTe_17Fm.js} +1 -1
- package/src/ui/public/index.html +3 -3
- package/src/ui/server/index.js +43 -0
- package/src/ui/public/assets/index-C9p4J1dI.css +0 -1
- package/src/ui/public/assets/index-mVMo_U3z.js +0 -78
package/src/ui/public/index.html
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>Zen GitSync</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DG746PgG.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-DTe_17Fm.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/vendor-BWT9SBHo.css">
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BvQ7ApK7.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="app"></div>
|
package/src/ui/server/index.js
CHANGED
|
@@ -3567,6 +3567,49 @@ async function startUIServer(noOpen = false, savePort = false) {
|
|
|
3567
3567
|
}
|
|
3568
3568
|
});
|
|
3569
3569
|
|
|
3570
|
+
// 保存部分文件的stash
|
|
3571
|
+
app.post('/api/stash-save-partial', async (req, res) => {
|
|
3572
|
+
try {
|
|
3573
|
+
const { files, message, includeUntracked } = req.body;
|
|
3574
|
+
|
|
3575
|
+
if (!files || !Array.isArray(files) || files.length === 0) {
|
|
3576
|
+
return res.json({ success: false, message: '请选择要储藏的文件' });
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
// 构建 git stash push 命令
|
|
3580
|
+
let command = 'git stash push';
|
|
3581
|
+
if (message) {
|
|
3582
|
+
command += ` -m "${message}"`;
|
|
3583
|
+
}
|
|
3584
|
+
if (includeUntracked) {
|
|
3585
|
+
command += ' --include-untracked';
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
// 添加文件列表
|
|
3589
|
+
const args = files.map(f => `"${f}"`).join(' ');
|
|
3590
|
+
command += ` -- ${args}`;
|
|
3591
|
+
|
|
3592
|
+
const { stdout } = await execGitCommand(command);
|
|
3593
|
+
|
|
3594
|
+
if (stdout.includes('No local changes to save')) {
|
|
3595
|
+
return res.json({ success: false, message: '没有本地更改需要保存' });
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
res.json({
|
|
3599
|
+
success: true,
|
|
3600
|
+
message: `成功储藏 ${files.length} 个文件`,
|
|
3601
|
+
output: stdout
|
|
3602
|
+
});
|
|
3603
|
+
} catch (error) {
|
|
3604
|
+
const msg = error?.message || '';
|
|
3605
|
+
if (msg.includes('No valid patches in input')) {
|
|
3606
|
+
return res.json({ success: false, message: '没有可储藏的更改' });
|
|
3607
|
+
}
|
|
3608
|
+
console.error('保存部分stash失败:', error);
|
|
3609
|
+
res.status(500).json({ success: false, error: error.message });
|
|
3610
|
+
}
|
|
3611
|
+
});
|
|
3612
|
+
|
|
3570
3613
|
// 应用特定的stash
|
|
3571
3614
|
app.post('/api/stash-apply', async (req, res) => {
|
|
3572
3615
|
try {
|