zen-gitsync 2.10.7 → 2.10.9
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 +46 -2
- package/src/ui/public/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/src/ui/public/assets/css.worker-DJHgoStD.js +93 -0
- package/src/ui/public/assets/editor.worker-1JAmoQSB.js +26 -0
- package/src/ui/public/assets/html.worker-BSNtyp_I.js +470 -0
- package/src/ui/public/assets/index-BS0V07Ya.css +1 -0
- package/src/ui/public/assets/index-DGL8BdDB.js +107 -0
- package/src/ui/public/assets/json.worker--DwPKSpO.js +58 -0
- package/src/ui/public/assets/ts.worker--OkPaiLD.js +67731 -0
- package/src/ui/public/assets/vendor-D8Cadz3F.js +1328 -0
- package/src/ui/public/assets/vendor-DpSHka1A.css +1 -0
- package/src/ui/public/index.html +4 -4
- package/src/ui/server/routes/config.js +27 -0
- package/src/ui/server/routes/exec.js +15 -4
- package/src/ui/public/assets/index-5z2rWrTJ.js +0 -106
- package/src/ui/public/assets/index-bVmQ0atC.css +0 -1
- package/src/ui/public/assets/vendor-BreftYKt.css +0 -1
- package/src/ui/public/assets/vendor-CrYGMytM.js +0 -95
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-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/vendor-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DGL8BdDB.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-D8Cadz3F.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/vendor-DpSHka1A.css">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BS0V07Ya.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="app"></div>
|
|
@@ -639,4 +639,31 @@ export function registerConfigRoutes({
|
|
|
639
639
|
res.status(500).json({ success: false, error: error.message })
|
|
640
640
|
}
|
|
641
641
|
})
|
|
642
|
+
|
|
643
|
+
// 保存“一键推送成功后启动项”
|
|
644
|
+
app.post('/api/config/save-after-quick-push-action', express.json(), async (req, res) => {
|
|
645
|
+
try {
|
|
646
|
+
const { afterQuickPushAction } = req.body
|
|
647
|
+
|
|
648
|
+
if (!afterQuickPushAction || typeof afterQuickPushAction !== 'object') {
|
|
649
|
+
return res.status(400).json({ success: false, error: '缺少必要参数' })
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const enabled = Boolean(afterQuickPushAction.enabled)
|
|
653
|
+
const type = afterQuickPushAction.type === 'workflow' ? 'workflow' : 'command'
|
|
654
|
+
const refId = String(afterQuickPushAction.refId || '').trim()
|
|
655
|
+
|
|
656
|
+
const config = await configManager.loadConfig()
|
|
657
|
+
config.afterQuickPushAction = {
|
|
658
|
+
enabled,
|
|
659
|
+
type,
|
|
660
|
+
refId
|
|
661
|
+
}
|
|
662
|
+
await configManager.saveConfig(config)
|
|
663
|
+
|
|
664
|
+
res.json({ success: true })
|
|
665
|
+
} catch (error) {
|
|
666
|
+
res.status(500).json({ success: false, error: error.message })
|
|
667
|
+
}
|
|
668
|
+
})
|
|
642
669
|
}
|
|
@@ -108,10 +108,21 @@ export function registerExecRoutes({
|
|
|
108
108
|
// 只有 Windows CMD 内置命令(如 dir、type 等)才需要 GBK 转换
|
|
109
109
|
// npm、node、git 等现代工具都输出 UTF-8
|
|
110
110
|
const isWindows = process.platform === 'win32';
|
|
111
|
-
const cmdBuiltins = ['dir', 'type', '
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
const cmdBuiltins = ['dir', 'type', 'set', 'path', 'cd', 'md', 'rd', 'del', 'copy', 'move', 'ren'];
|
|
112
|
+
|
|
113
|
+
// echo 命令特殊处理:如果包含变量替换(如 {{xxx}}),说明内容可能已经是 UTF-8,不转换
|
|
114
|
+
const isEchoCommand = command.trim().toLowerCase().startsWith('echo ');
|
|
115
|
+
const hasVariableSubstitution = isEchoCommand && (
|
|
116
|
+
command.includes('{{') ||
|
|
117
|
+
command.includes('${') ||
|
|
118
|
+
command.includes('%') // Windows 环境变量
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const needsGbkConversion = isWindows && (
|
|
122
|
+
cmdBuiltins.some(builtin =>
|
|
123
|
+
command.trim().toLowerCase().startsWith(builtin + ' ') ||
|
|
124
|
+
command.trim().toLowerCase() === builtin
|
|
125
|
+
) || (isEchoCommand && !hasVariableSubstitution) // echo 只在没有变量替换时才转换
|
|
115
126
|
);
|
|
116
127
|
|
|
117
128
|
console.log(`[流式输出] 命令: ${command.substring(0, 50)}, 需要GBK转换: ${needsGbkConversion}`);
|