diff --git a/README.md b/README.md index 0ff9b19..5a64461 100644 --- a/README.md +++ b/README.md @@ -99,22 +99,25 @@ **捐赠名单** -| 🕰 时间 | 📡 平台 | 🤲 捐赠者 | 💰 金额 | ✉️ 捐赠留言 | -|------------|-------|-----------|-------|--------------------| -| 2024-08-06 | 微信 | 三木 | 1 元 | 无 | -| 2024-08-25 | 微信 | 晚风 | 1 元 | 无 | -| 2024-08-27 | 微信 | x | 1 元 | 无 | -| 2024-10-09 | 微信 | 解脱 | 20 元 | 无 | -| 2024-10-09 | 微信 | KMDN | 20 元 | 无 | -| 2024-10-14 | 微信 | 121 | 5 元 | 无 | -| 2024-10-14 | 微信 | Different | 10 元 | 感谢您的开源 | -| 2024-10-16 | 微信 | 。 。 。 | 50 元 | 感谢开源的frp软件 | -| 2024-11-2 | 微信 | gesoft | 10 元 | 加油 | -| 2024-11-7 | 微信 | *进 | 10 元 | 谢谢,可见可得,省心省力 | -| 2024-11-8 | 微信 | **创 | 10 元 | 无 | -| 2024-11-20 | 微信 | 一東 | 20 元 | 请你喝咖啡 | -| 2024-11-20 | 微信 | KEVINSKH | 10 元 | 感谢开发方便快捷的图形化操作界面👍 | -| 2024-11-26 | 微信 | | 3 元 | 无 | +| 🕰 时间 | 📡 平台 | 🤲 捐赠者 | 💰 金额 | ✉️ 捐赠留言 | +|------------|-------|-----------|-------|--------------------------| +| 2024-08-06 | 微信 | 三木 | 1 元 | 无 | +| 2024-08-25 | 微信 | 晚风 | 1 元 | 无 | +| 2024-08-27 | 微信 | x | 1 元 | 无 | +| 2024-10-09 | 微信 | 解脱 | 20 元 | 无 | +| 2024-10-09 | 微信 | KMDN | 20 元 | 无 | +| 2024-10-14 | 微信 | 121 | 5 元 | 无 | +| 2024-10-14 | 微信 | Different | 10 元 | 感谢您的开源 | +| 2024-10-16 | 微信 | 。 。 。 | 50 元 | 感谢开源的frp软件 | +| 2024-11-2 | 微信 | gesoft | 10 元 | 加油 | +| 2024-11-7 | 微信 | *进 | 10 元 | 谢谢,可见可得,省心省力 | +| 2024-11-8 | 微信 | **创 | 10 元 | 无 | +| 2024-11-20 | 微信 | 一東 | 20 元 | 请你喝咖啡 | +| 2024-11-20 | 微信 | KEVINSKH | 10 元 | 感谢开发方便快捷的图形化操作界面👍 | +| 2024-11-26 | 微信 | | 3 元 | 无 | +| 2024-11-26 | 微信 | Kaori | 1 元 | 谢谢大佬的项目,要是能添加web控制页面就更好了 | +| 2024-12-03 | 微信 | 17¥ | 20 元 | 谢谢,很方便的软件 | +| 2024-12-03 | 微信 | Cr@k3r | 5 元 | 感谢你的工作 | ## 贡献者 diff --git a/electron/api/config.ts b/electron/api/config.ts index ff978cf..22a1db9 100644 --- a/electron/api/config.ts +++ b/electron/api/config.ts @@ -144,7 +144,9 @@ export const initConfigApi = win => { metaToken: sourceConfig?.metadatas?.token || "", systemSelfStart: false, systemStartupConnect: false, - systemSilentStartup: false + systemSilentStartup: false, + webEnable: true, + webPort: sourceConfig?.webServer?.port || 57400 }; let frpcProxys = []; // 解析proxy diff --git a/electron/api/frpc.ts b/electron/api/frpc.ts index c32a5d9..e06d1cd 100644 --- a/electron/api/frpc.ts +++ b/electron/api/frpc.ts @@ -56,7 +56,8 @@ ${ : "" } [[${ - (m.type === "stcp" || m.type === "xtcp") && m.stcpModel === "visitors" + (m.type === "stcp" || m.type === "xtcp" || m.type === "sudp") && + m.stcpModel === "visitors" ? "visitors" : "proxies" }]] @@ -98,6 +99,7 @@ httpPassword = "${m.httpPassword}" break; case "stcp": case "xtcp": + case "sudp": if (m.stcpModel === "visitors") { // 访问者 toml += ` @@ -169,7 +171,7 @@ log.to = "frpc.log" log.level = "${config.logLevel}" log.maxDays = ${config.logMaxDays} webServer.addr = "127.0.0.1" -webServer.port = 57400 +webServer.port = ${config.webPort} transport.tls.enable = ${config.tlsConfigEnable} ${ config.tlsConfigEnable && config.tlsConfigCertFile @@ -252,6 +254,7 @@ httpPassword = "${m.httpPassword}" break; case "stcp": case "xtcp": + case "sudp": if (m.stcpModel === "visitors") { // 访问者 ini += ` @@ -322,7 +325,7 @@ log_file = "frpc.log" log_level = ${config.logLevel} log_max_days = ${config.logMaxDays} admin_addr = 127.0.0.1 -admin_port = 57400 +admin_port = ${config.webPort} tls_enable = ${config.tlsConfigEnable} ${ diff --git a/electron/api/github.ts b/electron/api/github.ts index ed80d20..f3c2ce8 100644 --- a/electron/api/github.ts +++ b/electron/api/github.ts @@ -119,7 +119,8 @@ export const initGitHubApi = () => { ipcMain.on("github.getFrpVersions", async event => { const request = net.request({ method: "get", - url: "https://api.github.com/repos/fatedier/frp/releases?page=1&per_page=1000" + // url: "https://api.github.com/repos/fatedier/frp/releases?page=1&per_page=1000" + url: "https://api.jwinks.com/github/releases" }); request.on("response", response => { let responseData: Buffer = Buffer.alloc(0); diff --git a/electron/api/logger.ts b/electron/api/logger.ts index e75c58b..33be0b4 100644 --- a/electron/api/logger.ts +++ b/electron/api/logger.ts @@ -1,4 +1,4 @@ -import { app, ipcMain } from "electron"; +import { app, ipcMain, shell } from "electron"; const fs = require("fs"); const path = require("path"); @@ -28,4 +28,17 @@ export const initLoggerApi = () => { } }); }); + + ipcMain.on("logger.openLog", (event, args) => { + console.log('正在打开日志'); + shell.openPath(logPath).then((errorMessage) => { + if (errorMessage) { + console.error('Failed to open Logger:', errorMessage); + event.reply("Logger.openLog.hook", false); + } else { + console.log('Logger opened successfully'); + event.reply("Logger.openLog.hook", true); + } + }); + }); }; diff --git a/package.json b/package.json index 62356f8..573a7fc 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,10 @@ "frp", "frpc", "proxy", - "electron-app" + "electron-app", + "vue", + "vue3", + "vite" ], "engines": { "node": ">= 18" diff --git a/src/components/IconifyIcon/src/offlineIcon.ts b/src/components/IconifyIcon/src/offlineIcon.ts index 249f4e3..d656bc5 100644 --- a/src/components/IconifyIcon/src/offlineIcon.ts +++ b/src/components/IconifyIcon/src/offlineIcon.ts @@ -1,10 +1,5 @@ import {addIcon} from "@iconify/vue/dist/offline"; -/** - * 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载 - */ - -// 本地菜单图标,后端在路由的icon中返回对应的图标字符串并且前端在此处使用addIcon添加即可渲染菜单图标 import Cloud from "@iconify-icons/material-symbols/cloud"; import RocketLaunchRounded from "@iconify-icons/material-symbols/rocket-launch-rounded"; import Download from "@iconify-icons/material-symbols/download-2"; @@ -17,7 +12,6 @@ import MoreVert from "@iconify-icons/material-symbols/more-vert"; import Add from "@iconify-icons/material-symbols/add"; import BringYourOwnIpRounded from "@iconify-icons/material-symbols/bring-your-own-ip-rounded"; import DeleteRounded from "@iconify-icons/material-symbols/delete-rounded"; -import RefreshRounded from "@iconify-icons/material-symbols/refresh-rounded"; import CancelPresentation from "@iconify-icons/material-symbols/cancel-presentation"; import GestureSelect from "@iconify-icons/material-symbols/gesture-select"; import SaveRounded from "@iconify-icons/material-symbols/save-rounded"; @@ -36,6 +30,10 @@ import deviceReset from "@iconify-icons/material-symbols/device-reset"; import switchAccessOutlineRounded from "@iconify-icons/material-symbols/switch-access-outline-rounded"; import switchAccessRounded from "@iconify-icons/material-symbols/switch-access-rounded"; import chargerRounded from "@iconify-icons/material-symbols/charger-rounded"; +import fileOpenRounded from "@iconify-icons/material-symbols/file-open-rounded"; +import attachMoneyRounded from "@iconify-icons/material-symbols/attach-money-rounded"; +import volunteerActivismSharp from "@iconify-icons/material-symbols/volunteer-activism-sharp"; +import description from "@iconify-icons/material-symbols/description"; addIcon("cloud", Cloud); addIcon("rocket-launch-rounded", RocketLaunchRounded); @@ -52,7 +50,6 @@ addIcon("delete-rounded", DeleteRounded); addIcon("cancel-presentation", CancelPresentation); addIcon("gesture-select", GestureSelect); addIcon("save-rounded", SaveRounded); -addIcon("refresh-rounded", RefreshRounded); addIcon("info", Info); addIcon("question-mark", QuestionMark); addIcon("check-circle-rounded", CheckCircleRounded); @@ -67,5 +64,8 @@ addIcon("downloadRounded", downloadRounded); addIcon("deviceReset", deviceReset); addIcon("switchAccessOutlineRounded", switchAccessOutlineRounded); addIcon("switchAccessRounded", switchAccessRounded); - +addIcon("file-open-rounded", fileOpenRounded); +addIcon("attach-money-rounded", attachMoneyRounded); +addIcon("volunteer-activism-sharp", volunteerActivismSharp); +addIcon("description", description); diff --git a/src/layout/compoenets/LeftMenu.vue b/src/layout/compoenets/LeftMenu.vue index 448e096..3b3a5c8 100644 --- a/src/layout/compoenets/LeftMenu.vue +++ b/src/layout/compoenets/LeftMenu.vue @@ -118,14 +118,28 @@ onMounted(() => { > -
- {{ pkg.version }} +
diff --git a/src/styles/layout.scss b/src/styles/layout.scss index 1d11793..0d50b68 100644 --- a/src/styles/layout.scss +++ b/src/styles/layout.scss @@ -54,11 +54,18 @@ $danger-color: #F56C6C; display: flex; /* 设置为 flexbox */ flex-direction: column; /* 纵向排列子元素 */ + .menu-footer { + margin-top: auto; + + } + .version { height: 40px; + width: 60px; + display: flex; + justify-content: center; + align-items: center; color: $primary-color; - text-align: center; - margin-top: auto; font-weight: bold; font-size: 14px; cursor: pointer; @@ -68,7 +75,7 @@ $danger-color: #F56C6C; animation: heartBeat 1s; } - .menu-container { + .menu-container, .menu-footer { .menu { display: flex; diff --git a/src/views/about/index.vue b/src/views/about/index.vue index 5944e06..6a244ab 100644 --- a/src/views/about/index.vue +++ b/src/views/about/index.vue @@ -44,6 +44,22 @@ const handleOpenGitHub = () => { ipcRenderer.send("common.openUrl", "https://github.com/luckjiawei/frpc-desktop") } +/** + * 打开捐赠界面 + */ +const handleOpenDonate = () => { + ipcRenderer.send("common.openUrl", "https://jwinks.com/donate") +} + + +/** + * 打开文档 + */ +const handleOpenDoc = () => { + ipcRenderer.send("common.openUrl", "https://jwinks.com/p/frp") +} + + /** * 获取最后一个版本 */ @@ -124,6 +140,14 @@ defineComponent({

