Skip to content

Commit

Permalink
feature: 增加使用说明
Browse files Browse the repository at this point in the history
  • Loading branch information
buxianshan committed Mar 14, 2023
1 parent 547cc72 commit 9c220cb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ app.on('ready', async () => {
shell.openPath(path)
})

// 使用默认浏览器打开链接
ipcMain.on('open-url', (event, url) => {
shell.openExternal(url);
});

// 记录已打开的窗口
const projectWindowMap = new Map()

Expand Down
20 changes: 19 additions & 1 deletion src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<el-row id="topButton">
<el-button size="small" icon="el-icon-plus" @click="addProjectDialogVisible = true">创建项目</el-button>
<el-button size="small" icon="el-icon-upload" @click="handleUploadConfig">导入配置</el-button>
<el-button size="small" icon="el-icon-question" @click="handleAbout">使用说明</el-button>
<el-button size="small" icon="el-icon-question" @click="aboutDialogVisible = true">使用说明</el-button>
</el-row>
<el-table
:data="tableData.projects"
Expand Down Expand Up @@ -70,6 +70,19 @@
</el-form-item>
</el-form>
</el-dialog>

<el-dialog :visible.sync="aboutDialogVisible" width="80%">
<template slot="title">
<div>GitRepos <el-tag type="info">{{`v${appVersion}`}}</el-tag></div>
</template>
<div>
<p>此工具用于管理本地多Git仓库项目。点击创建项目,选择本地仓库路径即可。目前支持批量拉取和更新状态。</p>
<br>
源码地址:<el-link type="primary" @click="openBrowser('https://github.com/buxianshan/git-repos')">
https://github.com/buxianshan/git-repos
</el-link>
</div>
</el-dialog>
</div>
</template>

Expand All @@ -89,6 +102,7 @@ export default {
return {
tableData: config,
addProjectDialogVisible: false,
aboutDialogVisible: false,
addProjectForm: {
projectName: "",
repos: [
Expand All @@ -99,6 +113,7 @@ export default {
isEdit: false,
},
hasGitEnv: true,
appVersion: process.env.VUE_APP_VERSION,
}
},
mounted() {
Expand Down Expand Up @@ -277,6 +292,9 @@ export default {
],
}
},
openBrowser(url) {
ipcRenderer.send("open-url", url)
}
},
beforeCreate() {
document.getElementsByTagName("title")[0].innerHTML = "GitRepos"
Expand Down
1 change: 1 addition & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { defineConfig } = require('@vue/cli-service')
process.env.VUE_APP_VERSION = require('./package.json').version
module.exports = defineConfig({
devServer: {
"port": 9080,
Expand Down

0 comments on commit 9c220cb

Please sign in to comment.