增加打开github

This commit is contained in:
刘嘉伟 2023-12-01 16:34:34 +08:00
parent 9bdeccaab2
commit 7d4505eb44
2 changed files with 19 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import {app, BrowserWindow, ipcMain, net} from "electron";
import {app, BrowserWindow, ipcMain, net, shell} from "electron";
import {insertVersion} from "../storage/version";
const fs = require("fs");
@ -162,4 +162,11 @@ export const initGitHubApi = () => {
}
});
});
/**
* GitHub
*/
ipcMain.on("github.open", () => {
shell.openExternal("https://github.com/luckjiawei/frpc-desktop");
})
};

View File

@ -3,6 +3,7 @@ import { computed, defineComponent, onMounted, ref } from "vue";
import { Icon } from "@iconify/vue";
import router from "@/router";
import { RouteRecordRaw } from "vue-router";
import {ipcRenderer} from "electron";
defineComponent({
name: "AppMain"
@ -27,6 +28,10 @@ const handleMenuChange = (route: RouteRecordRaw) => {
});
};
const handleOpenGitHub = () => {
ipcRenderer.send("github.open")
}
onMounted(() => {
routes.value = router.options.routes[0].children?.filter(
f => !f.meta?.hidden
@ -49,6 +54,12 @@ onMounted(() => {
>
<Icon :icon="r?.meta?.icon as string" />
</li>
<li
class="menu"
@click="handleOpenGitHub"
>
<Icon icon="mdi:github" />
</li>
</ul>
</div>
</template>