+ + + 使用教程 + + + + 捐赠名单 + 仓库地址 diff --git a/src/views/config/index.vue b/src/views/config/index.vue index c3aad0d..b91bf97 100644 --- a/src/views/config/index.vue +++ b/src/views/config/index.vue @@ -45,7 +45,9 @@ const defaultFormData = ref({ user: "", metaToken: "", transportHeartbeatInterval: 30, - transportHeartbeatTimeout: 90 + transportHeartbeatTimeout: 90, + webEnable: true, + webPort: 57400 }); const formData = ref(defaultFormData.value); @@ -113,6 +115,12 @@ const rules = reactive({ ], transportHeartbeatTimeout: [ { required: true, message: "心跳超时时间不能为空", trigger: "change" } + ], + webEnable: [ + { required: true, message: "web界面开关不能为空", trigger: "change" } + ], + webPort: [ + { required: true, message: "web界面端口不能为空", trigger: "change" } ] }); @@ -187,6 +195,10 @@ onMounted(() => { data.transportHeartbeatTimeout = defaultFormData.value.transportHeartbeatTimeout; } + if (data.webEnable == null || data.webEnable == undefined) { + data.webEnable = true; + data.webPort = 57400; + } formData.value = data; } } @@ -687,7 +699,7 @@ onUnmounted(() => {
TLS Config
- + {
代理
- + { + +
Web 界面
+
+ + + + + + + + + +
日志配置
@@ -977,8 +1056,8 @@ onUnmounted(() => {