zen-gitsync 2.11.7 → 2.11.8
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/README.md +1 -1
- package/package.json +1 -1
- package/src/ui/public/assets/index-Ce26lMsG.css +1 -0
- package/src/ui/public/assets/index-DWV3mQ48.js +108 -0
- package/src/ui/public/assets/{vendor-BSAE54oX.js → vendor-BtihdyTS.js} +240 -233
- package/src/ui/public/assets/vendor-CeElb63i.css +1 -0
- package/src/ui/public/index.html +4 -4
- package/src/ui/server/routes/gitOps.js +18 -0
- package/src/ui/public/assets/index-CCP21wC3.js +0 -108
- package/src/ui/public/assets/index-DTMhEG-O.css +0 -1
- package/src/ui/public/assets/vendor-COoKXBNX.css +0 -1
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-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/vendor-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-DWV3mQ48.js"></script>
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-BtihdyTS.js">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/vendor-CeElb63i.css">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Ce26lMsG.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="app"></div>
|
|
@@ -1021,6 +1021,24 @@ export function registerGitOpsRoutes({
|
|
|
1021
1021
|
}
|
|
1022
1022
|
});
|
|
1023
1023
|
|
|
1024
|
+
// 添加远程仓库的API
|
|
1025
|
+
app.post('/api/add-remote', express.json(), async (req, res) => {
|
|
1026
|
+
try {
|
|
1027
|
+
if (!getIsGitRepo()) {
|
|
1028
|
+
return res.json({ success: false, error: '当前目录不是Git仓库' });
|
|
1029
|
+
}
|
|
1030
|
+
const { name = 'origin', url } = req.body;
|
|
1031
|
+
if (!url || !url.trim()) {
|
|
1032
|
+
return res.json({ success: false, error: '远程仓库地址不能为空' });
|
|
1033
|
+
}
|
|
1034
|
+
await execGitCommand(`git remote add ${name} ${url.trim()}`);
|
|
1035
|
+
res.json({ success: true });
|
|
1036
|
+
} catch (error) {
|
|
1037
|
+
console.error('添加远程仓库失败:', error);
|
|
1038
|
+
res.json({ success: false, error: error.message || '添加远程仓库失败' });
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1024
1042
|
// 获取远程仓库URL的API
|
|
1025
1043
|
app.get('/api/remote-url', async (req, res) => {
|
|
1026
1044
|
try {
|