zen-gitsync 2.0.8 → 2.1.0
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/client/src/App.vue +12 -10
- package/src/ui/client/src/components/CommitForm.vue +266 -265
- package/src/ui/client/src/components/GitStatus.vue +5 -8
- package/src/ui/client/src/components/LogList.vue +19 -8
- package/src/ui/client/src/stores/configStore.ts +212 -0
- package/src/ui/client/src/stores/gitStore.ts +48 -34
- package/src/ui/client/stats.html +1 -1
- package/src/ui/public/assets/{index-P9BcPWc5.js → index-VigI_HzC.js} +2 -2
- package/src/ui/public/assets/{index-C3BbS3PG.css → index-gLYHlw0f.css} +1 -1
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/index.js +53 -28
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
|
}
|
|
@@ -447,7 +449,7 @@ function stopHResize() {
|
|
|
447
449
|
</template>
|
|
448
450
|
</div>
|
|
449
451
|
<div class="commit-form-panel" v-else>
|
|
450
|
-
<div class="card">
|
|
452
|
+
<div class="card" style="padding: 20px;">
|
|
451
453
|
<h2>Git仓库初始化</h2>
|
|
452
454
|
<p>当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。</p>
|
|
453
455
|
<!-- 实用提示 -->
|