新版本

This commit is contained in:
刘嘉伟 2024-08-17 17:22:46 +08:00
parent ed66824931
commit fb2a8ecd51
7 changed files with 101 additions and 74 deletions

View File

@ -29,9 +29,12 @@
- [x] 增加udp代理类型
- [x] 支持快速分享frps
- [x] 增加快速选择本地端口
- [ ] 支持stcp代理类型
- [ ] 支持配的导出导入
- [ ] 优化配置
- [x] 支持stcp代理类型
- [ ] 支持所有配置的导入导出
- [ ] 支持代理的导出导入导出
- [ ] 一键清空所有配置
- [ ] 通过镜像站下载frp
- [ ] tcp、udp协议支持批量端口
## 常见问题
@ -39,6 +42,7 @@
执行命令:`sudo xattr -cr Frpc-Desktop.app`
## 里程碑
- 2024-08-17: 发布v1.0.8版本 支持stcp代理
- 2024-08-11: 发布v1.0.7版本
- 2024-08-09: 发布v1.0.6版本
- 2024-08-06: 发布v1.0.5版本

View File

@ -1,6 +1,6 @@
{
"name": "Frpc-Desktop",
"version": "1.0.7",
"version": "1.0.8",
"main": "dist-electron/main/index.js",
"description": "FRP跨平台桌面客户端可视化配置轻松实现内网穿透",
"repository": "github:luckjiawei/frpc-desktop",

View File

@ -28,6 +28,7 @@ import Error from "@iconify-icons/material-symbols/error";
import ContentCopy from "@iconify-icons/material-symbols/content-copy";
import ContentPasteGo from "@iconify-icons/material-symbols/content-paste-go";
import Edit from "@iconify-icons/material-symbols/edit";
import CheckBox from "@iconify-icons/material-symbols/check-box";
addIcon("cloud", Cloud);
addIcon("rocket-launch-rounded", RocketLaunchRounded);
@ -51,4 +52,5 @@ addIcon("error", Error);
addIcon("content-copy", ContentCopy);
addIcon("content-paste-go", ContentPasteGo);
addIcon("edit", Edit);
addIcon("check-box", CheckBox);

View File

@ -23,7 +23,7 @@ type ShareLinkConfig = {
};
const defaultFormData = ref<FrpConfig>({
currentVersion: "",
currentVersion: -1,
serverAddr: "",
serverPort: 7000,
authMethod: "",
@ -155,7 +155,7 @@ const checkAndResetVersion = () => {
currentVersion &&
!versions.value.some(item => item.id === currentVersion)
) {
formData.value.currentVersion = "";
formData.value.currentVersion = null;
}
};

View File

@ -6,7 +6,6 @@ import Breadcrumb from "@/layout/compoenets/Breadcrumb.vue";
import { ElMessage } from "element-plus";
import { useDebounceFn } from "@vueuse/core";
defineComponent({
name: "Download"
});
@ -14,7 +13,7 @@ defineComponent({
const versions = ref<Array<FrpVersion>>([]);
const loading = ref(1);
const downloadPercentage = ref(0);
const downloading = ref<Map<string, number>>(new Map<string, number>());
const downloading = ref<Map<number, number>>(new Map<number, number>());
/**
* 获取版本
@ -47,10 +46,10 @@ const handleInitDownloadHook = () => {
ipcRenderer.on("Download.frpVersionHook", (event, args) => {
loading.value--;
versions.value = args.map(m => {
m.published_at = moment(m.published_at).format("YYYY-MM-DD HH:mm:ss")
m.published_at = moment(m.published_at).format("YYYY-MM-DD");
return m as FrpVersion;
}) as Array<FrpVersion>;
console.log(versions, 'versions')
console.log(versions, "versions");
});
//
ipcRenderer.on("Download.frpVersionDownloadOnProgress", (event, args) => {
@ -70,7 +69,7 @@ const handleInitDownloadHook = () => {
}
});
ipcRenderer.on("Download.deleteVersion.hook", (event, args) => {
const {err, data} = args
const { err, data } = args;
if (!err) {
loading.value++;
ElMessage({
@ -79,8 +78,7 @@ const handleInitDownloadHook = () => {
});
handleLoadVersions();
}
})
});
};
onMounted(() => {
@ -128,7 +126,7 @@ onUnmounted(() => {
<!-- <el-tag class="ml-2">原文件名{{ version.assets[0]?.name }}</el-tag>-->
</div>
<div class="text-sm">
发布时间<span class="text-gray-00">{{
发布时间<span class="text-gray-00 text-sm text-primary font-bold">{{
// moment(version.published_at).format("YYYY-MM-DD HH:mm:ss")
version.published_at
}}</span>
@ -136,12 +134,25 @@ onUnmounted(() => {
</div>
<div class="right">
<div v-if="version.download_completed">
<el-button type="text">已下载</el-button>
<el-button type="text" class="danger-text" @click="handleDeleteVersion(version)">
<!-- <span class="text-[12px] text-primary font-bold mr-2"-->
<!-- >已下载</span-->
<!-- >-->
<el-button
type="text"
@click="handleDeleteVersion(version)"
>
<IconifyIconOffline class="mr-1" icon="check-box" />
已下载
</el-button>
<!-- <el-button type="text"></el-button>-->
<el-button
type="text"
class="danger-text"
@click="handleDeleteVersion(version)"
>
<IconifyIconOffline class="mr-1" icon="delete-rounded" />
删除
</el-button>
</div>
<template v-else>
@ -151,7 +162,12 @@ onUnmounted(() => {
:text-inside="false"
/>
</div>
<el-button v-else size="small" type="primary" @click="handleDownload(version)">
<el-button
v-else
size="small"
type="primary"
@click="handleDownload(version)"
>
<IconifyIconOffline class="mr-1" icon="download" />
下载
</el-button>
@ -160,7 +176,6 @@ onUnmounted(() => {
</div>
</el-col>
</el-row>
</template>
<div
v-else

View File

@ -4,7 +4,7 @@ import Breadcrumb from "@/layout/compoenets/Breadcrumb.vue";
import { ipcRenderer } from "electron";
import { ElMessageBox } from "element-plus";
import router from "@/router";
import {useDebounceFn} from "@vueuse/core";
import { useDebounceFn, useIntervalFn } from "@vueuse/core";
defineComponent({
name: "Home"
@ -29,12 +29,12 @@ const handleButtonClick = useDebounceFn(() => {
}, 300);
onMounted(() => {
setInterval(() => {
useIntervalFn(() => {
ipcRenderer.invoke("frpc.running").then(data => {
running.value = data;
console.log('进程状态', data)
console.log("进程状态", data);
});
}, 300);
}, 500);
ipcRenderer.on("Home.frpc.start.error.hook", (event, args) => {
if (args) {
@ -97,13 +97,14 @@ onUnmounted(() => {
<div class="font-bold text-2xl text-center">
<IconifyIconOffline
v-if="running"
class="text-[#7EC050]
inline-block relative top-1"
icon="check-circle-rounded"/>
class="text-[#7EC050] inline-block relative top-1"
icon="check-circle-rounded"
/>
<IconifyIconOffline
v-else
class="text-[#E47470] inline-block relative top-1"
icon="error"/>
icon="error"
/>
Frpc {{ running ? "已启动" : "已断开" }}
</div>
</transition>
@ -115,7 +116,12 @@ onUnmounted(() => {
<!-- >查看日志-->
<!-- </el-button>-->
<div class="w-full justify-center text-center">
<el-link v-if="running" type="primary" @click="$router.replace({ name: 'Logger' })">查看日志</el-link>
<el-link
v-if="running"
type="primary"
@click="$router.replace({ name: 'Logger' })"
>查看日志</el-link
>
</div>
<div
class="w-full h-8 bg-[#563EA4] rounded flex justify-center items-center text-white font-bold cursor-pointer"

4
types/global.d.ts vendored
View File

@ -25,7 +25,7 @@ declare global {
serverName: string;
secretKey: string;
bindAddr: string;
bindPort: string;
bindPort: number;
};
/**
@ -41,7 +41,7 @@ declare global {
*
*/
type FrpVersion = {
id: string;
id: number;
name: string;
published_at: string;
download_completed: boolean;