44 Commits
Author SHA1 Message Date
lxh2875931338 d21184efef Merge remote-tracking branch 'origin/test' 2026-08-03 22:11:44 +08:00
lxh2875931338 254151f41d 版本号更新至2.5 2026-08-03 22:11:35 +08:00
lxh2875931338 7be79fb456 Merge branch 'test' 2026-08-03 22:09:56 +08:00
lxh2875931338 18ddaa3dc3 优化部分字体显示 2026-08-03 22:00:03 +08:00
lxh2875931338 0d292ab29c 修复容器、二进制的特定环境下,偶发性存留多僵尸进程的问题 2026-08-03 21:51:21 +08:00
lxh2875931338 2f9612a1fa 优化tags位置布局 2026-08-03 21:44:40 +08:00
lxh2875931338 c24347cbcf 主界面弹窗位置优化 2026-08-03 21:42:03 +08:00
lxh2875931338 51b1600c68 字体显示优化 2026-08-03 21:36:54 +08:00
lxh2875931338 a307c77601 字体调整 2026-08-03 21:27:57 +08:00
lxh2875931338 4ffac6803e 2.5-Preview开工:字体替换与部分布局调整 2026-08-03 21:15:22 +08:00
lxh2875931338 a069c30906 2.4-LTS紧急更新:alpine官方源疑似失效,增加国内源匹配能力 2026-07-31 22:24:26 +08:00
lxh2875931338 1473083548 小修补后的deploy.sh部署逻辑,当前为LTS可用版本 2026-07-30 20:25:29 +08:00
lxh2875931338 0147f482e2 更新日志 2026-07-30 13:11:12 +08:00
lxh2875931338 94558dfa25 更新日志 2026-07-30 13:08:59 +08:00
lxh2875931338 26f184399f 更新日志调整 2026-07-30 13:08:20 +08:00
lxh2875931338 bd40eea81c 更新日志 2026-07-30 13:06:28 +08:00
lxh2875931338 461831414b Merge branch 'test' 2026-07-30 13:03:00 +08:00
lxh2875931338 2ad151e44b 合并test分支代码 2026-07-30 12:48:46 +08:00
lxh2875931338 5a28775f84 Merge branch 'test' 2026-07-30 12:48:29 +08:00
lxh2875931338 93d11d00a2 在test分支完成测试之前,自动部署脚本会恢复到原有版本 2026-07-29 23:51:16 +08:00
lxh2875931338 5c89232004 部分部署逻辑调整 2026-07-29 23:28:39 +08:00
lxh2875931338 cd178a1a9d 部署逻辑存在调整,与test端同步 2026-07-29 23:23:25 +08:00
lxh2875931338 a87e9aa0b8 给main端添加最新的自动化脚本进行测试 2026-07-29 23:17:19 +08:00
lxh2875931338 205525c243 调整更新文档 2026-07-29 19:53:28 +08:00
lxh2875931338 16204200de 增加独立的更新日志页面 2026-07-29 19:51:27 +08:00
lxh2875931338 e1cf6f4f47 推送新的日志 2026-07-28 23:14:39 +08:00
lxh2875931338 a5c33580e2 调整部分部署逻辑 2026-07-28 22:56:45 +08:00
lxh2875931338 f2af48f8d0 调整部分部署逻辑 2026-07-28 22:50:17 +08:00
lxh2875931338 2663e71b4f 调整部分部署逻辑 2026-07-28 22:35:48 +08:00
lxh2875931338 bf24d3cb00 调整部分部署逻辑 2026-07-28 22:29:42 +08:00
lxh2875931338 00f2b9fd14 重新设计新的部署逻辑,去掉本机自己的go build,合并到docker多阶段构建部分进行 2026-07-28 22:23:39 +08:00
lxh2875931338 76ac9503c6 调整部分部署逻辑 2026-07-28 21:58:12 +08:00
lxh2875931338 04851d244f 调整部分部署逻辑 2026-07-28 21:55:33 +08:00
lxh2875931338 a2f4326882 确认部分逻辑 2026-07-28 21:50:04 +08:00
lxh2875931338 4cd438ed3e Merge branch 'test' 2026-07-28 21:24:54 +08:00
lxh2875931338 1bfa2383c1 docker脚本部分逻辑更新 2026-07-28 20:21:01 +08:00
lxh2875931338 b13f2d5047 指南更新 2026-07-28 20:13:14 +08:00
lxh2875931338 7a2737bc83 指南更新 2026-07-28 20:11:53 +08:00
lxh2875931338 1fd845a981 readme更新 2026-07-28 20:09:34 +08:00
lxh2875931338 f9a97a0af5 版本更新说明 2026-07-28 20:06:14 +08:00
lxh2875931338 ab73a38f06 直接更新 2026-07-28 20:03:20 +08:00
lxh2875931338 21c9c9556b 2.2逻辑设计已完成 2026-07-28 20:01:43 +08:00
lxh2875931338 509de72d10 2.2的部分代码新增实现 2026-07-28 18:46:08 +08:00
lxh2875931338 74a054d90c 更新 readme.md
readme更新2.0-LTS发布信息
2026-07-28 00:28:23 +08:00
12 changed files with 200 additions and 124 deletions
+2 -1
View File
@@ -17,7 +17,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build \
-o frpc-console . -o frpc-console .
FROM alpine:latest FROM alpine:latest
# 先切换到国内镜像源,再安装包
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk --no-cache add ca-certificates tzdata sqlite RUN apk --no-cache add ca-certificates tzdata sqlite
WORKDIR /app WORKDIR /app
+30
View File
@@ -0,0 +1,30 @@
# 多阶段构建
FROM golang:alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN sed -i 's/go 1.2[6-9].*/go 1.21/' go.mod && go mod tidy
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go mod download
COPY . .
# 编译时不注入任何版本信息(纯净二进制)
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags="-s -w" \
-o frpc-console .
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata sqlite
WORKDIR /app
COPY --from=builder /app/frpc-console /app/frpc-console
COPY static/ /app/static/
EXPOSE 9300
ENTRYPOINT ["/app/frpc-console"]
+50 -51
View File
@@ -151,12 +151,12 @@ generate_target_version() {
} }
get_current_version() { get_current_version() {
local version_file="${DEPLOY_DIR}/version.ini" local version_file="${DEPLOY_DIR}/data/version.ini"
if [ -f "$version_file" ]; then if [ -f "$version_file" ]; then
grep -v "^[;#]" "$version_file" | head -1 | tr -d '\n' grep -v "^[;#]" "$version_file" | head -1 | tr -d '\n'
else else
if [ "$CONTAINER_EXISTS" = true ]; then if [ "$CONTAINER_EXISTS" = true ]; then
docker exec frpc-console cat /app/version.ini 2>/dev/null | grep -v "^[;#]" | head -1 | tr -d '\n' || echo "" docker exec frpc-console cat /app/data/version.ini 2>/dev/null | grep -v "^[;#]" | head -1 | tr -d '\n' || echo ""
else else
echo "" echo ""
fi fi
@@ -325,7 +325,6 @@ do_deploy() {
# ----- 事务前钩子:备份数据库(仅降级时) ----- # ----- 事务前钩子:备份数据库(仅降级时) -----
BACKUP_DIR="" BACKUP_DIR=""
if [ -n "$CURRENT_VERSION" ] && [ -n "$TARGET_VERSION" ]; then if [ -n "$CURRENT_VERSION" ] && [ -n "$TARGET_VERSION" ]; then
# 提取语义版本比较
CUR_SEMVER=$(echo "$CURRENT_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*$/\1/') CUR_SEMVER=$(echo "$CURRENT_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*$/\1/')
TGT_SEMVER=$(echo "$TARGET_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*$/\1/') TGT_SEMVER=$(echo "$TARGET_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*$/\1/')
if [ "$TGT_SEMVER" \< "$CUR_SEMVER" ] 2>/dev/null; then if [ "$TGT_SEMVER" \< "$CUR_SEMVER" ] 2>/dev/null; then
@@ -396,55 +395,52 @@ do_deploy() {
fi fi
# ----- 准备部署目录 ----- # ----- 准备部署目录 -----
print_step "准备部署目录..." print_step "准备部署目录..."
mkdir -p "$DEPLOY_DIR" mkdir -p "$DEPLOY_DIR"
mkdir -p "$DATA_DIR" mkdir -p "$DATA_DIR"
# ----- 检测并迁移旧版本文件(从根目录迁移到 data/)----- # ----- 检测并迁移旧版本文件(从根目录迁移到 data/)-----
print_step "检测旧版本文件..." print_step "检测旧版本文件..."
OLD_DB="${DEPLOY_DIR}/frpc-console.db" OLD_DB="${DEPLOY_DIR}/frpc-console.db"
OLD_TOML="${DEPLOY_DIR}/frpc.toml" OLD_TOML="${DEPLOY_DIR}/frpc.toml"
OLD_LOG="${DEPLOY_DIR}/frpc.log" OLD_LOG="${DEPLOY_DIR}/frpc.log"
OLD_PID="${DEPLOY_DIR}/frpc.pid" OLD_PID="${DEPLOY_DIR}/frpc.pid"
OLD_VERSION="${DEPLOY_DIR}/version.ini" OLD_VERSION="${DEPLOY_DIR}/version.ini"
NEW_DB="${DATA_DIR}/frpc-console.db" NEW_DB="${DATA_DIR}/frpc-console.db"
# 如果根目录有旧数据库文件,但 data/ 目录没有,执行迁移 if [ -f "$OLD_DB" ] && [ ! -f "$NEW_DB" ]; then
if [ -f "$OLD_DB" ] && [ ! -f "$NEW_DB" ]; then print_warn "检测到旧版本数据库文件在根目录,将迁移到 data/ 子目录"
print_warn "检测到旧版本数据库文件在根目录,将迁移到 data/ 子目录"
# 备份旧文件 BACKUP_OLD_DIR="${DEPLOY_DIR}/.old_backup_$(date +%Y%m%d_%H%M%S)"
BACKUP_OLD_DIR="${DEPLOY_DIR}/.old_backup_$(date +%Y%m%d_%H%M%S)" mkdir -p "$BACKUP_OLD_DIR"
mkdir -p "$BACKUP_OLD_DIR"
for file in frpc-console.db frpc.toml frpc.log frpc.pid version.ini; do for file in frpc-console.db frpc.toml frpc.log frpc.pid version.ini; do
if [ -f "${DEPLOY_DIR}/${file}" ]; then if [ -f "${DEPLOY_DIR}/${file}" ]; then
cp "${DEPLOY_DIR}/${file}" "${BACKUP_OLD_DIR}/" 2>/dev/null || true cp "${DEPLOY_DIR}/${file}" "${BACKUP_OLD_DIR}/" 2>/dev/null || true
print_info " 已备份: ${file}" print_info " 已备份: ${file}"
fi fi
done done
# 复制文件到 data/ 目录 for file in frpc-console.db frpc.toml frpc.log frpc.pid version.ini; do
for file in frpc-console.db frpc.toml frpc.log frpc.pid version.ini; do if [ -f "${DEPLOY_DIR}/${file}" ]; then
if [ -f "${DEPLOY_DIR}/${file}" ]; then cp "${DEPLOY_DIR}/${file}" "${DATA_DIR}/" 2>/dev/null || true
cp "${DEPLOY_DIR}/${file}" "${DATA_DIR}/" 2>/dev/null || true print_info " 已迁移: ${file} → data/"
print_info " 已迁移: ${file} → data/" fi
fi done
done
print_success "旧文件已迁移到 data/ 目录" print_success "旧文件已迁移到 data/ 目录"
print_info "旧文件备份位置: ${BACKUP_OLD_DIR}" print_info "旧文件备份位置: ${BACKUP_OLD_DIR}"
print_info "确认服务正常后,可手动删除备份目录" print_info "确认服务正常后,可手动删除备份目录"
else else
print_info "未检测到需要迁移的旧文件" print_info "未检测到需要迁移的旧文件"
fi fi
# ----- 构建 Docker 镜像 ----- # ----- 构建 Docker 镜像 -----
print_step "构建 Docker 镜像..." print_step "构建 Docker 镜像..."
docker build --no-cache \ docker build --no-cache \
-t "${IMAGE_NAME}:${IMAGE_TAG}" \ -t "${IMAGE_NAME}:${IMAGE_TAG}" \
. .
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
print_error "Docker 构建失败" print_error "Docker 构建失败"
exit 1 exit 1
@@ -471,7 +467,6 @@ docker build --no-cache \
# ----- 启动新容器 ----- # ----- 启动新容器 -----
print_step "启动 frpc-console 容器..." print_step "启动 frpc-console 容器..."
# 启动容器(只挂载数据目录)
docker run -d \ docker run -d \
--name frpc-console \ --name frpc-console \
--restart=always \ --restart=always \
@@ -509,20 +504,24 @@ docker build --no-cache \
print_warn "frpc 进程未运行(PID 文件不存在,请导入 TOML 后重试)" print_warn "frpc 进程未运行(PID 文件不存在,请导入 TOML 后重试)"
fi fi
# ----- 验证数据库 ----- # ----- 事务后钩子:检测数据库 -----
print_step "验证数据库状态..." print_step "验证数据库状态..."
if docker exec frpc-console sqlite3 /app/frpc-console.db "SELECT COUNT(*) FROM users;" 2>/dev/null | grep -q "^[0-9]"; then if docker exec frpc-console sqlite3 /app/data/frpc-console.db "SELECT COUNT(*) FROM users;" 2>/dev/null | grep -q "^[0-9]"; then
print_success "数据库可用" print_success "数据库可用"
else else
print_warn "数据库为空或不可用,请通过 WebUI 注册管理员账户" print_warn "数据库为空或不可用,请通过 WebUI 注册管理员账户"
fi fi
# ----- 验证版本 ----- # ----- 验证版本 -----
CONTAINER_VERSION=$(docker exec frpc-console cat /app/version.ini 2>/dev/null | tr -d '\n' || echo "") print_step "验证版本..."
sleep 1
CONTAINER_VERSION=$(docker exec frpc-console cat /app/data/version.ini 2>/dev/null | grep -v "^[;#]" | head -1 | tr -d '\n' || echo "unknown")
echo -e " 容器版本: ${CONTAINER_VERSION}"
echo -e " 目标版本: ${TARGET_VERSION}"
if [ "$CONTAINER_VERSION" = "$TARGET_VERSION" ]; then if [ "$CONTAINER_VERSION" = "$TARGET_VERSION" ]; then
print_success "容器版本验证通过: ${CONTAINER_VERSION}" print_success "版本写入成功"
else else
print_warn "容器版本: ${CONTAINER_VERSION}, 目标版本: ${TARGET_VERSION}" print_warn "版本不匹配,请检查"
fi fi
# ----- 清理旧镜像 ----- # ----- 清理旧镜像 -----
@@ -576,7 +575,7 @@ docker build --no-cache \
echo -e " ${CYAN}常用命令:${NC}" echo -e " ${CYAN}常用命令:${NC}"
echo " docker logs frpc-console # 查看日志" echo " docker logs frpc-console # 查看日志"
echo " docker restart frpc-console # 重启服务" echo " docker restart frpc-console # 重启服务"
echo " cat ${DEPLOY_DIR}/version.ini # 查看当前版本" echo " cat ${DEPLOY_DIR}/data/version.ini # 查看当前版本"
echo "" echo ""
echo -e " ${YELLOW}首次访问需要注册管理员账户${NC}" echo -e " ${YELLOW}首次访问需要注册管理员账户${NC}"
echo "" echo ""
+12 -4
View File
@@ -25,12 +25,12 @@ var FrpcTemplateContent string
var ( var (
cachedFrpcPath string cachedFrpcPath string
frpsPathMutex sync.Mutex frpcPathMutex sync.Mutex
) )
func getFrpcPath() (string, error) { func getFrpcPath() (string, error) {
frpsPathMutex.Lock() frpcPathMutex.Lock()
defer frpsPathMutex.Unlock() defer frpcPathMutex.Unlock()
if cachedFrpcPath != "" { if cachedFrpcPath != "" {
if _, err := os.Stat(cachedFrpcPath); err == nil { if _, err := os.Stat(cachedFrpcPath); err == nil {
@@ -144,7 +144,6 @@ func GenerateFrpcConfig() error {
return fmt.Errorf("渲染模板失败: %w", err) return fmt.Errorf("渲染模板失败: %w", err)
} }
// 所有文件写入 ./data/ 目录
if err := os.MkdirAll("./data", 0755); err != nil { if err := os.MkdirAll("./data", 0755); err != nil {
return fmt.Errorf("创建 data 目录失败: %w", err) return fmt.Errorf("创建 data 目录失败: %w", err)
} }
@@ -219,6 +218,15 @@ func StartFrpc() error {
return fmt.Errorf("启动 frpc 失败: %w", err) return fmt.Errorf("启动 frpc 失败: %w", err)
} }
// 回收子进程(防止僵尸进程)
go func() {
if err := cmd.Wait(); err != nil {
log.Printf("frpc 子进程退出: %v", err)
}
// 子进程退出后清理 PID 文件
os.Remove("./data/frpc.pid")
}()
if err := os.WriteFile("./data/frpc.pid", []byte(fmt.Sprintf("%d", cmd.Process.Pid)), 0644); err != nil { if err := os.WriteFile("./data/frpc.pid", []byte(fmt.Sprintf("%d", cmd.Process.Pid)), 0644); err != nil {
return fmt.Errorf("保存 PID 失败: %w", err) return fmt.Errorf("保存 PID 失败: %w", err)
} }
+5 -3
View File
@@ -1,13 +1,15 @@
## 🐳 Docker 版安装指南 ## 🐳 Docker 版安装指南
> 推荐方式:一键脚本自动部署,无需手动编译,无需安装 Go 环境。 > 推荐方式:一键脚本自动部署,无需手动编译,无需安装 Go 环境。</br>
> ⚠️ **注意**:Docker 版直接从源码构建,使用的是当前 `main` 分支的最新代码,更新进度会远快于 Release 版本。⚠️</br>
> 如需使用特定版本(如 LTS),请查看 [Releases](https://git.whitetop.xyz/lxh2875931338/frpc-console/releases) 确认版本号,并通过二进制方式部署指定版本。
### 一、📥 前置条件 ### 一、📥 前置条件
- 已安装 Docker(必须) - 已安装 Docker(必须)
- 已安装 curl / wget(脚本会自动检查并安装) - 已安装 curl / wget(脚本会自动检查并安装)
- 操作系统:Linuxx86_64 / ARM64 均可,ARMv7 将在不久的未来得到支持 - 操作系统:Linuxx86_64 / ARM64 / ARMv7 均可
### 二、🚀 一键部署(推荐) ### 二、🚀 一键部署(推荐)
@@ -130,7 +132,7 @@ docker run -d \
--name frpc-console \ --name frpc-console \
--restart=always \ --restart=always \
--network host \ --network host \
-v /opt/frpc-console/data:/app/data \ -v /opt/frpc-console/data:/app\
-e PORT=9300 \ -e PORT=9300 \
-e TZ=Asia/Shanghai \ -e TZ=Asia/Shanghai \
frpc-console:latest frpc-console:latest
+1 -4
View File
@@ -258,10 +258,7 @@ frpc-console 遵循 **“够用就好”** 的原则:
## 📝 更新日志 ## 📝 更新日志
#### 相关更新日志请查看[update-logs.md](./update-logs.md)
## 📝 更新日志
####相关更新日志请查看[update-logs.md](https://git.whitetop.xyz/lxh2875931338/frpc-console/raw/main/update-logs.md)
--- ---
+1 -1
View File
@@ -170,7 +170,7 @@ function filterProxies(list, keyword) {
(p) => (p) =>
p.name.toLowerCase().includes(kw) || p.name.toLowerCase().includes(kw) ||
p.localIP.includes(kw) || p.localIP.includes(kw) ||
String(p.remotePort).includes(kw), String(p.remotePort).includes(kw)
); );
} }
Binary file not shown.
+31 -29
View File
@@ -100,7 +100,8 @@
<!-- Ping 延迟显示 --> <!-- Ping 延迟显示 -->
<span class="ping-display" :class="pingStatusClass"> <span class="ping-display" :class="pingStatusClass">
<span class="ping-icon" v-html="pingIcon"></span> <span class="ping-icon" v-html="pingIcon"></span>
<span class="ping-value">{{ pingLatency !== null ? pingLatency + 'ms' : '--ms' }}</span> <span class="ping-value">{{ pingLatency !== null ? pingLatency + 'ms' : '--ms'
}}</span>
</span> </span>
</span> </span>
</div> </div>
@@ -343,34 +344,7 @@
</div> <!-- /content-area --> </div> <!-- /content-area -->
<!-- ====== 弹窗 ====== --> <!-- ====== 弹窗 ====== -->
<Transition name="dialog">
<div v-if="dialogVisible" class="dialog-overlay" @click.self="dialogVisible = false">
<div class="dialog-card">
<h3>{{ dialogMode === 'add' ? '新增隧道' : '编辑隧道' }}</h3>
<div class="dialog-form">
<div class="form-row"><label>名称</label><input v-model="dialogForm.name" /></div>
<div class="form-row">
<label>类型</label>
<select v-model="dialogForm.type">
<option value="tcp">tcp</option>
<option value="udp">udp</option>
<option value="http">http</option>
<option value="https">https</option>
</select>
</div>
<div class="form-row"><label>本地 IP</label><input v-model="dialogForm.localIP" /></div>
<div class="form-row"><label>本地端口</label><input type="number" v-model="dialogForm.localPort" />
</div>
<div class="form-row"><label>远程端口</label><input type="number" v-model="dialogForm.remotePort" />
</div>
</div>
<div class="dialog-actions">
<button class="btn-cancel" @click="dialogVisible = false">取消</button>
<button class="btn-confirm" @click="confirmDialog">确认</button>
</div>
</div>
</div>
</Transition>
</div> <!-- /main-panel --> </div> <!-- /main-panel -->
</div> <!-- /app-container --> </div> <!-- /app-container -->
@@ -378,6 +352,34 @@
<!-- 隐藏文件选择器 --> <!-- 隐藏文件选择器 -->
<input type="file" id="tomlFileInput" accept=".toml" style="display:none" @change="handleImport" /> <input type="file" id="tomlFileInput" accept=".toml" style="display:none" @change="handleImport" />
<Transition name="dialog">
<div v-if="dialogVisible" class="dialog-overlay" @click.self="dialogVisible = false">
<div class="dialog-card">
<h3>{{ dialogMode === 'add' ? '新增隧道' : '编辑隧道' }}</h3>
<div class="dialog-form">
<div class="form-row"><label>名称</label><input v-model="dialogForm.name" /></div>
<div class="form-row">
<label>类型</label>
<select v-model="dialogForm.type">
<option value="tcp">tcp</option>
<option value="udp">udp</option>
<option value="http">http</option>
<option value="https">https</option>
</select>
</div>
<div class="form-row"><label>本地 IP</label><input v-model="dialogForm.localIP" /></div>
<div class="form-row"><label>本地端口</label><input type="number" v-model="dialogForm.localPort" />
</div>
<div class="form-row"><label>远程端口</label><input type="number" v-model="dialogForm.remotePort" />
</div>
</div>
<div class="dialog-actions">
<button class="btn-cancel" @click="dialogVisible = false">取消</button>
<button class="btn-confirm" @click="confirmDialog">确认</button>
</div>
</div>
</div>
</Transition>
</div> <!-- /#app --> </div> <!-- /#app -->
<script src="/static/app.js"></script> <script src="/static/app.js"></script>
+22 -23
View File
@@ -1,30 +1,28 @@
/* ===== style-1.css - 全局基础 ===== */ /* ===== style-1.css - 全局基础 ===== */
/* ---------- 字体定义 ---------- */ /* ---------- 字体定义 ---------- */
/* 自托管 HarmonyOS Sans SC Regular */
/* 中英文:HarmonyOS Sans SC Regular */
@font-face { @font-face {
font-family: 'HarmonyOS Sans SC'; font-family: 'HarmonyOS Sans SC';
src: local('HarmonyOS Sans SC'), src: url('./fonts/HarmonyOS_Sans_SC_Regular.ttf') format('truetype');
local('PingFang SC'),
local('Microsoft YaHei'),
local('Helvetica Neue');
font-weight: 400; font-weight: 400;
font-style: normal;
font-display: swap; font-display: swap;
} }
/* 数字专用:复用 HarmonyOS Sans SC Regular(因 Light 版本缺失) */
@font-face { @font-face {
font-family: 'HarmonyOS Sans SC'; font-family: 'HarmonyOS Sans';
src: local('HarmonyOS Sans SC Medium'), src: url('./fonts/HarmonyOS_Sans_SC_Regular.ttf') format('truetype');
local('PingFang SC Medium'); font-weight: 300;
font-weight: 500; font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'HarmonyOS Sans SC';
src: local('HarmonyOS Sans SC Bold'),
local('PingFang SC Semibold');
font-weight: 700;
font-display: swap; font-display: swap;
} }
/* 后备:如果自托管字体加载失败,使用系统字体 */
/* ---------- 重置 ---------- */ /* ---------- 重置 ---------- */
* { * {
margin: 0; margin: 0;
@@ -33,14 +31,14 @@
} }
body { body {
font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; font-family: 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
background: #0a0a0f; background: #0a0a0f;
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
color: #e0e0e0; color: #e0e0e0;
} }
/* ---------- 数字专用字体(加粗 ---------- */ /* ---------- 数字专用字体(使用 HarmonyOS Sans ---------- */
.digit, .digit,
.big-number, .big-number,
.remote-port, .remote-port,
@@ -51,22 +49,23 @@ body {
.login-btn, .login-btn,
.save-btn, .save-btn,
.btn-confirm { .btn-confirm {
font-weight: 600 !important; font-weight: 300 !important;
letter-spacing: 0.02em; letter-spacing: 0.02em;
font-family: 'HarmonyOS Sans', 'JetBrains Mono', monospace;
} }
/* 数字特别加粗(适用于大数字展示) */ /* 数字特别加粗(适用于大数字展示) */
.big-number { .big-number {
font-weight: 700 !important; font-weight: 600 !important;
letter-spacing: -0.01em; letter-spacing: -0.01em;
} }
/* 代码/端口类数字使用等宽字体,但保持加粗 */ /* 代码/端口类数字使用等宽字体,但保持 HarmonyOS Sans 风格 */
.digit, .digit,
.remote-port, .remote-port,
.proxy-addr { .proxy-addr {
font-family: 'HarmonyOS Sans SC', 'JetBrains Mono', monospace; font-family: 'HarmonyOS Sans', 'JetBrains Mono', monospace;
font-weight: 600 !important; font-weight: 300 !important;
} }
/* ---------- 全局颜色变量 ---------- */ /* ---------- 全局颜色变量 ---------- */
@@ -175,7 +174,7 @@ body {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 20px 28px; /* ← 补上内边距 */ padding: 20px 28px;
opacity: 0; opacity: 0;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
} }
+45 -7
View File
@@ -17,8 +17,8 @@
} }
.top-left .nav-logo { .top-left .nav-logo {
width: 48px; width: 52px; /* 原 48px */
height: 48px; height: 52px; /* 原 48px */
flex-shrink: 0; flex-shrink: 0;
display: block; display: block;
object-fit: contain; object-fit: contain;
@@ -32,7 +32,7 @@
} }
.brand-info .logo-text { .brand-info .logo-text {
font-size: 22px; font-size: 20px;
font-weight: 600; font-weight: 600;
color: var(--text-primary); color: var(--text-primary);
line-height: 1.2; line-height: 1.2;
@@ -59,8 +59,9 @@
box-shadow: 0 0 12px rgba(99, 226, 183, 0.4); box-shadow: 0 0 12px rgba(99, 226, 183, 0.4);
} }
/* 状态文字 12px(原 13px */
.status-wrapper .status-text { .status-wrapper .status-text {
font-size: 13px; font-size: 12px;
color: var(--text-muted); color: var(--text-muted);
} }
@@ -71,7 +72,7 @@
} }
.user-name { .user-name {
font-size: 13px; font-size: 12px; /* 原 13px,与状态文字对齐 */
color: var(--text-secondary); color: var(--text-secondary);
} }
@@ -375,7 +376,7 @@
.proxy-addr { .proxy-addr {
font-size: 13px; font-size: 13px;
color: var(--text-dim); color: var(--text-dim);
font-family: 'JetBrains Mono', monospace; font-family: 'HarmonyOS Sans','JetBrains Mono', monospace;
} }
.proxy-tag { .proxy-tag {
@@ -395,7 +396,7 @@
} }
.remote-port { .remote-port {
font-family: 'JetBrains Mono', monospace; font-family: 'HarmonyOS Sans','JetBrains Mono', monospace;
font-size: 14px; font-size: 14px;
color: var(--text-secondary); color: var(--text-secondary);
} }
@@ -800,4 +801,41 @@ select:disabled {
width: 14px; width: 14px;
height: 14px; height: 14px;
} }
}
/* ---------- Tab 栏 ---------- */
.tab-bar {
display: flex;
gap: 32px;
padding: 14px 0 12px;
flex-shrink: 0;
border-bottom: 1px solid var(--border-subtle);
}
/* 将最后一个 Tab(用户配置)推到最右侧 */
.tab-item:last-child {
margin-left: auto;
/* 防止用户名过长导致溢出 */
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tab-item {
font-size: 14px;
color: var(--text-muted);
cursor: pointer;
padding: 4px 0;
transition: color 0.3s, border-color 0.3s;
border-bottom: 2px solid transparent;
}
.tab-item:hover {
color: var(--text-secondary);
}
.tab-item.active {
color: var(--primary-blue);
border-bottom-color: var(--primary-blue);
} }
+1 -1
View File
@@ -3,4 +3,4 @@
; 示例: ; 示例:
; 2.4 # Preview 版本,无日期 ; 2.4 # Preview 版本,无日期
; 2.5 20260729 # LTS 版本,带发布日期 ; 2.5 20260729 # LTS 版本,带发布日期
2.4 2.5