zen-gitsync 2.0.9 → 2.1.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/README.md +0 -30
- package/package.json +1 -1
- package/src/ui/client/src/App.vue +11 -9
- package/src/ui/client/src/components/CommitForm.vue +266 -265
- package/src/ui/client/src/components/GitStatus.vue +0 -6
- package/src/ui/client/src/components/LogList.vue +33 -42
- package/src/ui/client/src/stores/configStore.ts +212 -0
- package/src/ui/client/src/stores/gitLogStore.ts +0 -9
- package/src/ui/client/src/stores/gitStore.ts +45 -31
- package/src/ui/client/stats.html +1 -1
- package/src/ui/public/assets/index-C0FIVyIy.css +1 -0
- package/src/ui/public/assets/index-FuuBZ-mS.js +20 -0
- package/src/ui/public/assets/{vendor-eqaTZKOh.js → vendor-Dy1zosHw.js} +1 -1
- package/src/ui/public/index.html +3 -3
- package/src/ui/server/index.js +16 -1
- package/src/ui/public/assets/index-VigI_HzC.js +0 -20
- package/src/ui/public/assets/index-gLYHlw0f.css +0 -1
package/README.md
CHANGED
|
@@ -94,33 +94,3 @@ $ g log --n=5
|
|
|
94
94
|
```shell
|
|
95
95
|
$ g ui
|
|
96
96
|
```
|
|
97
|
-
|
|
98
|
-
# Zen GitSync 功能说明
|
|
99
|
-
|
|
100
|
-
## 自动文件监控与状态更新
|
|
101
|
-
|
|
102
|
-
Zen GitSync现在支持自动文件监控和状态更新功能:
|
|
103
|
-
|
|
104
|
-
- 当Git仓库内的文件发生变动时,系统会自动检测并更新Git状态
|
|
105
|
-
- 采用防抖(debounce)技术,避免频繁变动导致的性能问题
|
|
106
|
-
- 用户可以通过界面上的开关随时启用或禁用自动更新功能
|
|
107
|
-
- 设置会自动保存,下次打开应用时仍然生效
|
|
108
|
-
|
|
109
|
-
### 使用方法
|
|
110
|
-
|
|
111
|
-
1. 在Git状态面板的顶部有一个开关按钮,用于切换自动更新状态
|
|
112
|
-
2. 绿色表示自动更新已启用,灰色表示已禁用
|
|
113
|
-
3. 即使禁用了自动更新,用户仍然可以通过刷新按钮手动更新状态
|
|
114
|
-
|
|
115
|
-
### 技术说明
|
|
116
|
-
|
|
117
|
-
该功能使用以下技术实现:
|
|
118
|
-
- 服务端使用chokidar监控文件系统变化
|
|
119
|
-
- 使用Socket.IO实现服务器与客户端的实时通信
|
|
120
|
-
- 采用1000ms防抖延迟,优化性能并避免重复更新
|
|
121
|
-
|
|
122
|
-
### 注意事项
|
|
123
|
-
|
|
124
|
-
- 自动监控只会监控Git工作目录下的文件变动
|
|
125
|
-
- 监控器会自动过滤.git目录、node_modules目录和隐藏文件
|
|
126
|
-
- 在大型仓库中可能会增加服务器资源消耗
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { ElMessage } from 'element-plus'
|
|
|
7
7
|
import { Plus, Setting } from '@element-plus/icons-vue'
|
|
8
8
|
import logo from './assets/logo.svg'
|
|
9
9
|
import { useGitStore } from './stores/gitStore'
|
|
10
|
+
import { useConfigStore } from './stores/configStore'
|
|
10
11
|
|
|
11
12
|
const configInfo = ref('')
|
|
12
13
|
// 添加组件实例类型
|
|
@@ -15,6 +16,8 @@ const gitStatusRef = ref<InstanceType<typeof GitStatus> | null>(null)
|
|
|
15
16
|
|
|
16
17
|
// 使用Git Store
|
|
17
18
|
const gitStore = useGitStore()
|
|
19
|
+
// 使用Config Store
|
|
20
|
+
const configStore = useConfigStore()
|
|
18
21
|
|
|
19
22
|
// 添加初始化完成状态
|
|
20
23
|
const initCompleted = ref(false)
|
|
@@ -23,9 +26,10 @@ const currentDirectory = ref('')
|
|
|
23
26
|
// 加载配置
|
|
24
27
|
async function loadConfig() {
|
|
25
28
|
try {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
const config = await configStore.loadConfig()
|
|
30
|
+
if (config) {
|
|
31
|
+
configInfo.value = `默认提交信息: ${config.defaultCommitMessage}`
|
|
32
|
+
}
|
|
29
33
|
} catch (error) {
|
|
30
34
|
console.error('加载配置失败:', error)
|
|
31
35
|
}
|
|
@@ -60,14 +64,12 @@ onMounted(async () => {
|
|
|
60
64
|
|
|
61
65
|
// 只有是Git仓库的情况下才加载Git相关信息
|
|
62
66
|
if (gitStore.isGitRepo) {
|
|
63
|
-
//
|
|
67
|
+
// 并行获取所有Git信息,确保每个API只调用一次
|
|
64
68
|
await Promise.all([
|
|
65
|
-
gitStore.getCurrentBranch(),
|
|
66
|
-
gitStore.getAllBranches(),
|
|
67
|
-
gitStore.getUserInfo()
|
|
69
|
+
gitStore.getCurrentBranch(), // 获取当前分支
|
|
70
|
+
gitStore.getAllBranches(), // 获取所有分支
|
|
71
|
+
gitStore.getUserInfo() // 获取用户信息
|
|
68
72
|
])
|
|
69
|
-
|
|
70
|
-
// 日志信息通过LogList组件直接加载即可,避免重复调用
|
|
71
73
|
} else {
|
|
72
74
|
ElMessage.warning('当前目录不是Git仓库,部分功能将不可用')
|
|
73
75
|
}
|