Files
portFlow/README.md
T

77 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PortFlow
PortFlow 是一个基于 Tauri 2 + TypeScript 的桌面端口管理工具,用于查看系统网络端口占用并按 PID 结束进程。
## 功能特性
- 实时读取系统端口(TCP/UDP)及进程信息
- 展示端口、进程名、PID、连接状态等字段
- 支持关键词过滤(端口、进程名、PID、状态)
- 支持按 PID 强制结束进程(Windows 使用 `taskkill`,类 Unix 使用 `kill -9`
- 桌面端原生窗口(Tauri
## 技术栈
- 前端:TypeScript + Vite + HTML/CSS
- 桌面容器:Tauri 2
- 后端:Rust`sysinfo` + 系统命令)
## 环境要求
- Node.js 18+
- Bun(项目的 Tauri 构建命令使用 `bun run ...`
- Rust stable(建议与 Tauri 2 兼容版本)
- Windows 平台需要可用的 `netstat``taskkill`
## 本地开发
安装依赖:
```bash
pnpm install
```
启动前端开发服务器:
```bash
pnpm dev
```
启动 Tauri 开发模式:
```bash
pnpm tauri dev
```
## 构建打包
构建前端静态资源:
```bash
pnpm build
```
构建桌面应用:
```bash
pnpm tauri build
```
## 目录结构
```text
.
├─ src/ # 前端 TS 入口与样式
├─ src-tauri/ # Tauri / Rust 代码
│ ├─ src/main.rs # 端口扫描与进程结束命令
│ └─ tauri.conf.json # 应用窗口与构建配置
├─ index.html # 前端主页面
├─ package.json
└─ README.md
```
## 说明
- 当前仓库中同时存在 Tauri 模板默认 `src/main.ts` 与自定义 `index.html` 页面逻辑,实际功能以 `index.html` + `src-tauri/src/main.rs` 为主。
- 如需在生产环境中稳定使用,请以管理员权限运行应用,以确保获取完整端口数据并执行进程结束操作。