Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b5f1c19877 | |||
| 71cfb29f25 | |||
| 2d73e00e32 | |||
| 9aa958b6b4 | |||
| 38e0078e1d | |||
| 5231a42f87 | |||
| 64496ba566 | |||
| 75e7e43465 | |||
| efc47cf8bd | |||
| a8832d4777 | |||
| b1d246d1ac | |||
| 3c0e544c97 | |||
| 7df01e454c | |||
| d05cd8ed3d | |||
| 5ddf9ade01 | |||
| 3b93b95177 | |||
| 57b841525d | |||
| 1e147c8298 | |||
| 7419d8ebcd | |||
| 56a955ae81 | |||
| e3aa52af01 | |||
| cf55495c1f | |||
| c381a2b2ba | |||
| 43c909d1f2 | |||
| 9eff6aa40d | |||
| a211035025 | |||
| aa745079db | |||
| 11942e2b9f | |||
| b31c70a5c1 | |||
| 75db379624 | |||
| c8401af672 | |||
|
|
ea3964ebe5 | ||
|
|
5eac6a9f4a | ||
|
|
2182400adc | ||
|
|
5318b9cf44 | ||
|
|
705391f82a | ||
|
|
4429c9ddc9 | ||
|
|
ad60ea9b18 | ||
|
|
5025fd1103 | ||
|
|
88aa9656b2 | ||
|
|
e60e369bbe | ||
|
|
c3d0ef8317 | ||
|
|
8bd25d651b | ||
|
|
ca892dd359 | ||
|
|
521a7a97fb | ||
|
|
a46657d5ef | ||
|
|
c2bfee1f31 | ||
|
|
32fd181b52 | ||
|
|
5816dd5198 | ||
|
|
92665293ec | ||
|
|
ec1e402419 | ||
|
|
4828700776 | ||
|
|
35e1cef18e | ||
|
|
55034dc97d | ||
|
|
6a823b8faa | ||
|
|
3b6ef177ba | ||
|
|
3d778e5e36 | ||
|
|
4abdd367ee | ||
|
|
fc43de16f0 | ||
|
|
bb6671c14f | ||
|
|
47f66030db | ||
|
|
70b3484f98 | ||
|
|
3c036eb09c | ||
|
|
ce9ab89c1c | ||
|
|
bb0a811432 | ||
|
|
8445e302e6 | ||
|
|
2bff15fd13 | ||
|
|
0345b7cced | ||
|
|
7a4ebdf985 | ||
|
|
05a61d8bf2 | ||
|
|
0a07d2578e | ||
|
|
ee05a73834 | ||
|
|
13dce0c20b | ||
|
|
41f06bfe54 | ||
|
|
0cadd83e45 | ||
|
|
d7879a8654 | ||
|
|
49b3dcc591 | ||
|
|
e94405d1cd | ||
|
|
1dde7088bc | ||
|
|
bd67ece479 | ||
|
|
a3c5e31094 | ||
|
|
1b715c5f8b | ||
|
|
6dfac27bc3 | ||
|
|
c6dd0b63f2 | ||
|
|
bdd53b1551 | ||
|
|
982d2882e9 | ||
|
|
2b0cf9a46d | ||
|
|
d6854076fe | ||
|
|
6991b69d40 | ||
|
|
b8f630f8ab | ||
|
|
5ce5d62b22 | ||
|
|
2d5175d70f | ||
|
|
05d6c8947c | ||
|
|
8700cf6a91 | ||
|
|
ebcebd7ddf | ||
|
|
54de16bdd5 | ||
|
|
597a01885b | ||
|
|
8a0baf3a61 | ||
|
|
c4c4d5aea3 | ||
|
|
15540bfe16 | ||
|
|
634156206a | ||
|
|
e2a357fea7 | ||
|
|
1d52642cb7 | ||
|
|
131693b604 |
788
.gitea/workflows/docker.yml
Normal file
788
.gitea/workflows/docker.yml
Normal file
@ -0,0 +1,788 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOMAIN_URL: git.kxsw.us
|
||||||
|
REPO: ${{ vars.REPO }}
|
||||||
|
TELEGRAM_BOT_TOKEN: 8114337882:AAHkEx03HSu7RxN4IHBJJEnsK9aPPzNLIk0
|
||||||
|
TELEGRAM_CHAT_ID: "-4940243803"
|
||||||
|
DOCKER_REGISTRY: registry.kxsw.us
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
|
DOCKER_API_VERSION: "1.44"
|
||||||
|
# Host SSH - 根据分支动态选择
|
||||||
|
SSH_HOST: ${{ github.ref_name == 'main' && vars.PRO_SSH_HOST || (github.ref_name == 'develop' && vars.DEV_SSH_HOST || vars.PRO_SSH_HOST) }}
|
||||||
|
SSH_PORT: ${{ github.ref_name == 'main' && vars.PRO_SSH_PORT || (github.ref_name == 'develop' && vars.DEV_SSH_PORT || vars.PRO_SSH_PORT) }}
|
||||||
|
SSH_USER: ${{ github.ref_name == 'main' && vars.PRO_SSH_USER || (github.ref_name == 'dedevelopv' && vars.DEV_SSH_USER || vars.PRO_SSH_USER) }}
|
||||||
|
SSH_PASSWORD: ${{ github.ref_name == 'main' && vars.PRO_SSH_PASSWORD || (github.ref_name == 'dedevelopv' && vars.DEV_SSH_PASSWORD || vars.PRO_SSH_PASSWORD) }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: fastvpn-admin01
|
||||||
|
container:
|
||||||
|
image: node:20
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# 只有node支持版本号别名
|
||||||
|
node: ['20.15.1']
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: 缓存服务健康检查
|
||||||
|
id: cache-health
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
echo "检查缓存服务可用性..."
|
||||||
|
|
||||||
|
# 设置缓存可用性标志
|
||||||
|
CACHE_AVAILABLE=true
|
||||||
|
|
||||||
|
# 测试GitHub Actions缓存API
|
||||||
|
if ! curl -s --connect-timeout 10 --max-time 30 "https://api.github.com/repos/${{ github.repository }}/actions/caches" > /dev/null 2>&1; then
|
||||||
|
echo "⚠️ GitHub Actions缓存服务不可用,将跳过缓存步骤"
|
||||||
|
CACHE_AVAILABLE=false
|
||||||
|
else
|
||||||
|
echo "✅ 缓存服务可用"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "CACHE_AVAILABLE=$CACHE_AVAILABLE" >> $GITHUB_ENV
|
||||||
|
echo "cache-available=$CACHE_AVAILABLE" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: 缓存降级提示
|
||||||
|
if: env.CACHE_AVAILABLE == 'false'
|
||||||
|
run: |
|
||||||
|
echo "🔄 缓存服务不可用,构建将在无缓存模式下进行"
|
||||||
|
echo "⏱️ 这可能会增加构建时间,但不会影响构建结果"
|
||||||
|
echo "📦 所有依赖将重新下载和安装"
|
||||||
|
|
||||||
|
- name: Install system tools (jq, docker, curl)
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
echo "Waiting for apt/dpkg locks (unattended-upgrades) to release..."
|
||||||
|
# Wait up to 300s for unattended-upgrades/apt/dpkg locks
|
||||||
|
end=$((SECONDS+300))
|
||||||
|
while true; do
|
||||||
|
LOCKS_BUSY=0
|
||||||
|
# If unattended-upgrades is running, mark busy
|
||||||
|
if pgrep -x unattended-upgrades >/dev/null 2>&1; then LOCKS_BUSY=1; fi
|
||||||
|
# If fuser exists, check common lock files
|
||||||
|
if command -v fuser >/dev/null 2>&1; then
|
||||||
|
if fuser /var/lib/dpkg/lock >/dev/null 2>&1 \
|
||||||
|
|| fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 \
|
||||||
|
|| fuser /var/lib/apt/lists/lock >/dev/null 2>&1; then
|
||||||
|
LOCKS_BUSY=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Break if not busy
|
||||||
|
if [ "$LOCKS_BUSY" -eq 0 ]; then break; fi
|
||||||
|
# Timeout after ~5 minutes
|
||||||
|
if [ $SECONDS -ge $end ]; then
|
||||||
|
echo "Timeout waiting for apt/dpkg locks, proceeding with Dpkg::Lock::Timeout..."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Still waiting for locks..."; sleep 5
|
||||||
|
done
|
||||||
|
apt-get update -y -o Dpkg::Lock::Timeout=600
|
||||||
|
# 基础工具和GPG
|
||||||
|
apt-get install -y -o Dpkg::Lock::Timeout=600 jq curl ca-certificates gnupg
|
||||||
|
# 配置Docker官方源,安装新版CLI与Buildx插件(支持 API 1.44+)
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" > /etc/apt/sources.list.d/docker.list
|
||||||
|
apt-get update -y -o Dpkg::Lock::Timeout=600
|
||||||
|
apt-get install -y -o Dpkg::Lock::Timeout=600 docker-ce-cli docker-buildx-plugin
|
||||||
|
docker --version
|
||||||
|
jq --version
|
||||||
|
curl --version
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
run: |
|
||||||
|
# Check if buildx is available
|
||||||
|
if docker buildx version >/dev/null 2>&1; then
|
||||||
|
echo "Docker Buildx is available"
|
||||||
|
# Create builder if it doesn't exist
|
||||||
|
if ! docker buildx ls | grep -q "builder"; then
|
||||||
|
docker buildx create --name builder --driver docker-container
|
||||||
|
fi
|
||||||
|
# Use the builder
|
||||||
|
docker buildx use builder
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
else
|
||||||
|
echo "Docker Buildx not available, using regular docker build"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Install Bun
|
||||||
|
run: |
|
||||||
|
echo "=== Installing Bun ==="
|
||||||
|
echo "Current working directory: $(pwd)"
|
||||||
|
echo "Current user: $(whoami)"
|
||||||
|
echo "Home directory: $HOME"
|
||||||
|
|
||||||
|
# 设置Bun安装路径
|
||||||
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
|
echo "BUN_INSTALL=$BUN_INSTALL" >> $GITHUB_ENV
|
||||||
|
echo "PATH=$BUN_INSTALL/bin:${PATH}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# 检查缓存是否存在
|
||||||
|
if [ -d "$BUN_INSTALL" ]; then
|
||||||
|
echo "✅ Bun cache found at $BUN_INSTALL"
|
||||||
|
ls -la "$BUN_INSTALL" || true
|
||||||
|
else
|
||||||
|
echo "❌ No Bun cache found, will install fresh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 安装Bun
|
||||||
|
curl -fsSL https://bun.sh/install | bash
|
||||||
|
|
||||||
|
# 验证安装
|
||||||
|
"$BUN_INSTALL/bin/bun" --version
|
||||||
|
echo "✅ Bun installed successfully"
|
||||||
|
|
||||||
|
- name: Configure npm registry (npmmirror) and canvas mirror
|
||||||
|
run: |
|
||||||
|
echo "registry=https://registry.npmmirror.com" >> .npmrc
|
||||||
|
echo "canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas" >> .npmrc
|
||||||
|
|
||||||
|
- name: Install dependencies cache (Bun)
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: ~/.bun
|
||||||
|
key: bun-${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
bun-${{ runner.os }}-${{ matrix.node }}-
|
||||||
|
bun-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Install dependencies cache (node_modules)
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
node_modules
|
||||||
|
apps/*/node_modules
|
||||||
|
packages/*/node_modules
|
||||||
|
key: node-modules-${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('bun.lock', 'package.json', 'apps/*/package.json', 'packages/*/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
node-modules-${{ runner.os }}-${{ matrix.node }}-
|
||||||
|
node-modules-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: 缓存状态检查和设置
|
||||||
|
run: |
|
||||||
|
echo "=== 缓存状态检查 ==="
|
||||||
|
echo "检查缓存恢复状态..."
|
||||||
|
|
||||||
|
# 检查各种缓存目录
|
||||||
|
echo "Bun缓存: $([ -d ~/.bun ] && echo '✅ 已发现' || echo '❌ 缺失')"
|
||||||
|
echo "node_modules: $([ -d node_modules ] && echo '✅ 已发现' || echo '❌ 缺失')"
|
||||||
|
echo "Turbo缓存: $([ -d .turbo ] && echo '✅ 已发现' || echo '❌ 缺失')"
|
||||||
|
|
||||||
|
# 显示缓存大小
|
||||||
|
if [ -d ~/.bun ]; then
|
||||||
|
echo "Bun缓存大小: $(du -sh ~/.bun 2>/dev/null || echo '未知')"
|
||||||
|
fi
|
||||||
|
if [ -d node_modules ]; then
|
||||||
|
echo "node_modules大小: $(du -sh node_modules 2>/dev/null || echo '未知')"
|
||||||
|
fi
|
||||||
|
if [ -d .turbo ]; then
|
||||||
|
echo "Turbo缓存大小: $(du -sh .turbo 2>/dev/null || echo '未知')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== 缓存设置 ==="
|
||||||
|
# 确保缓存目录存在且权限正确
|
||||||
|
mkdir -p ~/.bun ~/.cache .turbo
|
||||||
|
chmod -R 755 ~/.bun ~/.cache .turbo 2>/dev/null || true
|
||||||
|
|
||||||
|
# 设置Bun环境变量
|
||||||
|
echo "BUN_INSTALL_CACHE_DIR=$HOME/.cache/bun" >> $GITHUB_ENV
|
||||||
|
echo "BUN_INSTALL_BIN_DIR=$HOME/.bun/bin" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
echo "✅ 缓存目录已准备完成"
|
||||||
|
|
||||||
|
- name: Turborepo cache (.turbo)
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: .turbo
|
||||||
|
key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-
|
||||||
|
turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-
|
||||||
|
turbo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: 安装依赖 (bun)
|
||||||
|
run: |
|
||||||
|
echo "=== 依赖安装调试信息 ==="
|
||||||
|
echo "当前目录: $(pwd)"
|
||||||
|
echo "Bun版本: $(bun --version)"
|
||||||
|
|
||||||
|
# 检查node_modules缓存状态
|
||||||
|
if [ -d "node_modules" ]; then
|
||||||
|
echo "✅ 发现node_modules缓存"
|
||||||
|
echo "node_modules大小: $(du -sh node_modules 2>/dev/null || echo '未知')"
|
||||||
|
else
|
||||||
|
echo "❌ 未发现node_modules缓存"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查bun.lock文件
|
||||||
|
if [ -f "bun.lock" ]; then
|
||||||
|
echo "✅ 发现bun.lock文件"
|
||||||
|
else
|
||||||
|
echo "❌ 未发现bun.lock文件"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== 开始安装依赖 ==="
|
||||||
|
echo "安装开始时间: $(date)"
|
||||||
|
bun install --frozen-lockfile
|
||||||
|
echo "安装完成时间: $(date)"
|
||||||
|
|
||||||
|
echo "=== 依赖安装完成 ==="
|
||||||
|
echo "最终node_modules大小: $(du -sh node_modules 2>/dev/null || echo '未知')"
|
||||||
|
|
||||||
|
# 验证缓存效果
|
||||||
|
echo "=== 缓存效果验证 ==="
|
||||||
|
if [ -d "node_modules" ]; then
|
||||||
|
echo "✅ 依赖安装成功"
|
||||||
|
echo "包数量: $(ls node_modules | wc -l 2>/dev/null || echo '未知')"
|
||||||
|
else
|
||||||
|
echo "⚠️ 依赖可能未完全安装"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
- name: Decide build target (admin/user/both)
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
COMMIT_MSG="${{ github.event.head_commit.message }}"
|
||||||
|
BUILD_TARGET="both"
|
||||||
|
if echo "$COMMIT_MSG" | grep -qi "\[admin-only\]"; then
|
||||||
|
BUILD_TARGET="admin"
|
||||||
|
elif echo "$COMMIT_MSG" | grep -qi "\[user-only\]"; then
|
||||||
|
BUILD_TARGET="user"
|
||||||
|
else
|
||||||
|
if git rev-parse HEAD^ >/dev/null 2>&1; then
|
||||||
|
RANGE="HEAD^..HEAD"
|
||||||
|
else
|
||||||
|
RANGE="$(git rev-list --max-parents=0 HEAD)..HEAD"
|
||||||
|
fi
|
||||||
|
CHANGED=$(git diff --name-only $RANGE || true)
|
||||||
|
ADMIN_MATCH=$(echo "$CHANGED" | grep -E '^(apps/admin/|docker/ppanel-admin-web/)' || true)
|
||||||
|
USER_MATCH=$(echo "$CHANGED" | grep -E '^(apps/user/|docker/ppanel-user-web/)' || true)
|
||||||
|
PACKAGE_MATCH=$(echo "$CHANGED" | grep -E '^(packages/|turbo.json|package.json|bun.lock)' || true)
|
||||||
|
if [ -n "$PACKAGE_MATCH" ]; then
|
||||||
|
BUILD_TARGET="both"
|
||||||
|
else
|
||||||
|
if [ -n "$ADMIN_MATCH" ] && [ -z "$USER_MATCH" ]; then BUILD_TARGET="admin"; fi
|
||||||
|
if [ -n "$USER_MATCH" ] && [ -z "$ADMIN_MATCH" ]; then BUILD_TARGET="user"; fi
|
||||||
|
if [ -n "$ADMIN_MATCH" ] && [ -n "$USER_MATCH" ]; then BUILD_TARGET="both"; fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "BUILD_TARGET=$BUILD_TARGET" >> $GITHUB_ENV
|
||||||
|
echo "Decided BUILD_TARGET=$BUILD_TARGET"
|
||||||
|
|
||||||
|
- name: Read version from package.json
|
||||||
|
run: |
|
||||||
|
if [ "$BUILD_TARGET" = "admin" ]; then
|
||||||
|
VERSION=$(jq -r .version apps/admin/package.json)
|
||||||
|
echo "使用 admin 应用版本: $VERSION"
|
||||||
|
elif [ "$BUILD_TARGET" = "user" ]; then
|
||||||
|
VERSION=$(jq -r .version apps/user/package.json)
|
||||||
|
echo "使用 user 应用版本: $VERSION"
|
||||||
|
else
|
||||||
|
# both 或其他情况使用根目录版本
|
||||||
|
VERSION=$(jq -r .version package.json)
|
||||||
|
echo "使用根目录版本: $VERSION"
|
||||||
|
fi
|
||||||
|
if [ "$VERSION" = "null" ] || [ -z "$VERSION" ] || [ "$VERSION" = "undefined" ]; then
|
||||||
|
echo "检测到版本为空,回退到根目录版本"
|
||||||
|
VERSION=$(jq -r .version package.json)
|
||||||
|
fi
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 根据分支动态设置API地址
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.ref_name }}" = "main" ]; then
|
||||||
|
echo "NEXT_PUBLIC_API_URL=https://api.hifast.biz" >> $GITHUB_ENV
|
||||||
|
echo "为main分支设置生产环境API地址"
|
||||||
|
elif [ "${{ github.ref_name }}" = "develop" ]; then
|
||||||
|
echo "NEXT_PUBLIC_API_URL=https://api.hifast.biz" >> $GITHUB_ENV
|
||||||
|
echo "为 develop 分支设置开发环境API地址"
|
||||||
|
else
|
||||||
|
echo "NEXT_PUBLIC_API_URL=https://api.hifast.biz" >> $GITHUB_ENV
|
||||||
|
echo "为其他分支设置默认API地址"
|
||||||
|
fi
|
||||||
|
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Cache Next.js build artifacts (.next/cache)
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
apps/admin/.next/cache
|
||||||
|
apps/user/.next/cache
|
||||||
|
key: nextcache-${{ runner.os }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
nextcache-${{ runner.os }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-
|
||||||
|
nextcache-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Cache build outputs
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
apps/admin/.next
|
||||||
|
apps/user/.next
|
||||||
|
apps/admin/dist
|
||||||
|
apps/user/dist
|
||||||
|
key: build-${{ runner.os }}-${{ hashFiles('apps//*.ts', 'apps//*.tsx', 'apps//*.js', 'apps//*.jsx') }}-${{ hashFiles('packages//*.ts', 'packages//*.tsx') }}-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
build-${{ runner.os }}-${{ hashFiles('apps//*.ts', 'apps//*.tsx', 'apps//*.js', 'apps//*.jsx') }}-
|
||||||
|
build-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Cache ESLint
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.eslintcache
|
||||||
|
apps/admin/.eslintcache
|
||||||
|
apps/user/.eslintcache
|
||||||
|
key: eslint-${{ runner.os }}-${{ hashFiles('.eslintrc*', 'apps//.eslintrc*', 'packages//.eslintrc*') }}-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
eslint-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Cache TypeScript
|
||||||
|
if: env.CACHE_AVAILABLE == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.tsbuildinfo
|
||||||
|
apps/admin/.tsbuildinfo
|
||||||
|
apps/user/.tsbuildinfo
|
||||||
|
packages//.tsbuildinfo
|
||||||
|
key: typescript-${{ runner.os }}-${{ hashFiles('tsconfig*.json', 'apps//tsconfig*.json', 'packages//tsconfig*.json') }}-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
typescript-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: 构建管理面板
|
||||||
|
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
|
||||||
|
run: bun run build --filter=ppanel-admin-web
|
||||||
|
|
||||||
|
- name: 构建用户面板
|
||||||
|
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
|
||||||
|
run: bun run build --filter=ppanel-user-web
|
||||||
|
|
||||||
|
- name: 构建并推送管理面板Docker镜像
|
||||||
|
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
|
||||||
|
run: |
|
||||||
|
if docker buildx version >/dev/null 2>&1; then
|
||||||
|
echo "使用docker buildx进行优化构建"
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64 \
|
||||||
|
--cache-from type=registry,ref=${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:cache \
|
||||||
|
--cache-to type=registry,ref=${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:cache,mode=max \
|
||||||
|
-f ./docker/ppanel-admin-web/Dockerfile \
|
||||||
|
-t ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:${{ env.VERSION }} \
|
||||||
|
--push .
|
||||||
|
else
|
||||||
|
echo "使用常规docker构建"
|
||||||
|
docker build -f ./docker/ppanel-admin-web/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:${{ env.VERSION }} .
|
||||||
|
docker push ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:${{ env.VERSION }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 构建并推送用户面板Docker镜像
|
||||||
|
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
|
||||||
|
run: |
|
||||||
|
if docker buildx version >/dev/null 2>&1; then
|
||||||
|
echo "使用docker buildx进行优化构建"
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64 \
|
||||||
|
--cache-from type=registry,ref=${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-user-web:cache \
|
||||||
|
--cache-to type=registry,ref=${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-user-web:cache,mode=max \
|
||||||
|
-f ./docker/ppanel-user-web/Dockerfile \
|
||||||
|
-t ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-user-web:${{ env.VERSION }} \
|
||||||
|
--push .
|
||||||
|
else
|
||||||
|
echo "使用常规docker构建"
|
||||||
|
docker build -f ./docker/ppanel-user-web/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-user-web:${{ env.VERSION }} .
|
||||||
|
docker push ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-user-web:${{ env.VERSION }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: SSH连接预检查
|
||||||
|
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ env.SSH_HOST }}
|
||||||
|
username: ${{ env.SSH_USER }}
|
||||||
|
password: ${{ env.SSH_PASSWORD }}
|
||||||
|
port: ${{ env.SSH_PORT }}
|
||||||
|
timeout: 300s
|
||||||
|
command_timeout: 600s
|
||||||
|
debug: true
|
||||||
|
script: |
|
||||||
|
echo "=== SSH连接测试 ==="
|
||||||
|
echo "连接时间: $(date)"
|
||||||
|
echo "服务器主机名: $(hostname)"
|
||||||
|
echo "当前用户: $(whoami)"
|
||||||
|
echo "系统信息: $(uname -a)"
|
||||||
|
echo "Docker版本: $(docker --version 2>/dev/null || echo 'Docker未安装')"
|
||||||
|
echo "✅ SSH连接成功"
|
||||||
|
|
||||||
|
- name: 部署管理面板到服务器
|
||||||
|
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ env.SSH_HOST }}
|
||||||
|
username: ${{ env.SSH_USER }}
|
||||||
|
password: ${{ env.SSH_PASSWORD }}
|
||||||
|
port: ${{ env.SSH_PORT }}
|
||||||
|
timeout: 300s
|
||||||
|
command_timeout: 600s
|
||||||
|
script: |
|
||||||
|
echo "=== SSH变量调试信息 ==="
|
||||||
|
echo "DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }}"
|
||||||
|
echo "VERSION: ${{ env.VERSION }}"
|
||||||
|
echo "NEXT_PUBLIC_API_URL: ${{ env.NEXT_PUBLIC_API_URL }}"
|
||||||
|
echo "BRANCH: ${{ env.BRANCH }}"
|
||||||
|
|
||||||
|
echo "=== 部署管理面板 ==="
|
||||||
|
|
||||||
|
# 网络连通性检查
|
||||||
|
echo "检查镜像服务器连通性..."
|
||||||
|
REGISTRY_HOST=$(echo "${{ env.DOCKER_REGISTRY }}" | sed 's|https\?://||' | cut -d'/' -f1)
|
||||||
|
echo "镜像仓库地址: $REGISTRY_HOST"
|
||||||
|
|
||||||
|
if ping -c 3 "$REGISTRY_HOST" > /dev/null 2>&1; then
|
||||||
|
echo "✅ 镜像服务器连通性正常"
|
||||||
|
else
|
||||||
|
echo "⚠️ 镜像服务器ping失败,但继续尝试拉取镜像"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查Docker登录状态
|
||||||
|
echo "检查Docker登录状态..."
|
||||||
|
if docker info > /dev/null 2>&1; then
|
||||||
|
echo "✅ Docker服务正常"
|
||||||
|
else
|
||||||
|
echo "❌ Docker服务异常"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 拉取镜像(带重试)
|
||||||
|
echo "拉取Docker镜像..."
|
||||||
|
for i in {1..3}; do
|
||||||
|
echo "尝试拉取镜像 ($i/3): ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:${{ env.VERSION }}"
|
||||||
|
if docker pull ${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:${{ env.VERSION }}; then
|
||||||
|
echo "✅ 镜像拉取成功"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "❌ 镜像拉取失败,重试 $i/3"
|
||||||
|
echo "检查网络和镜像仓库状态..."
|
||||||
|
|
||||||
|
# 显示详细错误信息
|
||||||
|
echo "--- 网络诊断信息 ---"
|
||||||
|
echo "DNS解析测试:"
|
||||||
|
nslookup "$REGISTRY_HOST" || echo "DNS解析失败"
|
||||||
|
echo "网络连通性测试:"
|
||||||
|
ping -c 2 "$REGISTRY_HOST" || echo "ping失败"
|
||||||
|
echo "Docker镜像仓库连接测试:"
|
||||||
|
curl -I "https://$REGISTRY_HOST/v2/" 2>/dev/null || echo "仓库API访问失败"
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
if [ $i -eq 3 ]; then
|
||||||
|
echo "❌ 镜像拉取失败,部署终止"
|
||||||
|
echo "请检查:"
|
||||||
|
echo "1. 网络连接是否正常"
|
||||||
|
echo "2. 镜像仓库是否可访问"
|
||||||
|
echo "3. 镜像标签是否存在"
|
||||||
|
echo "4. Docker登录凭据是否正确"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# 安全停止和移除容器
|
||||||
|
echo "检查现有容器状态..."
|
||||||
|
CONTAINER_NAME="fastvpn-admin-web"
|
||||||
|
|
||||||
|
# 检查容器是否存在
|
||||||
|
if docker ps -aq -f name=$CONTAINER_NAME | grep -q .; then
|
||||||
|
echo "发现现有容器,开始清理..."
|
||||||
|
|
||||||
|
# 检查容器是否正在运行
|
||||||
|
if docker ps -q -f name=$CONTAINER_NAME | grep -q .; then
|
||||||
|
echo "停止运行中的容器..."
|
||||||
|
docker stop $CONTAINER_NAME --time=15 || true
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查容器是否正在被移除
|
||||||
|
echo "检查容器移除状态..."
|
||||||
|
for i in {1..15}; do
|
||||||
|
# 尝试获取容器状态
|
||||||
|
CONTAINER_STATUS=$(docker inspect $CONTAINER_NAME --format='{{.State.Status}}' 2>/dev/null || echo "not_found")
|
||||||
|
|
||||||
|
if [ "$CONTAINER_STATUS" = "not_found" ]; then
|
||||||
|
echo "✅ 容器已不存在"
|
||||||
|
break
|
||||||
|
elif [ "$CONTAINER_STATUS" = "removing" ]; then
|
||||||
|
echo "⏳ 容器正在移除中,等待完成... $i/15"
|
||||||
|
sleep 3
|
||||||
|
else
|
||||||
|
echo "尝试移除容器... $i/15"
|
||||||
|
if docker rm -f $CONTAINER_NAME 2>/dev/null; then
|
||||||
|
echo "✅ 容器移除成功"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "⚠️ 容器移除失败,重试..."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 最后一次尝试强制清理
|
||||||
|
if [ $i -eq 15 ]; then
|
||||||
|
echo "🔧 执行强制清理..."
|
||||||
|
docker kill $CONTAINER_NAME 2>/dev/null || true
|
||||||
|
sleep 2
|
||||||
|
docker rm -f $CONTAINER_NAME 2>/dev/null || true
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "✅ 未发现现有容器"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "启动新容器..."
|
||||||
|
docker run -d \
|
||||||
|
--network host \
|
||||||
|
--name fastvpn-admin-web \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-p 3001:3000 \
|
||||||
|
-e NEXT_PUBLIC_API_URL=${{ env.NEXT_PUBLIC_API_URL }} \
|
||||||
|
${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-admin-web:${{ env.VERSION }}
|
||||||
|
|
||||||
|
# 验证容器启动
|
||||||
|
echo "验证容器启动状态..."
|
||||||
|
for i in {1..10}; do
|
||||||
|
if docker ps -q -f name=fastvpn-admin-web | grep -q .; then
|
||||||
|
echo "✅ 管理面板部署成功"
|
||||||
|
docker ps -f name=fastvpn-admin-web --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "等待容器启动... $i/10"
|
||||||
|
sleep 3
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "❌ 管理面板部署失败 - 容器未能正常启动"
|
||||||
|
docker logs fastvpn-admin-web || true
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: 部署用户面板到服务器
|
||||||
|
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ env.SSH_HOST }}
|
||||||
|
username: ${{ env.SSH_USER }}
|
||||||
|
password: ${{ env.SSH_PASSWORD }}
|
||||||
|
port: ${{ env.SSH_PORT }}
|
||||||
|
timeout: 300s
|
||||||
|
command_timeout: 600s
|
||||||
|
debug: true
|
||||||
|
script: |
|
||||||
|
echo "=== SSH变量调试信息 ==="
|
||||||
|
echo "DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }}"
|
||||||
|
echo "VERSION: ${{ env.VERSION }}"
|
||||||
|
echo "NEXT_PUBLIC_API_URL: ${{ env.NEXT_PUBLIC_API_URL }}"
|
||||||
|
echo "BRANCH: ${{ env.BRANCH }}"
|
||||||
|
|
||||||
|
echo "=== 部署用户面板 ==="
|
||||||
|
|
||||||
|
# 网络连通性检查
|
||||||
|
echo "检查镜像服务器连通性..."
|
||||||
|
REGISTRY_HOST=$(echo "${{ env.DOCKER_REGISTRY }}" | sed 's|https\?://||' | cut -d'/' -f1)
|
||||||
|
echo "镜像仓库地址: $REGISTRY_HOST"
|
||||||
|
|
||||||
|
if ping -c 3 "$REGISTRY_HOST" > /dev/null 2>&1; then
|
||||||
|
echo "✅ 镜像服务器连通性正常"
|
||||||
|
else
|
||||||
|
echo "⚠️ 镜像服务器ping失败,但继续尝试拉取镜像"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查Docker登录状态
|
||||||
|
echo "检查Docker登录状态..."
|
||||||
|
if docker info > /dev/null 2>&1; then
|
||||||
|
echo "✅ Docker服务正常"
|
||||||
|
else
|
||||||
|
echo "❌ Docker服务异常"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 拉取镜像(带重试)
|
||||||
|
echo "拉取Docker镜像..."
|
||||||
|
for i in {1..3}; do
|
||||||
|
echo "尝试拉取镜像 ($i/3): ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-user-web:${{ env.VERSION }}"
|
||||||
|
if docker pull ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-user-web:${{ env.VERSION }}; then
|
||||||
|
echo "✅ 镜像拉取成功"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "❌ 镜像拉取失败,重试 $i/3"
|
||||||
|
echo "检查网络和镜像仓库状态..."
|
||||||
|
|
||||||
|
# 显示详细错误信息
|
||||||
|
echo "--- 网络诊断信息 ---"
|
||||||
|
echo "DNS解析测试:"
|
||||||
|
nslookup "$REGISTRY_HOST" || echo "DNS解析失败"
|
||||||
|
echo "网络连通性测试:"
|
||||||
|
ping -c 2 "$REGISTRY_HOST" || echo "ping失败"
|
||||||
|
echo "Docker镜像仓库连接测试:"
|
||||||
|
curl -I "https://$REGISTRY_HOST/v2/" 2>/dev/null || echo "仓库API访问失败"
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
if [ $i -eq 3 ]; then
|
||||||
|
echo "❌ 镜像拉取失败,部署终止"
|
||||||
|
echo "请检查:"
|
||||||
|
echo "1. 网络连接是否正常"
|
||||||
|
echo "2. 镜像仓库是否可访问"
|
||||||
|
echo "3. 镜像标签是否存在"
|
||||||
|
echo "4. Docker登录凭据是否正确"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# 安全停止和移除容器
|
||||||
|
echo "检查现有容器状态..."
|
||||||
|
CONTAINER_NAME="ppanel-user-web"
|
||||||
|
|
||||||
|
# 检查容器是否存在
|
||||||
|
if docker ps -aq -f name=$CONTAINER_NAME | grep -q .; then
|
||||||
|
echo "发现现有容器,开始清理..."
|
||||||
|
|
||||||
|
# 检查容器是否正在运行
|
||||||
|
if docker ps -q -f name=$CONTAINER_NAME | grep -q .; then
|
||||||
|
echo "停止运行中的容器..."
|
||||||
|
docker stop $CONTAINER_NAME --time=15 || true
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查容器是否正在被移除
|
||||||
|
echo "检查容器移除状态..."
|
||||||
|
for i in {1..15}; do
|
||||||
|
# 尝试获取容器状态
|
||||||
|
CONTAINER_STATUS=$(docker inspect $CONTAINER_NAME --format='{{.State.Status}}' 2>/dev/null || echo "not_found")
|
||||||
|
|
||||||
|
if [ "$CONTAINER_STATUS" = "not_found" ]; then
|
||||||
|
echo "✅ 容器已不存在"
|
||||||
|
break
|
||||||
|
elif [ "$CONTAINER_STATUS" = "removing" ]; then
|
||||||
|
echo "⏳ 容器正在移除中,等待完成... $i/15"
|
||||||
|
sleep 3
|
||||||
|
else
|
||||||
|
echo "尝试移除容器... $i/15"
|
||||||
|
if docker rm -f $CONTAINER_NAME 2>/dev/null; then
|
||||||
|
echo "✅ 容器移除成功"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "⚠️ 容器移除失败,重试..."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 最后一次尝试强制清理
|
||||||
|
if [ $i -eq 15 ]; then
|
||||||
|
echo "🔧 执行强制清理..."
|
||||||
|
docker kill $CONTAINER_NAME 2>/dev/null || true
|
||||||
|
sleep 2
|
||||||
|
docker rm -f $CONTAINER_NAME 2>/dev/null || true
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "✅ 未发现现有容器"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "启动新容器..."
|
||||||
|
docker run -d \
|
||||||
|
--network host \
|
||||||
|
--name fastvpn-user-web \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-p 3002:3000 \
|
||||||
|
-e NEXT_PUBLIC_API_URL=${{ env.NEXT_PUBLIC_API_URL }} \
|
||||||
|
${{ env.DOCKER_REGISTRY }}/ppanel/fastvpn-user-web:${{ env.VERSION }}
|
||||||
|
|
||||||
|
# 验证容器启动
|
||||||
|
echo "验证容器启动状态..."
|
||||||
|
for i in {1..10}; do
|
||||||
|
if docker ps -q -f name=fastvpn-user-web | grep -q .; then
|
||||||
|
echo "✅ 用户面板部署成功"
|
||||||
|
docker ps -f name=fastvpn-user-web --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "等待容器启动... $i/10"
|
||||||
|
sleep 3
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "❌ 用户面板部署失败 - 容器未能正常启动"
|
||||||
|
docker logs fastvpn-user-web || true
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
# 步骤5: TG通知 (成功)
|
||||||
|
- name: 📱 发送成功通知到Telegram
|
||||||
|
if: success()
|
||||||
|
uses: appleboy/telegram-action@master
|
||||||
|
with:
|
||||||
|
token: ${{ env.TELEGRAM_BOT_TOKEN }}
|
||||||
|
to: ${{ env.TELEGRAM_CHAT_ID }}
|
||||||
|
message: |
|
||||||
|
✅ 部署成功!
|
||||||
|
|
||||||
|
📦 项目: ${{ github.repository }}
|
||||||
|
🌿 分支: ${{ github.ref_name }}
|
||||||
|
🔖 版本: ${{ env.VERSION }}
|
||||||
|
🎯 构建目标: ${{ env.BUILD_TARGET }}
|
||||||
|
🔗 API地址: ${{ env.NEXT_PUBLIC_API_URL }}
|
||||||
|
📝 提交: ${{ github.sha }}
|
||||||
|
👤 提交者: ${{ github.actor }}
|
||||||
|
🕐 时间: ${{ github.event.head_commit.timestamp }}
|
||||||
|
|
||||||
|
🚀 服务已成功部署到生产环境
|
||||||
|
|
||||||
|
# 步骤5: TG通知 (失败)
|
||||||
|
- name: 📱 发送失败通知到Telegram
|
||||||
|
if: failure()
|
||||||
|
uses: appleboy/telegram-action@master
|
||||||
|
with:
|
||||||
|
token: ${{ env.TELEGRAM_BOT_TOKEN }}
|
||||||
|
to: ${{ env.TELEGRAM_CHAT_ID }}
|
||||||
|
message: |
|
||||||
|
❌ 部署失败!
|
||||||
|
|
||||||
|
📦 项目: ${{ github.repository }}
|
||||||
|
🌿 分支: ${{ github.ref_name }}
|
||||||
|
🔖 版本: ${{ env.VERSION }}
|
||||||
|
🎯 构建目标: ${{ env.BUILD_TARGET }}
|
||||||
|
📝 提交: ${{ github.sha }}
|
||||||
|
👤 提交者: ${{ github.actor }}
|
||||||
|
🕐 时间: ${{ github.event.head_commit.timestamp }}
|
||||||
|
|
||||||
|
⚠️ 请检查构建日志获取详细信息
|
||||||
45
.github/ISSUE_TEMPLATE/1_bug_report.yml
vendored
45
.github/ISSUE_TEMPLATE/1_bug_report.yml
vendored
@ -1,45 +0,0 @@
|
|||||||
name: '🐛 反馈缺陷 Bug Report'
|
|
||||||
description: '反馈一个问题缺陷 | Report an bug'
|
|
||||||
title: '[Bug] '
|
|
||||||
labels: '🐛 Bug'
|
|
||||||
body:
|
|
||||||
- type: dropdown
|
|
||||||
attributes:
|
|
||||||
label: '💻 系统环境 | Operating System'
|
|
||||||
options:
|
|
||||||
- Windows
|
|
||||||
- macOS
|
|
||||||
- Ubuntu
|
|
||||||
- Other Linux
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
attributes:
|
|
||||||
label: '🌐 浏览器 | Browser'
|
|
||||||
options:
|
|
||||||
- Chrome
|
|
||||||
- Edge
|
|
||||||
- Safari
|
|
||||||
- Firefox
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '🐛 问题描述 | Bug Description'
|
|
||||||
description: A clear and concise description of the bug.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '🚦 期望结果 | Expected Behavior'
|
|
||||||
description: A clear and concise description of what you expected to happen.
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '📷 复现步骤 | Recurrence Steps'
|
|
||||||
description: A clear and concise description of how to recurrence.
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '📝 补充信息 | Additional Information'
|
|
||||||
description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
|
|
||||||
21
.github/ISSUE_TEMPLATE/2_feature_request.yml
vendored
21
.github/ISSUE_TEMPLATE/2_feature_request.yml
vendored
@ -1,21 +0,0 @@
|
|||||||
name: '🌠 功能需求 Feature Request'
|
|
||||||
description: '需求或建议 | Suggest an idea'
|
|
||||||
title: '[Request] '
|
|
||||||
labels: '🌠 Feature Request'
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '🥰 需求描述 | Feature Description'
|
|
||||||
description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '🧐 解决方案 | Proposed Solution'
|
|
||||||
description: Describe the solution you'd like in a clear and concise manner.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '📝 补充信息 | Additional Information'
|
|
||||||
description: Add any other context about the problem here.
|
|
||||||
15
.github/ISSUE_TEMPLATE/3_question.yml
vendored
15
.github/ISSUE_TEMPLATE/3_question.yml
vendored
@ -1,15 +0,0 @@
|
|||||||
name: '😇 疑问或帮助 Help Wanted'
|
|
||||||
description: '疑问或需要帮助 | Need help'
|
|
||||||
title: '[Question] '
|
|
||||||
labels: '😇 Help Wanted'
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '🧐 问题描述 | Proposed Solution'
|
|
||||||
description: A clear and concise description of the proplem.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: '📝 补充信息 | Additional Information'
|
|
||||||
description: Add any other context about the problem here.
|
|
||||||
7
.github/ISSUE_TEMPLATE/4_other.md
vendored
7
.github/ISSUE_TEMPLATE/4_other.md
vendored
@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
name: '📝 其他 Other'
|
|
||||||
about: '其他问题 | Other issues'
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,17 +0,0 @@
|
|||||||
#### 💻 变更类型 | Change Type
|
|
||||||
|
|
||||||
<!-- For change type, change [ ] to [x]. -->
|
|
||||||
|
|
||||||
- \[ ] ✨ feat
|
|
||||||
- \[ ] 🐛 fix
|
|
||||||
- \[ ] 💄 style
|
|
||||||
- \[ ] 🔨 chore
|
|
||||||
- \[ ] 📝 docs
|
|
||||||
|
|
||||||
#### 🔀 变更说明 | Description of Change
|
|
||||||
|
|
||||||
<!-- Thank you for your Pull Request. Please provide a description above. -->
|
|
||||||
|
|
||||||
#### 📝 补充信息 | Additional Information
|
|
||||||
|
|
||||||
<!-- Add any other context about the Pull Request here. -->
|
|
||||||
30
.github/workflows/auto-merge.yml
vendored
30
.github/workflows/auto-merge.yml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: Dependabot Auto Merge
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [labeled, edited]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
merge:
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'dependencies')
|
|
||||||
name: Dependabot Auto Merge
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Merge
|
|
||||||
uses: ahmadnassri/action-dependabot-auto-merge@v2
|
|
||||||
with:
|
|
||||||
command: merge
|
|
||||||
target: minor
|
|
||||||
github-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
22
.github/workflows/issue-check-inactive.yml
vendored
22
.github/workflows/issue-check-inactive.yml
vendored
@ -1,22 +0,0 @@
|
|||||||
name: Issue Check Inactive
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 */15 * *'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
issue-check-inactive:
|
|
||||||
permissions:
|
|
||||||
issues: write # for actions-cool/issues-helper to update issues
|
|
||||||
pull-requests: write # for actions-cool/issues-helper to update PRs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: check-inactive
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'check-inactive'
|
|
||||||
inactive-label: 'Inactive'
|
|
||||||
inactive-day: 30
|
|
||||||
46
.github/workflows/issue-close-require.yml
vendored
46
.github/workflows/issue-close-require.yml
vendored
@ -1,46 +0,0 @@
|
|||||||
name: Issue Close Require
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
issue-close-require:
|
|
||||||
permissions:
|
|
||||||
issues: write # for actions-cool/issues-helper to update issues
|
|
||||||
pull-requests: write # for actions-cool/issues-helper to update PRs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: need reproduce
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'close-issues'
|
|
||||||
labels: '✅ Fixed'
|
|
||||||
inactive-day: 3
|
|
||||||
body: |
|
|
||||||
Since the issue was labeled with `✅ Fixed`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
|
|
||||||
|
|
||||||
由于该 issue 被标记为已修复,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
|
|
||||||
- name: need reproduce
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'close-issues'
|
|
||||||
labels: '🤔 Need Reproduce'
|
|
||||||
inactive-day: 3
|
|
||||||
body: |
|
|
||||||
Since the issue was labeled with `🤔 Need Reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
|
|
||||||
|
|
||||||
由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
|
|
||||||
- name: need reproduce
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'close-issues'
|
|
||||||
labels: "🙅🏻♀️ WON'T DO"
|
|
||||||
inactive-day: 3
|
|
||||||
body: |
|
|
||||||
Since the issue was labeled with `🙅🏻♀️ WON'T DO`, and no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
|
|
||||||
|
|
||||||
由于该 issue 被标记为暂不处理,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
|
|
||||||
25
.github/workflows/issue-remove-inactive.yml
vendored
25
.github/workflows/issue-remove-inactive.yml
vendored
@ -1,25 +0,0 @@
|
|||||||
name: Issue Remove Inactive
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [edited]
|
|
||||||
issue_comment:
|
|
||||||
types: [created, edited]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
issue-remove-inactive:
|
|
||||||
permissions:
|
|
||||||
issues: write # for actions-cool/issues-helper to update issues
|
|
||||||
pull-requests: write # for actions-cool/issues-helper to update PRs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: remove inactive
|
|
||||||
if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'remove-labels'
|
|
||||||
issue-number: ${{ github.event.issue.number }}
|
|
||||||
labels: 'Inactive'
|
|
||||||
89
.github/workflows/publish-release-assets.yml
vendored
89
.github/workflows/publish-release-assets.yml
vendored
@ -1,89 +0,0 @@
|
|||||||
name: Publish Release Assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
name: Publish Release Assets
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Bun
|
|
||||||
uses: oven-sh/setup-bun@v1
|
|
||||||
with:
|
|
||||||
bun-version: 'latest'
|
|
||||||
|
|
||||||
- name: Cache Bun dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.bun
|
|
||||||
key: ${{ runner.os }}-bun-cache-${{ hashFiles('**/bun.lockb') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-bun-cache-
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
run: bun install --cache
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: bun run build
|
|
||||||
|
|
||||||
- name: Run publish script
|
|
||||||
run: |
|
|
||||||
chmod +x scripts/publish.sh
|
|
||||||
./scripts/publish.sh
|
|
||||||
|
|
||||||
- name: Upload tar.gz file to release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
out/ppanel-admin-web.tar.gz
|
|
||||||
out/ppanel-user-web.tar.gz
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Install jq
|
|
||||||
run: sudo apt-get install -y jq
|
|
||||||
|
|
||||||
- name: Extract version from package.json
|
|
||||||
id: version
|
|
||||||
run: echo "PPANEL_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker image for ppanel-admin-web
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./docker/ppanel-admin-web/Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ secrets.DOCKER_USERNAME }}/ppanel-admin-web:latest
|
|
||||||
${{ secrets.DOCKER_USERNAME }}/ppanel-admin-web:${{ env.PPANEL_VERSION }}
|
|
||||||
|
|
||||||
- name: Build and push Docker image for ppanel-user-web
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./docker/ppanel-user-web/Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ secrets.DOCKER_USERNAME }}/ppanel-user-web:latest
|
|
||||||
${{ secrets.DOCKER_USERNAME }}/ppanel-user-web:${{ env.PPANEL_VERSION }}
|
|
||||||
42
.github/workflows/release.yml
vendored
42
.github/workflows/release.yml
vendored
@ -1,42 +0,0 @@
|
|||||||
name: Build and Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, next, beta]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Bun
|
|
||||||
uses: oven-sh/setup-bun@v1
|
|
||||||
with:
|
|
||||||
bun-version: 'latest'
|
|
||||||
|
|
||||||
- name: Cache Bun dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.bun
|
|
||||||
node_modules
|
|
||||||
key: ${{ runner.os }}-bun-cache-${{ hashFiles('**/bun.lockb') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-bun-cache-
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: bun run build
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
id: release
|
|
||||||
run: bun run release
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
15
.vscode/settings.json
vendored
15
.vscode/settings.json
vendored
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"eslint.workingDirectories": [
|
|
||||||
{
|
|
||||||
"mode": "auto"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"explorer.fileNesting.enabled": true,
|
|
||||||
"explorer.fileNesting.patterns": {
|
|
||||||
"*.ts": "${capture}.js",
|
|
||||||
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
|
|
||||||
"*.jsx": "${capture}.js",
|
|
||||||
"*.tsx": "${capture}.ts",
|
|
||||||
"README.md": "*.md, LICENSE"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
298
CHANGELOG.md
298
CHANGELOG.md
@ -1,77 +1,249 @@
|
|||||||
<a name="readme-top"></a>
|
<a name="readme-top"></a>
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
# [1.4.0](https://github.com/perfect-panel/ppanel-web/compare/v1.3.0...v1.4.0) (2025-09-14)
|
## [1.6.1](https://github.com/perfect-panel/ppanel-web/compare/v1.6.0...v1.6.1) (2025-11-05)
|
||||||
|
|
||||||
|
|
||||||
### ♻ Code Refactoring
|
|
||||||
|
|
||||||
* **logs**: Add localization files and update existing translations for multiple languages ([2f20ac9](https://github.com/perfect-panel/ppanel-web/commit/2f20ac9))
|
|
||||||
* **subscribe-form**: Replace server_group and server with node_tags and nodes in default values and form schema ([38dda84](https://github.com/perfect-panel/ppanel-web/commit/38dda84))
|
|
||||||
* Add localization updates for log and server files across multiple languages ([2bcd4cf](https://github.com/perfect-panel/ppanel-web/commit/2bcd4cf))
|
|
||||||
* Clean up NodeForm and ServerForm components by removing unused functions and optimizing state management ([10250d9](https://github.com/perfect-panel/ppanel-web/commit/10250d9))
|
|
||||||
* Enhance log pages with Badge component and update translations ([a4de9df](https://github.com/perfect-panel/ppanel-web/commit/a4de9df))
|
|
||||||
* Make 'scheme' field optional in client form schema ([f4a1237](https://github.com/perfect-panel/ppanel-web/commit/f4a1237))
|
|
||||||
* Refactor server management API endpoints and typings ([4f7cc80](https://github.com/perfect-panel/ppanel-web/commit/4f7cc80))
|
|
||||||
* Remove application management forms and related configurations ([0c43844](https://github.com/perfect-panel/ppanel-web/commit/0c43844))
|
|
||||||
* Remove default options from TagInput component for improved flexibility ([6a3bb70](https://github.com/perfect-panel/ppanel-web/commit/6a3bb70))
|
|
||||||
* Remove unused preview state variables and add sort order to node properties ([e63f823](https://github.com/perfect-panel/ppanel-web/commit/e63f823))
|
|
||||||
* Rename buildScheme to buildSchema and update imports in server form components ([ee98e7e](https://github.com/perfect-panel/ppanel-web/commit/ee98e7e))
|
|
||||||
* Simplify node display in subscribe form and remove unused Badge import ([551135d](https://github.com/perfect-panel/ppanel-web/commit/551135d))
|
|
||||||
* Update bun.lockb to reflect dependency changes ([ba2b50e](https://github.com/perfect-panel/ppanel-web/commit/ba2b50e))
|
|
||||||
* Update component imports and improve code consistency ([59faeab](https://github.com/perfect-panel/ppanel-web/commit/59faeab))
|
|
||||||
* Update dependencies and improve code consistency across multiple files ([e37ae49](https://github.com/perfect-panel/ppanel-web/commit/e37ae49))
|
|
||||||
* Update localization files and service imports ([d4b37e4](https://github.com/perfect-panel/ppanel-web/commit/d4b37e4))
|
|
||||||
|
|
||||||
|
|
||||||
### ✨ Features
|
|
||||||
|
|
||||||
* **config**: Add translations for server configuration in multiple languages ([f9a7ece](https://github.com/perfect-panel/ppanel-web/commit/f9a7ece))
|
|
||||||
* **logs**: Add various log pages for tracking user activities and system events ([d85af49](https://github.com/perfect-panel/ppanel-web/commit/d85af49))
|
|
||||||
* Add bandwidth fields and placeholders for upload and download in server configuration forms; update localization files for multiple languages ([3e5402f](https://github.com/perfect-panel/ppanel-web/commit/3e5402f))
|
|
||||||
* Add batch delete functionality and enhance chart tooltips in statistics cards ([c4f536e](https://github.com/perfect-panel/ppanel-web/commit/c4f536e))
|
|
||||||
* Add language support and descriptions in product localization files ([fd48856](https://github.com/perfect-panel/ppanel-web/commit/fd48856))
|
|
||||||
* Add log cleanup settings and update localization files ([6ccf9b8](https://github.com/perfect-panel/ppanel-web/commit/6ccf9b8))
|
|
||||||
* Add queryNodeTag function and integrate tag retrieval in NodeForm and SubscribeForm components ([4563c57](https://github.com/perfect-panel/ppanel-web/commit/4563c57))
|
|
||||||
* Add quota management features and localization updates ([fce627b](https://github.com/perfect-panel/ppanel-web/commit/fce627b))
|
|
||||||
* Add server form component with protocol configuration and localization support ([217ddce](https://github.com/perfect-panel/ppanel-web/commit/217ddce))
|
|
||||||
* Enhance TagInput component with option handling and improved tag addition logic ([b6e778d](https://github.com/perfect-panel/ppanel-web/commit/b6e778d))
|
|
||||||
* Implement data migration functionality and update localization files ([6d81bfd](https://github.com/perfect-panel/ppanel-web/commit/6d81bfd))
|
|
||||||
* Refactor user detail and subscription management components ([973c06f](https://github.com/perfect-panel/ppanel-web/commit/973c06f))
|
|
||||||
* Update server list fetching logic and adjust query parameters ([5272360](https://github.com/perfect-panel/ppanel-web/commit/5272360))
|
|
||||||
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
* **page**: Refine version checking logic and remove unnecessary comments for clarity ([26176a7](https://github.com/perfect-panel/ppanel-web/commit/26176a7))
|
* Fixing issues with generating standard and quantum-resistant encryption keys ([5eac6a9](https://github.com/perfect-panel/ppanel-web/commit/5eac6a9))
|
||||||
* Add localization updates and new utility functions ([4da5960](https://github.com/perfect-panel/ppanel-web/commit/4da5960))
|
|
||||||
* Add user_subscribe_id filter to SubscribeLogPage and update typings; disable eslint in service index files ([ab6f6a6](https://github.com/perfect-panel/ppanel-web/commit/ab6f6a6))
|
|
||||||
* Added system version card and system log dialog components; updated statistics page to include total server and user statistics ([fe69980](https://github.com/perfect-panel/ppanel-web/commit/fe69980))
|
|
||||||
* Adjust timestamp calculations to use milliseconds instead of seconds in quota broadcast form submission ([8dffd69](https://github.com/perfect-panel/ppanel-web/commit/8dffd69))
|
|
||||||
* Correct cookie key format for sidebar state retrieval ([9e01f4f](https://github.com/perfect-panel/ppanel-web/commit/9e01f4f))
|
|
||||||
* Improve UI for protocol status display in server form component ([461fdb1](https://github.com/perfect-panel/ppanel-web/commit/461fdb1))
|
|
||||||
* Increase pagination size limit for server and node lists to improve data retrieval ([7c0a312](https://github.com/perfect-panel/ppanel-web/commit/7c0a312))
|
|
||||||
* Optimize Task Manager to use milliseconds to calculate timers, and simplify import statements ([d8fa13b](https://github.com/perfect-panel/ppanel-web/commit/d8fa13b))
|
|
||||||
* Refactor protocol status display for improved readability in server form component ([f700be0](https://github.com/perfect-panel/ppanel-web/commit/f700be0))
|
|
||||||
* Remove GroupTable and related components, simplify SubscribeTable and update language handling in subscription forms ([1ab9b39](https://github.com/perfect-panel/ppanel-web/commit/1ab9b39))
|
|
||||||
* Remove redundant transport label from localization files ([88ce8d7](https://github.com/perfect-panel/ppanel-web/commit/88ce8d7))
|
|
||||||
* Remove unnecessary comments and improve variable handling in GoTemplateEditor; ensure zero value displays as empty in EnhancedInput ([c4a47a4](https://github.com/perfect-panel/ppanel-web/commit/c4a47a4))
|
|
||||||
* Remove unnecessary comments to simplify code readability ([a988cb3](https://github.com/perfect-panel/ppanel-web/commit/a988cb3))
|
|
||||||
* Replace MarkdownEditor with HTMLEditor in EmailBroadcastForm; simplify content rendering in EmailTaskManager; disable eslint in service index files ([e2d83ec](https://github.com/perfect-panel/ppanel-web/commit/e2d83ec))
|
|
||||||
* Replace redundant icon rendering with a single instance in system version card component ([e4429a5](https://github.com/perfect-panel/ppanel-web/commit/e4429a5))
|
|
||||||
* Update billing URL fetching logic and improve version handling in system version card component ([1c8d4af](https://github.com/perfect-panel/ppanel-web/commit/1c8d4af))
|
|
||||||
* Update condition for plugin field in PROTOCOL_FIELDS to include specific plugins ([6376ec1](https://github.com/perfect-panel/ppanel-web/commit/6376ec1))
|
|
||||||
* Update getAppSubLink function to improve URL handling and encoding logic ([351fffc](https://github.com/perfect-panel/ppanel-web/commit/351fffc))
|
|
||||||
* Update order_id to order_no in BalanceLogPage and related typings; enhance timezone switch component with additional features and localization updates ([ac36075](https://github.com/perfect-panel/ppanel-web/commit/ac36075))
|
|
||||||
* Update protocol plugin handling and add new options in typings ([6ca2433](https://github.com/perfect-panel/ppanel-web/commit/6ca2433))
|
|
||||||
* Update release URLs to include 'v' prefix for versioning in system version card component ([1d526b5](https://github.com/perfect-panel/ppanel-web/commit/1d526b5))
|
|
||||||
* Update SidebarLeft component styles to enhance hover effects ([e4fbd5c](https://github.com/perfect-panel/ppanel-web/commit/e4fbd5c))
|
|
||||||
* Update validation for days and gift_value fields in QuotaBroadcastForm; set default values to avoid errors ([39d746f](https://github.com/perfect-panel/ppanel-web/commit/39d746f))
|
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
# [1.6.0](https://github.com/perfect-panel/ppanel-web/compare/v1.5.4...v1.6.0) (2025-10-28)
|
||||||
|
|
||||||
|
### ✨ Features
|
||||||
|
|
||||||
|
- Add server installation dialog and commands ([4429c9d](https://github.com/perfect-panel/ppanel-web/commit/4429c9d))
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add typeRoots configuration to ensure type definitions are resolved correctly ([ad60ea9](https://github.com/perfect-panel/ppanel-web/commit/ad60ea9))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.5.4](https://github.com/perfect-panel/ppanel-web/compare/v1.5.3...v1.5.4) (2025-10-26)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Update generateRealityKeyPair to use async key generation ([e60e369](https://github.com/perfect-panel/ppanel-web/commit/e60e369))
|
||||||
|
- Update the wallet localization file and add new fields such as automatic reset and recharge ([88aa965](https://github.com/perfect-panel/ppanel-web/commit/88aa965))
|
||||||
|
|
||||||
|
## [1.5.3](https://github.com/perfect-panel/ppanel-web/compare/v1.5.2...v1.5.3) (2025-10-21)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Fix bugs ([a46657d](https://github.com/perfect-panel/ppanel-web/commit/a46657d))
|
||||||
|
- Fix dependencies ([8bd25d6](https://github.com/perfect-panel/ppanel-web/commit/8bd25d6))
|
||||||
|
- Remove unnecessary migration function code and add device configuration options ([521a7a9](https://github.com/perfect-panel/ppanel-web/commit/521a7a9))
|
||||||
|
- Update bun.lockb to reflect dependency changes ([ca892dd](https://github.com/perfect-panel/ppanel-web/commit/ca892dd))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.5.2](https://github.com/perfect-panel/ppanel-web/compare/v1.5.1...v1.5.2) (2025-09-29)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add step attribute to datetime-local inputs for precise time selection in forms ([32fd181](https://github.com/perfect-panel/ppanel-web/commit/32fd181))
|
||||||
|
- Rename 'hysteria2' to 'hysteria' across protocol definitions and schemas for consistency ([5816dd5](https://github.com/perfect-panel/ppanel-web/commit/5816dd5))
|
||||||
|
- Update protocol options in ServerConfig for accuracy and consistency ([9266529](https://github.com/perfect-panel/ppanel-web/commit/9266529))
|
||||||
|
|
||||||
|
## [1.5.1](https://github.com/perfect-panel/ppanel-web/compare/v1.5.0...v1.5.1) (2025-09-28)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Simplify protocol enable checks by removing unnecessary false comparisons ([4828700](https://github.com/perfect-panel/ppanel-web/commit/4828700))
|
||||||
|
|
||||||
|
# [1.5.0](https://github.com/perfect-panel/ppanel-web/compare/v1.4.8...v1.5.0) (2025-09-28)
|
||||||
|
|
||||||
|
### ✨ Features
|
||||||
|
|
||||||
|
- Update server configuration translations for multiple languages ([fc43de1](https://github.com/perfect-panel/ppanel-web/commit/fc43de1))
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add DynamicMultiplier component for managing node multipliers and update ServersPage layout ([bb6671c](https://github.com/perfect-panel/ppanel-web/commit/bb6671c))
|
||||||
|
- Remove unnecessary blank lines in multiple index files for cleaner code structure ([6a823b8](https://github.com/perfect-panel/ppanel-web/commit/6a823b8))
|
||||||
|
- Remove unused ratio variable from server traffic log and server form for cleaner code ([55034dc](https://github.com/perfect-panel/ppanel-web/commit/55034dc))
|
||||||
|
- Update Badge variants and restructure traffic ratio display in ServersPage ([3d778e5](https://github.com/perfect-panel/ppanel-web/commit/3d778e5))
|
||||||
|
- Update minimum ratio value to 0 in protocol fields and adjust related schemas; enhance unit conversion in ServerConfig ([3b6ef17](https://github.com/perfect-panel/ppanel-web/commit/3b6ef17))
|
||||||
|
- Update protocol fields to use 'obfs' instead of 'security' and adjust related configurations ([4abdd36](https://github.com/perfect-panel/ppanel-web/commit/4abdd36))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.4.8](https://github.com/perfect-panel/ppanel-web/compare/v1.4.7...v1.4.8) (2025-09-23)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Rename 'server_id' to 'protocol' in NodesPage and clean up unused imports and code in ServerConfig ([70b3484](https://github.com/perfect-panel/ppanel-web/commit/70b3484))
|
||||||
|
- Update announcement page to display timeline of announcements with Markdown content ([3c036eb](https://github.com/perfect-panel/ppanel-web/commit/3c036eb))
|
||||||
|
- Update Empty component to support border prop and adjust usage in various pages ([ce9ab89](https://github.com/perfect-panel/ppanel-web/commit/ce9ab89))
|
||||||
|
|
||||||
|
## [1.4.7](https://github.com/perfect-panel/ppanel-web/compare/v1.4.6...v1.4.7) (2025-09-23)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add unique key to ProTable for improved rendering with user ID filters ([2bff15f](https://github.com/perfect-panel/ppanel-web/commit/2bff15f))
|
||||||
|
- Adjust layout spacing and chart aspect ratio in ServerConfig component ([05a61d8](https://github.com/perfect-panel/ppanel-web/commit/05a61d8))
|
||||||
|
- Refactor server ID cell rendering for improved readability and consistency ([0345b7c](https://github.com/perfect-panel/ppanel-web/commit/0345b7c))
|
||||||
|
- Update announcement page to format creation date and enhance content display ([8445e30](https://github.com/perfect-panel/ppanel-web/commit/8445e30))
|
||||||
|
- Update OnlineUsersCell to display user count with icon instead of badge ([7a4ebdf](https://github.com/perfect-panel/ppanel-web/commit/7a4ebdf))
|
||||||
|
- Update subscribe name fallback to return '--' instead of 'Unknown' ([0a07d25](https://github.com/perfect-panel/ppanel-web/commit/0a07d25))
|
||||||
|
|
||||||
|
## [1.4.6](https://github.com/perfect-panel/ppanel-web/compare/v1.4.5...v1.4.6) (2025-09-17)
|
||||||
|
|
||||||
|
### 🎫 Chores
|
||||||
|
|
||||||
|
- Merge branch 'main' into develop ([41f06bf](https://github.com/perfect-panel/ppanel-web/commit/41f06bf))
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add loaded state to node, server, and subscribe stores for better loading management ([13dce0c](https://github.com/perfect-panel/ppanel-web/commit/13dce0c))
|
||||||
|
- Removed node metadata fields in subscription schema to simplify structure ([0cadd83](https://github.com/perfect-panel/ppanel-web/commit/0cadd83))
|
||||||
|
|
||||||
|
## [1.4.5](https://github.com/perfect-panel/ppanel-web/compare/v1.4.4...v1.4.5) (2025-09-17)
|
||||||
|
|
||||||
|
### ♻ Code Refactoring
|
||||||
|
|
||||||
|
- Replace useQuery with Zustand store for subscription and node data management ([c6dd0b6](https://github.com/perfect-panel/ppanel-web/commit/c6dd0b6))
|
||||||
|
- Simplify TemplatePreview component structure by consolidating Sheet and Button elements ([1b715c5](https://github.com/perfect-panel/ppanel-web/commit/1b715c5))
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add showLineNumbers prop handling in MonacoEditor for improved placeholder positioning ([bd67ece](https://github.com/perfect-panel/ppanel-web/commit/bd67ece))
|
||||||
|
- Add fetchTags method to NodesPage and ensure tags are fetched alongside nodes ([a3c5e31](https://github.com/perfect-panel/ppanel-web/commit/a3c5e31))
|
||||||
|
- Add NEXT_PUBLIC_HIDDEN_TUTORIAL_DOCUMENT to control tutorial visibility and update page query accordingly ([e94405d](https://github.com/perfect-panel/ppanel-web/commit/e94405d))
|
||||||
|
- Add subscribeSchema for subscription management with detailed proxy and user information ([49b3dcc](https://github.com/perfect-panel/ppanel-web/commit/49b3dcc))
|
||||||
|
- Enhance server ID display in ServerTrafficLogPage with badges and server ratio ([6dfac27](https://github.com/perfect-panel/ppanel-web/commit/6dfac27))
|
||||||
|
- Update platform handling in Content component to ensure available platforms are correctly filtered and displayed ([1dde708](https://github.com/perfect-panel/ppanel-web/commit/1dde708))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.4.4](https://github.com/perfect-panel/ppanel-web/compare/v1.4.3...v1.4.4) (2025-09-16)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add minimum value constraint for count and user limit inputs in CouponForm ([6991b69](https://github.com/perfect-panel/ppanel-web/commit/6991b69))
|
||||||
|
- Add protocol-related constants, default configurations, field definitions, and validation modes ([d685407](https://github.com/perfect-panel/ppanel-web/commit/d685407))
|
||||||
|
- Added the enabled field in the protocol configuration, updated the related type definition and default configuration ([2b0cf9a](https://github.com/perfect-panel/ppanel-web/commit/2b0cf9a))
|
||||||
|
- Filter available protocols to exclude disabled ones in NodeForm ([982d288](https://github.com/perfect-panel/ppanel-web/commit/982d288))
|
||||||
|
- Refactor key generation logic and update dependencies for ML-KEM-768 integration ([b8f630f](https://github.com/perfect-panel/ppanel-web/commit/b8f630f))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.4.3](https://github.com/perfect-panel/ppanel-web/compare/v1.4.2...v1.4.3) (2025-09-16)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add success toast message for sorting in nodes and servers pages ([2d5175d](https://github.com/perfect-panel/ppanel-web/commit/2d5175d))
|
||||||
|
- Implement encryption and obfuscation features in protocol configuration ([54de16b](https://github.com/perfect-panel/ppanel-web/commit/54de16b))
|
||||||
|
- Refactor toB64 function to toB64Url for URL-safe base64 encoding in VlessX25519Pair generation ([8700cf6](https://github.com/perfect-panel/ppanel-web/commit/8700cf6))
|
||||||
|
- Simplify initialValues assignment and update node submission logic in NodesPage ([05d6c89](https://github.com/perfect-panel/ppanel-web/commit/05d6c89))
|
||||||
|
- Update bun.lockb to reflect dependency changes ([ebcebd7](https://github.com/perfect-panel/ppanel-web/commit/ebcebd7))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.4.2](https://github.com/perfect-panel/ppanel-web/compare/v1.4.1...v1.4.2) (2025-09-15)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add GitHub template repository link to ProtocolForm header for easier access ([8a0baf3](https://github.com/perfect-panel/ppanel-web/commit/8a0baf3))
|
||||||
|
- Add readOnly prop to MonacoEditor and TemplatePreview components for improved content handling ([c4c4d5a](https://github.com/perfect-panel/ppanel-web/commit/c4c4d5a))
|
||||||
|
|
||||||
|
## [1.4.1](https://github.com/perfect-panel/ppanel-web/compare/v1.4.0...v1.4.1) (2025-09-15)
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add copy subscription functionality to user subscription dashboard and improve localization for new features ([e2a357f](https://github.com/perfect-panel/ppanel-web/commit/e2a357f))
|
||||||
|
- Simplify handleInputBlur function by removing unnecessary setTimeout ([6341562](https://github.com/perfect-panel/ppanel-web/commit/6341562))
|
||||||
|
- Update TemplatePreview to use MonacoEditor for content display and improve error handling ([1d52642](https://github.com/perfect-panel/ppanel-web/commit/1d52642))
|
||||||
|
- Update user dashboard link to correct path ([131693b](https://github.com/perfect-panel/ppanel-web/commit/131693b))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
# [1.4.0](https://github.com/perfect-panel/ppanel-web/compare/v1.3.0...v1.4.0) (2025-09-14)
|
||||||
|
|
||||||
|
### ♻ Code Refactoring
|
||||||
|
|
||||||
|
- **logs**: Add localization files and update existing translations for multiple languages ([2f20ac9](https://github.com/perfect-panel/ppanel-web/commit/2f20ac9))
|
||||||
|
- **subscribe-form**: Replace server_group and server with node_tags and nodes in default values and form schema ([38dda84](https://github.com/perfect-panel/ppanel-web/commit/38dda84))
|
||||||
|
- Add localization updates for log and server files across multiple languages ([2bcd4cf](https://github.com/perfect-panel/ppanel-web/commit/2bcd4cf))
|
||||||
|
- Clean up NodeForm and ServerForm components by removing unused functions and optimizing state management ([10250d9](https://github.com/perfect-panel/ppanel-web/commit/10250d9))
|
||||||
|
- Enhance log pages with Badge component and update translations ([a4de9df](https://github.com/perfect-panel/ppanel-web/commit/a4de9df))
|
||||||
|
- Make 'scheme' field optional in client form schema ([f4a1237](https://github.com/perfect-panel/ppanel-web/commit/f4a1237))
|
||||||
|
- Refactor server management API endpoints and typings ([4f7cc80](https://github.com/perfect-panel/ppanel-web/commit/4f7cc80))
|
||||||
|
- Remove application management forms and related configurations ([0c43844](https://github.com/perfect-panel/ppanel-web/commit/0c43844))
|
||||||
|
- Remove default options from TagInput component for improved flexibility ([6a3bb70](https://github.com/perfect-panel/ppanel-web/commit/6a3bb70))
|
||||||
|
- Remove unused preview state variables and add sort order to node properties ([e63f823](https://github.com/perfect-panel/ppanel-web/commit/e63f823))
|
||||||
|
- Rename buildScheme to buildSchema and update imports in server form components ([ee98e7e](https://github.com/perfect-panel/ppanel-web/commit/ee98e7e))
|
||||||
|
- Simplify node display in subscribe form and remove unused Badge import ([551135d](https://github.com/perfect-panel/ppanel-web/commit/551135d))
|
||||||
|
- Update bun.lockb to reflect dependency changes ([ba2b50e](https://github.com/perfect-panel/ppanel-web/commit/ba2b50e))
|
||||||
|
- Update component imports and improve code consistency ([59faeab](https://github.com/perfect-panel/ppanel-web/commit/59faeab))
|
||||||
|
- Update dependencies and improve code consistency across multiple files ([e37ae49](https://github.com/perfect-panel/ppanel-web/commit/e37ae49))
|
||||||
|
- Update localization files and service imports ([d4b37e4](https://github.com/perfect-panel/ppanel-web/commit/d4b37e4))
|
||||||
|
|
||||||
|
### ✨ Features
|
||||||
|
|
||||||
|
- **config**: Add translations for server configuration in multiple languages ([f9a7ece](https://github.com/perfect-panel/ppanel-web/commit/f9a7ece))
|
||||||
|
- **logs**: Add various log pages for tracking user activities and system events ([d85af49](https://github.com/perfect-panel/ppanel-web/commit/d85af49))
|
||||||
|
- Add bandwidth fields and placeholders for upload and download in server configuration forms; update localization files for multiple languages ([3e5402f](https://github.com/perfect-panel/ppanel-web/commit/3e5402f))
|
||||||
|
- Add batch delete functionality and enhance chart tooltips in statistics cards ([c4f536e](https://github.com/perfect-panel/ppanel-web/commit/c4f536e))
|
||||||
|
- Add language support and descriptions in product localization files ([fd48856](https://github.com/perfect-panel/ppanel-web/commit/fd48856))
|
||||||
|
- Add log cleanup settings and update localization files ([6ccf9b8](https://github.com/perfect-panel/ppanel-web/commit/6ccf9b8))
|
||||||
|
- Add queryNodeTag function and integrate tag retrieval in NodeForm and SubscribeForm components ([4563c57](https://github.com/perfect-panel/ppanel-web/commit/4563c57))
|
||||||
|
- Add quota management features and localization updates ([fce627b](https://github.com/perfect-panel/ppanel-web/commit/fce627b))
|
||||||
|
- Add server form component with protocol configuration and localization support ([217ddce](https://github.com/perfect-panel/ppanel-web/commit/217ddce))
|
||||||
|
- Enhance TagInput component with option handling and improved tag addition logic ([b6e778d](https://github.com/perfect-panel/ppanel-web/commit/b6e778d))
|
||||||
|
- Implement data migration functionality and update localization files ([6d81bfd](https://github.com/perfect-panel/ppanel-web/commit/6d81bfd))
|
||||||
|
- Refactor user detail and subscription management components ([973c06f](https://github.com/perfect-panel/ppanel-web/commit/973c06f))
|
||||||
|
- Update server list fetching logic and adjust query parameters ([5272360](https://github.com/perfect-panel/ppanel-web/commit/5272360))
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- **page**: Refine version checking logic and remove unnecessary comments for clarity ([26176a7](https://github.com/perfect-panel/ppanel-web/commit/26176a7))
|
||||||
|
- Add localization updates and new utility functions ([4da5960](https://github.com/perfect-panel/ppanel-web/commit/4da5960))
|
||||||
|
- Add user_subscribe_id filter to SubscribeLogPage and update typings; disable eslint in service index files ([ab6f6a6](https://github.com/perfect-panel/ppanel-web/commit/ab6f6a6))
|
||||||
|
- Added system version card and system log dialog components; updated statistics page to include total server and user statistics ([fe69980](https://github.com/perfect-panel/ppanel-web/commit/fe69980))
|
||||||
|
- Adjust timestamp calculations to use milliseconds instead of seconds in quota broadcast form submission ([8dffd69](https://github.com/perfect-panel/ppanel-web/commit/8dffd69))
|
||||||
|
- Correct cookie key format for sidebar state retrieval ([9e01f4f](https://github.com/perfect-panel/ppanel-web/commit/9e01f4f))
|
||||||
|
- Improve UI for protocol status display in server form component ([461fdb1](https://github.com/perfect-panel/ppanel-web/commit/461fdb1))
|
||||||
|
- Increase pagination size limit for server and node lists to improve data retrieval ([7c0a312](https://github.com/perfect-panel/ppanel-web/commit/7c0a312))
|
||||||
|
- Optimize Task Manager to use milliseconds to calculate timers, and simplify import statements ([d8fa13b](https://github.com/perfect-panel/ppanel-web/commit/d8fa13b))
|
||||||
|
- Refactor protocol status display for improved readability in server form component ([f700be0](https://github.com/perfect-panel/ppanel-web/commit/f700be0))
|
||||||
|
- Remove GroupTable and related components, simplify SubscribeTable and update language handling in subscription forms ([1ab9b39](https://github.com/perfect-panel/ppanel-web/commit/1ab9b39))
|
||||||
|
- Remove redundant transport label from localization files ([88ce8d7](https://github.com/perfect-panel/ppanel-web/commit/88ce8d7))
|
||||||
|
- Remove unnecessary comments and improve variable handling in GoTemplateEditor; ensure zero value displays as empty in EnhancedInput ([c4a47a4](https://github.com/perfect-panel/ppanel-web/commit/c4a47a4))
|
||||||
|
- Remove unnecessary comments to simplify code readability ([a988cb3](https://github.com/perfect-panel/ppanel-web/commit/a988cb3))
|
||||||
|
- Replace MarkdownEditor with HTMLEditor in EmailBroadcastForm; simplify content rendering in EmailTaskManager; disable eslint in service index files ([e2d83ec](https://github.com/perfect-panel/ppanel-web/commit/e2d83ec))
|
||||||
|
- Replace redundant icon rendering with a single instance in system version card component ([e4429a5](https://github.com/perfect-panel/ppanel-web/commit/e4429a5))
|
||||||
|
- Update billing URL fetching logic and improve version handling in system version card component ([1c8d4af](https://github.com/perfect-panel/ppanel-web/commit/1c8d4af))
|
||||||
|
- Update condition for plugin field in PROTOCOL_FIELDS to include specific plugins ([6376ec1](https://github.com/perfect-panel/ppanel-web/commit/6376ec1))
|
||||||
|
- Update getAppSubLink function to improve URL handling and encoding logic ([351fffc](https://github.com/perfect-panel/ppanel-web/commit/351fffc))
|
||||||
|
- Update order_id to order_no in BalanceLogPage and related typings; enhance timezone switch component with additional features and localization updates ([ac36075](https://github.com/perfect-panel/ppanel-web/commit/ac36075))
|
||||||
|
- Update protocol plugin handling and add new options in typings ([6ca2433](https://github.com/perfect-panel/ppanel-web/commit/6ca2433))
|
||||||
|
- Update release URLs to include 'v' prefix for versioning in system version card component ([1d526b5](https://github.com/perfect-panel/ppanel-web/commit/1d526b5))
|
||||||
|
- Update SidebarLeft component styles to enhance hover effects ([e4fbd5c](https://github.com/perfect-panel/ppanel-web/commit/e4fbd5c))
|
||||||
|
- Update validation for days and gift_value fields in QuotaBroadcastForm; set default values to avoid errors ([39d746f](https://github.com/perfect-panel/ppanel-web/commit/39d746f))
|
||||||
|
|
||||||
### 📝 Documentation
|
### 📝 Documentation
|
||||||
|
|
||||||
* Merge branch 'main' into develop ([d7f8b3b](https://github.com/perfect-panel/ppanel-web/commit/d7f8b3b))
|
- Merge branch 'main' into develop ([d7f8b3b](https://github.com/perfect-panel/ppanel-web/commit/d7f8b3b))
|
||||||
|
|
||||||
<a name="readme-top"></a>
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<img width="160" src="https://raw.githubusercontent.com/perfect-panel/ppanel-assets/refs/heads/main/logo.svg">
|
<img width="160" src="https://raw.githubusercontent.com/perfect-panel/ppanel-assets/refs/heads/main/logo.svg">
|
||||||
|
|
||||||
<h1>PPanel web</h1>
|
<h1>PPanel web hifastvpn</h1>
|
||||||
|
|
||||||
This is a PPanel web powered by PPanel
|
This is a PPanel web powered by PPanel
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<h1>PPanel 前端</h1>
|
<h1>PPanel 前端</h1>
|
||||||
|
|
||||||
这是由 PPanel 提供支持的前端
|
这是由 PPanel 提供支持的前端1
|
||||||
|
|
||||||
[英文](./README.md)
|
[英文](./README.md)
|
||||||
·
|
·
|
||||||
|
|||||||
@ -225,6 +225,7 @@ export default function AdsForm<T extends Record<string, any>>({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
placeholder={t('form.enterStartTime')}
|
placeholder={t('form.enterStartTime')}
|
||||||
value={field.value ? new Date(field.value).toISOString().slice(0, 16) : ''}
|
value={field.value ? new Date(field.value).toISOString().slice(0, 16) : ''}
|
||||||
min={Number(new Date().toISOString().slice(0, 16))}
|
min={Number(new Date().toISOString().slice(0, 16))}
|
||||||
@ -253,6 +254,7 @@ export default function AdsForm<T extends Record<string, any>>({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
placeholder={t('form.enterEndTime')}
|
placeholder={t('form.enterEndTime')}
|
||||||
value={
|
value={
|
||||||
field.value ? new Date(field.value).toISOString().slice(0, 16) : ''
|
field.value ? new Date(field.value).toISOString().slice(0, 16) : ''
|
||||||
|
|||||||
@ -87,6 +87,7 @@ export default function EmailSettingsForm() {
|
|||||||
|
|
||||||
const form = useForm<EmailSettingsFormData>({
|
const form = useForm<EmailSettingsFormData>({
|
||||||
resolver: zodResolver(emailSettingsSchema),
|
resolver: zodResolver(emailSettingsSchema),
|
||||||
|
shouldUnregister: false,
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
id: 0,
|
id: 0,
|
||||||
method: 'email',
|
method: 'email',
|
||||||
@ -416,8 +417,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
@ -480,8 +481,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
@ -525,8 +526,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
@ -580,8 +581,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@ -81,16 +80,7 @@ export default function CouponForm<T extends Record<string, any>>({
|
|||||||
|
|
||||||
const type = form.watch('type');
|
const type = form.watch('type');
|
||||||
|
|
||||||
const { data: subscribe } = useQuery({
|
const { subscribes } = useSubscribe();
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 9999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.Subscribe[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sheet open={open} onOpenChange={setOpen}>
|
<Sheet open={open} onOpenChange={setOpen}>
|
||||||
@ -247,9 +237,9 @@ export default function CouponForm<T extends Record<string, any>>({
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
form.setValue(field.name, value);
|
form.setValue(field.name, value);
|
||||||
}}
|
}}
|
||||||
options={subscribe?.map((item: API.Subscribe) => ({
|
options={subscribes?.map((item) => ({
|
||||||
value: item.id,
|
value: item.id!,
|
||||||
label: item.name,
|
label: item.name!,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@ -307,6 +297,7 @@ export default function CouponForm<T extends Record<string, any>>({
|
|||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
placeholder={t('form.countPlaceholder')}
|
placeholder={t('form.countPlaceholder')}
|
||||||
type='number'
|
type='number'
|
||||||
|
min={0}
|
||||||
step={1}
|
step={1}
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
@ -328,6 +319,7 @@ export default function CouponForm<T extends Record<string, any>>({
|
|||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
placeholder={t('form.userLimitPlaceholder')}
|
placeholder={t('form.userLimitPlaceholder')}
|
||||||
type='number'
|
type='number'
|
||||||
|
min={0}
|
||||||
step={1}
|
step={1}
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
|
|||||||
@ -9,9 +9,8 @@ import {
|
|||||||
getCouponList,
|
getCouponList,
|
||||||
updateCoupon,
|
updateCoupon,
|
||||||
} from '@/services/admin/coupon';
|
} from '@/services/admin/coupon';
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { formatDate } from '@/utils/common';
|
import { formatDate } from '@/utils/common';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { Switch } from '@workspace/ui/components/switch';
|
import { Switch } from '@workspace/ui/components/switch';
|
||||||
@ -24,16 +23,7 @@ import CouponForm from './coupon-form';
|
|||||||
export default function Page() {
|
export default function Page() {
|
||||||
const t = useTranslations('coupon');
|
const t = useTranslations('coupon');
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { data } = useQuery({
|
const { subscribes } = useSubscribe();
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 9999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.SubscribeGroup[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
return (
|
return (
|
||||||
<ProTable<API.Coupon, { group_id: number; query: string }>
|
<ProTable<API.Coupon, { group_id: number; query: string }>
|
||||||
@ -67,8 +57,8 @@ export default function Page() {
|
|||||||
{
|
{
|
||||||
key: 'subscribe',
|
key: 'subscribe',
|
||||||
placeholder: t('subscribe'),
|
placeholder: t('subscribe'),
|
||||||
options: data?.map((item) => ({
|
options: subscribes?.map((item) => ({
|
||||||
label: item.name,
|
label: item.name!,
|
||||||
value: String(item.id),
|
value: String(item.id),
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import { ProTable } from '@/components/pro-table';
|
import { ProTable } from '@/components/pro-table';
|
||||||
import { filterServerTrafficLog } from '@/services/admin/log';
|
import { filterServerTrafficLog } from '@/services/admin/log';
|
||||||
import { filterServerList } from '@/services/admin/server';
|
import { useServer } from '@/store/server';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { formatBytes } from '@workspace/ui/utils';
|
import { formatBytes } from '@workspace/ui/utils';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
@ -13,20 +13,10 @@ import { useSearchParams } from 'next/navigation';
|
|||||||
export default function ServerTrafficLogPage() {
|
export default function ServerTrafficLogPage() {
|
||||||
const t = useTranslations('log');
|
const t = useTranslations('log');
|
||||||
const sp = useSearchParams();
|
const sp = useSearchParams();
|
||||||
|
const { getServerName, getServerById } = useServer();
|
||||||
|
|
||||||
const today = new Date().toISOString().split('T')[0];
|
const today = new Date().toISOString().split('T')[0];
|
||||||
|
|
||||||
const { data: servers = [] } = useQuery({
|
|
||||||
queryKey: ['filterServerListAll'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await filterServerList({ page: 1, size: 999999999 });
|
|
||||||
return data?.data?.list || [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const getServerName = (id?: number) =>
|
|
||||||
id ? (servers.find((s) => s.id === id)?.name ?? `Server ${id}`) : 'Unknown';
|
|
||||||
|
|
||||||
const initialFilters = {
|
const initialFilters = {
|
||||||
date: sp.get('date') || today,
|
date: sp.get('date') || today,
|
||||||
server_id: sp.get('server_id') ? Number(sp.get('server_id')) : undefined,
|
server_id: sp.get('server_id') ? Number(sp.get('server_id')) : undefined,
|
||||||
@ -50,11 +40,14 @@ export default function ServerTrafficLogPage() {
|
|||||||
{
|
{
|
||||||
accessorKey: 'server_id',
|
accessorKey: 'server_id',
|
||||||
header: t('column.server'),
|
header: t('column.server'),
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => {
|
||||||
<span>
|
return (
|
||||||
{getServerName(row.original.server_id)} ({row.original.server_id})
|
<div className='flex items-center gap-2'>
|
||||||
</span>
|
<Badge>{row.original.server_id}</Badge>
|
||||||
),
|
<span>{getServerName(row.original.server_id)}</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'upload',
|
accessorKey: 'upload',
|
||||||
|
|||||||
@ -3,9 +3,8 @@
|
|||||||
import { UserDetail, UserSubscribeDetail } from '@/app/dashboard/user/user-detail';
|
import { UserDetail, UserSubscribeDetail } from '@/app/dashboard/user/user-detail';
|
||||||
import { ProTable } from '@/components/pro-table';
|
import { ProTable } from '@/components/pro-table';
|
||||||
import { filterTrafficLogDetails } from '@/services/admin/log';
|
import { filterTrafficLogDetails } from '@/services/admin/log';
|
||||||
import { filterServerList } from '@/services/admin/server';
|
import { useServer } from '@/store/server';
|
||||||
import { formatDate } from '@/utils/common';
|
import { formatDate } from '@/utils/common';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { formatBytes } from '@workspace/ui/utils';
|
import { formatBytes } from '@workspace/ui/utils';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useSearchParams } from 'next/navigation';
|
import { useSearchParams } from 'next/navigation';
|
||||||
@ -13,20 +12,10 @@ import { useSearchParams } from 'next/navigation';
|
|||||||
export default function TrafficDetailsPage() {
|
export default function TrafficDetailsPage() {
|
||||||
const t = useTranslations('log');
|
const t = useTranslations('log');
|
||||||
const sp = useSearchParams();
|
const sp = useSearchParams();
|
||||||
|
const { getServerName } = useServer();
|
||||||
|
|
||||||
const today = new Date().toISOString().split('T')[0];
|
const today = new Date().toISOString().split('T')[0];
|
||||||
|
|
||||||
const { data: servers = [] } = useQuery({
|
|
||||||
queryKey: ['filterServerListAll'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await filterServerList({ page: 1, size: 999999999 });
|
|
||||||
return data?.data?.list || [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const getServerName = (id?: number) =>
|
|
||||||
id ? (servers.find((s) => s.id === id)?.name ?? `Server ${id}`) : 'Unknown';
|
|
||||||
|
|
||||||
const initialFilters = {
|
const initialFilters = {
|
||||||
date: sp.get('date') || today,
|
date: sp.get('date') || today,
|
||||||
server_id: sp.get('server_id') ? Number(sp.get('server_id')) : undefined,
|
server_id: sp.get('server_id') ? Number(sp.get('server_id')) : undefined,
|
||||||
|
|||||||
@ -366,6 +366,7 @@ export default function EmailBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
disabled={form.watch('scope') === 5} // ScopeSkip
|
disabled={form.watch('scope') === 5} // ScopeSkip
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
@ -384,6 +385,7 @@ export default function EmailBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
disabled={form.watch('scope') === 5} // ScopeSkip
|
disabled={form.watch('scope') === 5} // ScopeSkip
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
@ -425,6 +427,7 @@ export default function EmailBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
placeholder={t('leaveEmptyForImmediateSend')}
|
placeholder={t('leaveEmptyForImmediateSend')}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
|
|||||||
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
import { Display } from '@/components/display';
|
import { Display } from '@/components/display';
|
||||||
import { createQuotaTask, queryQuotaTaskPreCount } from '@/services/admin/marketing';
|
import { createQuotaTask, queryQuotaTaskPreCount } from '@/services/admin/marketing';
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@ -73,17 +72,7 @@ export default function QuotaBroadcastForm() {
|
|||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
// Get subscribe list
|
const { subscribes } = useSubscribe();
|
||||||
const { data: subscribeList } = useQuery({
|
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 999999999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.SubscribeItem[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Calculate recipient count
|
// Calculate recipient count
|
||||||
const calculateRecipients = async () => {
|
const calculateRecipients = async () => {
|
||||||
@ -217,21 +206,19 @@ export default function QuotaBroadcastForm() {
|
|||||||
value={field.value || []}
|
value={field.value || []}
|
||||||
onChange={field.onChange}
|
onChange={field.onChange}
|
||||||
placeholder={t('pleaseSelectSubscribers')}
|
placeholder={t('pleaseSelectSubscribers')}
|
||||||
options={
|
options={subscribes?.map((subscribe) => ({
|
||||||
subscribeList?.map((subscribe) => ({
|
value: subscribe.id!,
|
||||||
value: subscribe.id!,
|
label: subscribe.name!,
|
||||||
label: subscribe.name!,
|
children: (
|
||||||
children: (
|
<div>
|
||||||
<div>
|
<div>{subscribe.name}</div>
|
||||||
<div>{subscribe.name}</div>
|
<div className='text-muted-foreground text-xs'>
|
||||||
<div className='text-muted-foreground text-xs'>
|
<Display type='traffic' value={subscribe.traffic || 0} /> /{' '}
|
||||||
<Display type='traffic' value={subscribe.traffic || 0} /> /{' '}
|
<Display type='currency' value={subscribe.unit_price || 0} />
|
||||||
<Display type='currency' value={subscribe.unit_price || 0} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
),
|
</div>
|
||||||
})) || []
|
),
|
||||||
}
|
}))}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@ -282,6 +269,7 @@ export default function QuotaBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
@ -299,6 +287,7 @@ export default function QuotaBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -3,9 +3,8 @@
|
|||||||
import { Display } from '@/components/display';
|
import { Display } from '@/components/display';
|
||||||
import { ProTable } from '@/components/pro-table';
|
import { ProTable } from '@/components/pro-table';
|
||||||
import { queryQuotaTaskList } from '@/services/admin/marketing';
|
import { queryQuotaTaskList } from '@/services/admin/marketing';
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { formatDate } from '@/utils/common';
|
import { formatDate } from '@/utils/common';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
||||||
import {
|
import {
|
||||||
@ -23,21 +22,9 @@ export default function QuotaTaskManager() {
|
|||||||
const t = useTranslations('marketing');
|
const t = useTranslations('marketing');
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
// Get subscribe list to show subscription names
|
const { subscribes } = useSubscribe();
|
||||||
const { data: subscribeList } = useQuery({
|
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 999999999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.SubscribeItem[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a map for quick lookup of subscription names
|
|
||||||
const subscribeMap =
|
const subscribeMap =
|
||||||
subscribeList?.reduce(
|
subscribes?.reduce(
|
||||||
(acc, subscribe) => {
|
(acc, subscribe) => {
|
||||||
acc[subscribe.id!] = subscribe.name!;
|
acc[subscribe.id!] = subscribe.name!;
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { filterServerList, queryNodeTag } from '@/services/admin/server';
|
import { useNode } from '@/store/node';
|
||||||
|
import { useServer } from '@/store/server';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@ -36,11 +36,13 @@ export type ProtocolName =
|
|||||||
| 'vmess'
|
| 'vmess'
|
||||||
| 'vless'
|
| 'vless'
|
||||||
| 'trojan'
|
| 'trojan'
|
||||||
| 'hysteria2'
|
| 'hysteria'
|
||||||
| 'tuic'
|
| 'tuic'
|
||||||
| 'anytls';
|
| 'anytls'
|
||||||
|
| 'naive'
|
||||||
type ServerRow = API.Server;
|
| 'http'
|
||||||
|
| 'socks'
|
||||||
|
| 'mieru';
|
||||||
|
|
||||||
const buildSchema = (t: ReturnType<typeof useTranslations>) =>
|
const buildSchema = (t: ReturnType<typeof useTranslations>) =>
|
||||||
z.object({
|
z.object({
|
||||||
@ -74,6 +76,20 @@ export default function NodeForm(props: {
|
|||||||
const Scheme = useMemo(() => buildSchema(t), [t]);
|
const Scheme = useMemo(() => buildSchema(t), [t]);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
|
const [autoFilledFields, setAutoFilledFields] = useState<Set<string>>(new Set());
|
||||||
|
|
||||||
|
const addAutoFilledField = (fieldName: string) => {
|
||||||
|
setAutoFilledFields((prev) => new Set(prev).add(fieldName));
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeAutoFilledField = (fieldName: string) => {
|
||||||
|
setAutoFilledFields((prev) => {
|
||||||
|
const newSet = new Set(prev);
|
||||||
|
newSet.delete(fieldName);
|
||||||
|
return newSet;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const form = useForm<NodeFormValues>({
|
const form = useForm<NodeFormValues>({
|
||||||
resolver: zodResolver(Scheme),
|
resolver: zodResolver(Scheme),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
@ -89,36 +105,12 @@ export default function NodeForm(props: {
|
|||||||
|
|
||||||
const serverId = form.watch('server_id');
|
const serverId = form.watch('server_id');
|
||||||
|
|
||||||
const { data } = useQuery({
|
const { servers, getAvailableProtocols } = useServer();
|
||||||
enabled: open,
|
const { tags } = useNode();
|
||||||
queryKey: ['filterServerListAll'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await filterServerList({ page: 1, size: 999999999 });
|
|
||||||
return data?.data?.list || [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const servers: ServerRow[] = data as ServerRow[];
|
|
||||||
|
|
||||||
const { data: tagsData } = useQuery({
|
const existingTags: string[] = tags || [];
|
||||||
enabled: open,
|
|
||||||
queryKey: ['queryNodeTag'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await queryNodeTag();
|
|
||||||
return data?.data?.tags || [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const existingTags: string[] = tagsData as string[];
|
|
||||||
|
|
||||||
const currentServer = useMemo(() => servers?.find((s) => s.id === serverId), [servers, serverId]);
|
const availableProtocols = getAvailableProtocols(serverId);
|
||||||
|
|
||||||
const availableProtocols = useMemo(() => {
|
|
||||||
return (currentServer?.protocols || [])
|
|
||||||
.map((p) => ({
|
|
||||||
protocol: (p as any).type as ProtocolName,
|
|
||||||
port: (p as any).port as number | undefined,
|
|
||||||
}))
|
|
||||||
.filter((p) => !!p.protocol);
|
|
||||||
}, [currentServer]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialValues) {
|
if (initialValues) {
|
||||||
@ -139,60 +131,93 @@ export default function NodeForm(props: {
|
|||||||
const id = nextId ?? undefined;
|
const id = nextId ?? undefined;
|
||||||
form.setValue('server_id', id);
|
form.setValue('server_id', id);
|
||||||
|
|
||||||
const sel = servers.find((s) => s.id === id);
|
if (!id) {
|
||||||
const dirty = form.formState.dirtyFields as Record<string, any>;
|
setAutoFilledFields(new Set());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedServer = servers.find((s) => s.id === id);
|
||||||
|
if (!selectedServer) return;
|
||||||
|
|
||||||
const currentValues = form.getValues();
|
const currentValues = form.getValues();
|
||||||
|
const fieldsToFill: string[] = [];
|
||||||
|
|
||||||
if (!dirty.name) {
|
if (!currentValues.name || autoFilledFields.has('name')) {
|
||||||
form.setValue('name', (sel?.name as string) || '', { shouldDirty: false });
|
form.setValue('name', selectedServer.name as string, { shouldDirty: false });
|
||||||
|
fieldsToFill.push('name');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!currentValues.address || autoFilledFields.has('address')) {
|
||||||
!dirty.address &&
|
form.setValue('address', selectedServer.address as string, { shouldDirty: false });
|
||||||
(!currentValues.address || currentValues.address === (sel?.address as string))
|
fieldsToFill.push('address');
|
||||||
) {
|
|
||||||
form.setValue('address', (sel?.address as string) || '', { shouldDirty: false });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const allowed = (sel?.protocols || [])
|
const protocols = getAvailableProtocols(id);
|
||||||
.map((p) => (p as any).type as ProtocolName)
|
const firstProtocol = protocols[0];
|
||||||
.filter(Boolean);
|
|
||||||
|
|
||||||
const currentProtocol = form.getValues('protocol') as ProtocolName;
|
if (firstProtocol && (!currentValues.protocol || autoFilledFields.has('protocol'))) {
|
||||||
|
form.setValue('protocol', firstProtocol.protocol, { shouldDirty: false });
|
||||||
|
fieldsToFill.push('protocol');
|
||||||
|
|
||||||
if (!allowed.includes(currentProtocol)) {
|
if (!currentValues.port || currentValues.port === 0 || autoFilledFields.has('port')) {
|
||||||
const firstProtocol = allowed[0] || '';
|
const port = firstProtocol.port || 0;
|
||||||
form.setValue('protocol', firstProtocol as any);
|
form.setValue('port', port, { shouldDirty: false });
|
||||||
|
fieldsToFill.push('port');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (firstProtocol) {
|
setAutoFilledFields(new Set(fieldsToFill));
|
||||||
handleProtocolChange(firstProtocol);
|
}
|
||||||
|
|
||||||
|
const handleManualFieldChange = (fieldName: keyof NodeFormValues, value: any) => {
|
||||||
|
form.setValue(fieldName, value);
|
||||||
|
removeAutoFilledField(fieldName);
|
||||||
|
};
|
||||||
|
|
||||||
|
function handleProtocolChange(nextProto?: ProtocolName | null) {
|
||||||
|
const protocol = (nextProto || '') as ProtocolName | '';
|
||||||
|
form.setValue('protocol', protocol);
|
||||||
|
|
||||||
|
if (!protocol || !serverId) {
|
||||||
|
removeAutoFilledField('protocol');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentValues = form.getValues();
|
||||||
|
const isPortAutoFilled = autoFilledFields.has('port');
|
||||||
|
|
||||||
|
removeAutoFilledField('protocol');
|
||||||
|
|
||||||
|
if (!currentValues.port || currentValues.port === 0 || isPortAutoFilled) {
|
||||||
|
const protocolData = availableProtocols.find((p) => p.protocol === protocol);
|
||||||
|
|
||||||
|
if (protocolData) {
|
||||||
|
const port = protocolData.port || 0;
|
||||||
|
form.setValue('port', port, { shouldDirty: false });
|
||||||
|
addAutoFilledField('port');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleProtocolChange(nextProto?: ProtocolName | null) {
|
async function handleSubmit(values: NodeFormValues) {
|
||||||
const p = (nextProto || '') as ProtocolName | '';
|
const result = await onSubmit(values);
|
||||||
form.setValue('protocol', p);
|
if (result) {
|
||||||
if (!p || !currentServer) return;
|
setOpen(false);
|
||||||
|
setAutoFilledFields(new Set());
|
||||||
const dirty = form.formState.dirtyFields as Record<string, any>;
|
|
||||||
const currentValues = form.getValues();
|
|
||||||
|
|
||||||
if (!dirty.port) {
|
|
||||||
const hit = (currentServer.protocols as any[]).find((x) => (x as any).type === p);
|
|
||||||
const port = (hit as any)?.port as number | undefined;
|
|
||||||
const newPort = typeof port === 'number' && port > 0 ? port : 0;
|
|
||||||
|
|
||||||
if (!currentValues.port || currentValues.port === 0 || currentValues.port === newPort) {
|
|
||||||
form.setValue('port', newPort, { shouldDirty: false });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sheet open={open} onOpenChange={setOpen}>
|
<Sheet open={open} onOpenChange={setOpen}>
|
||||||
<SheetTrigger asChild>
|
<SheetTrigger asChild>
|
||||||
<Button onClick={() => form.reset()}>{trigger}</Button>
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
form.reset();
|
||||||
|
setAutoFilledFields(new Set());
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{trigger}
|
||||||
|
</Button>
|
||||||
</SheetTrigger>
|
</SheetTrigger>
|
||||||
|
|
||||||
<SheetContent className='w-[560px] max-w-full'>
|
<SheetContent className='w-[560px] max-w-full'>
|
||||||
@ -253,7 +278,7 @@ export default function NodeForm(props: {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(v) => form.setValue(field.name, v as string)}
|
onValueChange={(v) => handleManualFieldChange('name', v as string)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@ -270,7 +295,7 @@ export default function NodeForm(props: {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(v) => form.setValue(field.name, v as string)}
|
onValueChange={(v) => handleManualFieldChange('address', v as string)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@ -291,7 +316,7 @@ export default function NodeForm(props: {
|
|||||||
min={1}
|
min={1}
|
||||||
max={65535}
|
max={65535}
|
||||||
placeholder='1-65535'
|
placeholder='1-65535'
|
||||||
onValueChange={(v) => form.setValue(field.name, Number(v))}
|
onValueChange={(v) => handleManualFieldChange('port', Number(v))}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@ -327,7 +352,7 @@ export default function NodeForm(props: {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
onClick={form.handleSubmit(onSubmit, (errors) => {
|
onClick={form.handleSubmit(handleSubmit, (errors) => {
|
||||||
const key = Object.keys(errors)[0] as keyof typeof errors;
|
const key = Object.keys(errors)[0] as keyof typeof errors;
|
||||||
if (key) toast.error(String(errors[key]?.message));
|
if (key) toast.error(String(errors[key]?.message));
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -5,12 +5,12 @@ import {
|
|||||||
createNode,
|
createNode,
|
||||||
deleteNode,
|
deleteNode,
|
||||||
filterNodeList,
|
filterNodeList,
|
||||||
filterServerList,
|
|
||||||
resetSortWithNode,
|
resetSortWithNode,
|
||||||
toggleNodeStatus,
|
toggleNodeStatus,
|
||||||
updateNode,
|
updateNode,
|
||||||
} from '@/services/admin/server';
|
} from '@/services/admin/server';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useNode } from '@/store/node';
|
||||||
|
import { useServer } from '@/store/server';
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { Switch } from '@workspace/ui/components/switch';
|
import { Switch } from '@workspace/ui/components/switch';
|
||||||
@ -25,24 +25,9 @@ export default function NodesPage() {
|
|||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const { data: servers = [] } = useQuery({
|
// Use our zustand store for server data
|
||||||
queryKey: ['filterServerListAll'],
|
const { getServerName, getServerAddress, getProtocolPort } = useServer();
|
||||||
queryFn: async () => {
|
const { fetchNodes, fetchTags } = useNode();
|
||||||
const { data } = await filterServerList({ page: 1, size: 999999999 });
|
|
||||||
return data?.data?.list || [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const getServerName = (id?: number) =>
|
|
||||||
id ? (servers.find((s) => s.id === id)?.name ?? `#${id}`) : '—';
|
|
||||||
const getServerOriginAddr = (id?: number) =>
|
|
||||||
id ? (servers.find((s) => s.id === id)?.address ?? '—') : '—';
|
|
||||||
const getProtocolOriginPort = (id?: number, proto?: string) => {
|
|
||||||
if (!id || !proto) return '—';
|
|
||||||
const hit = servers.find((s) => s.id === id)?.protocols?.find((p) => (p as any).type === proto);
|
|
||||||
const p = (hit as any)?.port as number | undefined;
|
|
||||||
return typeof p === 'number' ? String(p) : '—';
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProTable<API.Node, { search: string }>
|
<ProTable<API.Node, { search: string }>
|
||||||
@ -69,6 +54,8 @@ export default function NodesPage() {
|
|||||||
await createNode(body);
|
await createNode(body);
|
||||||
toast.success(t('created'));
|
toast.success(t('created'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchNodes();
|
||||||
|
fetchTags();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -90,6 +77,8 @@ export default function NodesPage() {
|
|||||||
await toggleNodeStatus({ id: row.original.id, enable: v });
|
await toggleNodeStatus({ id: row.original.id, enable: v });
|
||||||
toast.success(v ? t('enabled_on') : t('enabled_off'));
|
toast.success(v ? t('enabled_on') : t('enabled_off'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchNodes();
|
||||||
|
fetchTags();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@ -99,24 +88,20 @@ export default function NodesPage() {
|
|||||||
{
|
{
|
||||||
id: 'address_port',
|
id: 'address_port',
|
||||||
header: `${t('address')}:${t('port')}`,
|
header: `${t('address')}:${t('port')}`,
|
||||||
cell: ({ row }) => (row.original.address || '—') + ':' + (row.original.port ?? '—'),
|
cell: ({ row }) => `${row.original.address || '—'}:${row.original.port || '—'}`,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
id: 'server_id',
|
id: 'server_id',
|
||||||
header: t('server'),
|
header: t('server'),
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) =>
|
||||||
<div className='flex flex-wrap gap-2'>
|
`${getServerName(row.original.server_id)}:${getServerAddress(row.original.server_id)}`,
|
||||||
<Badge variant='outline'>
|
},
|
||||||
{getServerName(row.original.server_id)} ·{' '}
|
{
|
||||||
{getServerOriginAddr(row.original.server_id)}
|
id: 'protocol',
|
||||||
</Badge>
|
header: ` ${t('protocol')}:${t('port')}`,
|
||||||
<Badge variant='outline'>
|
cell: ({ row }) =>
|
||||||
{row.original.protocol || '—'} ·{' '}
|
`${row.original.protocol}:${getProtocolPort(row.original.server_id, row.original.protocol)}`,
|
||||||
{getProtocolOriginPort(row.original.server_id, row.original.protocol)}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'tags',
|
accessorKey: 'tags',
|
||||||
@ -152,30 +137,19 @@ export default function NodesPage() {
|
|||||||
trigger={t('edit')}
|
trigger={t('edit')}
|
||||||
title={t('drawerEditTitle')}
|
title={t('drawerEditTitle')}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
initialValues={{
|
initialValues={row}
|
||||||
name: row.name,
|
|
||||||
server_id: row.server_id,
|
|
||||||
protocol: row.protocol as any,
|
|
||||||
address: row.address as any,
|
|
||||||
port: row.port as any,
|
|
||||||
tags: (row.tags as any) || [],
|
|
||||||
}}
|
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const body: API.UpdateNodeRequest = {
|
const body: API.UpdateNodeRequest = {
|
||||||
id: row.id,
|
...row,
|
||||||
name: values.name,
|
...values,
|
||||||
server_id: Number(values.server_id!),
|
|
||||||
protocol: values.protocol,
|
|
||||||
address: values.address,
|
|
||||||
port: Number(values.port!),
|
|
||||||
tags: values.tags || [],
|
|
||||||
enabled: row.enabled,
|
|
||||||
} as any;
|
} as any;
|
||||||
await updateNode(body);
|
await updateNode(body);
|
||||||
toast.success(t('updated'));
|
toast.success(t('updated'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchNodes();
|
||||||
|
fetchTags();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -193,6 +167,8 @@ export default function NodesPage() {
|
|||||||
await deleteNode({ id: row.id } as any);
|
await deleteNode({ id: row.id } as any);
|
||||||
toast.success(t('deleted'));
|
toast.success(t('deleted'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchNodes();
|
||||||
|
fetchTags();
|
||||||
}}
|
}}
|
||||||
cancelText={t('cancel')}
|
cancelText={t('cancel')}
|
||||||
confirmText={t('confirm')}
|
confirmText={t('confirm')}
|
||||||
@ -201,18 +177,15 @@ export default function NodesPage() {
|
|||||||
key='copy'
|
key='copy'
|
||||||
variant='outline'
|
variant='outline'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const { id, enabled, created_at, updated_at, ...rest } = row as any;
|
const { id, enabled, created_at, updated_at, sort, ...rest } = row as any;
|
||||||
await createNode({
|
await createNode({
|
||||||
name: rest.name,
|
...rest,
|
||||||
server_id: rest.server_id,
|
|
||||||
protocol: rest.protocol,
|
|
||||||
address: rest.address,
|
|
||||||
port: rest.port,
|
|
||||||
tags: rest.tags || [],
|
|
||||||
enabled: false,
|
enabled: false,
|
||||||
} as any);
|
});
|
||||||
toast.success(t('copied'));
|
toast.success(t('copied'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchNodes();
|
||||||
|
fetchTags();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('copy')}
|
{t('copy')}
|
||||||
@ -229,6 +202,8 @@ export default function NodesPage() {
|
|||||||
await Promise.all(rows.map((r) => deleteNode({ id: r.id } as any)));
|
await Promise.all(rows.map((r) => deleteNode({ id: r.id } as any)));
|
||||||
toast.success(t('deleted'));
|
toast.success(t('deleted'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchNodes();
|
||||||
|
fetchTags();
|
||||||
}}
|
}}
|
||||||
cancelText={t('cancel')}
|
cancelText={t('cancel')}
|
||||||
confirmText={t('confirm')}
|
confirmText={t('confirm')}
|
||||||
@ -262,6 +237,7 @@ export default function NodesPage() {
|
|||||||
sort: item.sort,
|
sort: item.sort,
|
||||||
})) as API.SortItem[],
|
})) as API.SortItem[],
|
||||||
});
|
});
|
||||||
|
toast.success(t('sorted_success'));
|
||||||
}
|
}
|
||||||
return updatedItems;
|
return updatedItems;
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useSearchParams } from 'next/navigation';
|
import { useSearchParams } from 'next/navigation';
|
||||||
import { useRef } from 'react';
|
import { useRef } from 'react';
|
||||||
@ -8,7 +7,7 @@ import { useRef } from 'react';
|
|||||||
import { Display } from '@/components/display';
|
import { Display } from '@/components/display';
|
||||||
import { ProTable, ProTableActions } from '@/components/pro-table';
|
import { ProTable, ProTableActions } from '@/components/pro-table';
|
||||||
import { getOrderList, updateOrderStatus } from '@/services/admin/order';
|
import { getOrderList, updateOrderStatus } from '@/services/admin/order';
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { formatDate } from '@/utils/common';
|
import { formatDate } from '@/utils/common';
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
@ -32,16 +31,7 @@ export default function Page() {
|
|||||||
|
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
|
|
||||||
const { data: subscribeList } = useQuery({
|
const { subscribes, getSubscribeName } = useSubscribe();
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 999999999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.SubscribeGroup[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const initialFilters = {
|
const initialFilters = {
|
||||||
search: sp.get('search') || undefined,
|
search: sp.get('search') || undefined,
|
||||||
@ -68,9 +58,10 @@ export default function Page() {
|
|||||||
accessorKey: 'subscribe_id',
|
accessorKey: 'subscribe_id',
|
||||||
header: t('subscribe'),
|
header: t('subscribe'),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const name = subscribeList?.find(
|
if (row.original.type === 4) {
|
||||||
(item) => item.id === row.getValue('subscribe_id'),
|
return t(`type.${row.getValue('type')}`);
|
||||||
)?.name;
|
}
|
||||||
|
const name = getSubscribeName(row.getValue('subscribe_id'));
|
||||||
const quantity = row.original.quantity;
|
const quantity = row.original.quantity;
|
||||||
return name ? `${name} × ${quantity}` : '';
|
return name ? `${name} × ${quantity}` : '';
|
||||||
},
|
},
|
||||||
@ -186,8 +177,8 @@ export default function Page() {
|
|||||||
{
|
{
|
||||||
key: 'subscribe_id',
|
key: 'subscribe_id',
|
||||||
placeholder: `${t('subscribe')}`,
|
placeholder: `${t('subscribe')}`,
|
||||||
options: subscribeList?.map((item) => ({
|
options: subscribes?.map((item) => ({
|
||||||
label: item.name,
|
label: item.name!,
|
||||||
value: String(item.id),
|
value: String(item.id),
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
import { getTranslations } from 'next-intl/server';
|
|
||||||
|
|
||||||
import SubscribeTable from './subscribe-table';
|
import SubscribeTable from './subscribe-table';
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const t = await getTranslations('product');
|
|
||||||
|
|
||||||
return <SubscribeTable />;
|
return <SubscribeTable />;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { filterNodeList, queryNodeTag } from '@/services/admin/server';
|
import useGlobalStore from '@/config/use-global';
|
||||||
|
import { useNode } from '@/store/node';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import {
|
import {
|
||||||
Accordion,
|
Accordion,
|
||||||
AccordionContent,
|
AccordionContent,
|
||||||
@ -79,6 +79,9 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
trigger,
|
trigger,
|
||||||
title,
|
title,
|
||||||
}: Readonly<SubscribeFormProps<T>>) {
|
}: Readonly<SubscribeFormProps<T>>) {
|
||||||
|
const { common } = useGlobalStore();
|
||||||
|
const { currency } = common;
|
||||||
|
|
||||||
const t = useTranslations('product');
|
const t = useTranslations('product');
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const updateTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
const updateTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
@ -214,7 +217,11 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
form?.reset(
|
form?.reset(
|
||||||
assign(defaultValues, shake(initialValues, (value) => value === null) as Record<string, any>),
|
assign(defaultValues, shake(initialValues, (value) => value === null) as Record<string, any>),
|
||||||
);
|
);
|
||||||
}, [form, initialValues]);
|
const discount = form.getValues('discount') || [];
|
||||||
|
if (discount.length > 0) {
|
||||||
|
debouncedCalculateDiscount(discount, 'discount');
|
||||||
|
}
|
||||||
|
}, [form, initialValues, open]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
@ -229,35 +236,9 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
if (bool) setOpen(false);
|
if (bool) setOpen(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data: nodes } = useQuery({
|
const { getAllAvailableTags, getNodesByTag, getNodesWithoutTags } = useNode();
|
||||||
queryKey: ['filterNodeListAll'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await filterNodeList({ page: 1, size: 999999999 });
|
|
||||||
return (data.data?.list || []) as API.Node[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: allTagsData } = useQuery({
|
const tagGroups = getAllAvailableTags();
|
||||||
queryKey: ['queryNodeTag'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await queryNodeTag();
|
|
||||||
return data?.data?.tags || [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const nodeExtractedTags = Array.from(
|
|
||||||
new Set(
|
|
||||||
((nodes as API.Node[]) || [])
|
|
||||||
.flatMap((n) => (Array.isArray(n.tags) ? n.tags : []))
|
|
||||||
.filter(Boolean),
|
|
||||||
),
|
|
||||||
) as string[];
|
|
||||||
|
|
||||||
const allAvailableTags = (allTagsData as string[]) || [];
|
|
||||||
|
|
||||||
const tagGroups = Array.from(new Set([...allAvailableTags, ...nodeExtractedTags])).filter(
|
|
||||||
Boolean,
|
|
||||||
);
|
|
||||||
|
|
||||||
const unit_time = form.watch('unit_time');
|
const unit_time = form.watch('unit_time');
|
||||||
|
|
||||||
@ -657,9 +638,9 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
{
|
{
|
||||||
name: 'discount',
|
name: 'discount',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0.01,
|
min: 1,
|
||||||
max: 100,
|
max: 100,
|
||||||
step: 0.01,
|
step: 1,
|
||||||
placeholder: t('form.discountPercent'),
|
placeholder: t('form.discountPercent'),
|
||||||
suffix: '%',
|
suffix: '%',
|
||||||
},
|
},
|
||||||
@ -669,6 +650,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
prefix: currency.currency_symbol,
|
||||||
formatInput: (value) => unitConversion('centsToDollars', value),
|
formatInput: (value) => unitConversion('centsToDollars', value),
|
||||||
formatOutput: (value) =>
|
formatOutput: (value) =>
|
||||||
unitConversion('dollarsToCents', value).toString(),
|
unitConversion('dollarsToCents', value).toString(),
|
||||||
@ -806,10 +788,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
{tagGroups.map((tag) => {
|
{tagGroups.map((tag) => {
|
||||||
const value = field.value || [];
|
const value = field.value || [];
|
||||||
const tagId = tag;
|
const tagId = tag;
|
||||||
const nodesWithTag =
|
const nodesWithTag = getNodesByTag(tag);
|
||||||
(nodes as API.Node[])?.filter((n) =>
|
|
||||||
(n.tags || []).includes(tag),
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AccordionItem key={tag} value={String(tag)}>
|
<AccordionItem key={tag} value={String(tag)}>
|
||||||
@ -836,22 +815,20 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<ul className='space-y-1'>
|
<ul className='space-y-1'>
|
||||||
{(nodes as API.Node[])
|
{getNodesByTag(tag).map((node) => (
|
||||||
?.filter((n) => (n.tags || []).includes(tag))
|
<li
|
||||||
?.map((node) => (
|
key={node.id}
|
||||||
<li
|
className='flex items-center justify-between gap-3'
|
||||||
key={node.id}
|
>
|
||||||
className='flex items-center justify-between gap-3'
|
<span className='flex-1'>{node.name}</span>
|
||||||
>
|
<span className='flex-1'>
|
||||||
<span className='flex-1'>{node.name}</span>
|
{node.address}:{node.port}
|
||||||
<span className='flex-1'>
|
</span>
|
||||||
{node.address}:{node.port}
|
<span className='flex-1 text-right'>
|
||||||
</span>
|
{node.protocol}
|
||||||
<span className='flex-1 text-right'>
|
</span>
|
||||||
{node.protocol}
|
</li>
|
||||||
</span>
|
))}
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
</ul>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
@ -872,34 +849,32 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
<FormLabel>{t('form.node')}</FormLabel>
|
<FormLabel>{t('form.node')}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<div className='flex flex-col gap-2'>
|
<div className='flex flex-col gap-2'>
|
||||||
{(nodes as API.Node[])
|
{getNodesWithoutTags().map((item) => {
|
||||||
?.filter((item) => (item.tags || []).length === 0)
|
const value = field.value || [];
|
||||||
?.map((item) => {
|
|
||||||
const value = field.value || [];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center gap-2' key={item.id}>
|
<div className='flex items-center gap-2' key={item.id}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={value.includes(item.id!)}
|
checked={value.includes(item.id!)}
|
||||||
onCheckedChange={(checked) => {
|
onCheckedChange={(checked) => {
|
||||||
return checked
|
return checked
|
||||||
? form.setValue(field.name, [...value, item.id])
|
? form.setValue(field.name, [...value, item.id])
|
||||||
: form.setValue(
|
: form.setValue(
|
||||||
field.name,
|
field.name,
|
||||||
value.filter((value: number) => value !== item.id),
|
value.filter((value: number) => value !== item.id),
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Label className='flex w-full items-center justify-between gap-3'>
|
<Label className='flex w-full items-center justify-between gap-3'>
|
||||||
<span className='flex-1'>{item.name}</span>
|
<span className='flex-1'>{item.name}</span>
|
||||||
<span className='flex-1'>
|
<span className='flex-1'>
|
||||||
{item.address}:{item.port}
|
{item.address}:{item.port}
|
||||||
</span>
|
</span>
|
||||||
<span className='flex-1 text-right'>{item.protocol}</span>
|
<span className='flex-1 text-right'>{item.protocol}</span>
|
||||||
</Label>
|
</Label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
subscribeSort,
|
subscribeSort,
|
||||||
updateSubscribe,
|
updateSubscribe,
|
||||||
} from '@/services/admin/subscribe';
|
} from '@/services/admin/subscribe';
|
||||||
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { Switch } from '@workspace/ui/components/switch';
|
import { Switch } from '@workspace/ui/components/switch';
|
||||||
@ -23,6 +24,7 @@ export default function SubscribeTable() {
|
|||||||
const t = useTranslations('product');
|
const t = useTranslations('product');
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
|
const { fetchSubscribes } = useSubscribe();
|
||||||
return (
|
return (
|
||||||
<ProTable<API.SubscribeItem, { group_id: number; query: string }>
|
<ProTable<API.SubscribeItem, { group_id: number; query: string }>
|
||||||
action={ref}
|
action={ref}
|
||||||
@ -42,6 +44,7 @@ export default function SubscribeTable() {
|
|||||||
});
|
});
|
||||||
toast.success(t('createSuccess'));
|
toast.success(t('createSuccess'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchSubscribes();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -83,6 +86,7 @@ export default function SubscribeTable() {
|
|||||||
show: checked,
|
show: checked,
|
||||||
} as API.UpdateSubscribeRequest);
|
} as API.UpdateSubscribeRequest);
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchSubscribes();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@ -101,6 +105,7 @@ export default function SubscribeTable() {
|
|||||||
sell: checked,
|
sell: checked,
|
||||||
} as API.UpdateSubscribeRequest);
|
} as API.UpdateSubscribeRequest);
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchSubscribes();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@ -186,6 +191,7 @@ export default function SubscribeTable() {
|
|||||||
} as API.UpdateSubscribeRequest);
|
} as API.UpdateSubscribeRequest);
|
||||||
toast.success(t('updateSuccess'));
|
toast.success(t('updateSuccess'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchSubscribes();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -206,6 +212,7 @@ export default function SubscribeTable() {
|
|||||||
});
|
});
|
||||||
toast.success(t('deleteSuccess'));
|
toast.success(t('deleteSuccess'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchSubscribes();
|
||||||
}}
|
}}
|
||||||
cancelText={t('cancel')}
|
cancelText={t('cancel')}
|
||||||
confirmText={t('confirm')}
|
confirmText={t('confirm')}
|
||||||
@ -224,6 +231,7 @@ export default function SubscribeTable() {
|
|||||||
} as API.CreateSubscribeRequest);
|
} as API.CreateSubscribeRequest);
|
||||||
toast.success(t('copySuccess'));
|
toast.success(t('copySuccess'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchSubscribes();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -248,6 +256,7 @@ export default function SubscribeTable() {
|
|||||||
|
|
||||||
toast.success(t('deleteSuccess'));
|
toast.success(t('deleteSuccess'));
|
||||||
ref.current?.reset();
|
ref.current?.reset();
|
||||||
|
fetchSubscribes();
|
||||||
}}
|
}}
|
||||||
cancelText={t('cancel')}
|
cancelText={t('cancel')}
|
||||||
confirmText={t('confirm')}
|
confirmText={t('confirm')}
|
||||||
|
|||||||
121
apps/admin/app/dashboard/servers/dynamic-multiplier.tsx
Normal file
121
apps/admin/app/dashboard/servers/dynamic-multiplier.tsx
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { getNodeMultiplier, setNodeMultiplier } from '@/services/admin/system';
|
||||||
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { Button } from '@workspace/ui/components/button';
|
||||||
|
import { Card, CardContent } from '@workspace/ui/components/card';
|
||||||
|
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
||||||
|
import {
|
||||||
|
Sheet,
|
||||||
|
SheetContent,
|
||||||
|
SheetDescription,
|
||||||
|
SheetFooter,
|
||||||
|
SheetHeader,
|
||||||
|
SheetTitle,
|
||||||
|
SheetTrigger,
|
||||||
|
} from '@workspace/ui/components/sheet';
|
||||||
|
import { ArrayInput } from '@workspace/ui/custom-components/dynamic-Inputs';
|
||||||
|
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||||
|
import { useTranslations } from 'next-intl';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
|
export default function DynamicMultiplier() {
|
||||||
|
const t = useTranslations('servers');
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const [timeSlots, setTimeSlots] = useState<API.TimePeriod[]>([]);
|
||||||
|
|
||||||
|
const { data: periodsResp, refetch: refetchPeriods } = useQuery({
|
||||||
|
queryKey: ['getNodeMultiplier'],
|
||||||
|
queryFn: async () => {
|
||||||
|
const { data } = await getNodeMultiplier();
|
||||||
|
return (data.data?.periods || []) as API.TimePeriod[];
|
||||||
|
},
|
||||||
|
enabled: open,
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (periodsResp) {
|
||||||
|
setTimeSlots(periodsResp);
|
||||||
|
}
|
||||||
|
}, [periodsResp]);
|
||||||
|
|
||||||
|
async function savePeriods() {
|
||||||
|
await setNodeMultiplier({ periods: timeSlots });
|
||||||
|
await refetchPeriods();
|
||||||
|
toast.success(t('server_config.saveSuccess'));
|
||||||
|
setOpen(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Sheet open={open} onOpenChange={setOpen}>
|
||||||
|
<SheetTrigger asChild>
|
||||||
|
<Card>
|
||||||
|
<CardContent className='p-4'>
|
||||||
|
<div className='flex cursor-pointer items-center justify-between'>
|
||||||
|
<div className='flex items-center gap-3'>
|
||||||
|
<div className='bg-primary/10 flex h-10 w-10 items-center justify-center rounded-lg'>
|
||||||
|
<Icon icon='mdi:clock-time-eight' className='text-primary h-5 w-5' />
|
||||||
|
</div>
|
||||||
|
<div className='flex-1'>
|
||||||
|
<p className='font-medium'>{t('server_config.dynamic_multiplier')}</p>
|
||||||
|
<p className='text-muted-foreground truncate text-sm'>
|
||||||
|
{t('server_config.dynamic_multiplier_desc')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Icon icon='mdi:chevron-right' className='size-6' />
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</SheetTrigger>
|
||||||
|
|
||||||
|
<SheetContent className='w-[600px] max-w-full md:max-w-screen-md'>
|
||||||
|
<SheetHeader>
|
||||||
|
<SheetTitle>{t('server_config.dynamic_multiplier')}</SheetTitle>
|
||||||
|
<SheetDescription>{t('server_config.dynamic_multiplier_desc')}</SheetDescription>
|
||||||
|
</SheetHeader>
|
||||||
|
<ScrollArea className='-mx-6 h-[calc(100dvh-48px-36px-60px-env(safe-area-inset-top))] px-6'>
|
||||||
|
<div className='space-y-4 pt-4'>
|
||||||
|
<ArrayInput<API.TimePeriod>
|
||||||
|
fields={[
|
||||||
|
{
|
||||||
|
name: 'start_time',
|
||||||
|
prefix: t('server_config.fields.start_time'),
|
||||||
|
type: 'time',
|
||||||
|
step: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'end_time',
|
||||||
|
prefix: t('server_config.fields.end_time'),
|
||||||
|
type: 'time',
|
||||||
|
step: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'multiplier',
|
||||||
|
prefix: t('server_config.fields.multiplier'),
|
||||||
|
type: 'number',
|
||||||
|
placeholder: '0',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
value={timeSlots}
|
||||||
|
onChange={setTimeSlots}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ScrollArea>
|
||||||
|
|
||||||
|
<SheetFooter className='flex-row justify-between pt-3'>
|
||||||
|
<Button variant='outline' onClick={() => setTimeSlots(periodsResp || [])}>
|
||||||
|
{t('server_config.fields.reset')}
|
||||||
|
</Button>
|
||||||
|
<div className='flex gap-2'>
|
||||||
|
<Button variant='outline' onClick={() => setOpen(false)}>
|
||||||
|
{t('actions.cancel')}
|
||||||
|
</Button>
|
||||||
|
<Button onClick={savePeriods}>{t('actions.save')}</Button>
|
||||||
|
</div>
|
||||||
|
</SheetFooter>
|
||||||
|
</SheetContent>
|
||||||
|
</Sheet>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,928 +0,0 @@
|
|||||||
import { z } from 'zod';
|
|
||||||
|
|
||||||
export const protocols = [
|
|
||||||
'shadowsocks',
|
|
||||||
'vmess',
|
|
||||||
'vless',
|
|
||||||
'trojan',
|
|
||||||
'hysteria2',
|
|
||||||
'tuic',
|
|
||||||
'anytls',
|
|
||||||
'socks',
|
|
||||||
'naive',
|
|
||||||
'http',
|
|
||||||
'meru',
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export type FieldConfig = {
|
|
||||||
name: string;
|
|
||||||
type: 'input' | 'select' | 'switch' | 'number' | 'textarea';
|
|
||||||
label: string;
|
|
||||||
placeholder?: string | ((t: (key: string) => string, protocol: any) => string);
|
|
||||||
options?: readonly string[];
|
|
||||||
defaultValue?: any;
|
|
||||||
min?: number;
|
|
||||||
max?: number;
|
|
||||||
step?: number;
|
|
||||||
suffix?: string;
|
|
||||||
password?: number;
|
|
||||||
condition?: (protocol: any, values: any) => boolean;
|
|
||||||
group?: 'basic' | 'transport' | 'security' | 'reality' | 'plugin';
|
|
||||||
gridSpan?: 1 | 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Global label map for display; fallback to raw value if missing
|
|
||||||
export const LABELS = {
|
|
||||||
// transport
|
|
||||||
'tcp': 'TCP',
|
|
||||||
'udp': 'UDP',
|
|
||||||
'websocket': 'WebSocket',
|
|
||||||
'grpc': 'gRPC',
|
|
||||||
'mkcp': 'mKCP',
|
|
||||||
'httpupgrade': 'HTTP Upgrade',
|
|
||||||
'xhttp': 'XHTTP',
|
|
||||||
// security
|
|
||||||
'none': 'NONE',
|
|
||||||
'tls': 'TLS',
|
|
||||||
'reality': 'Reality',
|
|
||||||
// fingerprint
|
|
||||||
'chrome': 'Chrome',
|
|
||||||
'firefox': 'Firefox',
|
|
||||||
'safari': 'Safari',
|
|
||||||
'ios': 'IOS',
|
|
||||||
'android': 'Android',
|
|
||||||
'edge': 'edge',
|
|
||||||
'360': '360',
|
|
||||||
'qq': 'QQ',
|
|
||||||
// multiplex
|
|
||||||
'off': 'Off',
|
|
||||||
'low': 'Low',
|
|
||||||
'middle': 'Middle',
|
|
||||||
'high': 'High',
|
|
||||||
// ss plugins
|
|
||||||
'v2ray-plugin': 'V2Ray Plugin',
|
|
||||||
'simple-obfs': 'Simple Obfs',
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
// Flat arrays for enum-like sets
|
|
||||||
export const SS_CIPHERS = [
|
|
||||||
'aes-128-gcm',
|
|
||||||
'aes-192-gcm',
|
|
||||||
'aes-256-gcm',
|
|
||||||
'chacha20-ietf-poly1305',
|
|
||||||
'2022-blake3-aes-128-gcm',
|
|
||||||
'2022-blake3-aes-256-gcm',
|
|
||||||
'2022-blake3-chacha20-poly1305',
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export const SS_PLUGINS = ['none', 'simple-obfs', 'v2ray-plugin'] as const;
|
|
||||||
|
|
||||||
export const TRANSPORTS = {
|
|
||||||
vmess: ['tcp', 'websocket', 'grpc'] as const,
|
|
||||||
vless: ['tcp', 'websocket', 'grpc', 'mkcp', 'httpupgrade', 'xhttp'] as const,
|
|
||||||
trojan: ['tcp', 'websocket', 'grpc'] as const,
|
|
||||||
meru: ['tcp', 'udp'] as const,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const SECURITY = {
|
|
||||||
vmess: ['none', 'tls'] as const,
|
|
||||||
vless: ['none', 'tls', 'reality'] as const,
|
|
||||||
trojan: ['tls'] as const,
|
|
||||||
hysteria2: ['tls'] as const,
|
|
||||||
tuic: ['tls'] as const,
|
|
||||||
anytls: ['tls'] as const,
|
|
||||||
naive: ['none', 'tls'] as const,
|
|
||||||
http: ['none', 'tls'] as const,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const FLOWS = {
|
|
||||||
vless: ['none', 'xtls-rprx-direct', 'xtls-rprx-splice', 'xtls-rprx-vision'] as const,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const TUIC_UDP_RELAY_MODES = ['native', 'quic'] as const;
|
|
||||||
export const TUIC_CONGESTION = ['bbr', 'cubic', 'new_reno'] as const;
|
|
||||||
export const FINGERPRINTS = [
|
|
||||||
'chrome',
|
|
||||||
'firefox',
|
|
||||||
'safari',
|
|
||||||
'ios',
|
|
||||||
'android',
|
|
||||||
'edge',
|
|
||||||
'360',
|
|
||||||
'qq',
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export const multiplexLevels = ['off', 'low', 'middle', 'high'] as const;
|
|
||||||
|
|
||||||
export function getLabel(value: string): string {
|
|
||||||
const label = (LABELS as Record<string, string>)[value];
|
|
||||||
return label ?? value.toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
const nullableString = z.string().nullish();
|
|
||||||
const nullableBool = z.boolean().nullish();
|
|
||||||
const nullablePort = z.number().int().min(0).max(65535).nullish();
|
|
||||||
|
|
||||||
const ss = z.object({
|
|
||||||
type: z.literal('shadowsocks'),
|
|
||||||
host: nullableString,
|
|
||||||
port: nullablePort,
|
|
||||||
cipher: z.enum(SS_CIPHERS as any).nullish(),
|
|
||||||
server_key: nullableString,
|
|
||||||
plugin: z.enum(SS_PLUGINS as any).nullish(),
|
|
||||||
plugin_options: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const vmess = z.object({
|
|
||||||
type: z.literal('vmess'),
|
|
||||||
host: nullableString,
|
|
||||||
port: nullablePort,
|
|
||||||
transport: z.enum(TRANSPORTS.vmess as any).nullish(),
|
|
||||||
security: z.enum(SECURITY.vmess as any).nullish(),
|
|
||||||
path: nullableString,
|
|
||||||
service_name: nullableString,
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const vless = z.object({
|
|
||||||
type: z.literal('vless'),
|
|
||||||
host: nullableString,
|
|
||||||
port: nullablePort,
|
|
||||||
transport: z.enum(TRANSPORTS.vless as any).nullish(),
|
|
||||||
security: z.enum(SECURITY.vless as any).nullish(),
|
|
||||||
path: nullableString,
|
|
||||||
service_name: nullableString,
|
|
||||||
flow: z.enum(FLOWS.vless as any).nullish(),
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
reality_server_addr: nullableString,
|
|
||||||
reality_server_port: nullablePort,
|
|
||||||
reality_private_key: nullableString,
|
|
||||||
reality_public_key: nullableString,
|
|
||||||
reality_short_id: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const trojan = z.object({
|
|
||||||
type: z.literal('trojan'),
|
|
||||||
host: nullableString,
|
|
||||||
port: nullablePort,
|
|
||||||
transport: z.enum(TRANSPORTS.trojan as any).nullish(),
|
|
||||||
security: z.enum(SECURITY.trojan as any).nullish(),
|
|
||||||
path: nullableString,
|
|
||||||
service_name: nullableString,
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const hysteria2 = z.object({
|
|
||||||
type: z.literal('hysteria2'),
|
|
||||||
hop_ports: nullableString,
|
|
||||||
hop_interval: z.number().nullish(),
|
|
||||||
obfs_password: nullableString,
|
|
||||||
port: nullablePort,
|
|
||||||
security: z.enum(SECURITY.hysteria2 as any).nullish(),
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
up_mbps: z.number().nullish(),
|
|
||||||
down_mbps: z.number().nullish(),
|
|
||||||
});
|
|
||||||
|
|
||||||
const tuic = z.object({
|
|
||||||
type: z.literal('tuic'),
|
|
||||||
host: nullableString,
|
|
||||||
port: nullablePort,
|
|
||||||
disable_sni: z.boolean().nullish(),
|
|
||||||
reduce_rtt: z.boolean().nullish(),
|
|
||||||
udp_relay_mode: z.enum(TUIC_UDP_RELAY_MODES as any).nullish(),
|
|
||||||
congestion_controller: z.enum(TUIC_CONGESTION as any).nullish(),
|
|
||||||
security: z.enum(SECURITY.tuic as any).nullish(),
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const anytls = z.object({
|
|
||||||
type: z.literal('anytls'),
|
|
||||||
port: nullablePort,
|
|
||||||
security: z.enum(SECURITY.anytls as any).nullish(),
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
padding_scheme: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const socks = z.object({
|
|
||||||
type: z.literal('socks'),
|
|
||||||
port: nullablePort,
|
|
||||||
});
|
|
||||||
|
|
||||||
const naive = z.object({
|
|
||||||
type: z.literal('naive'),
|
|
||||||
port: nullablePort,
|
|
||||||
security: z.enum(SECURITY.naive as any).nullish(),
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const http = z.object({
|
|
||||||
type: z.literal('http'),
|
|
||||||
port: nullablePort,
|
|
||||||
security: z.enum(SECURITY.http as any).nullish(),
|
|
||||||
sni: nullableString,
|
|
||||||
allow_insecure: nullableBool,
|
|
||||||
fingerprint: nullableString,
|
|
||||||
});
|
|
||||||
|
|
||||||
const meru = z.object({
|
|
||||||
type: z.literal('meru'),
|
|
||||||
port: nullablePort,
|
|
||||||
multiplex: z.enum(multiplexLevels).nullish(),
|
|
||||||
transport: z.enum(TRANSPORTS.meru as any).nullish(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const protocolApiScheme = z.discriminatedUnion('type', [
|
|
||||||
ss,
|
|
||||||
vmess,
|
|
||||||
vless,
|
|
||||||
trojan,
|
|
||||||
hysteria2,
|
|
||||||
tuic,
|
|
||||||
anytls,
|
|
||||||
socks,
|
|
||||||
naive,
|
|
||||||
http,
|
|
||||||
meru,
|
|
||||||
]);
|
|
||||||
|
|
||||||
export const formSchema = z.object({
|
|
||||||
name: z.string().min(1),
|
|
||||||
address: z.string().min(1),
|
|
||||||
country: z.string().optional(),
|
|
||||||
city: z.string().optional(),
|
|
||||||
ratio: z.number().default(1),
|
|
||||||
protocols: z.array(protocolApiScheme),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type ServerFormValues = z.infer<typeof formSchema>;
|
|
||||||
|
|
||||||
export type ProtocolType = (typeof protocols)[number];
|
|
||||||
|
|
||||||
export function getProtocolDefaultConfig(proto: ProtocolType) {
|
|
||||||
switch (proto) {
|
|
||||||
case 'shadowsocks':
|
|
||||||
return {
|
|
||||||
type: 'shadowsocks',
|
|
||||||
port: null,
|
|
||||||
cipher: 'chacha20-ietf-poly1305',
|
|
||||||
server_key: null,
|
|
||||||
plugin: 'none',
|
|
||||||
plugin_opts: null,
|
|
||||||
} as any;
|
|
||||||
case 'vmess':
|
|
||||||
return { type: 'vmess', port: null, transport: 'tcp', security: 'none' } as any;
|
|
||||||
case 'vless':
|
|
||||||
return { type: 'vless', port: null, transport: 'tcp', security: 'none', flow: 'none' } as any;
|
|
||||||
case 'trojan':
|
|
||||||
return { type: 'trojan', port: null, transport: 'tcp', security: 'tls' } as any;
|
|
||||||
case 'hysteria2':
|
|
||||||
return {
|
|
||||||
type: 'hysteria2',
|
|
||||||
port: null,
|
|
||||||
hop_ports: null,
|
|
||||||
hop_interval: null,
|
|
||||||
obfs_password: null,
|
|
||||||
security: 'tls',
|
|
||||||
up_mbps: null,
|
|
||||||
down_mbps: null,
|
|
||||||
} as any;
|
|
||||||
case 'tuic':
|
|
||||||
return {
|
|
||||||
type: 'tuic',
|
|
||||||
port: null,
|
|
||||||
disable_sni: false,
|
|
||||||
reduce_rtt: false,
|
|
||||||
udp_relay_mode: 'native',
|
|
||||||
congestion_controller: 'bbr',
|
|
||||||
security: 'tls',
|
|
||||||
sni: null,
|
|
||||||
allow_insecure: false,
|
|
||||||
fingerprint: 'chrome',
|
|
||||||
} as any;
|
|
||||||
case 'socks':
|
|
||||||
return {
|
|
||||||
type: 'socks',
|
|
||||||
port: null,
|
|
||||||
} as any;
|
|
||||||
case 'naive':
|
|
||||||
return {
|
|
||||||
type: 'naive',
|
|
||||||
port: null,
|
|
||||||
security: 'none',
|
|
||||||
} as any;
|
|
||||||
case 'http':
|
|
||||||
return {
|
|
||||||
type: 'http',
|
|
||||||
port: null,
|
|
||||||
security: 'none',
|
|
||||||
} as any;
|
|
||||||
case 'meru':
|
|
||||||
return {
|
|
||||||
type: 'meru',
|
|
||||||
port: null,
|
|
||||||
multiplex: 'off',
|
|
||||||
transport: 'tcp',
|
|
||||||
} as any;
|
|
||||||
case 'anytls':
|
|
||||||
return {
|
|
||||||
type: 'anytls',
|
|
||||||
port: null,
|
|
||||||
security: 'tls',
|
|
||||||
padding_scheme: null,
|
|
||||||
sni: null,
|
|
||||||
allow_insecure: false,
|
|
||||||
fingerprint: 'chrome',
|
|
||||||
} as any;
|
|
||||||
default:
|
|
||||||
return {} as any;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
|
||||||
shadowsocks: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'cipher',
|
|
||||||
type: 'select',
|
|
||||||
label: 'encryption_method',
|
|
||||||
options: SS_CIPHERS,
|
|
||||||
defaultValue: 'chacha20-ietf-poly1305',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'server_key',
|
|
||||||
type: 'input',
|
|
||||||
label: 'server_key',
|
|
||||||
password: 32,
|
|
||||||
group: 'basic',
|
|
||||||
condition: (p) =>
|
|
||||||
[
|
|
||||||
'2022-blake3-aes-128-gcm',
|
|
||||||
'2022-blake3-aes-256-gcm',
|
|
||||||
'2022-blake3-chacha20-poly1305',
|
|
||||||
].includes(p.cipher),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'plugin',
|
|
||||||
type: 'select',
|
|
||||||
label: 'plugin',
|
|
||||||
options: SS_PLUGINS,
|
|
||||||
defaultValue: 'none',
|
|
||||||
group: 'plugin',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'plugin_opts',
|
|
||||||
type: 'textarea',
|
|
||||||
label: 'plugin_opts',
|
|
||||||
placeholder: (t: (key: string) => string, p: any) => {
|
|
||||||
switch (p.plugin) {
|
|
||||||
case 'simple-obfs':
|
|
||||||
return 'obfs=http;obfs-host=www.bing.com;path=/';
|
|
||||||
case 'v2ray-plugin':
|
|
||||||
return 'WebSocket: mode=websocket;host=mydomain.me;path=/;tls=true\n\nQUIC: mode=quic;host=mydomain.me';
|
|
||||||
default:
|
|
||||||
return 'key=value;key2=value2';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
group: 'plugin',
|
|
||||||
condition: (p) => ['simple-obfs', 'v2ray-plugin'].includes(p.plugin),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
vmess: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'transport',
|
|
||||||
type: 'select',
|
|
||||||
label: 'transport',
|
|
||||||
options: TRANSPORTS.vmess,
|
|
||||||
defaultValue: 'tcp',
|
|
||||||
group: 'transport',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'security',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security',
|
|
||||||
options: SECURITY.vmess,
|
|
||||||
defaultValue: 'none',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'host',
|
|
||||||
type: 'input',
|
|
||||||
label: 'host',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'path',
|
|
||||||
type: 'input',
|
|
||||||
label: 'path',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'service_name',
|
|
||||||
type: 'input',
|
|
||||||
label: 'service_name',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => p.transport === 'grpc',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'sni',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_sni',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allow_insecure',
|
|
||||||
type: 'switch',
|
|
||||||
label: 'security_allow_insecure',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
vless: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flow',
|
|
||||||
type: 'select',
|
|
||||||
label: 'flow',
|
|
||||||
options: FLOWS.vless,
|
|
||||||
defaultValue: 'none',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'transport',
|
|
||||||
type: 'select',
|
|
||||||
label: 'transport',
|
|
||||||
options: TRANSPORTS.vless,
|
|
||||||
defaultValue: 'tcp',
|
|
||||||
group: 'transport',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'security',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security',
|
|
||||||
options: SECURITY.vless,
|
|
||||||
defaultValue: 'none',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'host',
|
|
||||||
type: 'input',
|
|
||||||
label: 'host',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => ['websocket', 'mkcp', 'httpupgrade', 'xhttp'].includes(p.transport),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'path',
|
|
||||||
type: 'input',
|
|
||||||
label: 'path',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => ['websocket', 'mkcp', 'httpupgrade', 'xhttp'].includes(p.transport),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'service_name',
|
|
||||||
type: 'input',
|
|
||||||
label: 'service_name',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => p.transport === 'grpc',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'sni',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_sni',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allow_insecure',
|
|
||||||
type: 'switch',
|
|
||||||
label: 'security_allow_insecure',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'reality_server_addr',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_server_address',
|
|
||||||
placeholder: (t) => t('security_server_address_placeholder'),
|
|
||||||
group: 'reality',
|
|
||||||
condition: (p) => p.security === 'reality',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'reality_server_port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'security_server_port',
|
|
||||||
min: 1,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'reality',
|
|
||||||
condition: (p) => p.security === 'reality',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'reality_private_key',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_private_key',
|
|
||||||
placeholder: (t) => t('security_private_key_placeholder'),
|
|
||||||
group: 'reality',
|
|
||||||
condition: (p) => p.security === 'reality',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'reality_public_key',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_public_key',
|
|
||||||
placeholder: (t) => t('security_public_key_placeholder'),
|
|
||||||
group: 'reality',
|
|
||||||
condition: (p) => p.security === 'reality',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'reality_short_id',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_short_id',
|
|
||||||
group: 'reality',
|
|
||||||
condition: (p) => p.security === 'reality',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
trojan: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'transport',
|
|
||||||
type: 'select',
|
|
||||||
label: 'transport',
|
|
||||||
options: TRANSPORTS.trojan,
|
|
||||||
defaultValue: 'tcp',
|
|
||||||
group: 'transport',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'security',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security',
|
|
||||||
options: SECURITY.trojan,
|
|
||||||
defaultValue: 'tls',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'host',
|
|
||||||
type: 'input',
|
|
||||||
label: 'host',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'path',
|
|
||||||
type: 'input',
|
|
||||||
label: 'path',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'service_name',
|
|
||||||
type: 'input',
|
|
||||||
label: 'service_name',
|
|
||||||
group: 'transport',
|
|
||||||
condition: (p) => p.transport === 'grpc',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'sni',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_sni',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allow_insecure',
|
|
||||||
type: 'switch',
|
|
||||||
label: 'security_allow_insecure',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
hysteria2: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'hop_ports',
|
|
||||||
type: 'input',
|
|
||||||
label: 'hop_ports',
|
|
||||||
placeholder: (t) => t('hop_ports_placeholder'),
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'hop_interval',
|
|
||||||
type: 'number',
|
|
||||||
label: 'hop_interval',
|
|
||||||
placeholder: 'e.g. 300',
|
|
||||||
min: 0,
|
|
||||||
suffix: 'S',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'obfs_password',
|
|
||||||
type: 'input',
|
|
||||||
label: 'obfs_password',
|
|
||||||
placeholder: (t) => t('obfs_password_placeholder'),
|
|
||||||
password: 16,
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'up_mbps',
|
|
||||||
type: 'number',
|
|
||||||
label: 'up_mbps',
|
|
||||||
min: 0,
|
|
||||||
placeholder: (t) => t('bandwidth_placeholder'),
|
|
||||||
suffix: 'Mbps',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'down_mbps',
|
|
||||||
type: 'number',
|
|
||||||
label: 'down_mbps',
|
|
||||||
min: 0,
|
|
||||||
placeholder: (t) => t('bandwidth_placeholder'),
|
|
||||||
suffix: 'Mbps',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{ name: 'sni', type: 'input', label: 'security_sni', group: 'security' },
|
|
||||||
{ name: 'allow_insecure', type: 'switch', label: 'security_allow_insecure', group: 'security' },
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
tuic: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'udp_relay_mode',
|
|
||||||
type: 'select',
|
|
||||||
label: 'udp_relay_mode',
|
|
||||||
options: TUIC_UDP_RELAY_MODES,
|
|
||||||
defaultValue: 'native',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'congestion_controller',
|
|
||||||
type: 'select',
|
|
||||||
label: 'congestion_controller',
|
|
||||||
options: TUIC_CONGESTION,
|
|
||||||
defaultValue: 'bbr',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{ name: 'disable_sni', type: 'switch', label: 'disable_sni', group: 'basic' },
|
|
||||||
{ name: 'reduce_rtt', type: 'switch', label: 'reduce_rtt', group: 'basic' },
|
|
||||||
{ name: 'sni', type: 'input', label: 'security_sni', group: 'security' },
|
|
||||||
{ name: 'allow_insecure', type: 'switch', label: 'security_allow_insecure', group: 'security' },
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
socks: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
naive: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'security',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security',
|
|
||||||
options: SECURITY.naive,
|
|
||||||
defaultValue: 'none',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'sni',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_sni',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allow_insecure',
|
|
||||||
type: 'switch',
|
|
||||||
label: 'security_allow_insecure',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
http: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'security',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security',
|
|
||||||
options: SECURITY.http,
|
|
||||||
defaultValue: 'none',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'sni',
|
|
||||||
type: 'input',
|
|
||||||
label: 'security_sni',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allow_insecure',
|
|
||||||
type: 'switch',
|
|
||||||
label: 'security_allow_insecure',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
condition: (p) => p.security !== 'none',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
meru: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'multiplex',
|
|
||||||
type: 'select',
|
|
||||||
label: 'multiplex',
|
|
||||||
options: multiplexLevels,
|
|
||||||
defaultValue: 'off',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'transport',
|
|
||||||
type: 'select',
|
|
||||||
label: 'transport',
|
|
||||||
options: TRANSPORTS.meru,
|
|
||||||
defaultValue: 'tcp',
|
|
||||||
group: 'transport',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
anytls: [
|
|
||||||
{
|
|
||||||
name: 'port',
|
|
||||||
type: 'number',
|
|
||||||
label: 'port',
|
|
||||||
min: 0,
|
|
||||||
max: 65535,
|
|
||||||
placeholder: '1-65535',
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'padding_scheme',
|
|
||||||
type: 'textarea',
|
|
||||||
label: 'padding_scheme',
|
|
||||||
placeholder: (t: (key: string) => string) => t('padding_scheme_placeholder'),
|
|
||||||
group: 'basic',
|
|
||||||
},
|
|
||||||
{ name: 'sni', type: 'input', label: 'security_sni', group: 'security' },
|
|
||||||
{ name: 'allow_insecure', type: 'switch', label: 'security_allow_insecure', group: 'security' },
|
|
||||||
{
|
|
||||||
name: 'fingerprint',
|
|
||||||
type: 'select',
|
|
||||||
label: 'security_fingerprint',
|
|
||||||
options: FINGERPRINTS,
|
|
||||||
defaultValue: 'chrome',
|
|
||||||
group: 'security',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
102
apps/admin/app/dashboard/servers/form-schema/constants.ts
Normal file
102
apps/admin/app/dashboard/servers/form-schema/constants.ts
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
export const protocols = [
|
||||||
|
'shadowsocks',
|
||||||
|
'vmess',
|
||||||
|
'vless',
|
||||||
|
'trojan',
|
||||||
|
'hysteria',
|
||||||
|
'tuic',
|
||||||
|
'anytls',
|
||||||
|
'socks',
|
||||||
|
'naive',
|
||||||
|
'http',
|
||||||
|
'mieru',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
// Global label map for display; fallback to raw value if missing
|
||||||
|
export const LABELS = {
|
||||||
|
// transport
|
||||||
|
'tcp': 'TCP',
|
||||||
|
'udp': 'UDP',
|
||||||
|
'websocket': 'WebSocket',
|
||||||
|
'grpc': 'gRPC',
|
||||||
|
'mkcp': 'mKCP',
|
||||||
|
'httpupgrade': 'HTTP Upgrade',
|
||||||
|
'xhttp': 'XHTTP',
|
||||||
|
// security
|
||||||
|
'none': 'NONE',
|
||||||
|
'tls': 'TLS',
|
||||||
|
'reality': 'Reality',
|
||||||
|
// fingerprint
|
||||||
|
'chrome': 'Chrome',
|
||||||
|
'firefox': 'Firefox',
|
||||||
|
'safari': 'Safari',
|
||||||
|
'ios': 'IOS',
|
||||||
|
'android': 'Android',
|
||||||
|
'edge': 'edge',
|
||||||
|
'360': '360',
|
||||||
|
'qq': 'QQ',
|
||||||
|
// multiplex
|
||||||
|
'low': 'Low',
|
||||||
|
'middle': 'Middle',
|
||||||
|
'high': 'High',
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
// Flat arrays for enum-like sets
|
||||||
|
export const SS_CIPHERS = [
|
||||||
|
'aes-128-gcm',
|
||||||
|
'aes-192-gcm',
|
||||||
|
'aes-256-gcm',
|
||||||
|
'chacha20-ietf-poly1305',
|
||||||
|
'2022-blake3-aes-128-gcm',
|
||||||
|
'2022-blake3-aes-256-gcm',
|
||||||
|
'2022-blake3-chacha20-poly1305',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export const TRANSPORTS = {
|
||||||
|
vmess: ['tcp', 'websocket', 'grpc'] as const,
|
||||||
|
vless: ['tcp', 'websocket', 'grpc', 'mkcp', 'httpupgrade', 'xhttp'] as const,
|
||||||
|
trojan: ['tcp', 'websocket', 'grpc'] as const,
|
||||||
|
mieru: ['tcp', 'udp'] as const,
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export const SECURITY = {
|
||||||
|
shadowsocks: ['none', 'http', 'tls'] as const,
|
||||||
|
vmess: ['none', 'tls'] as const,
|
||||||
|
vless: ['none', 'tls', 'reality'] as const,
|
||||||
|
trojan: ['tls'] as const,
|
||||||
|
hysteria: ['tls'] as const,
|
||||||
|
tuic: ['tls'] as const,
|
||||||
|
anytls: ['tls'] as const,
|
||||||
|
naive: ['none', 'tls'] as const,
|
||||||
|
http: ['none', 'tls'] as const,
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export const FLOWS = {
|
||||||
|
vless: ['none', 'xtls-rprx-direct', 'xtls-rprx-splice', 'xtls-rprx-vision'] as const,
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export const TUIC_UDP_RELAY_MODES = ['native', 'quic'] as const;
|
||||||
|
export const TUIC_CONGESTION = ['bbr', 'cubic', 'new_reno'] as const;
|
||||||
|
export const XHTTP_MODES = ['auto', 'packet-up', 'stream-up', 'stream-one'] as const;
|
||||||
|
export const ENCRYPTION_TYPES = ['none', 'mlkem768x25519plus'] as const;
|
||||||
|
export const ENCRYPTION_MODES = ['native', 'xorpub', 'random'] as const;
|
||||||
|
export const ENCRYPTION_RTT = ['0rtt', '1rtt'] as const;
|
||||||
|
export const FINGERPRINTS = [
|
||||||
|
'chrome',
|
||||||
|
'firefox',
|
||||||
|
'safari',
|
||||||
|
'ios',
|
||||||
|
'android',
|
||||||
|
'edge',
|
||||||
|
'360',
|
||||||
|
'qq',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export const CERT_MODES = ['none', 'http', 'dns', 'self'] as const;
|
||||||
|
|
||||||
|
export const multiplexLevels = ['none', 'low', 'middle', 'high'] as const;
|
||||||
|
|
||||||
|
export function getLabel(value: string): string {
|
||||||
|
const label = (LABELS as Record<string, string>)[value];
|
||||||
|
return label ?? value.toUpperCase();
|
||||||
|
}
|
||||||
192
apps/admin/app/dashboard/servers/form-schema/defaults.ts
Normal file
192
apps/admin/app/dashboard/servers/form-schema/defaults.ts
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
import { XHTTP_MODES } from './constants';
|
||||||
|
import type { ProtocolType } from './types';
|
||||||
|
|
||||||
|
export function getProtocolDefaultConfig(proto: ProtocolType) {
|
||||||
|
switch (proto) {
|
||||||
|
case 'shadowsocks':
|
||||||
|
return {
|
||||||
|
type: 'shadowsocks',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
cipher: 'chacha20-ietf-poly1305',
|
||||||
|
server_key: null,
|
||||||
|
obfs: 'none',
|
||||||
|
obfs_host: null,
|
||||||
|
obfs_path: null,
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'vmess':
|
||||||
|
return {
|
||||||
|
type: 'vmess',
|
||||||
|
enable: false,
|
||||||
|
host: null,
|
||||||
|
port: null,
|
||||||
|
transport: 'tcp',
|
||||||
|
security: 'none',
|
||||||
|
path: null,
|
||||||
|
service_name: null,
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'vless':
|
||||||
|
return {
|
||||||
|
type: 'vless',
|
||||||
|
enable: false,
|
||||||
|
host: null,
|
||||||
|
port: null,
|
||||||
|
transport: 'tcp',
|
||||||
|
security: 'none',
|
||||||
|
flow: 'none',
|
||||||
|
path: null,
|
||||||
|
service_name: null,
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
reality_server_addr: null,
|
||||||
|
reality_server_port: null,
|
||||||
|
reality_private_key: null,
|
||||||
|
reality_public_key: null,
|
||||||
|
reality_short_id: null,
|
||||||
|
xhttp_mode: XHTTP_MODES[0], // 'auto'
|
||||||
|
xhttp_extra: null,
|
||||||
|
encryption: 'none',
|
||||||
|
encryption_mode: null,
|
||||||
|
encryption_rtt: null,
|
||||||
|
encryption_ticket: null,
|
||||||
|
encryption_server_padding: null,
|
||||||
|
encryption_private_key: null,
|
||||||
|
encryption_client_padding: null,
|
||||||
|
encryption_password: null,
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'trojan':
|
||||||
|
return {
|
||||||
|
type: 'trojan',
|
||||||
|
enable: false,
|
||||||
|
host: null,
|
||||||
|
port: null,
|
||||||
|
transport: 'tcp',
|
||||||
|
security: 'tls',
|
||||||
|
path: null,
|
||||||
|
service_name: null,
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'hysteria':
|
||||||
|
return {
|
||||||
|
type: 'hysteria',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
hop_ports: null,
|
||||||
|
hop_interval: null,
|
||||||
|
obfs: 'none',
|
||||||
|
obfs_password: null,
|
||||||
|
security: 'tls',
|
||||||
|
up_mbps: null,
|
||||||
|
down_mbps: null,
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'tuic':
|
||||||
|
return {
|
||||||
|
type: 'tuic',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
disable_sni: false,
|
||||||
|
reduce_rtt: false,
|
||||||
|
udp_relay_mode: 'native',
|
||||||
|
congestion_controller: 'bbr',
|
||||||
|
security: 'tls',
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: false,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'socks':
|
||||||
|
return {
|
||||||
|
type: 'socks',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'naive':
|
||||||
|
return {
|
||||||
|
type: 'naive',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
security: 'none',
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'http':
|
||||||
|
return {
|
||||||
|
type: 'http',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
security: 'none',
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: null,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
case 'mieru':
|
||||||
|
return {
|
||||||
|
type: 'mieru',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
multiplex: 'none',
|
||||||
|
transport: 'tcp',
|
||||||
|
} as any;
|
||||||
|
case 'anytls':
|
||||||
|
return {
|
||||||
|
type: 'anytls',
|
||||||
|
enable: false,
|
||||||
|
port: null,
|
||||||
|
security: 'tls',
|
||||||
|
padding_scheme: null,
|
||||||
|
sni: null,
|
||||||
|
allow_insecure: false,
|
||||||
|
fingerprint: 'chrome',
|
||||||
|
cert_mode: 'none',
|
||||||
|
cert_dns_provider: null,
|
||||||
|
cert_dns_env: null,
|
||||||
|
ratio: 1,
|
||||||
|
} as any;
|
||||||
|
default:
|
||||||
|
return {} as any;
|
||||||
|
}
|
||||||
|
}
|
||||||
1068
apps/admin/app/dashboard/servers/form-schema/fields.ts
Normal file
1068
apps/admin/app/dashboard/servers/form-schema/fields.ts
Normal file
File diff suppressed because it is too large
Load Diff
30
apps/admin/app/dashboard/servers/form-schema/index.ts
Normal file
30
apps/admin/app/dashboard/servers/form-schema/index.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Re-export all constants
|
||||||
|
export {
|
||||||
|
ENCRYPTION_MODES,
|
||||||
|
ENCRYPTION_RTT,
|
||||||
|
ENCRYPTION_TYPES,
|
||||||
|
FINGERPRINTS,
|
||||||
|
FLOWS,
|
||||||
|
LABELS,
|
||||||
|
SECURITY,
|
||||||
|
SS_CIPHERS,
|
||||||
|
TRANSPORTS,
|
||||||
|
TUIC_CONGESTION,
|
||||||
|
TUIC_UDP_RELAY_MODES,
|
||||||
|
XHTTP_MODES,
|
||||||
|
getLabel,
|
||||||
|
multiplexLevels,
|
||||||
|
protocols,
|
||||||
|
} from './constants';
|
||||||
|
|
||||||
|
// Re-export all types
|
||||||
|
export type { FieldConfig, ProtocolType } from './types';
|
||||||
|
|
||||||
|
// Re-export all schemas
|
||||||
|
export { formSchema, protocolApiScheme } from './schemas';
|
||||||
|
|
||||||
|
// Re-export defaults
|
||||||
|
export { getProtocolDefaultConfig } from './defaults';
|
||||||
|
|
||||||
|
// Re-export fields
|
||||||
|
export { PROTOCOL_FIELDS } from './fields';
|
||||||
225
apps/admin/app/dashboard/servers/form-schema/schemas.ts
Normal file
225
apps/admin/app/dashboard/servers/form-schema/schemas.ts
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
import { z } from 'zod';
|
||||||
|
import {
|
||||||
|
CERT_MODES,
|
||||||
|
ENCRYPTION_MODES,
|
||||||
|
ENCRYPTION_RTT,
|
||||||
|
ENCRYPTION_TYPES,
|
||||||
|
FLOWS,
|
||||||
|
multiplexLevels,
|
||||||
|
SECURITY,
|
||||||
|
SS_CIPHERS,
|
||||||
|
TRANSPORTS,
|
||||||
|
TUIC_CONGESTION,
|
||||||
|
TUIC_UDP_RELAY_MODES,
|
||||||
|
XHTTP_MODES,
|
||||||
|
} from './constants';
|
||||||
|
|
||||||
|
const nullableString = z.string().nullish();
|
||||||
|
const nullableBool = z.boolean().nullish();
|
||||||
|
const nullablePort = z.number().int().min(0).max(65535).nullish();
|
||||||
|
const nullableRatio = z.number().min(0).nullish();
|
||||||
|
|
||||||
|
const ss = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('shadowsocks'),
|
||||||
|
enable: nullableBool,
|
||||||
|
port: nullablePort,
|
||||||
|
cipher: z.enum(SS_CIPHERS).nullish(),
|
||||||
|
server_key: nullableString,
|
||||||
|
obfs: z.enum(['none', 'http', 'tls'] as const).nullish(),
|
||||||
|
obfs_host: nullableString,
|
||||||
|
obfs_path: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const vmess = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('vmess'),
|
||||||
|
enable: nullableBool,
|
||||||
|
host: nullableString,
|
||||||
|
port: nullablePort,
|
||||||
|
transport: z.enum(TRANSPORTS.vmess).nullish(),
|
||||||
|
security: z.enum(SECURITY.vmess).nullish(),
|
||||||
|
path: nullableString,
|
||||||
|
service_name: nullableString,
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const vless = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('vless'),
|
||||||
|
enable: nullableBool,
|
||||||
|
host: nullableString,
|
||||||
|
port: nullablePort,
|
||||||
|
transport: z.enum(TRANSPORTS.vless).nullish(),
|
||||||
|
security: z.enum(SECURITY.vless).nullish(),
|
||||||
|
path: nullableString,
|
||||||
|
service_name: nullableString,
|
||||||
|
flow: z.enum(FLOWS.vless).nullish(),
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
reality_server_addr: nullableString,
|
||||||
|
reality_server_port: nullablePort,
|
||||||
|
reality_private_key: nullableString,
|
||||||
|
reality_public_key: nullableString,
|
||||||
|
reality_short_id: nullableString,
|
||||||
|
xhttp_mode: z.enum(XHTTP_MODES).nullish(),
|
||||||
|
xhttp_extra: nullableString,
|
||||||
|
encryption: z.enum(ENCRYPTION_TYPES).nullish(),
|
||||||
|
encryption_mode: z.enum(ENCRYPTION_MODES).nullish(),
|
||||||
|
encryption_rtt: z.enum(ENCRYPTION_RTT).nullish(),
|
||||||
|
encryption_ticket: nullableString,
|
||||||
|
encryption_server_padding: nullableString,
|
||||||
|
encryption_private_key: nullableString,
|
||||||
|
encryption_client_padding: nullableString,
|
||||||
|
encryption_password: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const trojan = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('trojan'),
|
||||||
|
enable: nullableBool,
|
||||||
|
host: nullableString,
|
||||||
|
port: nullablePort,
|
||||||
|
transport: z.enum(TRANSPORTS.trojan).nullish(),
|
||||||
|
security: z.enum(SECURITY.trojan).nullish(),
|
||||||
|
path: nullableString,
|
||||||
|
service_name: nullableString,
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const hysteria = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('hysteria'),
|
||||||
|
enable: nullableBool,
|
||||||
|
hop_ports: nullableString,
|
||||||
|
hop_interval: z.number().nullish(),
|
||||||
|
obfs_password: nullableString,
|
||||||
|
obfs: z.enum(['none', 'salamander'] as const).nullish(),
|
||||||
|
port: nullablePort,
|
||||||
|
security: z.enum(SECURITY.hysteria).nullish(),
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
up_mbps: z.number().nullish(),
|
||||||
|
down_mbps: z.number().nullish(),
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const tuic = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('tuic'),
|
||||||
|
enable: nullableBool,
|
||||||
|
host: nullableString,
|
||||||
|
port: nullablePort,
|
||||||
|
disable_sni: z.boolean().nullish(),
|
||||||
|
reduce_rtt: z.boolean().nullish(),
|
||||||
|
udp_relay_mode: z.enum(TUIC_UDP_RELAY_MODES).nullish(),
|
||||||
|
congestion_controller: z.enum(TUIC_CONGESTION).nullish(),
|
||||||
|
security: z.enum(SECURITY.tuic).nullish(),
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const anytls = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('anytls'),
|
||||||
|
enable: nullableBool,
|
||||||
|
port: nullablePort,
|
||||||
|
security: z.enum(SECURITY.anytls).nullish(),
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
padding_scheme: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const socks = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('socks'),
|
||||||
|
enable: nullableBool,
|
||||||
|
port: nullablePort,
|
||||||
|
});
|
||||||
|
|
||||||
|
const naive = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('naive'),
|
||||||
|
enable: nullableBool,
|
||||||
|
port: nullablePort,
|
||||||
|
security: z.enum(SECURITY.naive).nullish(),
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const http = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('http'),
|
||||||
|
enable: nullableBool,
|
||||||
|
port: nullablePort,
|
||||||
|
security: z.enum(SECURITY.http).nullish(),
|
||||||
|
sni: nullableString,
|
||||||
|
allow_insecure: nullableBool,
|
||||||
|
fingerprint: nullableString,
|
||||||
|
cert_mode: z.enum(CERT_MODES).nullish(),
|
||||||
|
cert_dns_provider: nullableString,
|
||||||
|
cert_dns_env: nullableString,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mieru = z.object({
|
||||||
|
ratio: nullableRatio,
|
||||||
|
type: z.literal('mieru'),
|
||||||
|
enable: nullableBool,
|
||||||
|
port: nullablePort,
|
||||||
|
multiplex: z.enum(multiplexLevels).nullish(),
|
||||||
|
transport: z.enum(TRANSPORTS.mieru).nullish(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const protocolApiScheme = z.discriminatedUnion('type', [
|
||||||
|
ss,
|
||||||
|
vmess,
|
||||||
|
vless,
|
||||||
|
trojan,
|
||||||
|
hysteria,
|
||||||
|
tuic,
|
||||||
|
anytls,
|
||||||
|
socks,
|
||||||
|
naive,
|
||||||
|
http,
|
||||||
|
mieru,
|
||||||
|
]);
|
||||||
|
|
||||||
|
export const formSchema = z.object({
|
||||||
|
name: z.string().min(1),
|
||||||
|
address: z.string().min(1),
|
||||||
|
country: z.string().optional(),
|
||||||
|
city: z.string().optional(),
|
||||||
|
protocols: z.array(protocolApiScheme),
|
||||||
|
});
|
||||||
27
apps/admin/app/dashboard/servers/form-schema/types.ts
Normal file
27
apps/admin/app/dashboard/servers/form-schema/types.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { protocols } from './constants';
|
||||||
|
|
||||||
|
export type FieldConfig = {
|
||||||
|
name: string;
|
||||||
|
type: 'input' | 'select' | 'switch' | 'number' | 'textarea';
|
||||||
|
label: string;
|
||||||
|
placeholder?: string | ((t: (key: string) => string, protocol: any) => string);
|
||||||
|
options?: readonly string[];
|
||||||
|
defaultValue?: any;
|
||||||
|
min?: number;
|
||||||
|
max?: number;
|
||||||
|
step?: number;
|
||||||
|
suffix?: string;
|
||||||
|
generate?: {
|
||||||
|
function?: () => Promise<string | Record<string, string>> | string | Record<string, string>;
|
||||||
|
functions?: {
|
||||||
|
label: string | ((t: (key: string) => string, protocol: any) => string);
|
||||||
|
function: () => Promise<string | Record<string, string>> | string | Record<string, string>;
|
||||||
|
}[];
|
||||||
|
updateFields?: Record<string, string>;
|
||||||
|
};
|
||||||
|
condition?: (protocol: any, values: any) => boolean;
|
||||||
|
group?: 'basic' | 'transport' | 'security' | 'reality' | 'obfs' | 'encryption';
|
||||||
|
gridSpan?: 1 | 2;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ProtocolType = (typeof protocols)[number];
|
||||||
4
apps/admin/app/dashboard/servers/generate/index.ts
Normal file
4
apps/admin/app/dashboard/servers/generate/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export { generateMLKEM768KeyPair } from './mlkem768';
|
||||||
|
export { generateRealityShortId } from './short-id';
|
||||||
|
export { generatePassword } from './uid';
|
||||||
|
export { generateRealityKeyPair } from './x25519';
|
||||||
16
apps/admin/app/dashboard/servers/generate/mlkem768.ts
Normal file
16
apps/admin/app/dashboard/servers/generate/mlkem768.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import mlkem from 'mlkem-wasm';
|
||||||
|
import { toB64Url } from './util';
|
||||||
|
|
||||||
|
export async function generateMLKEM768KeyPair() {
|
||||||
|
const mlkemKeyPair = await mlkem.generateKey({ name: 'ML-KEM-768' }, true, [
|
||||||
|
'encapsulateBits',
|
||||||
|
'decapsulateBits',
|
||||||
|
]);
|
||||||
|
const mlkemPublicKeyRaw = await mlkem.exportKey('raw-public', mlkemKeyPair.publicKey);
|
||||||
|
const mlkemPrivateKeyRaw = await mlkem.exportKey('raw-seed', mlkemKeyPair.privateKey);
|
||||||
|
|
||||||
|
return {
|
||||||
|
publicKey: toB64Url(new Uint8Array(mlkemPublicKeyRaw)),
|
||||||
|
privateKey: toB64Url(new Uint8Array(mlkemPrivateKeyRaw)),
|
||||||
|
};
|
||||||
|
}
|
||||||
15
apps/admin/app/dashboard/servers/generate/short-id.ts
Normal file
15
apps/admin/app/dashboard/servers/generate/short-id.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Generate a short ID for Reality
|
||||||
|
* @returns A random hexadecimal string of length 2, 4, 6, 8, 10, 12, 14, or 16
|
||||||
|
*/
|
||||||
|
export function generateRealityShortId() {
|
||||||
|
const hex = '0123456789abcdef';
|
||||||
|
const lengths = [2, 4, 6, 8, 10, 12, 14, 16];
|
||||||
|
const idx = Math.floor(Math.random() * lengths.length);
|
||||||
|
const len = lengths[idx] ?? 16;
|
||||||
|
let out = '';
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
out += hex.charAt(Math.floor(Math.random() * hex.length));
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
11
apps/admin/app/dashboard/servers/generate/uid.ts
Normal file
11
apps/admin/app/dashboard/servers/generate/uid.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { uid } from 'radash';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a random password
|
||||||
|
* @param length Length of the password
|
||||||
|
* @param charset Character set to use (defaults to alphanumeric)
|
||||||
|
* @returns Randomly generated password
|
||||||
|
*/
|
||||||
|
export function generatePassword(length = 16, charset?: string) {
|
||||||
|
return uid(length, charset).toLowerCase();
|
||||||
|
}
|
||||||
6
apps/admin/app/dashboard/servers/generate/util.ts
Normal file
6
apps/admin/app/dashboard/servers/generate/util.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export function toB64Url(bytes: Uint8Array) {
|
||||||
|
return btoa(String.fromCharCode(...bytes))
|
||||||
|
.replace(/\+/g, '-')
|
||||||
|
.replace(/\//g, '_')
|
||||||
|
.replace(/=+$/g, '');
|
||||||
|
}
|
||||||
11
apps/admin/app/dashboard/servers/generate/x25519.ts
Normal file
11
apps/admin/app/dashboard/servers/generate/x25519.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { x25519 } from '@noble/curves/ed25519.js';
|
||||||
|
import { toB64Url } from './util';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a Reality key pair
|
||||||
|
* @returns An object containing the private and public keys in base64url format
|
||||||
|
*/
|
||||||
|
export function generateRealityKeyPair() {
|
||||||
|
const { secretKey, publicKey } = x25519.keygen();
|
||||||
|
return { privateKey: toB64Url(secretKey), publicKey: toB64Url(publicKey) };
|
||||||
|
}
|
||||||
@ -15,6 +15,7 @@ import {
|
|||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
} from '@workspace/ui/components/sheet';
|
} from '@workspace/ui/components/sheet';
|
||||||
import { formatBytes } from '@workspace/ui/utils';
|
import { formatBytes } from '@workspace/ui/utils';
|
||||||
|
import { Users } from 'lucide-react';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
@ -92,8 +93,7 @@ export default function OnlineUsersCell({ status }: { status?: API.ServerStatus
|
|||||||
<Sheet open={open} onOpenChange={setOpen}>
|
<Sheet open={open} onOpenChange={setOpen}>
|
||||||
<SheetTrigger asChild>
|
<SheetTrigger asChild>
|
||||||
<button className='hover:text-foreground text-muted-foreground flex items-center gap-2 bg-transparent p-0 text-sm'>
|
<button className='hover:text-foreground text-muted-foreground flex items-center gap-2 bg-transparent p-0 text-sm'>
|
||||||
<Badge variant='secondary'>{status?.online.length}</Badge>
|
<Users className='h-4 w-4' /> {status?.online.length}
|
||||||
<span>{t('onlineUsers')}</span>
|
|
||||||
</button>
|
</button>
|
||||||
</SheetTrigger>
|
</SheetTrigger>
|
||||||
<SheetContent className='h-screen w-screen max-w-none sm:h-auto sm:w-[900px] sm:max-w-[90vw]'>
|
<SheetContent className='h-screen w-screen max-w-none sm:h-auto sm:w-[900px] sm:max-w-[90vw]'>
|
||||||
|
|||||||
@ -1,39 +1,27 @@
|
|||||||
'use client';
|
'use client';
|
||||||
// Online users detail moved to separate component
|
|
||||||
import { ProTable, ProTableActions } from '@/components/pro-table';
|
import { ProTable, ProTableActions } from '@/components/pro-table';
|
||||||
import {
|
import {
|
||||||
createServer,
|
createServer,
|
||||||
deleteServer,
|
deleteServer,
|
||||||
filterServerList,
|
filterServerList,
|
||||||
hasMigrateSeverNode,
|
|
||||||
migrateServerNode,
|
|
||||||
resetSortWithServer,
|
resetSortWithServer,
|
||||||
updateServer,
|
updateServer,
|
||||||
} from '@/services/admin/server';
|
} from '@/services/admin/server';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useNode } from '@/store/node';
|
||||||
|
import { useServer } from '@/store/server';
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { Card, CardContent } from '@workspace/ui/components/card';
|
|
||||||
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
||||||
import { cn } from '@workspace/ui/lib/utils';
|
import { cn } from '@workspace/ui/lib/utils';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
import DynamicMultiplier from './dynamic-multiplier';
|
||||||
import OnlineUsersCell from './online-users-cell';
|
import OnlineUsersCell from './online-users-cell';
|
||||||
import ServerConfig from './server-config';
|
import ServerConfig from './server-config';
|
||||||
import ServerForm from './server-form';
|
import ServerForm from './server-form';
|
||||||
|
import ServerInstall from './server-install';
|
||||||
type ProtocolName = 'shadowsocks' | 'vmess' | 'vless' | 'trojan' | 'hysteria2' | 'tuic' | 'anytls';
|
|
||||||
|
|
||||||
const PROTOCOL_COLORS: Record<ProtocolName, string> = {
|
|
||||||
shadowsocks: 'bg-green-500',
|
|
||||||
vmess: 'bg-rose-500',
|
|
||||||
vless: 'bg-blue-500',
|
|
||||||
trojan: 'bg-yellow-500',
|
|
||||||
hysteria2: 'bg-purple-500',
|
|
||||||
tuic: 'bg-cyan-500',
|
|
||||||
anytls: 'bg-gray-500',
|
|
||||||
};
|
|
||||||
|
|
||||||
function PctBar({ value }: { value: number }) {
|
function PctBar({ value }: { value: number }) {
|
||||||
const v = value.toFixed(2);
|
const v = value.toFixed(2);
|
||||||
@ -62,63 +50,31 @@ function RegionIpCell({
|
|||||||
return (
|
return (
|
||||||
<div className='flex items-center gap-1'>
|
<div className='flex items-center gap-1'>
|
||||||
<Badge variant='outline'>{region}</Badge>
|
<Badge variant='outline'>{region}</Badge>
|
||||||
<Badge variant='outline'>{ip || t('notAvailable')}</Badge>
|
<Badge variant='secondary'>{ip || t('notAvailable')}</Badge>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ServersPage() {
|
export default function ServersPage() {
|
||||||
const t = useTranslations('servers');
|
const t = useTranslations('servers');
|
||||||
|
const { isServerReferencedByNodes } = useNode();
|
||||||
|
const { fetchServers } = useServer();
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [migrating, setMigrating] = useState(false);
|
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
|
|
||||||
const { data: hasMigrate, refetch: refetchHasMigrate } = useQuery({
|
|
||||||
queryKey: ['hasMigrateSeverNode'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await hasMigrateSeverNode();
|
|
||||||
return data.data?.has_migrate;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleMigrate = async () => {
|
|
||||||
setMigrating(true);
|
|
||||||
try {
|
|
||||||
const { data } = await migrateServerNode();
|
|
||||||
const fail = data.data?.fail || 0;
|
|
||||||
if (fail > 0) {
|
|
||||||
toast.error(data.data?.message);
|
|
||||||
} else {
|
|
||||||
toast.success(t('migrated'));
|
|
||||||
}
|
|
||||||
refetchHasMigrate();
|
|
||||||
ref.current?.refresh();
|
|
||||||
} catch (error) {
|
|
||||||
toast.error(t('migrateFailed'));
|
|
||||||
} finally {
|
|
||||||
setMigrating(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='space-y-4'>
|
<div className='space-y-4'>
|
||||||
<Card>
|
<div className='grid grid-cols-1 gap-4 md:grid-cols-2'>
|
||||||
<CardContent className='p-4'>
|
<DynamicMultiplier />
|
||||||
<ServerConfig />
|
<ServerConfig />
|
||||||
</CardContent>
|
</div>
|
||||||
</Card>
|
|
||||||
<ProTable<API.Server, { search: string }>
|
<ProTable<API.Server, { search: string }>
|
||||||
action={ref}
|
action={ref}
|
||||||
header={{
|
header={{
|
||||||
title: t('pageTitle'),
|
title: t('pageTitle'),
|
||||||
toolbar: (
|
toolbar: (
|
||||||
<div className='flex gap-2'>
|
<div className='flex gap-2'>
|
||||||
{hasMigrate && (
|
|
||||||
<Button variant='outline' onClick={handleMigrate} disabled={migrating}>
|
|
||||||
{migrating ? t('migrating') : t('migrate')}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<ServerForm
|
<ServerForm
|
||||||
trigger={t('create')}
|
trigger={t('create')}
|
||||||
title={t('drawerCreateTitle')}
|
title={t('drawerCreateTitle')}
|
||||||
@ -129,6 +85,7 @@ export default function ServersPage() {
|
|||||||
await createServer(values as unknown as API.CreateServerRequest);
|
await createServer(values as unknown as API.CreateServerRequest);
|
||||||
toast.success(t('created'));
|
toast.success(t('created'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchServers();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -163,24 +120,18 @@ export default function ServersPage() {
|
|||||||
accessorKey: 'protocols',
|
accessorKey: 'protocols',
|
||||||
header: t('protocols'),
|
header: t('protocols'),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const list = (row.original.protocols || []) as API.Protocol[];
|
const list = row.original.protocols.filter((p) => p.enable) as API.Protocol[];
|
||||||
if (!list.length) return t('noData');
|
if (!list.length) return '—';
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-wrap gap-1'>
|
<div className='flex flex-col gap-1'>
|
||||||
{list.map((p, idx) => {
|
{list.map((p, idx) => {
|
||||||
const proto = ((p as any)?.type || '') as ProtocolName | '';
|
const ratio = Number(p.ratio ?? 1) || 1;
|
||||||
if (!proto) return null;
|
|
||||||
const color = PROTOCOL_COLORS[proto as ProtocolName];
|
|
||||||
const port = (p as any)?.port as number | undefined;
|
|
||||||
const label = `${proto}${port ? ` (${port})` : ''}`;
|
|
||||||
return (
|
return (
|
||||||
<Badge
|
<div key={idx} className='flex items-center gap-2'>
|
||||||
key={idx}
|
<Badge variant='outline'>{ratio.toFixed(2)}x</Badge>
|
||||||
variant='outline'
|
<Badge variant='secondary'>{p.type}</Badge>
|
||||||
className={cn('text-primary-foreground', color)}
|
<Badge variant='secondary'>{p.port}</Badge>
|
||||||
>
|
</div>
|
||||||
{label}
|
|
||||||
</Badge>
|
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
@ -233,15 +184,7 @@ export default function ServersPage() {
|
|||||||
header: t('onlineUsers'),
|
header: t('onlineUsers'),
|
||||||
cell: ({ row }) => <OnlineUsersCell status={row.original.status as API.ServerStatus} />,
|
cell: ({ row }) => <OnlineUsersCell status={row.original.status as API.ServerStatus} />,
|
||||||
},
|
},
|
||||||
{
|
// traffic ratio moved to per-protocol configs; column removed
|
||||||
id: 'traffic_ratio',
|
|
||||||
header: t('traffic_ratio'),
|
|
||||||
cell: ({ row }) => {
|
|
||||||
const raw = row.original.ratio as unknown;
|
|
||||||
const ratio = Number(raw ?? 1) || 1;
|
|
||||||
return <span className='text-sm'>{ratio.toFixed(2)}x</span>;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
]}
|
||||||
params={[{ key: 'search' }]}
|
params={[{ key: 'search' }]}
|
||||||
request={async (pagination, filter) => {
|
request={async (pagination, filter) => {
|
||||||
@ -260,7 +203,7 @@ export default function ServersPage() {
|
|||||||
key='edit'
|
key='edit'
|
||||||
trigger={t('edit')}
|
trigger={t('edit')}
|
||||||
title={t('drawerEditTitle')}
|
title={t('drawerEditTitle')}
|
||||||
initialValues={row as any}
|
initialValues={row}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@ -272,6 +215,7 @@ export default function ServersPage() {
|
|||||||
});
|
});
|
||||||
toast.success(t('updated'));
|
toast.success(t('updated'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchServers();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -280,15 +224,21 @@ export default function ServersPage() {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>,
|
/>,
|
||||||
|
<ServerInstall key='install' server={row} />,
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
key='delete'
|
key='delete'
|
||||||
trigger={<Button variant='destructive'>{t('delete')}</Button>}
|
trigger={
|
||||||
|
<Button variant='destructive' disabled={isServerReferencedByNodes(row.id)}>
|
||||||
|
{t('delete')}
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
title={t('confirmDeleteTitle')}
|
title={t('confirmDeleteTitle')}
|
||||||
description={t('confirmDeleteDesc')}
|
description={t('confirmDeleteDesc')}
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
await deleteServer({ id: row.id } as any);
|
await deleteServer({ id: row.id } as any);
|
||||||
toast.success(t('deleted'));
|
toast.success(t('deleted'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchServers();
|
||||||
}}
|
}}
|
||||||
cancelText={t('cancel')}
|
cancelText={t('cancel')}
|
||||||
confirmText={t('confirm')}
|
confirmText={t('confirm')}
|
||||||
@ -304,13 +254,13 @@ export default function ServersPage() {
|
|||||||
name: others.name,
|
name: others.name,
|
||||||
country: others.country,
|
country: others.country,
|
||||||
city: others.city,
|
city: others.city,
|
||||||
ratio: others.ratio,
|
|
||||||
address: others.address,
|
address: others.address,
|
||||||
protocols: others.protocols || [],
|
protocols: others.protocols || [],
|
||||||
};
|
};
|
||||||
await createServer(body);
|
await createServer(body);
|
||||||
toast.success(t('copied'));
|
toast.success(t('copied'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchServers();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -318,16 +268,22 @@ export default function ServersPage() {
|
|||||||
</Button>,
|
</Button>,
|
||||||
],
|
],
|
||||||
batchRender(rows) {
|
batchRender(rows) {
|
||||||
|
const hasReferencedServers = rows.some((row) => isServerReferencedByNodes(row.id));
|
||||||
return [
|
return [
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
key='delete'
|
key='delete'
|
||||||
trigger={<Button variant='destructive'>{t('delete')}</Button>}
|
trigger={
|
||||||
|
<Button variant='destructive' disabled={hasReferencedServers}>
|
||||||
|
{t('delete')}
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
title={t('confirmDeleteTitle')}
|
title={t('confirmDeleteTitle')}
|
||||||
description={t('confirmDeleteDesc')}
|
description={t('confirmDeleteDesc')}
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
await Promise.all(rows.map((r) => deleteServer({ id: r.id })));
|
await Promise.all(rows.map((r) => deleteServer({ id: r.id })));
|
||||||
toast.success(t('deleted'));
|
toast.success(t('deleted'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
|
fetchServers();
|
||||||
}}
|
}}
|
||||||
cancelText={t('cancel')}
|
cancelText={t('cancel')}
|
||||||
confirmText={t('confirm')}
|
confirmText={t('confirm')}
|
||||||
@ -361,6 +317,7 @@ export default function ServersPage() {
|
|||||||
sort: item.sort,
|
sort: item.sort,
|
||||||
})) as API.SortItem[],
|
})) as API.SortItem[],
|
||||||
});
|
});
|
||||||
|
toast.success(t('sorted_success'));
|
||||||
}
|
}
|
||||||
return updatedItems;
|
return updatedItems;
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,15 +1,10 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import {
|
import { getNodeConfig, updateNodeConfig } from '@/services/admin/system';
|
||||||
getNodeConfig,
|
|
||||||
getNodeMultiplier,
|
|
||||||
setNodeMultiplier,
|
|
||||||
updateNodeConfig,
|
|
||||||
} from '@/services/admin/system';
|
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { ChartContainer, ChartTooltip } from '@workspace/ui/components/chart';
|
import { Card, CardContent } from '@workspace/ui/components/card';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
@ -19,8 +14,14 @@ import {
|
|||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from '@workspace/ui/components/form';
|
} from '@workspace/ui/components/form';
|
||||||
import { Label } from '@workspace/ui/components/label';
|
|
||||||
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@workspace/ui/components/select';
|
||||||
import {
|
import {
|
||||||
Sheet,
|
Sheet,
|
||||||
SheetContent,
|
SheetContent,
|
||||||
@ -29,75 +30,46 @@ import {
|
|||||||
SheetTitle,
|
SheetTitle,
|
||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
} from '@workspace/ui/components/sheet';
|
} from '@workspace/ui/components/sheet';
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs';
|
||||||
|
import { Textarea } from '@workspace/ui/components/textarea';
|
||||||
import { ArrayInput } from '@workspace/ui/custom-components/dynamic-Inputs';
|
import { ArrayInput } from '@workspace/ui/custom-components/dynamic-Inputs';
|
||||||
import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
|
import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
|
||||||
import { Icon } from '@workspace/ui/custom-components/icon';
|
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||||
|
import { unitConversion } from '@workspace/ui/utils';
|
||||||
import { DicesIcon } from 'lucide-react';
|
import { DicesIcon } from 'lucide-react';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { uid } from 'radash';
|
import { uid } from 'radash';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { Cell, Legend, Pie, PieChart } from 'recharts';
|
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
import { SS_CIPHERS } from './form-schema';
|
||||||
|
|
||||||
const COLORS = [
|
const dnsConfigSchema = z.object({
|
||||||
'hsl(var(--chart-1))',
|
proto: z.string(), // z.enum(['tcp', 'udp', 'tls', 'https', 'quic']),
|
||||||
'hsl(var(--chart-2))',
|
address: z.string(),
|
||||||
'hsl(var(--chart-3))',
|
domains: z.array(z.string()),
|
||||||
'hsl(var(--chart-4))',
|
});
|
||||||
'hsl(var(--chart-5))',
|
|
||||||
];
|
|
||||||
|
|
||||||
const MINUTES_IN_DAY = 1440;
|
const outboundConfigSchema = z.object({
|
||||||
|
name: z.string(),
|
||||||
function getTimeRangeData(slots: API.TimePeriod[]) {
|
protocol: z.string(),
|
||||||
const timePoints = slots
|
address: z.string(),
|
||||||
.filter((slot) => slot.start_time && slot.end_time)
|
port: z.number(),
|
||||||
.flatMap((slot) => {
|
cipher: z.string().optional(),
|
||||||
const [startH = 0, startM = 0] = slot.start_time.split(':').map(Number);
|
password: z.string().optional(),
|
||||||
const [endH = 0, endM = 0] = slot.end_time.split(':').map(Number);
|
rules: z.array(z.string()).optional(),
|
||||||
const start = startH * 60 + startM;
|
});
|
||||||
let end = endH * 60 + endM;
|
|
||||||
if (end < start) end += MINUTES_IN_DAY;
|
|
||||||
return { start, end, multiplier: slot.multiplier };
|
|
||||||
})
|
|
||||||
.sort((a, b) => a.start - b.start);
|
|
||||||
|
|
||||||
const result: { name: string; value: number; multiplier: number }[] = [];
|
|
||||||
let currentMinute = 0;
|
|
||||||
|
|
||||||
timePoints.forEach((point) => {
|
|
||||||
if (point.start > currentMinute) {
|
|
||||||
result.push({
|
|
||||||
name: `${Math.floor(currentMinute / 60)}:${String(currentMinute % 60).padStart(2, '0')} - ${Math.floor(point.start / 60)}:${String(point.start % 60).padStart(2, '0')}`,
|
|
||||||
value: point.start - currentMinute,
|
|
||||||
multiplier: 1,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
result.push({
|
|
||||||
name: `${Math.floor(point.start / 60)}:${String(point.start % 60).padStart(2, '0')} - ${Math.floor((point.end / 60) % 24)}:${String(point.end % 60).padStart(2, '0')}`,
|
|
||||||
value: point.end - point.start,
|
|
||||||
multiplier: point.multiplier,
|
|
||||||
});
|
|
||||||
currentMinute = point.end % MINUTES_IN_DAY;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (currentMinute < MINUTES_IN_DAY) {
|
|
||||||
result.push({
|
|
||||||
name: `${Math.floor(currentMinute / 60)}:${String(currentMinute % 60).padStart(2, '0')} - 24:00`,
|
|
||||||
value: MINUTES_IN_DAY - currentMinute,
|
|
||||||
multiplier: 1,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nodeConfigSchema = z.object({
|
const nodeConfigSchema = z.object({
|
||||||
node_secret: z.string().optional(),
|
node_secret: z.string().optional(),
|
||||||
node_pull_interval: z.number().optional(),
|
node_pull_interval: z.number().optional(),
|
||||||
node_push_interval: z.number().optional(),
|
node_push_interval: z.number().optional(),
|
||||||
|
traffic_report_threshold: z.number().optional(),
|
||||||
|
ip_strategy: z.enum(['prefer_ipv4', 'prefer_ipv6']).optional(),
|
||||||
|
dns: z.array(dnsConfigSchema).optional(),
|
||||||
|
block: z.array(z.string()).optional(),
|
||||||
|
outbound: z.array(outboundConfigSchema).optional(),
|
||||||
});
|
});
|
||||||
type NodeConfigFormData = z.infer<typeof nodeConfigSchema>;
|
type NodeConfigFormData = z.infer<typeof nodeConfigSchema>;
|
||||||
|
|
||||||
@ -105,7 +77,6 @@ export default function ServerConfig() {
|
|||||||
const t = useTranslations('servers');
|
const t = useTranslations('servers');
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
const [timeSlots, setTimeSlots] = useState<API.TimePeriod[]>([]);
|
|
||||||
|
|
||||||
const { data: cfgResp, refetch: refetchCfg } = useQuery({
|
const { data: cfgResp, refetch: refetchCfg } = useQuery({
|
||||||
queryKey: ['getNodeConfig'],
|
queryKey: ['getNodeConfig'],
|
||||||
@ -116,21 +87,17 @@ export default function ServerConfig() {
|
|||||||
enabled: open,
|
enabled: open,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: periodsResp, refetch: refetchPeriods } = useQuery({
|
|
||||||
queryKey: ['getNodeMultiplier'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getNodeMultiplier();
|
|
||||||
return (data.data?.periods || []) as API.TimePeriod[];
|
|
||||||
},
|
|
||||||
enabled: open,
|
|
||||||
});
|
|
||||||
|
|
||||||
const form = useForm<NodeConfigFormData>({
|
const form = useForm<NodeConfigFormData>({
|
||||||
resolver: zodResolver(nodeConfigSchema),
|
resolver: zodResolver(nodeConfigSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
node_secret: '',
|
node_secret: '',
|
||||||
node_pull_interval: undefined,
|
node_pull_interval: undefined,
|
||||||
node_push_interval: undefined,
|
node_push_interval: undefined,
|
||||||
|
traffic_report_threshold: undefined,
|
||||||
|
ip_strategy: 'prefer_ipv4',
|
||||||
|
dns: [],
|
||||||
|
block: [],
|
||||||
|
outbound: [],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -140,35 +107,21 @@ export default function ServerConfig() {
|
|||||||
node_secret: cfgResp.node_secret ?? '',
|
node_secret: cfgResp.node_secret ?? '',
|
||||||
node_pull_interval: cfgResp.node_pull_interval as number | undefined,
|
node_pull_interval: cfgResp.node_pull_interval as number | undefined,
|
||||||
node_push_interval: cfgResp.node_push_interval as number | undefined,
|
node_push_interval: cfgResp.node_push_interval as number | undefined,
|
||||||
|
traffic_report_threshold: cfgResp.traffic_report_threshold as number | undefined,
|
||||||
|
ip_strategy:
|
||||||
|
(cfgResp.ip_strategy as 'prefer_ipv4' | 'prefer_ipv6' | undefined) || 'prefer_ipv4',
|
||||||
|
dns: cfgResp.dns || [],
|
||||||
|
block: cfgResp.block || [],
|
||||||
|
outbound: cfgResp.outbound || [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [cfgResp, form]);
|
}, [cfgResp, form]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (periodsResp) {
|
|
||||||
setTimeSlots(periodsResp);
|
|
||||||
}
|
|
||||||
}, [periodsResp]);
|
|
||||||
|
|
||||||
const chartTimeSlots = useMemo(() => getTimeRangeData(timeSlots), [timeSlots]);
|
|
||||||
const chartConfig = useMemo(() => {
|
|
||||||
return chartTimeSlots.reduce(
|
|
||||||
(acc, item, index) => {
|
|
||||||
acc[item.name] = {
|
|
||||||
label: item.name,
|
|
||||||
color: COLORS[index % COLORS.length] || 'hsl(var(--default-chart-color))',
|
|
||||||
};
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{} as Record<string, { label: string; color: string }>,
|
|
||||||
);
|
|
||||||
}, [chartTimeSlots]);
|
|
||||||
|
|
||||||
async function onSubmit(values: NodeConfigFormData) {
|
async function onSubmit(values: NodeConfigFormData) {
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
try {
|
try {
|
||||||
await updateNodeConfig(values as API.NodeConfig);
|
await updateNodeConfig(values as API.NodeConfig);
|
||||||
toast.success(t('config.saveSuccess'));
|
toast.success(t('server_config.saveSuccess'));
|
||||||
await refetchCfg();
|
await refetchCfg();
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
} finally {
|
} finally {
|
||||||
@ -176,222 +129,379 @@ export default function ServerConfig() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function savePeriods() {
|
|
||||||
await setNodeMultiplier({ periods: timeSlots });
|
|
||||||
await refetchPeriods();
|
|
||||||
toast.success(t('config.saveSuccess'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sheet open={open} onOpenChange={setOpen}>
|
<Sheet open={open} onOpenChange={setOpen}>
|
||||||
<SheetTrigger asChild>
|
<SheetTrigger asChild>
|
||||||
<div className='flex cursor-pointer items-center justify-between'>
|
<Card>
|
||||||
<div className='flex items-center gap-3'>
|
<CardContent className='p-4'>
|
||||||
<div className='bg-primary/10 flex h-10 w-10 items-center justify-center rounded-lg'>
|
<div className='flex cursor-pointer items-center justify-between'>
|
||||||
<Icon icon='mdi:resistor-nodes' className='text-primary h-5 w-5' />
|
<div className='flex items-center gap-3'>
|
||||||
|
<div className='bg-primary/10 flex h-10 w-10 items-center justify-center rounded-lg'>
|
||||||
|
<Icon icon='mdi:resistor-nodes' className='text-primary h-5 w-5' />
|
||||||
|
</div>
|
||||||
|
<div className='flex-1'>
|
||||||
|
<p className='font-medium'>{t('server_config.title')}</p>
|
||||||
|
<p className='text-muted-foreground truncate text-sm'>
|
||||||
|
{t('server_config.description')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Icon icon='mdi:chevron-right' className='size-6' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex-1'>
|
</CardContent>
|
||||||
<p className='font-medium'>{t('config.title')}</p>
|
</Card>
|
||||||
<p className='text-muted-foreground text-sm'>{t('config.description')}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Icon icon='mdi:chevron-right' className='size-6' />
|
|
||||||
</div>
|
|
||||||
</SheetTrigger>
|
</SheetTrigger>
|
||||||
|
|
||||||
<SheetContent className='w-[720px] max-w-full md:max-w-screen-md'>
|
<SheetContent className='w-[720px] max-w-full md:max-w-screen-md'>
|
||||||
<SheetHeader>
|
<SheetHeader>
|
||||||
<SheetTitle>{t('config.title')}</SheetTitle>
|
<SheetTitle>{t('server_config.title')}</SheetTitle>
|
||||||
</SheetHeader>
|
</SheetHeader>
|
||||||
|
|
||||||
<ScrollArea className='-mx-6 h-[calc(100dvh-48px-36px-36px-env(safe-area-inset-top))] px-6'>
|
<ScrollArea className='-mx-6 h-[calc(100dvh-48px-36px-36px-env(safe-area-inset-top))] px-6'>
|
||||||
<Form {...form}>
|
<Tabs defaultValue='basic' className='pt-4'>
|
||||||
<form
|
<TabsList className='grid w-full grid-cols-4'>
|
||||||
id='server-config-form'
|
<TabsTrigger value='basic'>{t('server_config.tabs.basic')}</TabsTrigger>
|
||||||
onSubmit={form.handleSubmit(onSubmit)}
|
<TabsTrigger value='dns'>{t('server_config.tabs.dns')}</TabsTrigger>
|
||||||
className='space-y-4 pt-4'
|
<TabsTrigger value='outbound'>{t('server_config.tabs.outbound')}</TabsTrigger>
|
||||||
>
|
<TabsTrigger value='block'>{t('server_config.tabs.block')}</TabsTrigger>
|
||||||
<FormField
|
</TabsList>
|
||||||
control={form.control}
|
|
||||||
name='node_secret'
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t('config.communicationKey')}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<EnhancedInput
|
|
||||||
placeholder={t('config.inputPlaceholder')}
|
|
||||||
value={field.value || ''}
|
|
||||||
onValueChange={field.onChange}
|
|
||||||
suffix={
|
|
||||||
<div className='bg-muted flex h-9 items-center px-3'>
|
|
||||||
<DicesIcon
|
|
||||||
onClick={() => {
|
|
||||||
const id = uid(32).toLowerCase();
|
|
||||||
const formatted = `${id.slice(0, 8)}-${id.slice(8, 12)}-${id.slice(12, 16)}-${id.slice(16, 20)}-${id.slice(20)}`;
|
|
||||||
form.setValue('node_secret', formatted);
|
|
||||||
}}
|
|
||||||
className='cursor-pointer'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormDescription>{t('config.communicationKeyDescription')}</FormDescription>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormField
|
<Form {...form}>
|
||||||
control={form.control}
|
<form id='server-config-form' onSubmit={form.handleSubmit(onSubmit)} className='mt-4'>
|
||||||
name='node_pull_interval'
|
<TabsContent value='basic' className='space-y-4'>
|
||||||
render={({ field }) => (
|
<FormField
|
||||||
<FormItem>
|
control={form.control}
|
||||||
<FormLabel>{t('config.nodePullInterval')}</FormLabel>
|
name='node_secret'
|
||||||
<FormControl>
|
render={({ field }) => (
|
||||||
<EnhancedInput
|
<FormItem>
|
||||||
type='number'
|
<FormLabel>{t('server_config.fields.communication_key')}</FormLabel>
|
||||||
min={0}
|
<FormControl>
|
||||||
suffix='S'
|
<EnhancedInput
|
||||||
value={field.value as any}
|
placeholder={t('server_config.fields.communication_key_placeholder')}
|
||||||
onValueChange={field.onChange}
|
value={field.value || ''}
|
||||||
placeholder={t('config.inputPlaceholder')}
|
onValueChange={field.onChange}
|
||||||
/>
|
suffix={
|
||||||
</FormControl>
|
<div className='bg-muted flex h-9 items-center px-3'>
|
||||||
<FormDescription>{t('config.nodePullIntervalDescription')}</FormDescription>
|
<DicesIcon
|
||||||
<FormMessage />
|
onClick={() => {
|
||||||
</FormItem>
|
const id = uid(32).toLowerCase();
|
||||||
)}
|
const formatted = `${id.slice(0, 8)}-${id.slice(8, 12)}-${id.slice(12, 16)}-${id.slice(16, 20)}-${id.slice(20)}`;
|
||||||
/>
|
form.setValue('node_secret', formatted);
|
||||||
|
}}
|
||||||
<FormField
|
className='cursor-pointer'
|
||||||
control={form.control}
|
/>
|
||||||
name='node_push_interval'
|
</div>
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t('config.nodePushInterval')}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<EnhancedInput
|
|
||||||
type='number'
|
|
||||||
min={0}
|
|
||||||
suffix='S'
|
|
||||||
step={0.1}
|
|
||||||
value={field.value as any}
|
|
||||||
onValueChange={field.onChange}
|
|
||||||
placeholder={t('config.inputPlaceholder')}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormDescription>{t('config.nodePushIntervalDescription')}</FormDescription>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className='mt-6 space-y-3'>
|
|
||||||
<Label className='text-base'>{t('config.dynamicMultiplier')}</Label>
|
|
||||||
<p className='text-muted-foreground text-sm'>
|
|
||||||
{t('config.dynamicMultiplierDescription')}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div className='flex flex-col-reverse gap-8 md:flex-row md:items-start'>
|
|
||||||
<div className='w-full md:w-1/2'>
|
|
||||||
<ArrayInput<API.TimePeriod>
|
|
||||||
fields={[
|
|
||||||
{ name: 'start_time', prefix: t('config.startTime'), type: 'time' },
|
|
||||||
{ name: 'end_time', prefix: t('config.endTime'), type: 'time' },
|
|
||||||
{
|
|
||||||
name: 'multiplier',
|
|
||||||
prefix: t('config.multiplier'),
|
|
||||||
type: 'number',
|
|
||||||
placeholder: '0',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
value={timeSlots}
|
|
||||||
onChange={setTimeSlots}
|
|
||||||
/>
|
|
||||||
<div className='mt-3 flex gap-2'>
|
|
||||||
<Button
|
|
||||||
size='sm'
|
|
||||||
variant='outline'
|
|
||||||
onClick={() => setTimeSlots(periodsResp || [])}
|
|
||||||
>
|
|
||||||
{t('config.reset')}
|
|
||||||
</Button>
|
|
||||||
<Button size='sm' onClick={savePeriods}>
|
|
||||||
{t('config.save')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='w-full md:w-1/2'>
|
|
||||||
<ChartContainer
|
|
||||||
config={chartConfig}
|
|
||||||
className='mx-auto aspect-[4/3] max-w-[400px]'
|
|
||||||
>
|
|
||||||
<PieChart>
|
|
||||||
<Pie
|
|
||||||
data={chartTimeSlots}
|
|
||||||
cx='50%'
|
|
||||||
cy='50%'
|
|
||||||
labelLine={false}
|
|
||||||
outerRadius='80%'
|
|
||||||
fill='#8884d8'
|
|
||||||
dataKey='value'
|
|
||||||
label={({ percent, multiplier }) =>
|
|
||||||
`${(multiplier || 0)?.toFixed(2)}x (${(percent * 100).toFixed(0)}%)`
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{chartTimeSlots.map((entry, index) => (
|
|
||||||
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
|
||||||
))}
|
|
||||||
</Pie>
|
|
||||||
<ChartTooltip
|
|
||||||
content={({ payload }) => {
|
|
||||||
if (payload && payload.length) {
|
|
||||||
const d = payload[0]?.payload as any;
|
|
||||||
return (
|
|
||||||
<div className='bg-background rounded-lg border p-2 shadow-sm'>
|
|
||||||
<div className='grid grid-cols-2 gap-2'>
|
|
||||||
<div className='flex flex-col'>
|
|
||||||
<span className='text-muted-foreground text-[0.70rem] uppercase'>
|
|
||||||
{t('config.timeSlot')}
|
|
||||||
</span>
|
|
||||||
<span className='text-muted-foreground font-bold'>
|
|
||||||
{d.name || '—'}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className='flex flex-col'>
|
|
||||||
<span className='text-muted-foreground text-[0.70rem] uppercase'>
|
|
||||||
{t('config.multiplier')}
|
|
||||||
</span>
|
|
||||||
<span className='font-bold'>
|
|
||||||
{Number(d.multiplier).toFixed(2)}x
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return null;
|
/>
|
||||||
}}
|
</FormControl>
|
||||||
/>
|
<FormDescription>
|
||||||
<Legend />
|
{t('server_config.fields.communication_key_desc')}
|
||||||
</PieChart>
|
</FormDescription>
|
||||||
</ChartContainer>
|
<FormMessage />
|
||||||
</div>
|
</FormItem>
|
||||||
</div>
|
)}
|
||||||
</div>
|
/>
|
||||||
</form>
|
|
||||||
</Form>
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='node_pull_interval'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('server_config.fields.node_pull_interval')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
type='number'
|
||||||
|
min={0}
|
||||||
|
suffix='S'
|
||||||
|
value={field.value as any}
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
placeholder={t('server_config.fields.communication_key_placeholder')}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
{t('server_config.fields.node_pull_interval_desc')}
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='node_push_interval'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('server_config.fields.node_push_interval')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
type='number'
|
||||||
|
min={0}
|
||||||
|
suffix='S'
|
||||||
|
step={0.1}
|
||||||
|
value={field.value as any}
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
placeholder={t('server_config.fields.communication_key_placeholder')}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
{t('server_config.fields.node_push_interval_desc')}
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='traffic_report_threshold'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('server_config.fields.traffic_report_threshold')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
type='number'
|
||||||
|
min={0}
|
||||||
|
suffix='MB'
|
||||||
|
value={unitConversion('bitsToMb', field.value as number | undefined)}
|
||||||
|
onValueChange={(value) => {
|
||||||
|
field.onChange(unitConversion('mbToBits', value));
|
||||||
|
}}
|
||||||
|
placeholder='1'
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
{t('server_config.fields.traffic_report_threshold_desc')}
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
|
||||||
|
<TabsContent value='dns' className='space-y-4'>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='ip_strategy'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('server_config.fields.ip_strategy')}</FormLabel>
|
||||||
|
<Select onValueChange={field.onChange} value={field.value}>
|
||||||
|
<FormControl>
|
||||||
|
<SelectTrigger>
|
||||||
|
<SelectValue
|
||||||
|
placeholder={t('server_config.fields.ip_strategy_placeholder')}
|
||||||
|
/>
|
||||||
|
</SelectTrigger>
|
||||||
|
</FormControl>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='prefer_ipv4'>
|
||||||
|
{t('server_config.fields.ip_strategy_ipv4')}
|
||||||
|
</SelectItem>
|
||||||
|
<SelectItem value='prefer_ipv6'>
|
||||||
|
{t('server_config.fields.ip_strategy_ipv6')}
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<FormDescription>
|
||||||
|
{t('server_config.fields.ip_strategy_desc')}
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='dns'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('server_config.fields.dns_config')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<ArrayInput
|
||||||
|
className='grid grid-cols-2 gap-2'
|
||||||
|
fields={[
|
||||||
|
{
|
||||||
|
name: 'proto',
|
||||||
|
type: 'select',
|
||||||
|
placeholder: t('server_config.fields.dns_proto_placeholder'),
|
||||||
|
options: [
|
||||||
|
{ label: 'TCP', value: 'tcp' },
|
||||||
|
{ label: 'UDP', value: 'udp' },
|
||||||
|
{ label: 'TLS', value: 'tls' },
|
||||||
|
{ label: 'HTTPS', value: 'https' },
|
||||||
|
{ label: 'QUIC', value: 'quic' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{ name: 'address', type: 'text', placeholder: '8.8.8.8:53' },
|
||||||
|
{
|
||||||
|
name: 'domains',
|
||||||
|
type: 'textarea',
|
||||||
|
className: 'col-span-2',
|
||||||
|
placeholder: t('server_config.fields.dns_domains_placeholder'),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
value={(field.value || []).map((item) => ({
|
||||||
|
...item,
|
||||||
|
domains: Array.isArray(item.domains) ? item.domains.join('\n') : '',
|
||||||
|
}))}
|
||||||
|
onChange={(values) => {
|
||||||
|
const converted = values.map((item: any) => ({
|
||||||
|
proto: item.proto,
|
||||||
|
address: item.address,
|
||||||
|
domains:
|
||||||
|
typeof item.domains === 'string'
|
||||||
|
? item.domains.split('\n').map((d: string) => d.trim())
|
||||||
|
: item.domains || [],
|
||||||
|
}));
|
||||||
|
field.onChange(converted);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
|
||||||
|
<TabsContent value='outbound' className='space-y-4'>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='outbound'
|
||||||
|
render={({ field }) => {
|
||||||
|
return (
|
||||||
|
<FormItem>
|
||||||
|
<FormControl>
|
||||||
|
<ArrayInput
|
||||||
|
className='grid grid-cols-2 gap-2'
|
||||||
|
fields={[
|
||||||
|
{
|
||||||
|
name: 'name',
|
||||||
|
type: 'text',
|
||||||
|
className: 'col-span-2',
|
||||||
|
placeholder: t('server_config.fields.outbound_name_placeholder'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'protocol',
|
||||||
|
type: 'select',
|
||||||
|
placeholder: t(
|
||||||
|
'server_config.fields.outbound_protocol_placeholder',
|
||||||
|
),
|
||||||
|
options: [
|
||||||
|
{ label: 'HTTP', value: 'http' },
|
||||||
|
{ label: 'SOCKS', value: 'socks' },
|
||||||
|
{ label: 'Shadowsocks', value: 'shadowsocks' },
|
||||||
|
{ label: 'Brook', value: 'brook' },
|
||||||
|
{ label: 'Snell', value: 'snell' },
|
||||||
|
{ label: 'VMess', value: 'vmess' },
|
||||||
|
{ label: 'VLESS', value: 'vless' },
|
||||||
|
{ label: 'Trojan', value: 'trojan' },
|
||||||
|
{ label: 'WireGuard', value: 'wireguard' },
|
||||||
|
{ label: 'Hysteria', value: 'hysteria' },
|
||||||
|
{ label: 'TUIC', value: 'tuic' },
|
||||||
|
{ label: 'AnyTLS', value: 'anytls' },
|
||||||
|
{ label: 'Naive', value: 'naive' },
|
||||||
|
{ label: 'Direct', value: 'direct' },
|
||||||
|
{ label: 'Reject', value: 'reject' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cipher',
|
||||||
|
type: 'select',
|
||||||
|
options: SS_CIPHERS.map((cipher) => ({
|
||||||
|
label: cipher,
|
||||||
|
value: cipher,
|
||||||
|
})),
|
||||||
|
visible: (item: Record<string, any>) =>
|
||||||
|
item.protocol === 'shadowsocks',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'address',
|
||||||
|
type: 'text',
|
||||||
|
placeholder: t(
|
||||||
|
'server_config.fields.outbound_address_placeholder',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'port',
|
||||||
|
type: 'number',
|
||||||
|
placeholder: t('server_config.fields.outbound_port_placeholder'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'password',
|
||||||
|
type: 'text',
|
||||||
|
placeholder: t(
|
||||||
|
'server_config.fields.outbound_password_placeholder',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'rules',
|
||||||
|
type: 'textarea',
|
||||||
|
className: 'col-span-2',
|
||||||
|
placeholder: t('server_config.fields.outbound_rules_placeholder'),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
value={(field.value || []).map((item) => ({
|
||||||
|
...item,
|
||||||
|
rules: Array.isArray(item.rules) ? item.rules.join('\n') : '',
|
||||||
|
}))}
|
||||||
|
onChange={(values) => {
|
||||||
|
const converted = values.map((item: any) => ({
|
||||||
|
name: item.name,
|
||||||
|
protocol: item.protocol,
|
||||||
|
address: item.address,
|
||||||
|
port: item.port,
|
||||||
|
cipher: item.cipher,
|
||||||
|
password: item.password,
|
||||||
|
rules:
|
||||||
|
typeof item.rules === 'string'
|
||||||
|
? item.rules.split('\n').map((r: string) => r.trim())
|
||||||
|
: item.rules || [],
|
||||||
|
}));
|
||||||
|
field.onChange(converted);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
|
||||||
|
<TabsContent value='block' className='space-y-4'>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='block'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormControl>
|
||||||
|
<Textarea
|
||||||
|
placeholder={t('server_config.fields.block_rules_placeholder')}
|
||||||
|
value={(field.value || []).join('\n')}
|
||||||
|
onChange={(e) => {
|
||||||
|
const lines = e.target.value.split('\n').map((line) => line.trim());
|
||||||
|
field.onChange(lines);
|
||||||
|
}}
|
||||||
|
rows={10}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
</form>
|
||||||
|
</Form>
|
||||||
|
</Tabs>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
|
|
||||||
<SheetFooter className='flex-row justify-end gap-2 pt-3'>
|
<SheetFooter className='flex-row justify-end gap-2 pt-3'>
|
||||||
<Button variant='outline' disabled={saving} onClick={() => setOpen(false)}>
|
<Button variant='outline' disabled={saving} onClick={() => setOpen(false)}>
|
||||||
{t('config.actions.cancel')}
|
{t('actions.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button disabled={saving} type='submit' form='server-config-form'>
|
<Button disabled={saving} type='submit' form='server-config-form'>
|
||||||
<Icon icon='mdi:loading' className={saving ? 'mr-2 animate-spin' : 'hidden'} />
|
<Icon icon='mdi:loading' className={saving ? 'mr-2 animate-spin' : 'hidden'} />
|
||||||
{t('config.actions.save')}
|
{t('actions.save')}
|
||||||
</Button>
|
</Button>
|
||||||
</SheetFooter>
|
</SheetFooter>
|
||||||
</SheetContent>
|
</SheetContent>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { useNode } from '@/store/node';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import {
|
import {
|
||||||
Accordion,
|
Accordion,
|
||||||
@ -9,6 +10,12 @@ import {
|
|||||||
} from '@workspace/ui/components/accordion';
|
} from '@workspace/ui/components/accordion';
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from '@workspace/ui/components/dropdown-menu';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
@ -38,7 +45,6 @@ import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
|
|||||||
import { Icon } from '@workspace/ui/custom-components/icon';
|
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||||
import { cn } from '@workspace/ui/lib/utils';
|
import { cn } from '@workspace/ui/lib/utils';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { uid } from 'radash';
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useForm, useWatch } from 'react-hook-form';
|
import { useForm, useWatch } from 'react-hook-form';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
@ -49,18 +55,19 @@ import {
|
|||||||
getProtocolDefaultConfig,
|
getProtocolDefaultConfig,
|
||||||
PROTOCOL_FIELDS,
|
PROTOCOL_FIELDS,
|
||||||
protocols as PROTOCOLS,
|
protocols as PROTOCOLS,
|
||||||
ServerFormValues,
|
|
||||||
} from './form-schema';
|
} from './form-schema';
|
||||||
|
|
||||||
function DynamicField({
|
function DynamicField({
|
||||||
field,
|
field,
|
||||||
control,
|
control,
|
||||||
|
form,
|
||||||
protocolIndex,
|
protocolIndex,
|
||||||
protocolData,
|
protocolData,
|
||||||
t,
|
t,
|
||||||
}: {
|
}: {
|
||||||
field: FieldConfig;
|
field: FieldConfig;
|
||||||
control: any;
|
control: any;
|
||||||
|
form: any;
|
||||||
protocolIndex: number;
|
protocolIndex: number;
|
||||||
protocolData: any;
|
protocolData: any;
|
||||||
t: (key: string) => string;
|
t: (key: string) => string;
|
||||||
@ -97,18 +104,69 @@ function DynamicField({
|
|||||||
}
|
}
|
||||||
onValueChange={(v) => fieldProps.onChange(v)}
|
onValueChange={(v) => fieldProps.onChange(v)}
|
||||||
suffix={
|
suffix={
|
||||||
field.password ? (
|
field.generate ? (
|
||||||
<Button
|
field.generate.functions && field.generate.functions.length > 0 ? (
|
||||||
type='button'
|
<DropdownMenu>
|
||||||
variant='ghost'
|
<DropdownMenuTrigger asChild>
|
||||||
onClick={() => {
|
<Button type='button' variant='ghost' size='sm'>
|
||||||
const length = field.password || 16;
|
<Icon icon='mdi:key' className='h-4 w-4' />
|
||||||
const result = uid(length).toLowerCase();
|
</Button>
|
||||||
fieldProps.onChange(result);
|
</DropdownMenuTrigger>
|
||||||
}}
|
<DropdownMenuContent align='end'>
|
||||||
>
|
{field.generate.functions.map((genFunc, idx) => (
|
||||||
<Icon icon='mdi:refresh' className='h-4 w-4' />
|
<DropdownMenuItem
|
||||||
</Button>
|
key={idx}
|
||||||
|
onClick={async () => {
|
||||||
|
const result = await genFunc.function();
|
||||||
|
if (typeof result === 'string') {
|
||||||
|
fieldProps.onChange(result);
|
||||||
|
} else if (field.generate!.updateFields) {
|
||||||
|
Object.entries(field.generate!.updateFields).forEach(
|
||||||
|
([fieldName, resultKey]) => {
|
||||||
|
const fullFieldName = `protocols.${protocolIndex}.${fieldName}`;
|
||||||
|
form.setValue(fullFieldName, (result as any)[resultKey]);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (result.privateKey) {
|
||||||
|
fieldProps.onChange(result.privateKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{typeof genFunc.label === 'function'
|
||||||
|
? genFunc.label(t, protocolData)
|
||||||
|
: genFunc.label}
|
||||||
|
</DropdownMenuItem>
|
||||||
|
))}
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
) : field.generate.function ? (
|
||||||
|
<Button
|
||||||
|
type='button'
|
||||||
|
variant='ghost'
|
||||||
|
size='sm'
|
||||||
|
onClick={async () => {
|
||||||
|
const result = await field.generate!.function!();
|
||||||
|
if (typeof result === 'string') {
|
||||||
|
fieldProps.onChange(result);
|
||||||
|
} else if (field.generate!.updateFields) {
|
||||||
|
Object.entries(field.generate!.updateFields).forEach(
|
||||||
|
([fieldName, resultKey]) => {
|
||||||
|
const fullFieldName = `protocols.${protocolIndex}.${fieldName}`;
|
||||||
|
form.setValue(fullFieldName, (result as any)[resultKey]);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (result.privateKey) {
|
||||||
|
fieldProps.onChange(result.privateKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon='mdi:key' className='h-4 w-4' />
|
||||||
|
</Button>
|
||||||
|
) : null
|
||||||
) : (
|
) : (
|
||||||
field.suffix
|
field.suffix
|
||||||
)
|
)
|
||||||
@ -225,7 +283,7 @@ function DynamicField({
|
|||||||
field.placeholder
|
field.placeholder
|
||||||
? typeof field.placeholder === 'function'
|
? typeof field.placeholder === 'function'
|
||||||
? field.placeholder(t, protocolData)
|
? field.placeholder(t, protocolData)
|
||||||
: t(field.placeholder)
|
: field.placeholder
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
onChange={(e) => fieldProps.onChange(e.target.value)}
|
onChange={(e) => fieldProps.onChange(e.target.value)}
|
||||||
@ -246,6 +304,7 @@ function renderFieldsByGroup(
|
|||||||
fields: FieldConfig[],
|
fields: FieldConfig[],
|
||||||
group: string,
|
group: string,
|
||||||
control: any,
|
control: any,
|
||||||
|
form: any,
|
||||||
protocolIndex: number,
|
protocolIndex: number,
|
||||||
protocolData: any,
|
protocolData: any,
|
||||||
t: (key: string) => string,
|
t: (key: string) => string,
|
||||||
@ -260,6 +319,7 @@ function renderFieldsByGroup(
|
|||||||
key={field.name}
|
key={field.name}
|
||||||
field={field}
|
field={field}
|
||||||
control={control}
|
control={control}
|
||||||
|
form={form}
|
||||||
protocolIndex={protocolIndex}
|
protocolIndex={protocolIndex}
|
||||||
protocolData={protocolData}
|
protocolData={protocolData}
|
||||||
t={t}
|
t={t}
|
||||||
@ -274,6 +334,7 @@ function renderGroupCard(
|
|||||||
fields: FieldConfig[],
|
fields: FieldConfig[],
|
||||||
group: string,
|
group: string,
|
||||||
control: any,
|
control: any,
|
||||||
|
form: any,
|
||||||
protocolIndex: number,
|
protocolIndex: number,
|
||||||
protocolData: any,
|
protocolData: any,
|
||||||
t: (key: string) => string,
|
t: (key: string) => string,
|
||||||
@ -294,7 +355,7 @@ function renderGroupCard(
|
|||||||
{t(title)}
|
{t(title)}
|
||||||
</legend>
|
</legend>
|
||||||
<div className='p-4 pt-2'>
|
<div className='p-4 pt-2'>
|
||||||
{renderFieldsByGroup(fields, group, control, protocolIndex, protocolData, t)}
|
{renderFieldsByGroup(fields, group, control, form, protocolIndex, protocolData, t)}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
@ -305,14 +366,16 @@ export default function ServerForm(props: {
|
|||||||
trigger: string;
|
trigger: string;
|
||||||
title: string;
|
title: string;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
initialValues?: Partial<ServerFormValues>;
|
initialValues?: Partial<API.Server>;
|
||||||
onSubmit: (values: ServerFormValues) => Promise<boolean> | boolean;
|
onSubmit: (values: Partial<API.Server>) => Promise<boolean> | boolean;
|
||||||
}) {
|
}) {
|
||||||
const { trigger, title, loading, initialValues, onSubmit } = props;
|
const { trigger, title, loading, initialValues, onSubmit } = props;
|
||||||
const t = useTranslations('servers');
|
const t = useTranslations('servers');
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [accordionValue, setAccordionValue] = useState<string>();
|
const [accordionValue, setAccordionValue] = useState<string>();
|
||||||
|
|
||||||
|
const { isProtocolUsedInNodes } = useNode();
|
||||||
|
|
||||||
const form = useForm({
|
const form = useForm({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
@ -320,8 +383,7 @@ export default function ServerForm(props: {
|
|||||||
address: '',
|
address: '',
|
||||||
country: '',
|
country: '',
|
||||||
city: '',
|
city: '',
|
||||||
ratio: 1,
|
protocols: [] as any[],
|
||||||
protocols: [],
|
|
||||||
...initialValues,
|
...initialValues,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -336,11 +398,11 @@ export default function ServerForm(props: {
|
|||||||
address: '',
|
address: '',
|
||||||
country: '',
|
country: '',
|
||||||
city: '',
|
city: '',
|
||||||
ratio: 1,
|
|
||||||
...initialValues,
|
...initialValues,
|
||||||
protocols: PROTOCOLS.map((type) => {
|
protocols: PROTOCOLS.map((type) => {
|
||||||
const existingProtocol = initialValues.protocols?.find((p) => p.type === type);
|
const existingProtocol = initialValues.protocols?.find((p) => p.type === type);
|
||||||
return existingProtocol || getProtocolDefaultConfig(type);
|
const defaultConfig = getProtocolDefaultConfig(type);
|
||||||
|
return existingProtocol ? { ...defaultConfig, ...existingProtocol } : defaultConfig;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -348,24 +410,17 @@ export default function ServerForm(props: {
|
|||||||
}, [initialValues]);
|
}, [initialValues]);
|
||||||
|
|
||||||
async function handleSubmit(values: Record<string, any>) {
|
async function handleSubmit(values: Record<string, any>) {
|
||||||
const filtered = (values?.protocols || []).filter((p: any, index: number) => {
|
const filteredProtocols = (values?.protocols || []).filter((protocol: any) => {
|
||||||
const port = Number(p?.port);
|
const port = Number(protocol?.port);
|
||||||
const protocolType = PROTOCOLS[index];
|
return protocol && Number.isFinite(port) && port > 0 && port <= 65535;
|
||||||
return protocolType && p && Number.isFinite(port) && port > 0 && port <= 65535;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (filtered.length === 0) {
|
|
||||||
toast.error(t('validation_failed'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
name: values.name,
|
name: values.name,
|
||||||
country: values.country,
|
country: values.country,
|
||||||
city: values.city,
|
city: values.city,
|
||||||
ratio: Number(values.ratio || 1),
|
|
||||||
address: values.address,
|
address: values.address,
|
||||||
protocols: filtered,
|
protocols: filteredProtocols,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ok = await onSubmit(result);
|
const ok = await onSubmit(result);
|
||||||
@ -387,7 +442,6 @@ export default function ServerForm(props: {
|
|||||||
address: '',
|
address: '',
|
||||||
country: '',
|
country: '',
|
||||||
city: '',
|
city: '',
|
||||||
ratio: 1,
|
|
||||||
protocols: full,
|
protocols: full,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -404,7 +458,7 @@ export default function ServerForm(props: {
|
|||||||
<ScrollArea className='-mx-6 h-[calc(100dvh-48px-36px-36px-env(safe-area-inset-top))]'>
|
<ScrollArea className='-mx-6 h-[calc(100dvh-48px-36px-36px-env(safe-area-inset-top))]'>
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form className='grid grid-cols-1 gap-2 px-6 pt-4'>
|
<form className='grid grid-cols-1 gap-2 px-6 pt-4'>
|
||||||
<div className='grid grid-cols-3 gap-2'>
|
<div className='grid grid-cols-2 gap-2 md:grid-cols-4'>
|
||||||
<FormField
|
<FormField
|
||||||
control={control}
|
control={control}
|
||||||
name='name'
|
name='name'
|
||||||
@ -418,6 +472,23 @@ export default function ServerForm(props: {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
<FormField
|
||||||
|
control={control}
|
||||||
|
name='address'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('address')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
{...field}
|
||||||
|
placeholder={t('address_placeholder')}
|
||||||
|
onValueChange={(v) => field.onChange(v)}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
<FormField
|
<FormField
|
||||||
control={control}
|
control={control}
|
||||||
name='country'
|
name='country'
|
||||||
@ -445,44 +516,6 @@ export default function ServerForm(props: {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='grid grid-cols-2 gap-2'>
|
|
||||||
<FormField
|
|
||||||
control={control}
|
|
||||||
name='address'
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t('address')}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<EnhancedInput
|
|
||||||
{...field}
|
|
||||||
placeholder={t('address_placeholder')}
|
|
||||||
onValueChange={(v) => field.onChange(v)}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={control}
|
|
||||||
name='ratio'
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t('traffic_ratio')}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<EnhancedInput
|
|
||||||
{...field}
|
|
||||||
type='number'
|
|
||||||
step={0.1}
|
|
||||||
min={0}
|
|
||||||
onValueChange={(v) => field.onChange(v)}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className='my-3'>
|
<div className='my-3'>
|
||||||
<h3 className='text-foreground text-sm font-semibold'>
|
<h3 className='text-foreground text-sm font-semibold'>
|
||||||
{t('protocol_configurations')}
|
{t('protocol_configurations')}
|
||||||
@ -491,6 +524,7 @@ export default function ServerForm(props: {
|
|||||||
{t('protocol_configurations_desc')}
|
{t('protocol_configurations_desc')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Accordion
|
<Accordion
|
||||||
type='single'
|
type='single'
|
||||||
collapsible
|
collapsible
|
||||||
@ -504,56 +538,97 @@ export default function ServerForm(props: {
|
|||||||
PROTOCOLS.findIndex((t) => t === type),
|
PROTOCOLS.findIndex((t) => t === type),
|
||||||
);
|
);
|
||||||
const current = (protocolsValues[i] || {}) as Record<string, any>;
|
const current = (protocolsValues[i] || {}) as Record<string, any>;
|
||||||
const isEnabled = current.port && Number(current.port) > 0;
|
const isEnabled = current?.enable;
|
||||||
const fields = PROTOCOL_FIELDS[type] || [];
|
const fields = PROTOCOL_FIELDS[type] || [];
|
||||||
return (
|
return (
|
||||||
<AccordionItem key={type} value={type} className='mb-2 rounded-lg border'>
|
<AccordionItem key={type} value={type} className='mb-2 rounded-lg border'>
|
||||||
<AccordionTrigger className='px-4 py-3 hover:no-underline'>
|
<AccordionTrigger className='px-4 py-3 hover:no-underline'>
|
||||||
<div className='flex w-full items-center justify-between'>
|
<div className='flex w-full items-center justify-between'>
|
||||||
<div className='flex flex-col items-start'>
|
<div className='flex flex-col items-start gap-1'>
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-1'>
|
||||||
<span className='font-medium capitalize'>{type}</span>
|
<span className='font-medium capitalize'>{type}</span>
|
||||||
</div>
|
{current.transport && (
|
||||||
<span
|
<Badge variant='secondary' className='text-xs'>
|
||||||
className={cn(
|
{current.transport.toUpperCase()}
|
||||||
'text-muted-foreground text-xs',
|
</Badge>
|
||||||
isEnabled && 'text-green-500',
|
|
||||||
)}
|
)}
|
||||||
>
|
{current.security && current.security !== 'none' && (
|
||||||
{isEnabled ? t('enabled') : t('disabled')}
|
<Badge variant='outline' className='text-xs'>
|
||||||
</span>
|
{current.security.toUpperCase()}
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
{current.port && <Badge className='text-xs'>{current.port}</Badge>}
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center gap-1'>
|
||||||
|
<span
|
||||||
|
className={cn(
|
||||||
|
'text-xs',
|
||||||
|
isEnabled ? 'text-green-500' : 'text-muted-foreground',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{isEnabled ? t('enabled') : t('disabled')}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='mr-2 flex items-center gap-1'>
|
<Switch
|
||||||
{current.transport && (
|
className='mr-2'
|
||||||
<Badge variant='secondary' className='text-xs'>
|
checked={!!isEnabled}
|
||||||
{current.transport.toUpperCase()}
|
disabled={Boolean(
|
||||||
</Badge>
|
initialValues?.id &&
|
||||||
|
isProtocolUsedInNodes(initialValues?.id || 0, type) &&
|
||||||
|
isEnabled,
|
||||||
)}
|
)}
|
||||||
{current.security && current.security !== 'none' && (
|
onCheckedChange={(checked) => {
|
||||||
<Badge variant='outline' className='text-xs'>
|
form.setValue(`protocols.${i}.enable`, checked);
|
||||||
{current.security.toUpperCase()}
|
}}
|
||||||
</Badge>
|
onClick={(e) => e.stopPropagation()}
|
||||||
)}
|
/>
|
||||||
|
|
||||||
{current.port && <Badge className='text-xs'>{current.port}</Badge>}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className='px-4 pb-4 pt-0'>
|
<AccordionContent className='px-4 pb-4 pt-0'>
|
||||||
<div className='-mx-4 space-y-4 rounded-b-lg border-t px-4 pt-4'>
|
<div className='-mx-4 space-y-4 rounded-b-lg border-t px-4 pt-4'>
|
||||||
{renderGroupCard('basic', fields, 'basic', control, i, current, t)}
|
{renderGroupCard('basic', fields, 'basic', control, form, i, current, t)}
|
||||||
{renderGroupCard('plugin', fields, 'plugin', control, i, current, t)}
|
{renderGroupCard('obfs', fields, 'obfs', control, form, i, current, t)}
|
||||||
{renderGroupCard(
|
{renderGroupCard(
|
||||||
'transport',
|
'transport',
|
||||||
fields,
|
fields,
|
||||||
'transport',
|
'transport',
|
||||||
control,
|
control,
|
||||||
|
form,
|
||||||
|
i,
|
||||||
|
current,
|
||||||
|
t,
|
||||||
|
)}
|
||||||
|
{renderGroupCard(
|
||||||
|
'security',
|
||||||
|
fields,
|
||||||
|
'security',
|
||||||
|
control,
|
||||||
|
form,
|
||||||
|
i,
|
||||||
|
current,
|
||||||
|
t,
|
||||||
|
)}
|
||||||
|
{renderGroupCard(
|
||||||
|
'reality',
|
||||||
|
fields,
|
||||||
|
'reality',
|
||||||
|
control,
|
||||||
|
form,
|
||||||
|
i,
|
||||||
|
current,
|
||||||
|
t,
|
||||||
|
)}
|
||||||
|
{renderGroupCard(
|
||||||
|
'encryption',
|
||||||
|
fields,
|
||||||
|
'encryption',
|
||||||
|
control,
|
||||||
|
form,
|
||||||
i,
|
i,
|
||||||
current,
|
current,
|
||||||
t,
|
t,
|
||||||
)}
|
)}
|
||||||
{renderGroupCard('security', fields, 'security', control, i, current, t)}
|
|
||||||
{renderGroupCard('reality', fields, 'reality', control, i, current, t)}
|
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
@ -576,7 +651,8 @@ export default function ServerForm(props: {
|
|||||||
return false;
|
return false;
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{loading && <Icon icon='mdi:loading' className='mr-2 animate-spin' />} {t('confirm')}
|
{loading && <Icon icon='mdi:loading' className='mr-2 animate-spin' />}
|
||||||
|
{t('confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</SheetFooter>
|
</SheetFooter>
|
||||||
</SheetContent>
|
</SheetContent>
|
||||||
|
|||||||
119
apps/admin/app/dashboard/servers/server-install.tsx
Normal file
119
apps/admin/app/dashboard/servers/server-install.tsx
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { getNodeConfig } from '@/services/admin/system';
|
||||||
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { Button } from '@workspace/ui/components/button';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
DialogTrigger,
|
||||||
|
} from '@workspace/ui/components/dialog';
|
||||||
|
import { Input } from '@workspace/ui/components/input';
|
||||||
|
import { Label } from '@workspace/ui/components/label';
|
||||||
|
import { useTranslations } from 'next-intl';
|
||||||
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
server: API.Server;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function ServerInstall({ server }: Props) {
|
||||||
|
const t = useTranslations('servers');
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const [domain, setDomain] = useState('');
|
||||||
|
|
||||||
|
const { data: cfgResp } = useQuery({
|
||||||
|
queryKey: ['getNodeConfig'],
|
||||||
|
queryFn: async () => {
|
||||||
|
const { data } = await getNodeConfig();
|
||||||
|
return data.data as API.NodeConfig | undefined;
|
||||||
|
},
|
||||||
|
enabled: open,
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (open) {
|
||||||
|
const host = localStorage.getItem('API_HOST') ?? window.location.origin;
|
||||||
|
setDomain(host);
|
||||||
|
}
|
||||||
|
}, [open]);
|
||||||
|
|
||||||
|
const installCommand = useMemo(() => {
|
||||||
|
const secret = cfgResp?.node_secret ?? '';
|
||||||
|
return `wget -N https://raw.githubusercontent.com/perfect-panel/ppanel-node/master/scripts/install.sh && bash install.sh --api-host ${domain} --server-id ${server.id} --secret-key ${secret}`;
|
||||||
|
}, [domain, server.id, cfgResp?.node_secret]);
|
||||||
|
|
||||||
|
async function handleCopy() {
|
||||||
|
try {
|
||||||
|
if (navigator?.clipboard?.writeText) {
|
||||||
|
await navigator.clipboard.writeText(installCommand);
|
||||||
|
} else {
|
||||||
|
// fallback for environments without clipboard API
|
||||||
|
const el = document.createElement('textarea');
|
||||||
|
el.value = installCommand;
|
||||||
|
document.body.appendChild(el);
|
||||||
|
el.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(el);
|
||||||
|
}
|
||||||
|
toast.success(t('copied'));
|
||||||
|
setOpen(false);
|
||||||
|
} catch (error) {
|
||||||
|
toast.error(t('copyFailed'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDomainChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setDomain(e.target.value);
|
||||||
|
localStorage.setItem('API_HOST', e.target.value);
|
||||||
|
}, []);
|
||||||
|
return (
|
||||||
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<Button variant='secondary'>{t('connect')}</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
|
||||||
|
<DialogContent className='w-[720px] max-w-full md:max-w-screen-md'>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>{t('oneClickInstall')}</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div>
|
||||||
|
<Label>{t('apiHost')}</Label>
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<Input
|
||||||
|
value={domain}
|
||||||
|
placeholder={t('apiHostPlaceholder')}
|
||||||
|
onChange={onDomainChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Label>{t('installCommand')}</Label>
|
||||||
|
<div className='flex flex-col gap-2'>
|
||||||
|
<textarea
|
||||||
|
readOnly
|
||||||
|
aria-label={t('installCommand')}
|
||||||
|
value={installCommand}
|
||||||
|
className='min-h-[88px] w-full rounded border p-2 font-mono text-sm'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DialogFooter className='flex-row justify-end gap-2 pt-3'>
|
||||||
|
<Button variant='outline' onClick={() => setOpen(false)}>
|
||||||
|
{t('close')}
|
||||||
|
</Button>
|
||||||
|
<Button onClick={handleCopy}>{t('copyAndClose')}</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
450
apps/admin/app/dashboard/settings/version/page.tsx
Normal file
450
apps/admin/app/dashboard/settings/version/page.tsx
Normal file
@ -0,0 +1,450 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import {
|
||||||
|
createAppVersion,
|
||||||
|
deleteAppVersion,
|
||||||
|
getAppVersionList,
|
||||||
|
updateAppVersion,
|
||||||
|
} from '@/services/admin/application';
|
||||||
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
|
import { Button } from '@workspace/ui/components/button';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
} from '@workspace/ui/components/dialog';
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
FormControl,
|
||||||
|
FormField,
|
||||||
|
FormItem,
|
||||||
|
FormLabel,
|
||||||
|
FormMessage,
|
||||||
|
} from '@workspace/ui/components/form';
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@workspace/ui/components/select';
|
||||||
|
import { Switch } from '@workspace/ui/components/switch';
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from '@workspace/ui/components/table';
|
||||||
|
import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
|
||||||
|
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||||
|
|
||||||
|
import { useTranslations } from 'next-intl';
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
import { toast } from 'sonner';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
const versionSchema = z.object({
|
||||||
|
id: z.number().optional(),
|
||||||
|
platform: z.string().min(1),
|
||||||
|
version: z.string().min(1),
|
||||||
|
min_version: z.string().optional(),
|
||||||
|
url: z.string().url(),
|
||||||
|
description: z.string().optional(),
|
||||||
|
force_update: z.boolean(),
|
||||||
|
is_default: z.boolean(),
|
||||||
|
is_in_review: z.boolean(),
|
||||||
|
});
|
||||||
|
|
||||||
|
type VersionFormData = z.infer<typeof versionSchema>;
|
||||||
|
|
||||||
|
export default function VersionPage() {
|
||||||
|
const t = useTranslations('system');
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
const [pageSize, setPageSize] = useState(10);
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const [editingVersion, setEditingVersion] = useState<API.ApplicationVersion | null>(null);
|
||||||
|
|
||||||
|
const { data } = useQuery({
|
||||||
|
queryKey: ['app-versions', page, pageSize],
|
||||||
|
queryFn: async () => {
|
||||||
|
const res = await getAppVersionList({ page, size: pageSize });
|
||||||
|
return res.data?.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const form = useForm<VersionFormData>({
|
||||||
|
resolver: zodResolver(versionSchema),
|
||||||
|
defaultValues: {
|
||||||
|
platform: 'android',
|
||||||
|
version: '',
|
||||||
|
min_version: '',
|
||||||
|
url: '',
|
||||||
|
description: '',
|
||||||
|
force_update: false,
|
||||||
|
is_default: false,
|
||||||
|
is_in_review: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const createMutation = useMutation({
|
||||||
|
mutationFn: createAppVersion,
|
||||||
|
onSuccess: () => {
|
||||||
|
toast.success(t('common.saveSuccess'));
|
||||||
|
setOpen(false);
|
||||||
|
form.reset();
|
||||||
|
queryClient.invalidateQueries({ queryKey: ['app-versions'] });
|
||||||
|
},
|
||||||
|
onError: () => {
|
||||||
|
toast.error(t('common.saveFailed'));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateMutation = useMutation({
|
||||||
|
mutationFn: updateAppVersion,
|
||||||
|
onSuccess: () => {
|
||||||
|
toast.success(t('common.saveSuccess'));
|
||||||
|
setOpen(false);
|
||||||
|
setEditingVersion(null);
|
||||||
|
form.reset();
|
||||||
|
queryClient.invalidateQueries({ queryKey: ['app-versions'] });
|
||||||
|
},
|
||||||
|
onError: () => {
|
||||||
|
toast.error(t('common.saveFailed'));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteMutation = useMutation({
|
||||||
|
mutationFn: deleteAppVersion,
|
||||||
|
onSuccess: () => {
|
||||||
|
toast.success(t('common.saveSuccess'));
|
||||||
|
queryClient.invalidateQueries({ queryKey: ['app-versions'] });
|
||||||
|
},
|
||||||
|
onError: () => {
|
||||||
|
toast.error(t('common.saveFailed'));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const onSubmit = (values: VersionFormData) => {
|
||||||
|
const payload = {
|
||||||
|
...values,
|
||||||
|
description: JSON.stringify({ 'en-US': values.description, 'zh-CN': values.description }),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (editingVersion) {
|
||||||
|
updateMutation.mutate({ ...payload, id: editingVersion.id } as API.UpdateAppVersionRequest);
|
||||||
|
} else {
|
||||||
|
createMutation.mutate(payload as API.CreateAppVersionRequest);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEdit = (version: API.ApplicationVersion) => {
|
||||||
|
setEditingVersion(version);
|
||||||
|
let desc = '';
|
||||||
|
if (version.description && typeof version.description === 'object') {
|
||||||
|
desc = Object.values(version.description)[0] || '';
|
||||||
|
} else if (typeof version.description === 'string') {
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(version.description);
|
||||||
|
desc = (Object.values(parsed)[0] as string) || '';
|
||||||
|
} catch (e) {
|
||||||
|
desc = version.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
form.reset({
|
||||||
|
platform: version.platform,
|
||||||
|
version: version.version,
|
||||||
|
min_version: version.min_version,
|
||||||
|
url: version.url,
|
||||||
|
description: desc,
|
||||||
|
force_update: version.force_update,
|
||||||
|
is_default: version.is_default,
|
||||||
|
is_in_review: version.is_in_review,
|
||||||
|
});
|
||||||
|
setOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDelete = (id: number) => {
|
||||||
|
if (confirm(t('version.confirmDelete'))) {
|
||||||
|
deleteMutation.mutate({ id });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOpenChange = (open: boolean) => {
|
||||||
|
setOpen(open);
|
||||||
|
if (!open) {
|
||||||
|
setEditingVersion(null);
|
||||||
|
form.reset({
|
||||||
|
platform: 'android',
|
||||||
|
version: '',
|
||||||
|
min_version: '',
|
||||||
|
url: '',
|
||||||
|
description: '',
|
||||||
|
force_update: false,
|
||||||
|
is_default: false,
|
||||||
|
is_in_review: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<h2 className='text-2xl font-bold tracking-tight'>{t('version.title')}</h2>
|
||||||
|
<Button onClick={() => handleOpenChange(true)}>
|
||||||
|
<Icon icon='mdi:plus' className='mr-2 h-4 w-4' />
|
||||||
|
{t('version.create')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='rounded-md border'>
|
||||||
|
<Table>
|
||||||
|
<TableHeader>
|
||||||
|
<TableRow>
|
||||||
|
<TableHead>ID</TableHead>
|
||||||
|
<TableHead>{t('version.platform')}</TableHead>
|
||||||
|
<TableHead>{t('version.versionNumber')}</TableHead>
|
||||||
|
<TableHead>{t('version.url')}</TableHead>
|
||||||
|
<TableHead>{t('version.force')}</TableHead>
|
||||||
|
<TableHead>{t('version.default')}</TableHead>
|
||||||
|
<TableHead>{t('version.actions')}</TableHead>
|
||||||
|
</TableRow>
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{data?.list?.map((version: API.ApplicationVersion) => (
|
||||||
|
<TableRow key={version.id}>
|
||||||
|
<TableCell>{version.id}</TableCell>
|
||||||
|
<TableCell>{version.platform}</TableCell>
|
||||||
|
<TableCell>{version.version}</TableCell>
|
||||||
|
<TableCell className='max-w-[200px] truncate' title={version.url}>
|
||||||
|
{version.url}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell>{version.force_update ? t('version.yes') : t('version.no')}</TableCell>
|
||||||
|
<TableCell>{version.is_default ? t('version.yes') : t('version.no')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<div className='flex space-x-2'>
|
||||||
|
<Button variant='ghost' size='icon' onClick={() => handleEdit(version)}>
|
||||||
|
<Icon icon='mdi:pencil' className='h-4 w-4' />
|
||||||
|
</Button>
|
||||||
|
<Button variant='ghost' size='icon' onClick={() => handleDelete(version.id)}>
|
||||||
|
<Icon icon='mdi:delete' className='h-4 w-4 text-red-500' />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
{!data?.list?.length && (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={7} className='h-24 text-center'>
|
||||||
|
{t('version.noResults')}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between py-2'>
|
||||||
|
<div className='text-muted-foreground text-sm'>
|
||||||
|
{t('version.total', { count: data?.total || 0 })}
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center space-x-2'>
|
||||||
|
<Select value={String(pageSize)} onValueChange={(val) => setPageSize(Number(val))}>
|
||||||
|
<SelectTrigger className='w-[80px]'>
|
||||||
|
<SelectValue />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='10'>10</SelectItem>
|
||||||
|
<SelectItem value='20'>20</SelectItem>
|
||||||
|
<SelectItem value='50'>50</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<Button
|
||||||
|
variant='outline'
|
||||||
|
size='sm'
|
||||||
|
onClick={() => setPage(Math.max(1, page - 1))}
|
||||||
|
disabled={page <= 1}
|
||||||
|
>
|
||||||
|
{t('version.previous')}
|
||||||
|
</Button>
|
||||||
|
<span className='text-sm'>{t('version.page', { page })}</span>
|
||||||
|
<Button
|
||||||
|
variant='outline'
|
||||||
|
size='sm'
|
||||||
|
onClick={() => setPage(page + 1)}
|
||||||
|
disabled={!data?.list?.length || data.list.length < pageSize}
|
||||||
|
>
|
||||||
|
{t('version.next')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Dialog open={open} onOpenChange={handleOpenChange}>
|
||||||
|
<DialogContent className='sm:max-w-[600px]'>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>
|
||||||
|
{editingVersion ? t('version.edit') : t('version.createVersion')}
|
||||||
|
</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
<Form {...form}>
|
||||||
|
<form onSubmit={form.handleSubmit(onSubmit)} className='space-y-4'>
|
||||||
|
<div className='grid grid-cols-2 gap-4'>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='platform'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('version.platform')}</FormLabel>
|
||||||
|
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||||
|
<FormControl>
|
||||||
|
<SelectTrigger>
|
||||||
|
<SelectValue placeholder={t('version.platformPlaceholder')} />
|
||||||
|
</SelectTrigger>
|
||||||
|
</FormControl>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='android'>Android</SelectItem>
|
||||||
|
<SelectItem value='ios'>iOS</SelectItem>
|
||||||
|
<SelectItem value='windows'>Windows</SelectItem>
|
||||||
|
<SelectItem value='macos'>macOS</SelectItem>
|
||||||
|
<SelectItem value='linux'>Linux</SelectItem>
|
||||||
|
<SelectItem value='harmony'>Harmony</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='version'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('version.versionNumber')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
value={field.value}
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
placeholder={t('version.versionPlaceholder')}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='grid grid-cols-2 gap-4'>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='min_version'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('version.minVersion')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
value={field.value}
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
placeholder={t('version.versionPlaceholder')}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='url'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('version.downloadUrl')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
value={field.value}
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
placeholder='https://...'
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='description'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('version.descriptionField')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
value={field.value}
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
placeholder={t('version.descriptionPlaceholder')}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<div className='flex flex-row gap-4'>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='force_update'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className='flex flex-1 flex-row items-center justify-between rounded-lg border p-3 shadow-sm'>
|
||||||
|
<div className='space-y-0.5'>
|
||||||
|
<FormLabel>{t('version.forceUpdate')}</FormLabel>
|
||||||
|
</div>
|
||||||
|
<FormControl>
|
||||||
|
<Switch checked={field.value} onCheckedChange={field.onChange} />
|
||||||
|
</FormControl>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='is_default'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className='flex flex-1 flex-row items-center justify-between rounded-lg border p-3 shadow-sm'>
|
||||||
|
<div className='space-y-0.5'>
|
||||||
|
<FormLabel>{t('version.default')}</FormLabel>
|
||||||
|
</div>
|
||||||
|
<FormControl>
|
||||||
|
<Switch checked={field.value} onCheckedChange={field.onChange} />
|
||||||
|
</FormControl>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='is_in_review'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className='flex flex-1 flex-row items-center justify-between rounded-lg border p-3 shadow-sm'>
|
||||||
|
<div className='space-y-0.5'>
|
||||||
|
<FormLabel>{t('version.inReview')}</FormLabel>
|
||||||
|
</div>
|
||||||
|
<FormControl>
|
||||||
|
<Switch checked={field.value} onCheckedChange={field.onChange} />
|
||||||
|
</FormControl>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<DialogFooter>
|
||||||
|
<Button type='submit'>
|
||||||
|
{editingVersion ? t('version.update') : t('version.create')}
|
||||||
|
</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</form>
|
||||||
|
</Form>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -56,6 +56,7 @@ import { useRef, useState } from 'react';
|
|||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
import { subscribeSchema } from './schema';
|
||||||
import { TemplatePreview } from './template-preview';
|
import { TemplatePreview } from './template-preview';
|
||||||
|
|
||||||
const createClientFormSchema = (t: any) =>
|
const createClientFormSchema = (t: any) =>
|
||||||
@ -313,7 +314,21 @@ export function ProtocolForm() {
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
request={request}
|
request={request}
|
||||||
header={{
|
header={{
|
||||||
title: <h2 className='text-lg font-semibold'>{t('protocol.title')}</h2>,
|
title: (
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<h2 className='text-lg font-semibold'>{t('protocol.title')}</h2>
|
||||||
|
<a
|
||||||
|
href='https://github.com/perfect-panel/subscription-template'
|
||||||
|
target='_blank'
|
||||||
|
rel='noreferrer'
|
||||||
|
className='text-primary inline-flex items-center gap-2 rounded-md px-3 py-1 text-sm font-medium hover:underline'
|
||||||
|
>
|
||||||
|
<Icon icon='mdi:github' className='h-4 w-4' />
|
||||||
|
<span>Template Repo</span>
|
||||||
|
<Icon icon='mdi:open-in-new' className='text-muted-foreground h-4 w-4' />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
toolbar: <Button onClick={handleAdd}>{t('actions.add')}</Button>,
|
toolbar: <Button onClick={handleAdd}>{t('actions.add')}</Button>,
|
||||||
}}
|
}}
|
||||||
actions={{
|
actions={{
|
||||||
@ -648,137 +663,7 @@ export function ProtocolForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<GoTemplateEditor
|
<GoTemplateEditor
|
||||||
showLineNumbers
|
showLineNumbers
|
||||||
schema={{
|
schema={subscribeSchema}
|
||||||
SiteName: { type: 'string', description: 'Site name' },
|
|
||||||
SubscribeName: { type: 'string', description: 'Subscribe name' },
|
|
||||||
Proxies: {
|
|
||||||
type: 'array',
|
|
||||||
description: 'Array of proxy nodes',
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
Name: { type: 'string', description: 'Node name' },
|
|
||||||
Server: { type: 'string', description: 'Server host' },
|
|
||||||
Port: { type: 'number', description: 'Server port' },
|
|
||||||
Type: { type: 'string', description: 'Proxy type' },
|
|
||||||
Tags: {
|
|
||||||
type: 'array',
|
|
||||||
description: 'Node tags',
|
|
||||||
items: { type: 'string' },
|
|
||||||
},
|
|
||||||
Sort: { type: 'number', description: 'Node sort order' },
|
|
||||||
// Security Options
|
|
||||||
Security: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Security protocol',
|
|
||||||
},
|
|
||||||
SNI: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Server Name Indication for TLS',
|
|
||||||
},
|
|
||||||
AllowInsecure: {
|
|
||||||
type: 'boolean',
|
|
||||||
description:
|
|
||||||
'Allow insecure connections (skip certificate verification)',
|
|
||||||
},
|
|
||||||
Fingerprint: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Client fingerprint for TLS connections',
|
|
||||||
},
|
|
||||||
RealityServerAddr: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Reality server address',
|
|
||||||
},
|
|
||||||
RealityServerPort: {
|
|
||||||
type: 'number',
|
|
||||||
description: 'Reality server port',
|
|
||||||
},
|
|
||||||
RealityPrivateKey: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Reality private key for authentication',
|
|
||||||
},
|
|
||||||
RealityPublicKey: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Reality public key for authentication',
|
|
||||||
},
|
|
||||||
RealityShortId: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Reality short ID for authentication',
|
|
||||||
},
|
|
||||||
// Transport Options
|
|
||||||
Transport: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Transport protocol (e.g., ws, http, grpc)',
|
|
||||||
},
|
|
||||||
Host: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'For WebSocket/HTTP/HTTPS',
|
|
||||||
},
|
|
||||||
Path: { type: 'string', description: 'For HTTP/HTTPS' },
|
|
||||||
ServiceName: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'For gRPC',
|
|
||||||
},
|
|
||||||
// Shadowsocks Options
|
|
||||||
Method: { type: 'string', description: 'Encryption method' },
|
|
||||||
ServerKey: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'For Shadowsocks 2022',
|
|
||||||
},
|
|
||||||
// Vmess/Vless/Trojan Options
|
|
||||||
Flow: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Flow for Vmess/Vless/Trojan',
|
|
||||||
},
|
|
||||||
// Hysteria2 Options
|
|
||||||
HopPorts: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Comma-separated list of hop ports',
|
|
||||||
},
|
|
||||||
HopInterval: {
|
|
||||||
type: 'number',
|
|
||||||
description: 'Interval for hop ports in seconds',
|
|
||||||
},
|
|
||||||
ObfsPassword: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Obfuscation password for Hysteria2',
|
|
||||||
},
|
|
||||||
// Tuic Options
|
|
||||||
DisableSNI: {
|
|
||||||
type: 'boolean',
|
|
||||||
description: 'Disable SNI',
|
|
||||||
},
|
|
||||||
ReduceRtt: {
|
|
||||||
type: 'boolean',
|
|
||||||
description: 'Reduce RTT',
|
|
||||||
},
|
|
||||||
UDPRelayMode: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'UDP relay mode (e.g., "full", "partial")',
|
|
||||||
},
|
|
||||||
CongestionController: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Congestion controller (e.g., "cubic", "bbr")',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
UserInfo: {
|
|
||||||
type: 'object',
|
|
||||||
description: 'User information',
|
|
||||||
properties: {
|
|
||||||
Password: { type: 'string', description: 'User password' },
|
|
||||||
ExpiredAt: { type: 'string', description: 'Expiration date' },
|
|
||||||
Download: { type: 'number', description: 'Downloaded bytes' },
|
|
||||||
Upload: { type: 'number', description: 'Uploaded bytes' },
|
|
||||||
Traffic: { type: 'number', description: 'Total traffic bytes' },
|
|
||||||
SubscribeURL: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Subscription URL',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
enableSprig
|
enableSprig
|
||||||
value={field.value || ''}
|
value={field.value || ''}
|
||||||
onChange={(value) => field.onChange(value)}
|
onChange={(value) => field.onChange(value)}
|
||||||
|
|||||||
225
apps/admin/app/dashboard/subscribe/schema.ts
Normal file
225
apps/admin/app/dashboard/subscribe/schema.ts
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
export const subscribeSchema = {
|
||||||
|
SiteName: { type: 'string', description: 'Site name' },
|
||||||
|
SubscribeName: { type: 'string', description: 'Subscribe name' },
|
||||||
|
Proxies: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'Array of proxy nodes',
|
||||||
|
items: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
Name: { type: 'string', description: 'Node name' },
|
||||||
|
Server: { type: 'string', description: 'Server host' },
|
||||||
|
Port: { type: 'number', description: 'Server port' },
|
||||||
|
Type: { type: 'string', description: 'Proxy type' },
|
||||||
|
Tags: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'Node tags',
|
||||||
|
items: { type: 'string' },
|
||||||
|
},
|
||||||
|
Sort: { type: 'number', description: 'Node sort order' },
|
||||||
|
// Security Options
|
||||||
|
Security: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Security protocol',
|
||||||
|
},
|
||||||
|
SNI: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Server Name Indication for TLS',
|
||||||
|
},
|
||||||
|
AllowInsecure: {
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'Allow insecure connections (skip certificate verification)',
|
||||||
|
},
|
||||||
|
Fingerprint: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Client fingerprint for TLS connections',
|
||||||
|
},
|
||||||
|
RealityServerAddr: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Reality server address',
|
||||||
|
},
|
||||||
|
RealityServerPort: {
|
||||||
|
type: 'number',
|
||||||
|
description: 'Reality server port',
|
||||||
|
},
|
||||||
|
RealityPrivateKey: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Reality private key for authentication',
|
||||||
|
},
|
||||||
|
RealityPublicKey: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Reality public key for authentication',
|
||||||
|
},
|
||||||
|
RealityShortId: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Reality short ID for authentication',
|
||||||
|
},
|
||||||
|
// Transport Options
|
||||||
|
Transport: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Transport protocol (e.g., ws, http, grpc)',
|
||||||
|
},
|
||||||
|
Host: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'For WebSocket/HTTP/HTTPS',
|
||||||
|
},
|
||||||
|
Path: { type: 'string', description: 'For HTTP/HTTPS' },
|
||||||
|
ServiceName: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'For gRPC',
|
||||||
|
},
|
||||||
|
// Shadowsocks Options
|
||||||
|
Method: { type: 'string', description: 'Encryption method' },
|
||||||
|
ServerKey: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'For Shadowsocks 2022',
|
||||||
|
},
|
||||||
|
// Vmess/Vless/Trojan Options
|
||||||
|
Flow: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Flow for Vmess/Vless/Trojan',
|
||||||
|
},
|
||||||
|
// Hysteria2 Options
|
||||||
|
HopPorts: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Comma-separated list of hop ports',
|
||||||
|
},
|
||||||
|
HopInterval: {
|
||||||
|
type: 'number',
|
||||||
|
description: 'Interval for hop ports in seconds',
|
||||||
|
},
|
||||||
|
ObfsPassword: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Obfuscation password for Hysteria2',
|
||||||
|
},
|
||||||
|
// Tuic Options
|
||||||
|
DisableSNI: {
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'Disable SNI',
|
||||||
|
},
|
||||||
|
ReduceRtt: {
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'Reduce RTT',
|
||||||
|
},
|
||||||
|
UDPRelayMode: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'UDP relay mode (e.g., "full", "partial")',
|
||||||
|
},
|
||||||
|
CongestionController: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Congestion controller (e.g., "cubic", "bbr")',
|
||||||
|
},
|
||||||
|
// Hysteria2 additional options
|
||||||
|
UpMbps: {
|
||||||
|
type: 'number',
|
||||||
|
description: 'Upload bandwidth in Mbps',
|
||||||
|
},
|
||||||
|
DownMbps: {
|
||||||
|
type: 'number',
|
||||||
|
description: 'Download bandwidth in Mbps',
|
||||||
|
},
|
||||||
|
// VLESS encryption options
|
||||||
|
Encryption: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Encryption type for VLESS',
|
||||||
|
},
|
||||||
|
EncryptionMode: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Encryption mode (e.g., "native", "xorpub", "random")',
|
||||||
|
},
|
||||||
|
EncryptionRtt: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Encryption RTT (e.g., "0rtt", "1rtt")',
|
||||||
|
},
|
||||||
|
EncryptionTicket: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Encryption ticket',
|
||||||
|
},
|
||||||
|
EncryptionServerPadding: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Server padding for encryption',
|
||||||
|
},
|
||||||
|
EncryptionClientPadding: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Client padding for encryption',
|
||||||
|
},
|
||||||
|
EncryptionPassword: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Encryption password',
|
||||||
|
},
|
||||||
|
EncryptionPrivateKey: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Private key for encryption',
|
||||||
|
},
|
||||||
|
// XHTTP options
|
||||||
|
XhttpMode: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'XHTTP mode (e.g., "auto", "packet-up", "stream-up", "stream-one")',
|
||||||
|
},
|
||||||
|
XhttpExtra: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'XHTTP extra parameters',
|
||||||
|
},
|
||||||
|
// Shadowsocks obfs options (combined with Hysteria2 obfs)
|
||||||
|
ObfsHost: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Obfuscation host',
|
||||||
|
},
|
||||||
|
ObfsPath: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Obfuscation path',
|
||||||
|
},
|
||||||
|
// Shadowsocks cipher
|
||||||
|
Cipher: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Shadowsocks cipher method',
|
||||||
|
},
|
||||||
|
// AnyTLS options
|
||||||
|
PaddingScheme: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Padding scheme for AnyTLS',
|
||||||
|
},
|
||||||
|
// Mieru options
|
||||||
|
Multiplex: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Multiplex level (e.g., "none", "low", "middle", "high")',
|
||||||
|
},
|
||||||
|
// General protocol field
|
||||||
|
Enable: {
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'Whether this protocol is enabled',
|
||||||
|
},
|
||||||
|
// UUID for vmess/vless
|
||||||
|
UUID: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'User UUID for vmess/vless protocols',
|
||||||
|
},
|
||||||
|
// Alternative ID for vmess
|
||||||
|
AlterId: {
|
||||||
|
type: 'number',
|
||||||
|
description: 'Alternative ID for vmess (deprecated)',
|
||||||
|
},
|
||||||
|
// Password for trojan/tuic
|
||||||
|
Password: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Password for authentication',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
UserInfo: {
|
||||||
|
type: 'object',
|
||||||
|
description: 'User information',
|
||||||
|
properties: {
|
||||||
|
Password: { type: 'string', description: 'User password' },
|
||||||
|
ExpiredAt: { type: 'string', description: 'Expiration date' },
|
||||||
|
Download: { type: 'number', description: 'Downloaded bytes' },
|
||||||
|
Upload: { type: 'number', description: 'Uploaded bytes' },
|
||||||
|
Traffic: { type: 'number', description: 'Total traffic bytes' },
|
||||||
|
SubscribeURL: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'Subscription URL',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -3,9 +3,15 @@
|
|||||||
import { previewSubscribeTemplate } from '@/services/admin/application';
|
import { previewSubscribeTemplate } from '@/services/admin/application';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@workspace/ui/components/sheet';
|
import {
|
||||||
|
Sheet,
|
||||||
|
SheetContent,
|
||||||
|
SheetHeader,
|
||||||
|
SheetTitle,
|
||||||
|
SheetTrigger,
|
||||||
|
} from '@workspace/ui/components/sheet';
|
||||||
|
import { MonacoEditor } from '@workspace/ui/custom-components/editor/monaco-editor';
|
||||||
import { Icon } from '@workspace/ui/custom-components/icon';
|
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||||
import { Markdown } from '@workspace/ui/custom-components/markdown';
|
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
@ -27,7 +33,6 @@ export function TemplatePreview({ applicationId, output_format }: TemplatePrevie
|
|||||||
|
|
||||||
const originalContent = data?.data?.data?.template || '';
|
const originalContent = data?.data?.data?.template || '';
|
||||||
const errorMessage = (error as any)?.data?.msg || error?.message || t('failed');
|
const errorMessage = (error as any)?.data?.msg || error?.message || t('failed');
|
||||||
const displayContent = originalContent || (error ? errorMessage : '');
|
|
||||||
|
|
||||||
const getDecodedContent = () => {
|
const getDecodedContent = () => {
|
||||||
if (output_format === 'base64' && originalContent) {
|
if (output_format === 'base64' && originalContent) {
|
||||||
@ -41,49 +46,61 @@ export function TemplatePreview({ applicationId, output_format }: TemplatePrevie
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getDisplayContent = () => {
|
const getDisplayContent = () => {
|
||||||
|
if (error) return errorMessage;
|
||||||
|
if (!originalContent) return '';
|
||||||
switch (output_format) {
|
switch (output_format) {
|
||||||
case 'base64':
|
case 'base64': {
|
||||||
return `\`\`\`base64\n# ${t('base64.originalContent')}\n${displayContent}\n\n# ${t('base64.decodedContent')}\n${getDecodedContent()}\n\`\`\``;
|
const decoded = getDecodedContent();
|
||||||
case 'yaml':
|
return `${t('base64.originalContent')}:\n${originalContent}\n\n${t('base64.decodedContent')}:\n${decoded}`;
|
||||||
return `\`\`\`yaml\n${displayContent}\n\`\`\``;
|
}
|
||||||
case 'json':
|
|
||||||
return `\`\`\`json\n${displayContent}\n\`\`\``;
|
|
||||||
case 'conf':
|
|
||||||
return `\`\`\`ini\n${displayContent}\n\`\`\``;
|
|
||||||
case 'plain':
|
|
||||||
return `\`\`\`text\n${displayContent}\n\`\`\``;
|
|
||||||
default:
|
default:
|
||||||
return displayContent;
|
return originalContent;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const mapLanguage = (fmt?: string) => {
|
||||||
|
switch (fmt) {
|
||||||
|
case 'json':
|
||||||
|
return 'json';
|
||||||
|
case 'yaml':
|
||||||
|
return 'yaml';
|
||||||
|
case 'base64':
|
||||||
|
return 'ini';
|
||||||
|
case 'plain':
|
||||||
|
return 'ini';
|
||||||
|
case 'conf':
|
||||||
|
return 'ini';
|
||||||
|
default:
|
||||||
|
return 'ini';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOpenChange = (newOpen: boolean) => {
|
|
||||||
setIsOpen(newOpen);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Sheet open={isOpen} onOpenChange={setIsOpen}>
|
||||||
<Button variant='ghost' size='sm' onClick={() => setIsOpen(true)}>
|
<SheetTrigger asChild>
|
||||||
<Icon icon='mdi:eye' className='mr-2 h-4 w-4' />
|
<Button variant='ghost'>
|
||||||
{t('preview')}
|
<Icon icon='mdi:eye' className='h-4 w-4' />
|
||||||
</Button>
|
{t('preview')}
|
||||||
<Sheet open={isOpen} onOpenChange={handleOpenChange}>
|
</Button>
|
||||||
<SheetContent className='w-[800px] max-w-[90vw] md:max-w-screen-md'>
|
</SheetTrigger>
|
||||||
<SheetHeader>
|
<SheetHeader>
|
||||||
<SheetTitle>{t('title')}</SheetTitle>
|
<SheetTitle></SheetTitle>
|
||||||
</SheetHeader>
|
</SheetHeader>
|
||||||
{isLoading ? (
|
<SheetContent className='w-[800px] max-w-[90vw] pt-10 md:max-w-screen-md'>
|
||||||
<div className='flex items-center justify-center'>
|
{isLoading ? (
|
||||||
<Icon icon='mdi:loading' className='h-6 w-6 animate-spin' />
|
<div className='flex items-center justify-center'>
|
||||||
<span className='ml-2'>{t('loading')}</span>
|
<Icon icon='mdi:loading' className='h-6 w-6 animate-spin' />
|
||||||
</div>
|
<span className='ml-2'>{t('loading')}</span>
|
||||||
) : (
|
</div>
|
||||||
<div className='*:text-sm [&_pre>div>div+div]:max-h-[calc(100dvh-48px-36px-36px)] [&_pre>div>div+div]:overflow-auto'>
|
) : (
|
||||||
<Markdown>{getDisplayContent()}</Markdown>
|
<MonacoEditor
|
||||||
</div>
|
title={t('title')}
|
||||||
)}
|
value={getDisplayContent()}
|
||||||
</SheetContent>
|
language={mapLanguage(output_format)}
|
||||||
</Sheet>
|
showLineNumbers
|
||||||
</>
|
readOnly
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</SheetContent>
|
||||||
|
</Sheet>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,7 @@ const currencySchema = z.object({
|
|||||||
access_key: z.string().optional(),
|
access_key: z.string().optional(),
|
||||||
currency_unit: z.string().min(1),
|
currency_unit: z.string().min(1),
|
||||||
currency_symbol: z.string().min(1),
|
currency_symbol: z.string().min(1),
|
||||||
|
fixed_rate: z.number().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
type CurrencyFormData = z.infer<typeof currencySchema>;
|
type CurrencyFormData = z.infer<typeof currencySchema>;
|
||||||
@ -62,6 +63,7 @@ export default function CurrencyConfig() {
|
|||||||
access_key: '',
|
access_key: '',
|
||||||
currency_unit: 'USD',
|
currency_unit: 'USD',
|
||||||
currency_symbol: '$',
|
currency_symbol: '$',
|
||||||
|
fixed_rate: 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -170,6 +172,26 @@ export default function CurrencyConfig() {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name='fixed_rate'
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t('currency.fixedRate')}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<EnhancedInput
|
||||||
|
type='number'
|
||||||
|
placeholder={t('currency.fixedRatePlaceholder', { defaultValue: '0' })}
|
||||||
|
value={field.value}
|
||||||
|
onValueChange={(val) => field.onChange(Number(val))}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>{t('currency.fixedRateDescription')}</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
|
||||||
import { getRegisterConfig, updateRegisterConfig } from '@/services/admin/system';
|
import { getRegisterConfig, updateRegisterConfig } from '@/services/admin/system';
|
||||||
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
@ -61,17 +61,7 @@ export default function RegisterConfig() {
|
|||||||
enabled: open,
|
enabled: open,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: subscribe } = useQuery({
|
const { subscribes } = useSubscribe();
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 9999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.Subscribe[];
|
|
||||||
},
|
|
||||||
enabled: open,
|
|
||||||
});
|
|
||||||
|
|
||||||
const form = useForm<RegisterFormData>({
|
const form = useForm<RegisterFormData>({
|
||||||
resolver: zodResolver(registerSchema),
|
resolver: zodResolver(registerSchema),
|
||||||
@ -268,12 +258,10 @@ export default function RegisterConfig() {
|
|||||||
field.onChange(value);
|
field.onChange(value);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
options={
|
options={subscribes?.map((item) => ({
|
||||||
subscribe?.map((item) => ({
|
label: item.name!,
|
||||||
label: item.name,
|
value: item.id!,
|
||||||
value: item.id,
|
}))}
|
||||||
})) || []
|
|
||||||
}
|
|
||||||
className='bg-secondary w-32 rounded-r-none'
|
className='bg-secondary w-32 rounded-r-none'
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { Display } from '@/components/display';
|
|
||||||
import { ProTable, ProTableActions } from '@/components/pro-table';
|
import { ProTable, ProTableActions } from '@/components/pro-table';
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
|
||||||
import {
|
import {
|
||||||
createUser,
|
createUser,
|
||||||
deleteUser,
|
deleteUser,
|
||||||
@ -10,9 +8,9 @@ import {
|
|||||||
getUserList,
|
getUserList,
|
||||||
updateUserBasicInfo,
|
updateUserBasicInfo,
|
||||||
} from '@/services/admin/user';
|
} from '@/services/admin/user';
|
||||||
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { formatDate } from '@/utils/common';
|
import { formatDate } from '@/utils/common';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@ -20,6 +18,13 @@ import {
|
|||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@workspace/ui/components/dropdown-menu';
|
} from '@workspace/ui/components/dropdown-menu';
|
||||||
|
import { Input } from '@workspace/ui/components/input';
|
||||||
|
import {
|
||||||
|
Popover,
|
||||||
|
PopoverClose,
|
||||||
|
PopoverContent,
|
||||||
|
PopoverTrigger,
|
||||||
|
} from '@workspace/ui/components/popover';
|
||||||
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
import { ScrollArea } from '@workspace/ui/components/scroll-area';
|
||||||
import {
|
import {
|
||||||
Sheet,
|
Sheet,
|
||||||
@ -31,6 +36,7 @@ import {
|
|||||||
import { Switch } from '@workspace/ui/components/switch';
|
import { Switch } from '@workspace/ui/components/switch';
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs';
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs';
|
||||||
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
||||||
|
import { FilePenLine } from 'lucide-react';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useSearchParams } from 'next/navigation';
|
import { useSearchParams } from 'next/navigation';
|
||||||
@ -38,37 +44,88 @@ import { useRef, useState } from 'react';
|
|||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { UserDetail } from './user-detail';
|
import { UserDetail } from './user-detail';
|
||||||
import UserForm from './user-form';
|
import UserForm from './user-form';
|
||||||
import { AuthMethodsForm } from './user-profile/auth-methods-form';
|
|
||||||
import { BasicInfoForm } from './user-profile/basic-info-form';
|
import { BasicInfoForm } from './user-profile/basic-info-form';
|
||||||
import { NotifySettingsForm } from './user-profile/notify-settings-form';
|
import { NotifySettingsForm } from './user-profile/notify-settings-form';
|
||||||
import UserSubscription from './user-subscription';
|
import UserSubscription from './user-subscription';
|
||||||
|
|
||||||
|
function getDeviceTypeInfo(userAgent = '') {
|
||||||
|
let deviceType = 'Unknown';
|
||||||
|
const ua = userAgent.toLowerCase();
|
||||||
|
|
||||||
|
if (ua.includes('android')) {
|
||||||
|
deviceType = 'Android';
|
||||||
|
} else if (ua.includes('iphone') || ua.includes('ios')) {
|
||||||
|
deviceType = 'iPhone';
|
||||||
|
} else if (ua.includes('ipad')) {
|
||||||
|
deviceType = 'iPad';
|
||||||
|
} else if (ua.includes('mac os') || ua.includes('mac')) {
|
||||||
|
deviceType = 'Mac';
|
||||||
|
} else if (ua.includes('windows')) {
|
||||||
|
deviceType = 'Windows';
|
||||||
|
} else if (ua.includes('linux')) {
|
||||||
|
deviceType = 'Linux';
|
||||||
|
}
|
||||||
|
|
||||||
|
return { deviceType };
|
||||||
|
}
|
||||||
|
|
||||||
|
// 为 RemarkForm 组件定义 props 类型
|
||||||
|
interface RemarkFormProps {
|
||||||
|
initialRemark?: string | null;
|
||||||
|
onSave: (remark: string) => void;
|
||||||
|
CloseComponent: React.ComponentType<{ asChild?: boolean; children: React.ReactNode }>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新的子组件,在管理它自己的备注状态
|
||||||
|
const RemarkForm: React.FC<RemarkFormProps> = ({ onSave, initialRemark, CloseComponent }) => {
|
||||||
|
const [remark, setRemark] = useState<string>(initialRemark ?? '');
|
||||||
|
|
||||||
|
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setRemark(event.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSaveClick = () => {
|
||||||
|
onSave(remark);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='mb-2 text-sm font-semibold'>备注</div>
|
||||||
|
<Input
|
||||||
|
type='text'
|
||||||
|
value={remark}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
placeholder='在此输入备注...'
|
||||||
|
className='w-full'
|
||||||
|
/>
|
||||||
|
<CloseComponent asChild>
|
||||||
|
<Button onClick={handleSaveClick} variant='default' size={'sm'} className={'mt-2'}>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</CloseComponent>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const t = useTranslations('user');
|
const t = useTranslations('user');
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
const sp = useSearchParams();
|
const sp = useSearchParams();
|
||||||
|
|
||||||
const { data: subscribeList } = useQuery({
|
const { subscribes } = useSubscribe();
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 9999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.SubscribeGroup[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const initialFilters = {
|
const initialFilters = {
|
||||||
search: sp.get('search') || undefined,
|
search: sp.get('search') || undefined,
|
||||||
user_id: sp.get('user_id') || undefined,
|
user_id: sp.get('user_id') || undefined,
|
||||||
subscribe_id: sp.get('subscribe_id') || undefined,
|
subscribe_id: sp.get('subscribe_id') || undefined,
|
||||||
user_subscribe_id: sp.get('user_subscribe_id') || undefined,
|
user_subscribe_id: sp.get('user_subscribe_id') || undefined,
|
||||||
|
device_id: sp.get('device_id') || undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProTable<API.User, API.GetUserListParams>
|
<ProTable<API.User, API.GetUserListParams>
|
||||||
|
key={initialFilters.user_id}
|
||||||
action={ref}
|
action={ref}
|
||||||
initialFilters={initialFilters}
|
initialFilters={initialFilters}
|
||||||
header={{
|
header={{
|
||||||
@ -136,20 +193,96 @@ export default function Page() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'auth_methods',
|
accessorKey: 'auth_methods',
|
||||||
header: t('userName'),
|
header: '绑定邮箱',
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const method = row.original.auth_methods?.[0];
|
const method = row.original.auth_methods;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Badge className='mr-1 uppercase' title={method?.verified ? t('verified') : ''}>
|
<Popover>
|
||||||
{method?.auth_type}
|
<PopoverTrigger>
|
||||||
</Badge>
|
<div className={'flex items-center'}>
|
||||||
{method?.auth_identifier}
|
{method?.find((v) => v.auth_type === 'email')?.auth_identifier || '待绑定'}
|
||||||
|
{row.original?.remark ? `(${row.original.remark})` : ''}
|
||||||
|
<FilePenLine size={14} className={'text-primary ml-2'} />
|
||||||
|
</div>
|
||||||
|
</PopoverTrigger>
|
||||||
|
<PopoverContent className={'w-64'}>
|
||||||
|
<RemarkForm
|
||||||
|
initialRemark={row.original.remark}
|
||||||
|
CloseComponent={PopoverClose}
|
||||||
|
onSave={async (remark) => {
|
||||||
|
const {
|
||||||
|
auth_methods,
|
||||||
|
user_devices,
|
||||||
|
enable_balance_notify,
|
||||||
|
enable_login_notify,
|
||||||
|
enable_subscribe_notify,
|
||||||
|
enable_trade_notify,
|
||||||
|
updated_at,
|
||||||
|
created_at,
|
||||||
|
id,
|
||||||
|
...rest
|
||||||
|
} = row.original;
|
||||||
|
await updateUserBasicInfo({
|
||||||
|
user_id: id,
|
||||||
|
...rest,
|
||||||
|
remark,
|
||||||
|
} as unknown as API.UpdateUserBasiceInfoRequest);
|
||||||
|
toast.success(t('updateSuccess'));
|
||||||
|
ref.current?.refresh();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</PopoverContent>
|
||||||
|
</Popover>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
accessorKey: 'user_devices',
|
||||||
|
header: '绑定设备',
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const devices = row?.original.user_devices ?? [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
|
||||||
|
{devices.map((v, index) => {
|
||||||
|
const { deviceType } = getDeviceTypeInfo(v.user_agent);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div key={v.id + '_wrapper'}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
padding: '4px 6px',
|
||||||
|
background: '#f8f8f8',
|
||||||
|
borderRadius: '4px',
|
||||||
|
border: '1px solid #e0e0e0',
|
||||||
|
fontSize: '12px',
|
||||||
|
lineHeight: '16px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ fontWeight: 500 }}>
|
||||||
|
ID:{v.id}({deviceType})
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{index !== devices.length - 1 && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
height: '1px',
|
||||||
|
background: '#eee',
|
||||||
|
margin: '4px 0',
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/*{
|
||||||
accessorKey: 'balance',
|
accessorKey: 'balance',
|
||||||
header: t('balance'),
|
header: t('balance'),
|
||||||
cell: ({ row }) => <Display type='currency' value={row.getValue('balance')} />,
|
cell: ({ row }) => <Display type='currency' value={row.getValue('balance')} />,
|
||||||
@ -163,12 +296,31 @@ export default function Page() {
|
|||||||
accessorKey: 'commission',
|
accessorKey: 'commission',
|
||||||
header: t('commission'),
|
header: t('commission'),
|
||||||
cell: ({ row }) => <Display type='currency' value={row.getValue('commission')} />,
|
cell: ({ row }) => <Display type='currency' value={row.getValue('commission')} />,
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
accessorKey: 'refer_code',
|
accessorKey: 'refer_code',
|
||||||
header: t('inviteCode'),
|
header: t('inviteCode'),
|
||||||
cell: ({ row }) => row.getValue('refer_code') || '--',
|
cell: ({ row }) => row.getValue('refer_code') || '--',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'last_login_time',
|
||||||
|
header: '最后登录时间',
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const v = (row.original as any)?.last_login_time;
|
||||||
|
if (!v) return '---';
|
||||||
|
const ts = Number(v);
|
||||||
|
const ms = ts < 1e12 ? ts * 1000 : ts;
|
||||||
|
return formatDate(ms) as any;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'member_status',
|
||||||
|
header: '会员状态',
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const v = (row.original as any)?.member_status;
|
||||||
|
return <span className='text-sm'>{v ?? '---'}</span>;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'referer_id',
|
accessorKey: 'referer_id',
|
||||||
header: t('referer'),
|
header: t('referer'),
|
||||||
@ -194,9 +346,9 @@ export default function Page() {
|
|||||||
{
|
{
|
||||||
key: 'subscribe_id',
|
key: 'subscribe_id',
|
||||||
placeholder: t('subscription'),
|
placeholder: t('subscription'),
|
||||||
options: subscribeList?.map((item) => ({
|
options: subscribes?.map((item) => ({
|
||||||
label: item.name,
|
label: item.name!,
|
||||||
value: String(item.id),
|
value: String(item.id!),
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -211,6 +363,10 @@ export default function Page() {
|
|||||||
key: 'user_subscribe_id',
|
key: 'user_subscribe_id',
|
||||||
placeholder: t('subscriptionId'),
|
placeholder: t('subscriptionId'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'device_id',
|
||||||
|
placeholder: '设备id',
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
actions={{
|
actions={{
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
@ -289,7 +445,7 @@ function ProfileSheet({ userId }: { userId: number }) {
|
|||||||
<TabsList className='mb-3'>
|
<TabsList className='mb-3'>
|
||||||
<TabsTrigger value='basic'>{t('basicInfoTitle')}</TabsTrigger>
|
<TabsTrigger value='basic'>{t('basicInfoTitle')}</TabsTrigger>
|
||||||
<TabsTrigger value='notify'>{t('notifySettingsTitle')}</TabsTrigger>
|
<TabsTrigger value='notify'>{t('notifySettingsTitle')}</TabsTrigger>
|
||||||
<TabsTrigger value='auth'>{t('authMethodsTitle')}</TabsTrigger>
|
{/*<TabsTrigger value='auth'>{t('authMethodsTitle')}</TabsTrigger>*/}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
<TabsContent value='basic' className='mt-0'>
|
<TabsContent value='basic' className='mt-0'>
|
||||||
<BasicInfoForm user={user} refetch={refetch as any} />
|
<BasicInfoForm user={user} refetch={refetch as any} />
|
||||||
@ -297,9 +453,9 @@ function ProfileSheet({ userId }: { userId: number }) {
|
|||||||
<TabsContent value='notify' className='mt-0'>
|
<TabsContent value='notify' className='mt-0'>
|
||||||
<NotifySettingsForm user={user} refetch={refetch as any} />
|
<NotifySettingsForm user={user} refetch={refetch as any} />
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
<TabsContent value='auth' className='mt-0'>
|
{/*<TabsContent value='auth' className='mt-0'>
|
||||||
<AuthMethodsForm user={user} refetch={refetch as any} />
|
<AuthMethodsForm user={user} refetch={refetch as any} />
|
||||||
</TabsContent>
|
</TabsContent>*/}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -148,7 +148,8 @@ export function UserDetail({ id }: { id: number }) {
|
|||||||
|
|
||||||
const identifier =
|
const identifier =
|
||||||
data?.auth_methods.find((m) => m.auth_type === 'email')?.auth_identifier ||
|
data?.auth_methods.find((m) => m.auth_type === 'email')?.auth_identifier ||
|
||||||
data?.auth_methods[0]?.auth_identifier;
|
`设备Id:${data?.user_devices[0]?.id}` ||
|
||||||
|
'账号不存在';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverCard>
|
<HoverCard>
|
||||||
|
|||||||
@ -170,6 +170,7 @@ export default function UserForm<T extends Record<string, any>>({
|
|||||||
<FormLabel>{t('password')}</FormLabel>
|
<FormLabel>{t('password')}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
|
autoComplete='new-password'
|
||||||
placeholder={t('passwordPlaceholder')}
|
placeholder={t('passwordPlaceholder')}
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { Display } from '@/components/display';
|
import { Display } from '@/components/display';
|
||||||
import { ProTable, ProTableActions } from '@/components/pro-table';
|
import { ProTable, ProTableActions } from '@/components/pro-table';
|
||||||
|
import useGlobalStore from '@/config/use-global';
|
||||||
import {
|
import {
|
||||||
createUserSubscribe,
|
createUserSubscribe,
|
||||||
deleteUserSubscribe,
|
deleteUserSubscribe,
|
||||||
@ -28,6 +29,7 @@ export default function UserSubscription({ userId }: { userId: number }) {
|
|||||||
const t = useTranslations('user');
|
const t = useTranslations('user');
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
|
const { getUserSubscribeUrls } = useGlobalStore();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProTable<API.UserSubscribe, Record<string, unknown>>
|
<ProTable<API.UserSubscribe, Record<string, unknown>>
|
||||||
@ -146,6 +148,16 @@ export default function UserSubscription({ userId }: { userId: number }) {
|
|||||||
return true;
|
return true;
|
||||||
}}
|
}}
|
||||||
/>,
|
/>,
|
||||||
|
<Button
|
||||||
|
key='copy'
|
||||||
|
variant='secondary'
|
||||||
|
onClick={async () => {
|
||||||
|
await navigator.clipboard.writeText(getUserSubscribeUrls(row.token)[0] || '');
|
||||||
|
toast.success(t('copySuccess'));
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t('copySubscription')}
|
||||||
|
</Button>,
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
key='delete'
|
key='delete'
|
||||||
trigger={<Button variant='destructive'>{t('delete')}</Button>}
|
trigger={<Button variant='destructive'>{t('delete')}</Button>}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { getSubscribeList } from '@/services/admin/subscribe';
|
import { useSubscribe } from '@/store/subscribe';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@ -74,16 +73,7 @@ export function SubscriptionForm({ trigger, title, loading, initialData, onSubmi
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: subscribe } = useQuery({
|
const { subscribes } = useSubscribe();
|
||||||
queryKey: ['getSubscribeList', 'all'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await getSubscribeList({
|
|
||||||
page: 1,
|
|
||||||
size: 9999,
|
|
||||||
});
|
|
||||||
return data.data?.list as API.Subscribe[];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sheet open={open} onOpenChange={setOpen}>
|
<Sheet open={open} onOpenChange={setOpen}>
|
||||||
@ -117,9 +107,9 @@ export function SubscriptionForm({ trigger, title, loading, initialData, onSubmi
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
form.setValue(field.name, value);
|
form.setValue(field.name, value);
|
||||||
}}
|
}}
|
||||||
options={subscribe?.map((item: API.Subscribe) => ({
|
options={subscribes?.map((item) => ({
|
||||||
value: item.id,
|
value: item.id!,
|
||||||
label: item.name,
|
label: item.name!,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export default function Statistics() {
|
|||||||
value: ServerTotal?.online_users || 0,
|
value: ServerTotal?.online_users || 0,
|
||||||
subtitle: t('currentlyOnline'),
|
subtitle: t('currentlyOnline'),
|
||||||
icon: 'uil:users-alt',
|
icon: 'uil:users-alt',
|
||||||
href: '/dashboard/users',
|
href: '/dashboard/user',
|
||||||
color: 'text-blue-600 dark:text-blue-400',
|
color: 'text-blue-600 dark:text-blue-400',
|
||||||
iconBg: 'bg-blue-100 dark:bg-blue-900/30',
|
iconBg: 'bg-blue-100 dark:bg-blue-900/30',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import useGlobalStore, { GlobalStore } from '@/config/use-global';
|
import useGlobalStore, { GlobalStore } from '@/config/use-global';
|
||||||
|
import { useStatsStore } from '@/store/stats';
|
||||||
import { Logout } from '@/utils/common';
|
import { Logout } from '@/utils/common';
|
||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
||||||
@ -42,6 +43,12 @@ export default function Providers({
|
|||||||
setCommon(common);
|
setCommon(common);
|
||||||
}, [setCommon, common]);
|
}, [setCommon, common]);
|
||||||
|
|
||||||
|
const { stats } = useStatsStore();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
stats();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NextThemesProvider attribute='class' defaultTheme='system' enableSystem>
|
<NextThemesProvider attribute='class' defaultTheme='system' enableSystem>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
|
|||||||
@ -77,6 +77,11 @@ export const navs = [
|
|||||||
icon: 'flat-color-icons:currency-exchange',
|
icon: 'flat-color-icons:currency-exchange',
|
||||||
},
|
},
|
||||||
{ title: 'ADS Config', url: '/dashboard/ads', icon: 'flat-color-icons:electrical-sensor' },
|
{ title: 'ADS Config', url: '/dashboard/ads', icon: 'flat-color-icons:electrical-sensor' },
|
||||||
|
{
|
||||||
|
title: 'Version Management',
|
||||||
|
url: '/dashboard/settings/version',
|
||||||
|
icon: 'flat-color-icons:kindle',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '@/config/constants';
|
||||||
|
import { extractDomain } from '@workspace/ui/utils';
|
||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
|
|
||||||
export interface GlobalStore {
|
export interface GlobalStore {
|
||||||
@ -5,9 +7,10 @@ export interface GlobalStore {
|
|||||||
user?: API.User;
|
user?: API.User;
|
||||||
setCommon: (common: Partial<API.GetGlobalConfigResponse>) => void;
|
setCommon: (common: Partial<API.GetGlobalConfigResponse>) => void;
|
||||||
setUser: (user?: API.User) => void;
|
setUser: (user?: API.User) => void;
|
||||||
|
getUserSubscribeUrls: (uuid: string, type?: string) => string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useGlobalStore = create<GlobalStore>((set) => ({
|
export const useGlobalStore = create<GlobalStore>((set, get) => ({
|
||||||
common: {
|
common: {
|
||||||
site: {
|
site: {
|
||||||
host: '',
|
host: '',
|
||||||
@ -42,6 +45,12 @@ export const useGlobalStore = create<GlobalStore>((set) => ({
|
|||||||
ip_register_limit: 0,
|
ip_register_limit: 0,
|
||||||
ip_register_limit_duration: 0,
|
ip_register_limit_duration: 0,
|
||||||
},
|
},
|
||||||
|
device: {
|
||||||
|
enable: false,
|
||||||
|
show_ads: false,
|
||||||
|
enable_security: false,
|
||||||
|
only_real_device: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
invite: {
|
invite: {
|
||||||
forced_invite: false,
|
forced_invite: false,
|
||||||
@ -77,6 +86,22 @@ export const useGlobalStore = create<GlobalStore>((set) => ({
|
|||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
setUser: (user) => set({ user }),
|
setUser: (user) => set({ user }),
|
||||||
|
getUserSubscribeUrls: (uuid: string, type?: string) => {
|
||||||
|
const { pan_domain, subscribe_domain, subscribe_path } = get().common.subscribe || {};
|
||||||
|
const domains = subscribe_domain
|
||||||
|
? subscribe_domain.split('\n')
|
||||||
|
: [extractDomain(NEXT_PUBLIC_API_URL || NEXT_PUBLIC_SITE_URL || '', pan_domain)];
|
||||||
|
|
||||||
|
return domains.map((domain) => {
|
||||||
|
if (pan_domain) {
|
||||||
|
if (type) return `https://${uuid}.${type}.${domain}`;
|
||||||
|
return `https://${uuid}.${domain}`;
|
||||||
|
} else {
|
||||||
|
if (type) return `https://${domain}${subscribe_path}?token=${uuid}&type=${type}`;
|
||||||
|
return `https://${domain}${subscribe_path}?token=${uuid}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useGlobalStore;
|
export default useGlobalStore;
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Vyberte protokol…",
|
"select_protocol": "Vyberte protokol…",
|
||||||
"select_server": "Vyberte server…",
|
"select_server": "Vyberte server…",
|
||||||
"server": "Server",
|
"server": "Server",
|
||||||
|
"sorted_success": "Úspěšně seřazeno",
|
||||||
"tags": "Štítky",
|
"tags": "Štítky",
|
||||||
"tags_description": "Štítek pro skupinování oprávnění (včetně vazby na plán a dodací politiky).",
|
"tags_description": "Štítek pro skupinování oprávnění (včetně vazby na plán a dodací politiky).",
|
||||||
"tags_placeholder": "Použijte Enter nebo čárku (,) pro přidání více štítků",
|
"tags_placeholder": "Použijte Enter nebo čárku (,) pro přidání více štítků",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Zrušit",
|
||||||
|
"save": "Uložit"
|
||||||
|
},
|
||||||
"address": "Adresa",
|
"address": "Adresa",
|
||||||
"address_placeholder": "Adresa serveru",
|
"address_placeholder": "Adresa serveru",
|
||||||
|
"apiHost": "API hostitel",
|
||||||
|
"apiHostPlaceholder": "http(s)://example.com",
|
||||||
"bandwidth_placeholder": "Zadejte šířku pásma, nechte prázdné pro BBR",
|
"bandwidth_placeholder": "Zadejte šířku pásma, nechte prázdné pro BBR",
|
||||||
"basic": "Základní konfigurace",
|
"basic": "Základní konfigurace",
|
||||||
"cancel": "Zrušit",
|
"cancel": "Zrušit",
|
||||||
|
"cert_dns_env": "DNS proměnné prostředí",
|
||||||
|
"cert_dns_provider": "DNS poskytovatel",
|
||||||
|
"cert_mode": "Režim certifikátu",
|
||||||
|
"cipher": "Šifrovací algoritmus",
|
||||||
"city": "Město",
|
"city": "Město",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Zrušit",
|
|
||||||
"save": "Uložit"
|
|
||||||
},
|
|
||||||
"communicationKey": "Komunikační klíč",
|
|
||||||
"communicationKeyDescription": "Používá se pro autentizaci uzlu.",
|
|
||||||
"description": "Spravujte klíče pro komunikaci uzlu, intervaly stahování/odesílání a dynamické multiplikátory.",
|
|
||||||
"dynamicMultiplier": "Dynamický multiplikátor",
|
|
||||||
"dynamicMultiplierDescription": "Definujte časové sloty a multiplikátory pro úpravu účtování provozu.",
|
|
||||||
"endTime": "Čas konce",
|
|
||||||
"inputPlaceholder": "Prosím zadejte",
|
|
||||||
"multiplier": "Multiplikátor",
|
|
||||||
"nodePullInterval": "Interval stahování uzlu",
|
|
||||||
"nodePullIntervalDescription": "Jak často uzel stahuje konfiguraci (vteřiny).",
|
|
||||||
"nodePushInterval": "Interval odesílání uzlu",
|
|
||||||
"nodePushIntervalDescription": "Jak často uzel odesílá statistiky (vteřiny).",
|
|
||||||
"reset": "Obnovit",
|
|
||||||
"save": "Uložit",
|
|
||||||
"saveSuccess": "Úspěšně uloženo",
|
|
||||||
"startTime": "Čas začátku",
|
|
||||||
"timeSlot": "Časový slot",
|
|
||||||
"title": "Konfigurace uzlu"
|
|
||||||
},
|
|
||||||
"confirm": "Potvrdit",
|
"confirm": "Potvrdit",
|
||||||
"confirmDeleteDesc": "Tuto akci nelze vrátit zpět.",
|
"confirmDeleteDesc": "Tuto akci nelze vrátit zpět.",
|
||||||
"confirmDeleteTitle": "Smazat tento server?",
|
"confirmDeleteTitle": "Smazat tento server?",
|
||||||
"congestion_controller": "Ovladač přetížení",
|
"congestion_controller": "Ovladač přetížení",
|
||||||
|
"connect": "Připojit",
|
||||||
"copied": "Zkopírováno",
|
"copied": "Zkopírováno",
|
||||||
"copy": "Kopírovat",
|
"copy": "Kopírovat",
|
||||||
"country": "Země",
|
"country": "Země",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Upravit server",
|
"drawerEditTitle": "Upravit server",
|
||||||
"edit": "Upravit",
|
"edit": "Upravit",
|
||||||
"enabled": "Povoleno",
|
"enabled": "Povoleno",
|
||||||
"encryption_method": "Metoda šifrování",
|
"encryption": "Metoda šifrování",
|
||||||
|
"encryption_client_padding": "Padding klienta",
|
||||||
|
"encryption_mode": "Režim",
|
||||||
|
"encryption_password": "Heslo",
|
||||||
|
"encryption_password_placeholder": "Nechte prázdné pro automatickou generaci, nahraďte ručně pro postkvantové šifrování",
|
||||||
|
"encryption_private_key": "Soukromý klíč",
|
||||||
|
"encryption_private_key_placeholder": "Nechte prázdné pro automatickou generaci, nahraďte ručně pro postkvantové šifrování",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Padding serveru",
|
||||||
|
"encryption_ticket": "Čas lístku",
|
||||||
"expireTime": "Čas vypršení",
|
"expireTime": "Čas vypršení",
|
||||||
"expired": "Vypršelo",
|
"expired": "Vypršelo",
|
||||||
|
"extra": "Další konfigurace",
|
||||||
"flow": "Tok",
|
"flow": "Tok",
|
||||||
|
"generate_quantum_resistant_key": "Generovat kvantově odolný klíč",
|
||||||
|
"generate_standard_encryption_key": "Generovat standardní šifrovací klíč",
|
||||||
"hop_interval": "Interval skoku",
|
"hop_interval": "Interval skoku",
|
||||||
"hop_ports": "Porty skoku",
|
"hop_ports": "Porty skoku",
|
||||||
"hop_ports_placeholder": "např. 1-65535",
|
"hop_ports_placeholder": "např. 1-65535",
|
||||||
"host": "Hostitel",
|
"host": "Hostitel",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Instalační příkaz",
|
||||||
"ipAddresses": "IP adresy",
|
"ipAddresses": "IP adresy",
|
||||||
"memory": "Paměť",
|
"memory": "Paměť",
|
||||||
"migrate": "Migrace dat",
|
"migrate": "Migrace dat",
|
||||||
"migrateFailed": "Migrace dat se nezdařila",
|
"migrateFailed": "Migrace dat se nezdařila",
|
||||||
"migrated": "Data byla úspěšně migrována",
|
"migrated": "Data byla úspěšně migrována",
|
||||||
"migrating": "Probíhá migrace...",
|
"migrating": "Probíhá migrace...",
|
||||||
|
"mode": "Režim",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Název",
|
"name": "Název",
|
||||||
"noData": "Žádná data",
|
"noData": "Žádná data",
|
||||||
"notAvailable": "Není k dispozici",
|
"notAvailable": "Není k dispozici",
|
||||||
|
"obfs": "Obfuskování",
|
||||||
|
"obfs_host": "Obfs hostitel",
|
||||||
"obfs_password": "Heslo pro obfuskaci",
|
"obfs_password": "Heslo pro obfuskaci",
|
||||||
"obfs_password_placeholder": "Zadejte heslo pro obfuskaci",
|
"obfs_password_placeholder": "Zadejte heslo pro obfuskaci",
|
||||||
|
"obfs_path": "Obfs cesta",
|
||||||
"offline": "Offline",
|
"offline": "Offline",
|
||||||
|
"oneClickInstall": "Instalace jedním kliknutím",
|
||||||
"online": "Online",
|
"online": "Online",
|
||||||
"onlineUsers": "Online uživatelé",
|
"onlineUsers": "Online uživatelé",
|
||||||
"padding_scheme": "Schéma vycpání",
|
"padding_scheme": "Schéma vycpání",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Servery",
|
"pageTitle": "Servery",
|
||||||
"path": "Cesta",
|
"path": "Cesta",
|
||||||
"please_select": "Prosím vyberte",
|
"please_select": "Prosím vyberte",
|
||||||
"plugin": "Konfigurace pluginu",
|
|
||||||
"plugin_opts": "Možnosti pluginu",
|
|
||||||
"port": "Port",
|
"port": "Port",
|
||||||
"protocol_configurations": "Konfigurace protokolu",
|
"protocol_configurations": "Konfigurace protokolu",
|
||||||
"protocol_configurations_desc": "Povolit a nakonfigurovat požadované typy protokolů",
|
"protocol_configurations_desc": "Povolit a nakonfigurovat požadované typy protokolů",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Hexadecimální řetězec (max. 16 znaků)",
|
"security_short_id_placeholder": "Hexadecimální řetězec (max. 16 znaků)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Vyberte metodu šifrování",
|
"select_encryption_method": "Vyberte metodu šifrování",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Spravujte klíče pro komunikaci uzlu, intervaly stahování/odesílání.",
|
||||||
|
"dynamic_multiplier": "Dynamický multiplikátor",
|
||||||
|
"dynamic_multiplier_desc": "Definujte časové sloty a multiplikátory pro úpravu účtování provozu.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Jedno pravidlo domény na řádek, podporuje:\nkeyword:google (shoda podle klíčového slova)\nsuffix:google.com (shoda podle přípony)\nregex:.*\\.example\\.com$ (shoda podle regulárního výrazu)\nexample.com (přesná shoda)",
|
||||||
|
"communication_key": "Klíč pro komunikaci",
|
||||||
|
"communication_key_desc": "Používá se pro autentizaci uzlu.",
|
||||||
|
"communication_key_placeholder": "Zadejte prosím",
|
||||||
|
"dns_config": "DNS konfigurace",
|
||||||
|
"dns_domains_placeholder": "Jedno pravidlo domény na řádek, podporuje:\nkeyword:google (shoda podle klíčového slova)\nsuffix:google.com (shoda podle přípony)\nregex:.*\\.example\\.com$ (shoda podle regulárního výrazu)\nexample.com (přesná shoda)",
|
||||||
|
"dns_proto_placeholder": "Vyberte typ",
|
||||||
|
"end_time": "Čas konce",
|
||||||
|
"ip_strategy": "IP strategie",
|
||||||
|
"ip_strategy_desc": "Vyberte preferenci verze IP pro síťová připojení",
|
||||||
|
"ip_strategy_ipv4": "Preferovat IPv4",
|
||||||
|
"ip_strategy_ipv6": "Preferovat IPv6",
|
||||||
|
"ip_strategy_placeholder": "Vyberte IP strategii",
|
||||||
|
"multiplier": "Multiplikátor",
|
||||||
|
"node_pull_interval": "Interval stahování uzlu",
|
||||||
|
"node_pull_interval_desc": "Jak často uzel stahuje konfiguraci (v sekundách).",
|
||||||
|
"node_push_interval": "Interval odesílání uzlu",
|
||||||
|
"node_push_interval_desc": "Jak často uzel odesílá statistiky (v sekundách).",
|
||||||
|
"outbound_address_placeholder": "Adresa serveru",
|
||||||
|
"outbound_name_placeholder": "Název konfigurace",
|
||||||
|
"outbound_password_placeholder": "Heslo (volitelné)",
|
||||||
|
"outbound_port_placeholder": "Číslo portu",
|
||||||
|
"outbound_protocol_placeholder": "Vyberte protokol",
|
||||||
|
"outbound_rules_placeholder": "Jedno pravidlo na řádek, podporuje:\nkeyword:google (shoda podle klíčového slova)\nsuffix:google.com (shoda podle přípony)\nregex:.*\\.example\\.com$ (shoda podle regulárního výrazu)\nexample.com (přesná shoda)\nNechte prázdné pro výchozí směrování",
|
||||||
|
"reset": "Obnovit",
|
||||||
|
"save": "Uložit",
|
||||||
|
"start_time": "Čas začátku",
|
||||||
|
"time_slot": "Časový slot",
|
||||||
|
"traffic_report_threshold": "Prahová hodnota zprávy o provozu",
|
||||||
|
"traffic_report_threshold_desc": "Nastavte minimální prahovou hodnotu pro hlášení o provozu. Provoz bude hlášen pouze tehdy, když překročí tuto hodnotu. Nastavte na 0 nebo nechte prázdné pro hlášení veškerého provozu."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Úspěšně uloženo",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Základní konfigurace",
|
||||||
|
"block": "Blokovací pravidla",
|
||||||
|
"dns": "DNS konfigurace",
|
||||||
|
"outbound": "Odchozí pravidla"
|
||||||
|
},
|
||||||
|
"title": "Konfigurace uzlu"
|
||||||
|
},
|
||||||
"server_key": "Klíč serveru",
|
"server_key": "Klíč serveru",
|
||||||
"service_name": "Název služby",
|
"service_name": "Název služby",
|
||||||
|
"sorted_success": "Úspěšně seřazeno",
|
||||||
"status": "Stav",
|
"status": "Stav",
|
||||||
"subscribeId": "ID předplatného",
|
"subscribeId": "ID předplatného",
|
||||||
"subscription": "Předplatné",
|
"subscription": "Předplatné",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Potvrdit",
|
"confirm": "Potvrdit",
|
||||||
"confirmDelete": "Opravdu chcete smazat?",
|
"confirmDelete": "Opravdu chcete smazat?",
|
||||||
"confirmOffline": "Potvrdit offline",
|
"confirmOffline": "Potvrdit offline",
|
||||||
|
"copySubscription": "Kopírovat předplatné",
|
||||||
|
"copySuccess": "Kopírování bylo úspěšné",
|
||||||
"create": "Vytvořit",
|
"create": "Vytvořit",
|
||||||
"createSubscription": "Vytvořit předplatné",
|
"createSubscription": "Vytvořit předplatné",
|
||||||
"createSuccess": "Vytvoření úspěšné",
|
"createSuccess": "Vytvoření úspěšné",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Protokoll auswählen…",
|
"select_protocol": "Protokoll auswählen…",
|
||||||
"select_server": "Server auswählen…",
|
"select_server": "Server auswählen…",
|
||||||
"server": "Server",
|
"server": "Server",
|
||||||
|
"sorted_success": "Erfolgreich sortiert",
|
||||||
"tags": "Tags",
|
"tags": "Tags",
|
||||||
"tags_description": "Berechtigungsgruppierungs-Tag (einschließlich Planbindung und Lieferrichtlinien).",
|
"tags_description": "Berechtigungsgruppierungs-Tag (einschließlich Planbindung und Lieferrichtlinien).",
|
||||||
"tags_placeholder": "Verwenden Sie Enter oder Komma (,) um mehrere Tags hinzuzufügen",
|
"tags_placeholder": "Verwenden Sie Enter oder Komma (,) um mehrere Tags hinzuzufügen",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Abbrechen",
|
||||||
|
"save": "Speichern"
|
||||||
|
},
|
||||||
"address": "Adresse",
|
"address": "Adresse",
|
||||||
"address_placeholder": "Serveradresse",
|
"address_placeholder": "Serveradresse",
|
||||||
|
"apiHost": "API-Host",
|
||||||
|
"apiHostPlaceholder": "http(s)://beispiel.de",
|
||||||
"bandwidth_placeholder": "Geben Sie die Bandbreite ein, lassen Sie das Feld leer für BBR",
|
"bandwidth_placeholder": "Geben Sie die Bandbreite ein, lassen Sie das Feld leer für BBR",
|
||||||
"basic": "Grundkonfiguration",
|
"basic": "Grundkonfiguration",
|
||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
|
"cert_dns_env": "DNS-Umgebungsvariablen",
|
||||||
|
"cert_dns_provider": "DNS-Anbieter",
|
||||||
|
"cert_mode": "Zertifikatsmodus",
|
||||||
|
"cipher": "Verschlüsselungsalgorithmus",
|
||||||
"city": "Stadt",
|
"city": "Stadt",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Abbrechen",
|
|
||||||
"save": "Speichern"
|
|
||||||
},
|
|
||||||
"communicationKey": "Kommunikationsschlüssel",
|
|
||||||
"communicationKeyDescription": "Wird zur Authentifizierung des Knotens verwendet.",
|
|
||||||
"description": "Verwalten Sie die Kommunikationsschlüssel des Knotens, Pull/Push-Intervalle und dynamische Multiplikatoren.",
|
|
||||||
"dynamicMultiplier": "Dynamischer Multiplikator",
|
|
||||||
"dynamicMultiplierDescription": "Definieren Sie Zeitfenster und Multiplikatoren zur Anpassung der Verkehrsabrechnung.",
|
|
||||||
"endTime": "Endzeit",
|
|
||||||
"inputPlaceholder": "Bitte eingeben",
|
|
||||||
"multiplier": "Multiplikator",
|
|
||||||
"nodePullInterval": "Knoten-Pull-Intervall",
|
|
||||||
"nodePullIntervalDescription": "Wie oft der Knoten die Konfiguration abruft (Sekunden).",
|
|
||||||
"nodePushInterval": "Knoten-Push-Intervall",
|
|
||||||
"nodePushIntervalDescription": "Wie oft der Knoten Statistiken sendet (Sekunden).",
|
|
||||||
"reset": "Zurücksetzen",
|
|
||||||
"save": "Speichern",
|
|
||||||
"saveSuccess": "Erfolgreich gespeichert",
|
|
||||||
"startTime": "Startzeit",
|
|
||||||
"timeSlot": "Zeitfenster",
|
|
||||||
"title": "Knoten-Konfiguration"
|
|
||||||
},
|
|
||||||
"confirm": "Bestätigen",
|
"confirm": "Bestätigen",
|
||||||
"confirmDeleteDesc": "Diese Aktion kann nicht rückgängig gemacht werden.",
|
"confirmDeleteDesc": "Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||||
"confirmDeleteTitle": "Diesen Server löschen?",
|
"confirmDeleteTitle": "Diesen Server löschen?",
|
||||||
"congestion_controller": "Staukontroller",
|
"congestion_controller": "Staukontroller",
|
||||||
|
"connect": "Verbinden",
|
||||||
"copied": "Kopiert",
|
"copied": "Kopiert",
|
||||||
"copy": "Kopieren",
|
"copy": "Kopieren",
|
||||||
"country": "Land",
|
"country": "Land",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Server bearbeiten",
|
"drawerEditTitle": "Server bearbeiten",
|
||||||
"edit": "Bearbeiten",
|
"edit": "Bearbeiten",
|
||||||
"enabled": "Aktiviert",
|
"enabled": "Aktiviert",
|
||||||
"encryption_method": "Verschlüsselungsmethode",
|
"encryption": "Verschlüsselungsmethode",
|
||||||
|
"encryption_client_padding": "Client-Padding",
|
||||||
|
"encryption_mode": "Modus",
|
||||||
|
"encryption_password": "Passwort",
|
||||||
|
"encryption_password_placeholder": "Leer lassen für automatische Generierung, manuell ersetzen für post-quanten Verschlüsselung",
|
||||||
|
"encryption_private_key": "Privater Schlüssel",
|
||||||
|
"encryption_private_key_placeholder": "Leer lassen für automatische Generierung, manuell ersetzen für post-quanten Verschlüsselung",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Server-Padding",
|
||||||
|
"encryption_ticket": "Ticketzeit",
|
||||||
"expireTime": "Ablaufzeit",
|
"expireTime": "Ablaufzeit",
|
||||||
"expired": "Abgelaufen",
|
"expired": "Abgelaufen",
|
||||||
|
"extra": "Zusätzliche Konfiguration",
|
||||||
"flow": "Fluss",
|
"flow": "Fluss",
|
||||||
|
"generate_quantum_resistant_key": "Quantenresistenten Schlüssel generieren",
|
||||||
|
"generate_standard_encryption_key": "Standard-Verschlüsselungsschlüssel generieren",
|
||||||
"hop_interval": "Hop-Intervall",
|
"hop_interval": "Hop-Intervall",
|
||||||
"hop_ports": "Hop-Ports",
|
"hop_ports": "Hop-Ports",
|
||||||
"hop_ports_placeholder": "z.B. 1-65535",
|
"hop_ports_placeholder": "z.B. 1-65535",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Installationsbefehl",
|
||||||
"ipAddresses": "IP-Adressen",
|
"ipAddresses": "IP-Adressen",
|
||||||
"memory": "Speicher",
|
"memory": "Speicher",
|
||||||
"migrate": "Daten migrieren",
|
"migrate": "Daten migrieren",
|
||||||
"migrateFailed": "Datenmigration fehlgeschlagen",
|
"migrateFailed": "Datenmigration fehlgeschlagen",
|
||||||
"migrated": "Daten erfolgreich migriert",
|
"migrated": "Daten erfolgreich migriert",
|
||||||
"migrating": "Wird migriert...",
|
"migrating": "Wird migriert...",
|
||||||
|
"mode": "Modus",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"noData": "Keine Daten",
|
"noData": "Keine Daten",
|
||||||
"notAvailable": "Nicht verfügbar",
|
"notAvailable": "Nicht verfügbar",
|
||||||
|
"obfs": "Obfuskation",
|
||||||
|
"obfs_host": "Obfs-Host",
|
||||||
"obfs_password": "Obfuskationspasswort",
|
"obfs_password": "Obfuskationspasswort",
|
||||||
"obfs_password_placeholder": "Obfuskationspasswort eingeben",
|
"obfs_password_placeholder": "Obfuskationspasswort eingeben",
|
||||||
|
"obfs_path": "Obfs-Pfad",
|
||||||
"offline": "Offline",
|
"offline": "Offline",
|
||||||
|
"oneClickInstall": "Ein-Klick-Installation",
|
||||||
"online": "Online",
|
"online": "Online",
|
||||||
"onlineUsers": "Online-Benutzer",
|
"onlineUsers": "Online-Benutzer",
|
||||||
"padding_scheme": "Polsterungsschema",
|
"padding_scheme": "Polsterungsschema",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Server",
|
"pageTitle": "Server",
|
||||||
"path": "Pfad",
|
"path": "Pfad",
|
||||||
"please_select": "Bitte auswählen",
|
"please_select": "Bitte auswählen",
|
||||||
"plugin": "Plugin-Konfiguration",
|
|
||||||
"plugin_opts": "Plugin-Optionen",
|
|
||||||
"port": "Port",
|
"port": "Port",
|
||||||
"protocol_configurations": "Protokollkonfigurationen",
|
"protocol_configurations": "Protokollkonfigurationen",
|
||||||
"protocol_configurations_desc": "Aktivieren und konfigurieren Sie die erforderlichen Protokolltypen",
|
"protocol_configurations_desc": "Aktivieren und konfigurieren Sie die erforderlichen Protokolltypen",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Hex-String (bis zu 16 Zeichen)",
|
"security_short_id_placeholder": "Hex-String (bis zu 16 Zeichen)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Verschlüsselungsmethode auswählen",
|
"select_encryption_method": "Verschlüsselungsmethode auswählen",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Verwalten Sie die Kommunikationsschlüssel des Knotens, Pull/Push-Intervalle.",
|
||||||
|
"dynamic_multiplier": "Dynamischer Multiplikator",
|
||||||
|
"dynamic_multiplier_desc": "Definieren Sie Zeitfenster und Multiplikatoren zur Anpassung der Verkehrserfassung.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Eine Domainregel pro Zeile, unterstützt:\nkeyword:google (Schlüsselwortübereinstimmung)\nsuffix:google.com (Suffixübereinstimmung)\nregex:.*\\.example\\.com$ (Regex-Übereinstimmung)\nexample.com (exakte Übereinstimmung)",
|
||||||
|
"communication_key": "Kommunikationsschlüssel",
|
||||||
|
"communication_key_desc": "Wird zur Authentifizierung des Knotens verwendet.",
|
||||||
|
"communication_key_placeholder": "Bitte eingeben",
|
||||||
|
"dns_config": "DNS-Konfiguration",
|
||||||
|
"dns_domains_placeholder": "Eine Domainregel pro Zeile, unterstützt:\nkeyword:google (Schlüsselwortübereinstimmung)\nsuffix:google.com (Suffixübereinstimmung)\nregex:.*\\.example\\.com$ (Regex-Übereinstimmung)\nexample.com (exakte Übereinstimmung)",
|
||||||
|
"dns_proto_placeholder": "Typ auswählen",
|
||||||
|
"end_time": "Endzeit",
|
||||||
|
"ip_strategy": "IP-Strategie",
|
||||||
|
"ip_strategy_desc": "Wählen Sie die bevorzugte IP-Version für Netzwerkverbindungen",
|
||||||
|
"ip_strategy_ipv4": "Bevorzuge IPv4",
|
||||||
|
"ip_strategy_ipv6": "Bevorzuge IPv6",
|
||||||
|
"ip_strategy_placeholder": "IP-Strategie auswählen",
|
||||||
|
"multiplier": "Multiplikator",
|
||||||
|
"node_pull_interval": "Knoten-Pull-Intervall",
|
||||||
|
"node_pull_interval_desc": "Wie oft der Knoten die Konfiguration abruft (Sekunden).",
|
||||||
|
"node_push_interval": "Knoten-Push-Intervall",
|
||||||
|
"node_push_interval_desc": "Wie oft der Knoten Statistiken sendet (Sekunden).",
|
||||||
|
"outbound_address_placeholder": "Serveradresse",
|
||||||
|
"outbound_name_placeholder": "Konfigurationsname",
|
||||||
|
"outbound_password_placeholder": "Passwort (optional)",
|
||||||
|
"outbound_port_placeholder": "Portnummer",
|
||||||
|
"outbound_protocol_placeholder": "Protokoll auswählen",
|
||||||
|
"outbound_rules_placeholder": "Eine Regel pro Zeile, unterstützt:\nkeyword:google (Schlüsselwortübereinstimmung)\nsuffix:google.com (Suffixübereinstimmung)\nregex:.*\\.example\\.com$ (Regex-Übereinstimmung)\nexample.com (exakte Übereinstimmung)\nLeer lassen für Standardrouting",
|
||||||
|
"reset": "Zurücksetzen",
|
||||||
|
"save": "Speichern",
|
||||||
|
"start_time": "Startzeit",
|
||||||
|
"time_slot": "Zeitfenster",
|
||||||
|
"traffic_report_threshold": "Schwellenwert für Verkehrsberichte",
|
||||||
|
"traffic_report_threshold_desc": "Legen Sie den Mindestschwellenwert für die Verkehrsmeldung fest. Verkehr wird nur gemeldet, wenn er diesen Wert überschreitet. Auf 0 setzen oder leer lassen, um gesamten Verkehr zu melden."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Erfolgreich gespeichert",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Grundkonfiguration",
|
||||||
|
"block": "Blockierungsregeln",
|
||||||
|
"dns": "DNS-Konfiguration",
|
||||||
|
"outbound": "Ausgehende Regeln"
|
||||||
|
},
|
||||||
|
"title": "Knoten-Konfiguration"
|
||||||
|
},
|
||||||
"server_key": "Server-Schlüssel",
|
"server_key": "Server-Schlüssel",
|
||||||
"service_name": "Dienstname",
|
"service_name": "Dienstname",
|
||||||
|
"sorted_success": "Erfolgreich sortiert",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"subscribeId": "Abonnement-ID",
|
"subscribeId": "Abonnement-ID",
|
||||||
"subscription": "Abonnement",
|
"subscription": "Abonnement",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Bestätigen",
|
"confirm": "Bestätigen",
|
||||||
"confirmDelete": "Sind Sie sicher, dass Sie löschen möchten?",
|
"confirmDelete": "Sind Sie sicher, dass Sie löschen möchten?",
|
||||||
"confirmOffline": "Offline bestätigen",
|
"confirmOffline": "Offline bestätigen",
|
||||||
|
"copySubscription": "Abonnement kopieren",
|
||||||
|
"copySuccess": "Kopie erfolgreich",
|
||||||
"create": "Erstellen",
|
"create": "Erstellen",
|
||||||
"createSubscription": "Abonnement erstellen",
|
"createSubscription": "Abonnement erstellen",
|
||||||
"createSuccess": "Erstellung erfolgreich",
|
"createSuccess": "Erstellung erfolgreich",
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
{
|
{
|
||||||
"ADS Config": "ADS Config",
|
"ADS Config": "ADS Config",
|
||||||
"Announcement Management": "Announcement Management",
|
"Announcement Management": "Announcement Management",
|
||||||
|
|
||||||
"Auth Control": "Auth Control",
|
"Auth Control": "Auth Control",
|
||||||
"Balance": "Balance",
|
"Balance": "Balance",
|
||||||
"Commerce": "Commerce",
|
"Commerce": "Commerce",
|
||||||
"Commission": "Commission",
|
"Commission": "Commission",
|
||||||
"Coupon Management": "Coupon Management",
|
"Coupon Management": "Coupon Management",
|
||||||
"Dashboard": "Dashboard",
|
"Dashboard": "Dashboard",
|
||||||
|
|
||||||
"Document Management": "Document Management",
|
"Document Management": "Document Management",
|
||||||
|
|
||||||
"Email": "Email",
|
"Email": "Email",
|
||||||
"Gift": "Gift",
|
"Gift": "Gift",
|
||||||
"Login": "Login",
|
"Login": "Login",
|
||||||
@ -23,7 +20,6 @@
|
|||||||
"Order Management": "Order Management",
|
"Order Management": "Order Management",
|
||||||
"Payment Config": "Payment Config",
|
"Payment Config": "Payment Config",
|
||||||
"Product Management": "Product Management",
|
"Product Management": "Product Management",
|
||||||
|
|
||||||
"Register": "Register",
|
"Register": "Register",
|
||||||
"Reset Subscribe": "Reset Subscribe",
|
"Reset Subscribe": "Reset Subscribe",
|
||||||
"Server Management": "Server Management",
|
"Server Management": "Server Management",
|
||||||
@ -34,10 +30,10 @@
|
|||||||
"System": "System",
|
"System": "System",
|
||||||
"System Config": "System Config",
|
"System Config": "System Config",
|
||||||
"System Tool": "System Tool",
|
"System Tool": "System Tool",
|
||||||
|
|
||||||
"Ticket Management": "Ticket Management",
|
"Ticket Management": "Ticket Management",
|
||||||
"Traffic Details": "Traffic Details",
|
"Traffic Details": "Traffic Details",
|
||||||
"User Detail": "User Detail",
|
"User Detail": "User Detail",
|
||||||
"User Management": "User Management",
|
"User Management": "User Management",
|
||||||
"Users & Support": "Users & Support"
|
"Users & Support": "Users & Support",
|
||||||
|
"Version Management": "Version Management"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Select protocol…",
|
"select_protocol": "Select protocol…",
|
||||||
"select_server": "Select server…",
|
"select_server": "Select server…",
|
||||||
"server": "Server",
|
"server": "Server",
|
||||||
|
"sorted_success": "Sorted successfully",
|
||||||
"tags": "Tags",
|
"tags": "Tags",
|
||||||
"tags_description": "Permission grouping tag (incl. plan binding and delivery policies).",
|
"tags_description": "Permission grouping tag (incl. plan binding and delivery policies).",
|
||||||
"tags_placeholder": "Use Enter or comma (,) to add multiple tags",
|
"tags_placeholder": "Use Enter or comma (,) to add multiple tags",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"save": "Save"
|
||||||
|
},
|
||||||
"address": "Address",
|
"address": "Address",
|
||||||
"address_placeholder": "Server address",
|
"address_placeholder": "Server address",
|
||||||
|
"apiHost": "API Host",
|
||||||
|
"apiHostPlaceholder": "http(s)://example.com",
|
||||||
"bandwidth_placeholder": "Enter bandwidth, leave empty for BBR",
|
"bandwidth_placeholder": "Enter bandwidth, leave empty for BBR",
|
||||||
"basic": "Basic Configuration",
|
"basic": "Basic Configuration",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
|
"cert_dns_env": "DNS Environment Variables",
|
||||||
|
"cert_dns_provider": "DNS Provider",
|
||||||
|
"cert_mode": "Certificate Mode",
|
||||||
|
"cipher": "Encryption Algorithm",
|
||||||
"city": "City",
|
"city": "City",
|
||||||
"config": {
|
|
||||||
"title": "Node configuration",
|
|
||||||
"description": "Manage node communication keys, pull/push intervals, and dynamic multipliers.",
|
|
||||||
"saveSuccess": "Saved successfully",
|
|
||||||
"communicationKey": "Communication key",
|
|
||||||
"inputPlaceholder": "Please enter",
|
|
||||||
"communicationKeyDescription": "Used for node authentication.",
|
|
||||||
"nodePullInterval": "Node pull interval",
|
|
||||||
"nodePullIntervalDescription": "How often the node pulls configuration (seconds).",
|
|
||||||
"nodePushInterval": "Node push interval",
|
|
||||||
"nodePushIntervalDescription": "How often the node pushes stats (seconds).",
|
|
||||||
"dynamicMultiplier": "Dynamic multiplier",
|
|
||||||
"dynamicMultiplierDescription": "Define time slots and multipliers to adjust traffic accounting.",
|
|
||||||
"startTime": "Start time",
|
|
||||||
"endTime": "End time",
|
|
||||||
"multiplier": "Multiplier",
|
|
||||||
"reset": "Reset",
|
|
||||||
"save": "Save",
|
|
||||||
"timeSlot": "Time slot",
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Cancel",
|
|
||||||
"save": "Save"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"confirmDeleteDesc": "This action cannot be undone.",
|
"confirmDeleteDesc": "This action cannot be undone.",
|
||||||
"confirmDeleteTitle": "Delete this server?",
|
"confirmDeleteTitle": "Delete this server?",
|
||||||
"congestion_controller": "Congestion controller",
|
"congestion_controller": "Congestion controller",
|
||||||
|
"connect": "Connect",
|
||||||
"copied": "Copied",
|
"copied": "Copied",
|
||||||
"copy": "Copy",
|
"copy": "Copy",
|
||||||
"country": "Country",
|
"country": "Country",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Edit Server",
|
"drawerEditTitle": "Edit Server",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"enabled": "Enabled",
|
"enabled": "Enabled",
|
||||||
"encryption_method": "Encryption method",
|
"encryption": "Encryption Method",
|
||||||
|
"encryption_client_padding": "Client Padding",
|
||||||
|
"encryption_mode": "Mode",
|
||||||
|
"encryption_password": "Password",
|
||||||
|
"encryption_password_placeholder": "Leave empty for auto-generation, replace manually for post-quantum encryption",
|
||||||
|
"encryption_private_key": "Private Key",
|
||||||
|
"encryption_private_key_placeholder": "Leave empty for auto-generation, replace manually for post-quantum encryption",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Server Padding",
|
||||||
|
"encryption_ticket": "Ticket time",
|
||||||
"expireTime": "Expire time",
|
"expireTime": "Expire time",
|
||||||
"expired": "Expired",
|
"expired": "Expired",
|
||||||
|
"extra": "Extra Configuration",
|
||||||
"flow": "Flow",
|
"flow": "Flow",
|
||||||
|
"generate_quantum_resistant_key": "Generate Quantum-Resistant Key",
|
||||||
|
"generate_standard_encryption_key": "Generate Standard Encryption Key",
|
||||||
"hop_interval": "Hop interval",
|
"hop_interval": "Hop interval",
|
||||||
"hop_ports": "Hop ports",
|
"hop_ports": "Hop ports",
|
||||||
"hop_ports_placeholder": "e.g. 1-65535",
|
"hop_ports_placeholder": "e.g. 1-65535",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Install command",
|
||||||
"ipAddresses": "IP addresses",
|
"ipAddresses": "IP addresses",
|
||||||
"memory": "Memory",
|
"memory": "Memory",
|
||||||
"migrate": "Migrate Data",
|
"migrate": "Migrate Data",
|
||||||
"migrateFailed": "Data migration failed",
|
"migrateFailed": "Data migration failed",
|
||||||
"migrated": "Data migrated successfully",
|
"migrated": "Data migrated successfully",
|
||||||
"migrating": "Migrating...",
|
"migrating": "Migrating...",
|
||||||
|
"mode": "Mode",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"noData": "No data",
|
"noData": "No data",
|
||||||
"notAvailable": "N/A",
|
"notAvailable": "N/A",
|
||||||
|
"obfs": "Obfuscation",
|
||||||
|
"obfs_host": "Obfs Host",
|
||||||
"obfs_password": "Obfuscation password",
|
"obfs_password": "Obfuscation password",
|
||||||
"obfs_password_placeholder": "Enter obfuscation password",
|
"obfs_password_placeholder": "Enter obfuscation password",
|
||||||
|
"obfs_path": "Obfs Path",
|
||||||
"offline": "Offline",
|
"offline": "Offline",
|
||||||
|
"oneClickInstall": "One-click Install",
|
||||||
"online": "Online",
|
"online": "Online",
|
||||||
"onlineUsers": "Online users",
|
"onlineUsers": "Online users",
|
||||||
"padding_scheme": "Padding Scheme",
|
"padding_scheme": "Padding Scheme",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Servers",
|
"pageTitle": "Servers",
|
||||||
"path": "Path",
|
"path": "Path",
|
||||||
"please_select": "Please select",
|
"please_select": "Please select",
|
||||||
"plugin": "Plugin Configuration",
|
|
||||||
"plugin_opts": "Plugin Options",
|
|
||||||
"port": "Port",
|
"port": "Port",
|
||||||
"protocol_configurations": "Protocol Configurations",
|
"protocol_configurations": "Protocol Configurations",
|
||||||
"protocol_configurations_desc": "Enable and configure the required protocol types",
|
"protocol_configurations_desc": "Enable and configure the required protocol types",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Hex string (up to 16 chars)",
|
"security_short_id_placeholder": "Hex string (up to 16 chars)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Select encryption method",
|
"select_encryption_method": "Select encryption method",
|
||||||
|
"server_config": {
|
||||||
|
"title": "Node configuration",
|
||||||
|
"description": "Manage node communication keys, pull/push intervals.",
|
||||||
|
"saveSuccess": "Saved successfully",
|
||||||
|
"dynamic_multiplier": "Dynamic multiplier",
|
||||||
|
"dynamic_multiplier_desc": "Define time slots and multipliers to adjust traffic accounting.",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Basic Configuration",
|
||||||
|
"dns": "DNS Configuration",
|
||||||
|
"outbound": "Outbound Rules",
|
||||||
|
"block": "Block Rules"
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"communication_key": "Communication key",
|
||||||
|
"communication_key_placeholder": "Please enter",
|
||||||
|
"communication_key_desc": "Used for node authentication.",
|
||||||
|
"node_pull_interval": "Node pull interval",
|
||||||
|
"node_pull_interval_desc": "How often the node pulls configuration (seconds).",
|
||||||
|
"node_push_interval": "Node push interval",
|
||||||
|
"node_push_interval_desc": "How often the node pushes stats (seconds).",
|
||||||
|
"start_time": "Start time",
|
||||||
|
"end_time": "End time",
|
||||||
|
"multiplier": "Multiplier",
|
||||||
|
"reset": "Reset",
|
||||||
|
"save": "Save",
|
||||||
|
"time_slot": "Time slot",
|
||||||
|
"traffic_report_threshold": "Traffic Report Threshold",
|
||||||
|
"traffic_report_threshold_desc": "Set the minimum threshold for traffic reporting. Traffic will only be reported when it exceeds this value. Set to 0 or leave empty to report all traffic.",
|
||||||
|
"ip_strategy": "IP Strategy",
|
||||||
|
"ip_strategy_desc": "Choose IP version preference for network connections",
|
||||||
|
"ip_strategy_placeholder": "Select IP strategy",
|
||||||
|
"ip_strategy_ipv4": "Prefer IPv4",
|
||||||
|
"ip_strategy_ipv6": "Prefer IPv6",
|
||||||
|
"dns_config": "DNS Configuration",
|
||||||
|
"dns_proto_placeholder": "Select type",
|
||||||
|
"dns_domains_placeholder": "One domain rule per line, supports:\nkeyword:google (keyword matching)\nsuffix:google.com (suffix matching)\nregex:.*\\.example\\.com$ (regex matching)\nexample.com (exact matching)",
|
||||||
|
"outbound_protocol_placeholder": "Select protocol",
|
||||||
|
"outbound_name_placeholder": "Configuration name",
|
||||||
|
"outbound_address_placeholder": "Server address",
|
||||||
|
"outbound_port_placeholder": "Port number",
|
||||||
|
"outbound_password_placeholder": "Password (optional)",
|
||||||
|
"outbound_rules_placeholder": "One rule per line, supports:\nkeyword:google (keyword matching)\nsuffix:google.com (suffix matching)\nregex:.*\\.example\\.com$ (regex matching)\nexample.com (exact matching)\nLeave empty for default routing",
|
||||||
|
"block_rules_placeholder": "One domain rule per line, supports:\nkeyword:google (keyword matching)\nsuffix:google.com (suffix matching)\nregex:.*\\.example\\.com$ (regex matching)\nexample.com (exact matching)"
|
||||||
|
}
|
||||||
|
},
|
||||||
"server_key": "Server key",
|
"server_key": "Server key",
|
||||||
"service_name": "Service name",
|
"service_name": "Service name",
|
||||||
|
"sorted_success": "Sorted successfully",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"subscribeId": "Subscription ID",
|
"subscribeId": "Subscription ID",
|
||||||
"subscription": "Subscription",
|
"subscription": "Subscription",
|
||||||
|
|||||||
@ -18,7 +18,10 @@
|
|||||||
"currencySymbolPlaceholder": "$",
|
"currencySymbolPlaceholder": "$",
|
||||||
"currencyUnit": "Currency Unit",
|
"currencyUnit": "Currency Unit",
|
||||||
"currencyUnitDescription": "Used for display purposes only; changing this will affect all currency units in the system",
|
"currencyUnitDescription": "Used for display purposes only; changing this will affect all currency units in the system",
|
||||||
"currencyUnitPlaceholder": "USD"
|
"currencyUnitPlaceholder": "USD",
|
||||||
|
"fixedRate": "Fixed Exchange Rate",
|
||||||
|
"fixedRatePlaceholder": "0",
|
||||||
|
"fixedRateDescription": "If a fixed rate is set, it will be used instead of the API rate"
|
||||||
},
|
},
|
||||||
"invite": {
|
"invite": {
|
||||||
"title": "Invitation Settings",
|
"title": "Invitation Settings",
|
||||||
@ -135,5 +138,35 @@
|
|||||||
"inputPlaceholder": "Please enter",
|
"inputPlaceholder": "Please enter",
|
||||||
"saveSuccess": "Save Successful",
|
"saveSuccess": "Save Successful",
|
||||||
"saveFailed": "Save Failed"
|
"saveFailed": "Save Failed"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"title": "Version Management",
|
||||||
|
"description": "Manage app versions for all platforms",
|
||||||
|
"create": "Create",
|
||||||
|
"edit": "Edit Version",
|
||||||
|
"createVersion": "Create Version",
|
||||||
|
"platform": "Platform",
|
||||||
|
"platformPlaceholder": "Select platform",
|
||||||
|
"versionNumber": "Version",
|
||||||
|
"versionPlaceholder": "1.0.0",
|
||||||
|
"minVersion": "Min Version",
|
||||||
|
"downloadUrl": "Download URL",
|
||||||
|
"descriptionField": "Description",
|
||||||
|
"descriptionPlaceholder": "Update description...",
|
||||||
|
"forceUpdate": "Force Update",
|
||||||
|
"default": "Default",
|
||||||
|
"inReview": "In Review",
|
||||||
|
"actions": "Actions",
|
||||||
|
"url": "URL",
|
||||||
|
"force": "Force",
|
||||||
|
"total": "Total: {count} items",
|
||||||
|
"previous": "Previous",
|
||||||
|
"next": "Next",
|
||||||
|
"page": "Page {page}",
|
||||||
|
"noResults": "No results.",
|
||||||
|
"yes": "Yes",
|
||||||
|
"no": "No",
|
||||||
|
"update": "Update",
|
||||||
|
"confirmDelete": "Are you sure you want to delete?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"confirmDelete": "Confirm Delete",
|
"confirmDelete": "Confirm Delete",
|
||||||
"confirmOffline": "Confirm Offline",
|
"confirmOffline": "Confirm Offline",
|
||||||
|
"copySubscription": "Copy Subscription",
|
||||||
|
"copySuccess": "Copy successful",
|
||||||
"create": "Create",
|
"create": "Create",
|
||||||
"createSubscription": "Create Subscription",
|
"createSubscription": "Create Subscription",
|
||||||
"createSuccess": "Create successful",
|
"createSuccess": "Create successful",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Seleccionar protocolo…",
|
"select_protocol": "Seleccionar protocolo…",
|
||||||
"select_server": "Seleccionar servidor…",
|
"select_server": "Seleccionar servidor…",
|
||||||
"server": "Servidor",
|
"server": "Servidor",
|
||||||
|
"sorted_success": "Ordenado con éxito",
|
||||||
"tags": "Etiquetas",
|
"tags": "Etiquetas",
|
||||||
"tags_description": "Etiqueta de agrupación de permisos (incl. vinculación de planes y políticas de entrega).",
|
"tags_description": "Etiqueta de agrupación de permisos (incl. vinculación de planes y políticas de entrega).",
|
||||||
"tags_placeholder": "Usa Enter o coma (,) para añadir múltiples etiquetas",
|
"tags_placeholder": "Usa Enter o coma (,) para añadir múltiples etiquetas",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Cancelar",
|
||||||
|
"save": "Guardar"
|
||||||
|
},
|
||||||
"address": "Dirección",
|
"address": "Dirección",
|
||||||
"address_placeholder": "Dirección del servidor",
|
"address_placeholder": "Dirección del servidor",
|
||||||
|
"apiHost": "Host de API",
|
||||||
|
"apiHostPlaceholder": "http(s)://ejemplo.com",
|
||||||
"bandwidth_placeholder": "Introduce el ancho de banda, deja vacío para BBR",
|
"bandwidth_placeholder": "Introduce el ancho de banda, deja vacío para BBR",
|
||||||
"basic": "Configuración Básica",
|
"basic": "Configuración Básica",
|
||||||
"cancel": "Cancelar",
|
"cancel": "Cancelar",
|
||||||
|
"cert_dns_env": "Variables de Entorno DNS",
|
||||||
|
"cert_dns_provider": "Proveedor de DNS",
|
||||||
|
"cert_mode": "Modo de Certificado",
|
||||||
|
"cipher": "Algoritmo de Cifrado",
|
||||||
"city": "Ciudad",
|
"city": "Ciudad",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Cancelar",
|
|
||||||
"save": "Guardar"
|
|
||||||
},
|
|
||||||
"communicationKey": "Clave de comunicación",
|
|
||||||
"communicationKeyDescription": "Utilizado para la autenticación del nodo.",
|
|
||||||
"description": "Gestionar las claves de comunicación del nodo, intervalos de extracción/empuje y multiplicadores dinámicos.",
|
|
||||||
"dynamicMultiplier": "Multiplicador dinámico",
|
|
||||||
"dynamicMultiplierDescription": "Definir intervalos de tiempo y multiplicadores para ajustar la contabilidad del tráfico.",
|
|
||||||
"endTime": "Hora de finalización",
|
|
||||||
"inputPlaceholder": "Por favor ingrese",
|
|
||||||
"multiplier": "Multiplicador",
|
|
||||||
"nodePullInterval": "Intervalo de extracción del nodo",
|
|
||||||
"nodePullIntervalDescription": "Con qué frecuencia el nodo extrae la configuración (segundos).",
|
|
||||||
"nodePushInterval": "Intervalo de empuje del nodo",
|
|
||||||
"nodePushIntervalDescription": "Con qué frecuencia el nodo envía estadísticas (segundos).",
|
|
||||||
"reset": "Restablecer",
|
|
||||||
"save": "Guardar",
|
|
||||||
"saveSuccess": "Guardado con éxito",
|
|
||||||
"startTime": "Hora de inicio",
|
|
||||||
"timeSlot": "Intervalo de tiempo",
|
|
||||||
"title": "Configuración del nodo"
|
|
||||||
},
|
|
||||||
"confirm": "Confirmar",
|
"confirm": "Confirmar",
|
||||||
"confirmDeleteDesc": "Esta acción no se puede deshacer.",
|
"confirmDeleteDesc": "Esta acción no se puede deshacer.",
|
||||||
"confirmDeleteTitle": "¿Eliminar este servidor?",
|
"confirmDeleteTitle": "¿Eliminar este servidor?",
|
||||||
"congestion_controller": "Controlador de congestión",
|
"congestion_controller": "Controlador de congestión",
|
||||||
|
"connect": "Conectar",
|
||||||
"copied": "Copiado",
|
"copied": "Copiado",
|
||||||
"copy": "Copiar",
|
"copy": "Copiar",
|
||||||
"country": "País",
|
"country": "País",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Editar Servidor",
|
"drawerEditTitle": "Editar Servidor",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"enabled": "Habilitado",
|
"enabled": "Habilitado",
|
||||||
"encryption_method": "Método de cifrado",
|
"encryption": "Método de Cifrado",
|
||||||
|
"encryption_client_padding": "Relleno del Cliente",
|
||||||
|
"encryption_mode": "Modo",
|
||||||
|
"encryption_password": "Contraseña",
|
||||||
|
"encryption_password_placeholder": "Dejar vacío para auto-generación, reemplazar manualmente para cifrado post-cuántico",
|
||||||
|
"encryption_private_key": "Clave Privada",
|
||||||
|
"encryption_private_key_placeholder": "Dejar vacío para auto-generación, reemplazar manualmente para cifrado post-cuántico",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Relleno del Servidor",
|
||||||
|
"encryption_ticket": "Tiempo de Ticket",
|
||||||
"expireTime": "Tiempo de expiración",
|
"expireTime": "Tiempo de expiración",
|
||||||
"expired": "Expirado",
|
"expired": "Expirado",
|
||||||
|
"extra": "Configuración Extra",
|
||||||
"flow": "Flujo",
|
"flow": "Flujo",
|
||||||
|
"generate_quantum_resistant_key": "Generar clave resistente a cuánticos",
|
||||||
|
"generate_standard_encryption_key": "Generar clave de cifrado estándar",
|
||||||
"hop_interval": "Intervalo de salto",
|
"hop_interval": "Intervalo de salto",
|
||||||
"hop_ports": "Puertos de salto",
|
"hop_ports": "Puertos de salto",
|
||||||
"hop_ports_placeholder": "p. ej. 1-65535",
|
"hop_ports_placeholder": "p. ej. 1-65535",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Comando de instalación",
|
||||||
"ipAddresses": "Direcciones IP",
|
"ipAddresses": "Direcciones IP",
|
||||||
"memory": "Memoria",
|
"memory": "Memoria",
|
||||||
"migrate": "Migrar datos",
|
"migrate": "Migrar datos",
|
||||||
"migrateFailed": "La migración de datos falló",
|
"migrateFailed": "La migración de datos falló",
|
||||||
"migrated": "Datos migrados con éxito",
|
"migrated": "Datos migrados con éxito",
|
||||||
"migrating": "Migrando...",
|
"migrating": "Migrando...",
|
||||||
|
"mode": "Modo",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Nombre",
|
"name": "Nombre",
|
||||||
"noData": "Sin datos",
|
"noData": "Sin datos",
|
||||||
"notAvailable": "N/A",
|
"notAvailable": "N/A",
|
||||||
|
"obfs": "Ofuscación",
|
||||||
|
"obfs_host": "Host de Ofuscación",
|
||||||
"obfs_password": "Contraseña de ofuscación",
|
"obfs_password": "Contraseña de ofuscación",
|
||||||
"obfs_password_placeholder": "Ingrese la contraseña de ofuscación",
|
"obfs_password_placeholder": "Ingrese la contraseña de ofuscación",
|
||||||
|
"obfs_path": "Ruta de Ofuscación",
|
||||||
"offline": "Desconectado",
|
"offline": "Desconectado",
|
||||||
|
"oneClickInstall": "Instalación con un clic",
|
||||||
"online": "Conectado",
|
"online": "Conectado",
|
||||||
"onlineUsers": "Usuarios en línea",
|
"onlineUsers": "Usuarios en línea",
|
||||||
"padding_scheme": "Esquema de Relleno",
|
"padding_scheme": "Esquema de Relleno",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Servidores",
|
"pageTitle": "Servidores",
|
||||||
"path": "Ruta",
|
"path": "Ruta",
|
||||||
"please_select": "Por favor seleccione",
|
"please_select": "Por favor seleccione",
|
||||||
"plugin": "Configuración del Plugin",
|
|
||||||
"plugin_opts": "Opciones del Plugin",
|
|
||||||
"port": "Puerto",
|
"port": "Puerto",
|
||||||
"protocol_configurations": "Configuraciones de Protocolo",
|
"protocol_configurations": "Configuraciones de Protocolo",
|
||||||
"protocol_configurations_desc": "Habilitar y configurar los tipos de protocolo requeridos",
|
"protocol_configurations_desc": "Habilitar y configurar los tipos de protocolo requeridos",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Cadena hexadecimal (hasta 16 caracteres)",
|
"security_short_id_placeholder": "Cadena hexadecimal (hasta 16 caracteres)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Seleccionar método de cifrado",
|
"select_encryption_method": "Seleccionar método de cifrado",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Gestionar claves de comunicación del nodo, intervalos de extracción/push.",
|
||||||
|
"dynamic_multiplier": "Multiplicador dinámico",
|
||||||
|
"dynamic_multiplier_desc": "Definir intervalos de tiempo y multiplicadores para ajustar la contabilidad del tráfico.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Una regla de dominio por línea, soporta:\nkeyword:google (coincidencia de palabras clave)\nsuffix:google.com (coincidencia de sufijo)\nregex:.*\\.example\\.com$ (coincidencia de regex)\nexample.com (coincidencia exacta)",
|
||||||
|
"communication_key": "Clave de comunicación",
|
||||||
|
"communication_key_desc": "Utilizado para la autenticación del nodo.",
|
||||||
|
"communication_key_placeholder": "Por favor ingrese",
|
||||||
|
"dns_config": "Configuración de DNS",
|
||||||
|
"dns_domains_placeholder": "Una regla de dominio por línea, soporta:\nkeyword:google (coincidencia de palabras clave)\nsuffix:google.com (coincidencia de sufijo)\nregex:.*\\.example\\.com$ (coincidencia de regex)\nexample.com (coincidencia exacta)",
|
||||||
|
"dns_proto_placeholder": "Seleccionar tipo",
|
||||||
|
"end_time": "Hora de finalización",
|
||||||
|
"ip_strategy": "Estrategia de IP",
|
||||||
|
"ip_strategy_desc": "Elija la preferencia de versión de IP para conexiones de red",
|
||||||
|
"ip_strategy_ipv4": "Preferir IPv4",
|
||||||
|
"ip_strategy_ipv6": "Preferir IPv6",
|
||||||
|
"ip_strategy_placeholder": "Seleccionar estrategia de IP",
|
||||||
|
"multiplier": "Multiplicador",
|
||||||
|
"node_pull_interval": "Intervalo de extracción del nodo",
|
||||||
|
"node_pull_interval_desc": "Con qué frecuencia el nodo extrae la configuración (segundos).",
|
||||||
|
"node_push_interval": "Intervalo de push del nodo",
|
||||||
|
"node_push_interval_desc": "Con qué frecuencia el nodo envía estadísticas (segundos).",
|
||||||
|
"outbound_address_placeholder": "Dirección del servidor",
|
||||||
|
"outbound_name_placeholder": "Nombre de la configuración",
|
||||||
|
"outbound_password_placeholder": "Contraseña (opcional)",
|
||||||
|
"outbound_port_placeholder": "Número de puerto",
|
||||||
|
"outbound_protocol_placeholder": "Seleccionar protocolo",
|
||||||
|
"outbound_rules_placeholder": "Una regla por línea, soporta:\nkeyword:google (coincidencia de palabras clave)\nsuffix:google.com (coincidencia de sufijo)\nregex:.*\\.example\\.com$ (coincidencia de regex)\nexample.com (coincidencia exacta)\nDejar vacío para enrutamiento por defecto",
|
||||||
|
"reset": "Restablecer",
|
||||||
|
"save": "Guardar",
|
||||||
|
"start_time": "Hora de inicio",
|
||||||
|
"time_slot": "Intervalo de tiempo",
|
||||||
|
"traffic_report_threshold": "Umbral de Informe de Tráfico",
|
||||||
|
"traffic_report_threshold_desc": "Establecer el umbral mínimo para el informe de tráfico. El tráfico solo se informará cuando supere este valor. Establezca en 0 o deje vacío para informar todo el tráfico."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Guardado con éxito",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Configuración Básica",
|
||||||
|
"block": "Reglas de Bloqueo",
|
||||||
|
"dns": "Configuración de DNS",
|
||||||
|
"outbound": "Reglas Salientes"
|
||||||
|
},
|
||||||
|
"title": "Configuración del nodo"
|
||||||
|
},
|
||||||
"server_key": "Clave del servidor",
|
"server_key": "Clave del servidor",
|
||||||
"service_name": "Nombre del servicio",
|
"service_name": "Nombre del servicio",
|
||||||
|
"sorted_success": "Ordenado con éxito",
|
||||||
"status": "Estado",
|
"status": "Estado",
|
||||||
"subscribeId": "ID de suscripción",
|
"subscribeId": "ID de suscripción",
|
||||||
"subscription": "Suscripción",
|
"subscription": "Suscripción",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Confirmar",
|
"confirm": "Confirmar",
|
||||||
"confirmDelete": "¿Está seguro de que desea eliminar?",
|
"confirmDelete": "¿Está seguro de que desea eliminar?",
|
||||||
"confirmOffline": "Confirmar sin conexión",
|
"confirmOffline": "Confirmar sin conexión",
|
||||||
|
"copySubscription": "Copiar Suscripción",
|
||||||
|
"copySuccess": "Copia exitosa",
|
||||||
"create": "Crear",
|
"create": "Crear",
|
||||||
"createSubscription": "Crear suscripción",
|
"createSubscription": "Crear suscripción",
|
||||||
"createSuccess": "Creación exitosa",
|
"createSuccess": "Creación exitosa",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Seleccionar protocolo…",
|
"select_protocol": "Seleccionar protocolo…",
|
||||||
"select_server": "Seleccionar servidor…",
|
"select_server": "Seleccionar servidor…",
|
||||||
"server": "Servidor",
|
"server": "Servidor",
|
||||||
|
"sorted_success": "Ordenado con éxito",
|
||||||
"tags": "Etiquetas",
|
"tags": "Etiquetas",
|
||||||
"tags_description": "Etiqueta de agrupación de permisos (incl. vinculación de planes y políticas de entrega).",
|
"tags_description": "Etiqueta de agrupación de permisos (incl. vinculación de planes y políticas de entrega).",
|
||||||
"tags_placeholder": "Usa Enter o coma (,) para agregar múltiples etiquetas",
|
"tags_placeholder": "Usa Enter o coma (,) para agregar múltiples etiquetas",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Cancelar",
|
||||||
|
"save": "Guardar"
|
||||||
|
},
|
||||||
"address": "Dirección",
|
"address": "Dirección",
|
||||||
"address_placeholder": "Dirección del servidor",
|
"address_placeholder": "Dirección del servidor",
|
||||||
|
"apiHost": "Host de API",
|
||||||
|
"apiHostPlaceholder": "http(s)://ejemplo.com",
|
||||||
"bandwidth_placeholder": "Ingresa el ancho de banda, deja vacío para BBR",
|
"bandwidth_placeholder": "Ingresa el ancho de banda, deja vacío para BBR",
|
||||||
"basic": "Configuración Básica",
|
"basic": "Configuración Básica",
|
||||||
"cancel": "Cancelar",
|
"cancel": "Cancelar",
|
||||||
|
"cert_dns_env": "Variables de Entorno DNS",
|
||||||
|
"cert_dns_provider": "Proveedor de DNS",
|
||||||
|
"cert_mode": "Modo de Certificado",
|
||||||
|
"cipher": "Algoritmo de Cifrado",
|
||||||
"city": "Ciudad",
|
"city": "Ciudad",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Cancelar",
|
|
||||||
"save": "Guardar"
|
|
||||||
},
|
|
||||||
"communicationKey": "Clave de comunicación",
|
|
||||||
"communicationKeyDescription": "Utilizado para la autenticación del nodo.",
|
|
||||||
"description": "Gestiona las claves de comunicación del nodo, intervalos de extracción/empuje y multiplicadores dinámicos.",
|
|
||||||
"dynamicMultiplier": "Multiplicador dinámico",
|
|
||||||
"dynamicMultiplierDescription": "Define intervalos de tiempo y multiplicadores para ajustar la contabilidad del tráfico.",
|
|
||||||
"endTime": "Hora de finalización",
|
|
||||||
"inputPlaceholder": "Por favor ingresa",
|
|
||||||
"multiplier": "Multiplicador",
|
|
||||||
"nodePullInterval": "Intervalo de extracción del nodo",
|
|
||||||
"nodePullIntervalDescription": "Con qué frecuencia el nodo extrae la configuración (segundos).",
|
|
||||||
"nodePushInterval": "Intervalo de empuje del nodo",
|
|
||||||
"nodePushIntervalDescription": "Con qué frecuencia el nodo envía estadísticas (segundos).",
|
|
||||||
"reset": "Restablecer",
|
|
||||||
"save": "Guardar",
|
|
||||||
"saveSuccess": "Guardado con éxito",
|
|
||||||
"startTime": "Hora de inicio",
|
|
||||||
"timeSlot": "Intervalo de tiempo",
|
|
||||||
"title": "Configuración del nodo"
|
|
||||||
},
|
|
||||||
"confirm": "Confirmar",
|
"confirm": "Confirmar",
|
||||||
"confirmDeleteDesc": "Esta acción no se puede deshacer.",
|
"confirmDeleteDesc": "Esta acción no se puede deshacer.",
|
||||||
"confirmDeleteTitle": "¿Eliminar este servidor?",
|
"confirmDeleteTitle": "¿Eliminar este servidor?",
|
||||||
"congestion_controller": "Controlador de congestión",
|
"congestion_controller": "Controlador de congestión",
|
||||||
|
"connect": "Conectar",
|
||||||
"copied": "Copiado",
|
"copied": "Copiado",
|
||||||
"copy": "Copiar",
|
"copy": "Copiar",
|
||||||
"country": "País",
|
"country": "País",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Editar Servidor",
|
"drawerEditTitle": "Editar Servidor",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"enabled": "Habilitado",
|
"enabled": "Habilitado",
|
||||||
"encryption_method": "Método de encriptación",
|
"encryption": "Método de Cifrado",
|
||||||
|
"encryption_client_padding": "Relleno del Cliente",
|
||||||
|
"encryption_mode": "Modo",
|
||||||
|
"encryption_password": "Contraseña",
|
||||||
|
"encryption_password_placeholder": "Dejar vacío para auto-generación, reemplazar manualmente para cifrado post-cuántico",
|
||||||
|
"encryption_private_key": "Clave Privada",
|
||||||
|
"encryption_private_key_placeholder": "Dejar vacío para auto-generación, reemplazar manualmente para cifrado post-cuántico",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Relleno del Servidor",
|
||||||
|
"encryption_ticket": "Tiempo de Ticket",
|
||||||
"expireTime": "Tiempo de expiración",
|
"expireTime": "Tiempo de expiración",
|
||||||
"expired": "Expirado",
|
"expired": "Expirado",
|
||||||
|
"extra": "Configuración Extra",
|
||||||
"flow": "Flujo",
|
"flow": "Flujo",
|
||||||
|
"generate_quantum_resistant_key": "Generar clave resistente a cuánticos",
|
||||||
|
"generate_standard_encryption_key": "Generar clave de cifrado estándar",
|
||||||
"hop_interval": "Intervalo de salto",
|
"hop_interval": "Intervalo de salto",
|
||||||
"hop_ports": "Puertos de salto",
|
"hop_ports": "Puertos de salto",
|
||||||
"hop_ports_placeholder": "p. ej. 1-65535",
|
"hop_ports_placeholder": "p. ej. 1-65535",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Comando de instalación",
|
||||||
"ipAddresses": "Direcciones IP",
|
"ipAddresses": "Direcciones IP",
|
||||||
"memory": "Memoria",
|
"memory": "Memoria",
|
||||||
"migrate": "Migrar datos",
|
"migrate": "Migrar datos",
|
||||||
"migrateFailed": "La migración de datos falló",
|
"migrateFailed": "La migración de datos falló",
|
||||||
"migrated": "Datos migrados con éxito",
|
"migrated": "Datos migrados con éxito",
|
||||||
"migrating": "Migrando...",
|
"migrating": "Migrando...",
|
||||||
|
"mode": "Modo",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Nombre",
|
"name": "Nombre",
|
||||||
"noData": "Sin datos",
|
"noData": "Sin datos",
|
||||||
"notAvailable": "N/A",
|
"notAvailable": "N/A",
|
||||||
|
"obfs": "Ofuscación",
|
||||||
|
"obfs_host": "Host de Ofuscación",
|
||||||
"obfs_password": "Contraseña de ofuscación",
|
"obfs_password": "Contraseña de ofuscación",
|
||||||
"obfs_password_placeholder": "Ingresa la contraseña de ofuscación",
|
"obfs_password_placeholder": "Ingresa la contraseña de ofuscación",
|
||||||
|
"obfs_path": "Ruta de Ofuscación",
|
||||||
"offline": "Desconectado",
|
"offline": "Desconectado",
|
||||||
|
"oneClickInstall": "Instalación con un clic",
|
||||||
"online": "Conectado",
|
"online": "Conectado",
|
||||||
"onlineUsers": "Usuarios en línea",
|
"onlineUsers": "Usuarios en línea",
|
||||||
"padding_scheme": "Esquema de Relleno",
|
"padding_scheme": "Esquema de Relleno",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Servidores",
|
"pageTitle": "Servidores",
|
||||||
"path": "Ruta",
|
"path": "Ruta",
|
||||||
"please_select": "Por favor selecciona",
|
"please_select": "Por favor selecciona",
|
||||||
"plugin": "Configuración del Plugin",
|
|
||||||
"plugin_opts": "Opciones del Plugin",
|
|
||||||
"port": "Puerto",
|
"port": "Puerto",
|
||||||
"protocol_configurations": "Configuraciones de Protocolo",
|
"protocol_configurations": "Configuraciones de Protocolo",
|
||||||
"protocol_configurations_desc": "Habilitar y configurar los tipos de protocolo requeridos",
|
"protocol_configurations_desc": "Habilitar y configurar los tipos de protocolo requeridos",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Cadena hexadecimal (hasta 16 caracteres)",
|
"security_short_id_placeholder": "Cadena hexadecimal (hasta 16 caracteres)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Selecciona el método de encriptación",
|
"select_encryption_method": "Selecciona el método de encriptación",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Gestionar claves de comunicación del nodo, intervalos de extracción/push.",
|
||||||
|
"dynamic_multiplier": "Multiplicador Dinámico",
|
||||||
|
"dynamic_multiplier_desc": "Definir intervalos de tiempo y multiplicadores para ajustar la contabilidad del tráfico.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Una regla de dominio por línea, soporta:\nkeyword:google (coincidencia de palabra clave)\nsuffix:google.com (coincidencia de sufijo)\nregex:.*\\.example\\.com$ (coincidencia de regex)\nexample.com (coincidencia exacta)",
|
||||||
|
"communication_key": "Clave de Comunicación",
|
||||||
|
"communication_key_desc": "Utilizado para la autenticación del nodo.",
|
||||||
|
"communication_key_placeholder": "Por favor ingrese",
|
||||||
|
"dns_config": "Configuración de DNS",
|
||||||
|
"dns_domains_placeholder": "Una regla de dominio por línea, soporta:\nkeyword:google (coincidencia de palabra clave)\nsuffix:google.com (coincidencia de sufijo)\nregex:.*\\.example\\.com$ (coincidencia de regex)\nexample.com (coincidencia exacta)",
|
||||||
|
"dns_proto_placeholder": "Seleccionar tipo",
|
||||||
|
"end_time": "Hora de Fin",
|
||||||
|
"ip_strategy": "Estrategia de IP",
|
||||||
|
"ip_strategy_desc": "Elija la preferencia de versión de IP para conexiones de red",
|
||||||
|
"ip_strategy_ipv4": "Preferir IPv4",
|
||||||
|
"ip_strategy_ipv6": "Preferir IPv6",
|
||||||
|
"ip_strategy_placeholder": "Seleccionar estrategia de IP",
|
||||||
|
"multiplier": "Multiplicador",
|
||||||
|
"node_pull_interval": "Intervalo de Extracción del Nodo",
|
||||||
|
"node_pull_interval_desc": "Con qué frecuencia el nodo extrae la configuración (segundos).",
|
||||||
|
"node_push_interval": "Intervalo de Push del Nodo",
|
||||||
|
"node_push_interval_desc": "Con qué frecuencia el nodo envía estadísticas (segundos).",
|
||||||
|
"outbound_address_placeholder": "Dirección del servidor",
|
||||||
|
"outbound_name_placeholder": "Nombre de la configuración",
|
||||||
|
"outbound_password_placeholder": "Contraseña (opcional)",
|
||||||
|
"outbound_port_placeholder": "Número de puerto",
|
||||||
|
"outbound_protocol_placeholder": "Seleccionar protocolo",
|
||||||
|
"outbound_rules_placeholder": "Una regla por línea, soporta:\nkeyword:google (coincidencia de palabra clave)\nsuffix:google.com (coincidencia de sufijo)\nregex:.*\\.example\\.com$ (coincidencia de regex)\nexample.com (coincidencia exacta)\nDejar vacío para enrutamiento por defecto",
|
||||||
|
"reset": "Restablecer",
|
||||||
|
"save": "Guardar",
|
||||||
|
"start_time": "Hora de Inicio",
|
||||||
|
"time_slot": "Intervalo de Tiempo",
|
||||||
|
"traffic_report_threshold": "Umbral de Informe de Tráfico",
|
||||||
|
"traffic_report_threshold_desc": "Establecer el umbral mínimo para el informe de tráfico. El tráfico solo se informará cuando supere este valor. Establezca en 0 o deje vacío para informar todo el tráfico."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Guardado exitosamente",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Configuración Básica",
|
||||||
|
"block": "Reglas de Bloqueo",
|
||||||
|
"dns": "Configuración de DNS",
|
||||||
|
"outbound": "Reglas Salientes"
|
||||||
|
},
|
||||||
|
"title": "Configuración del Nodo"
|
||||||
|
},
|
||||||
"server_key": "Clave del servidor",
|
"server_key": "Clave del servidor",
|
||||||
"service_name": "Nombre del servicio",
|
"service_name": "Nombre del servicio",
|
||||||
|
"sorted_success": "Ordenado con éxito",
|
||||||
"status": "Estado",
|
"status": "Estado",
|
||||||
"subscribeId": "ID de suscripción",
|
"subscribeId": "ID de suscripción",
|
||||||
"subscription": "Suscripción",
|
"subscription": "Suscripción",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Confirmar",
|
"confirm": "Confirmar",
|
||||||
"confirmDelete": "¿Está seguro de que desea eliminar?",
|
"confirmDelete": "¿Está seguro de que desea eliminar?",
|
||||||
"confirmOffline": "Confirmar sin conexión",
|
"confirmOffline": "Confirmar sin conexión",
|
||||||
|
"copySubscription": "Copiar Suscripción",
|
||||||
|
"copySuccess": "Copia exitosa",
|
||||||
"create": "Crear",
|
"create": "Crear",
|
||||||
"createSubscription": "Crear Suscripción",
|
"createSubscription": "Crear Suscripción",
|
||||||
"createSuccess": "Creación exitosa",
|
"createSuccess": "Creación exitosa",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "پروتکل را انتخاب کنید…",
|
"select_protocol": "پروتکل را انتخاب کنید…",
|
||||||
"select_server": "سرور را انتخاب کنید…",
|
"select_server": "سرور را انتخاب کنید…",
|
||||||
"server": "سرور",
|
"server": "سرور",
|
||||||
|
"sorted_success": "با موفقیت مرتب شد",
|
||||||
"tags": "برچسبها",
|
"tags": "برچسبها",
|
||||||
"tags_description": "برچسب گروهبندی مجوز (شامل پیوند برنامه و سیاستهای تحویل).",
|
"tags_description": "برچسب گروهبندی مجوز (شامل پیوند برنامه و سیاستهای تحویل).",
|
||||||
"tags_placeholder": "برای افزودن چندین برچسب از Enter یا ویرگول (,) استفاده کنید",
|
"tags_placeholder": "برای افزودن چندین برچسب از Enter یا ویرگول (,) استفاده کنید",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "لغو",
|
||||||
|
"save": "ذخیره"
|
||||||
|
},
|
||||||
"address": "آدرس",
|
"address": "آدرس",
|
||||||
"address_placeholder": "آدرس سرور",
|
"address_placeholder": "آدرس سرور",
|
||||||
|
"apiHost": "میزبان API",
|
||||||
|
"apiHostPlaceholder": "http(s)://example.com",
|
||||||
"bandwidth_placeholder": "عرض پهنای باند، برای BBR خالی بگذارید",
|
"bandwidth_placeholder": "عرض پهنای باند، برای BBR خالی بگذارید",
|
||||||
"basic": "پیکربندی پایه",
|
"basic": "پیکربندی پایه",
|
||||||
"cancel": "لغو",
|
"cancel": "لغو",
|
||||||
|
"cert_dns_env": "متغیرهای محیطی DNS",
|
||||||
|
"cert_dns_provider": "ارائهدهنده DNS",
|
||||||
|
"cert_mode": "حالت گواهی",
|
||||||
|
"cipher": "الگوریتم رمزنگاری",
|
||||||
"city": "شهر",
|
"city": "شهر",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "لغو",
|
|
||||||
"save": "ذخیره"
|
|
||||||
},
|
|
||||||
"communicationKey": "کلید ارتباطی",
|
|
||||||
"communicationKeyDescription": "برای احراز هویت نود استفاده میشود.",
|
|
||||||
"description": "مدیریت کلیدهای ارتباطی نود، فواصل کشیدن/فشردن و ضریبهای دینامیک.",
|
|
||||||
"dynamicMultiplier": "ضریب دینامیک",
|
|
||||||
"dynamicMultiplierDescription": "تعریف زمانهای مشخص و ضریبها برای تنظیم حسابداری ترافیک.",
|
|
||||||
"endTime": "زمان پایان",
|
|
||||||
"inputPlaceholder": "لطفاً وارد کنید",
|
|
||||||
"multiplier": "ضریب",
|
|
||||||
"nodePullInterval": "فاصله کشیدن نود",
|
|
||||||
"nodePullIntervalDescription": "چند وقت یکبار نود پیکربندی را میکشد (ثانیه).",
|
|
||||||
"nodePushInterval": "فاصله فشردن نود",
|
|
||||||
"nodePushIntervalDescription": "چند وقت یکبار نود آمار را فشرده میکند (ثانیه).",
|
|
||||||
"reset": "بازنشانی",
|
|
||||||
"save": "ذخیره",
|
|
||||||
"saveSuccess": "با موفقیت ذخیره شد",
|
|
||||||
"startTime": "زمان شروع",
|
|
||||||
"timeSlot": "زمانبندی",
|
|
||||||
"title": "پیکربندی نود"
|
|
||||||
},
|
|
||||||
"confirm": "تأیید",
|
"confirm": "تأیید",
|
||||||
"confirmDeleteDesc": "این عمل قابل بازگشت نیست.",
|
"confirmDeleteDesc": "این عمل قابل بازگشت نیست.",
|
||||||
"confirmDeleteTitle": "آیا این سرور را حذف کنید؟",
|
"confirmDeleteTitle": "آیا این سرور را حذف کنید؟",
|
||||||
"congestion_controller": "کنترلکننده ترافیک",
|
"congestion_controller": "کنترلکننده ترافیک",
|
||||||
|
"connect": "اتصال",
|
||||||
"copied": "کپی شد",
|
"copied": "کپی شد",
|
||||||
"copy": "کپی",
|
"copy": "کپی",
|
||||||
"country": "کشور",
|
"country": "کشور",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "ویرایش سرور",
|
"drawerEditTitle": "ویرایش سرور",
|
||||||
"edit": "ویرایش",
|
"edit": "ویرایش",
|
||||||
"enabled": "فعال",
|
"enabled": "فعال",
|
||||||
"encryption_method": "روش رمزنگاری",
|
"encryption": "روش رمزنگاری",
|
||||||
|
"encryption_client_padding": "پدینگ کلاینت",
|
||||||
|
"encryption_mode": "حالت",
|
||||||
|
"encryption_password": "گذرواژه",
|
||||||
|
"encryption_password_placeholder": "برای تولید خودکار خالی بگذارید، به صورت دستی برای رمزنگاری پساکوانتومی جایگزین کنید",
|
||||||
|
"encryption_private_key": "کلید خصوصی",
|
||||||
|
"encryption_private_key_placeholder": "برای تولید خودکار خالی بگذارید، به صورت دستی برای رمزنگاری پساکوانتومی جایگزین کنید",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "پدینگ سرور",
|
||||||
|
"encryption_ticket": "زمان بلیط",
|
||||||
"expireTime": "زمان انقضا",
|
"expireTime": "زمان انقضا",
|
||||||
"expired": "منقضی شده",
|
"expired": "منقضی شده",
|
||||||
|
"extra": "پیکربندی اضافی",
|
||||||
"flow": "جریان",
|
"flow": "جریان",
|
||||||
|
"generate_quantum_resistant_key": "تولید کلید مقاوم در برابر کوانتوم",
|
||||||
|
"generate_standard_encryption_key": "تولید کلید رمزگذاری استاندارد",
|
||||||
"hop_interval": "فاصله پرش",
|
"hop_interval": "فاصله پرش",
|
||||||
"hop_ports": "پورتهای پرش",
|
"hop_ports": "پورتهای پرش",
|
||||||
"hop_ports_placeholder": "مثلاً 1-65535",
|
"hop_ports_placeholder": "مثلاً 1-65535",
|
||||||
"host": "میزبان",
|
"host": "میزبان",
|
||||||
"id": "شناسه",
|
"id": "شناسه",
|
||||||
|
"installCommand": "دستور نصب",
|
||||||
"ipAddresses": "آدرسهای IP",
|
"ipAddresses": "آدرسهای IP",
|
||||||
"memory": "حافظه",
|
"memory": "حافظه",
|
||||||
"migrate": "انتقال داده",
|
"migrate": "انتقال داده",
|
||||||
"migrateFailed": "انتقال داده ناموفق بود",
|
"migrateFailed": "انتقال داده ناموفق بود",
|
||||||
"migrated": "داده با موفقیت منتقل شد",
|
"migrated": "داده با موفقیت منتقل شد",
|
||||||
"migrating": "در حال انتقال...",
|
"migrating": "در حال انتقال...",
|
||||||
|
"mode": "حالت",
|
||||||
"multiplex": "چندمنظوره",
|
"multiplex": "چندمنظوره",
|
||||||
"name": "نام",
|
"name": "نام",
|
||||||
"noData": "هیچ دادهای",
|
"noData": "هیچ دادهای",
|
||||||
"notAvailable": "غیرقابل دسترسی",
|
"notAvailable": "غیرقابل دسترسی",
|
||||||
|
"obfs": "پنهانسازی",
|
||||||
|
"obfs_host": "میزبان پنهانسازی",
|
||||||
"obfs_password": "رمز عبور اختفا",
|
"obfs_password": "رمز عبور اختفا",
|
||||||
"obfs_password_placeholder": "رمز عبور اختفا را وارد کنید",
|
"obfs_password_placeholder": "رمز عبور اختفا را وارد کنید",
|
||||||
|
"obfs_path": "مسیر پنهانسازی",
|
||||||
"offline": "آفلاین",
|
"offline": "آفلاین",
|
||||||
|
"oneClickInstall": "نصب با یک کلیک",
|
||||||
"online": "آنلاین",
|
"online": "آنلاین",
|
||||||
"onlineUsers": "کاربران آنلاین",
|
"onlineUsers": "کاربران آنلاین",
|
||||||
"padding_scheme": "طرح پدینگ",
|
"padding_scheme": "طرح پدینگ",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "سرورها",
|
"pageTitle": "سرورها",
|
||||||
"path": "مسیر",
|
"path": "مسیر",
|
||||||
"please_select": "لطفاً انتخاب کنید",
|
"please_select": "لطفاً انتخاب کنید",
|
||||||
"plugin": "پیکربندی پلاگین",
|
|
||||||
"plugin_opts": "گزینههای پلاگین",
|
|
||||||
"port": "پورت",
|
"port": "پورت",
|
||||||
"protocol_configurations": "پیکربندیهای پروتکل",
|
"protocol_configurations": "پیکربندیهای پروتکل",
|
||||||
"protocol_configurations_desc": "پروتکلهای مورد نیاز را فعال و پیکربندی کنید",
|
"protocol_configurations_desc": "پروتکلهای مورد نیاز را فعال و پیکربندی کنید",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "رشته هگز (حداکثر 16 کاراکتر)",
|
"security_short_id_placeholder": "رشته هگز (حداکثر 16 کاراکتر)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "روش رمزنگاری را انتخاب کنید",
|
"select_encryption_method": "روش رمزنگاری را انتخاب کنید",
|
||||||
|
"server_config": {
|
||||||
|
"description": "مدیریت کلیدهای ارتباط نود، فواصل کشیدن/فشردن.",
|
||||||
|
"dynamic_multiplier": "ضریب دینامیک",
|
||||||
|
"dynamic_multiplier_desc": "زمانهای مشخص و ضرایب را برای تنظیم حسابداری ترافیک تعریف کنید.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "یک قانون دامنه در هر خط، پشتیبانی میکند:\nkeyword:google (مطابقت با کلمه کلیدی)\nsuffix:google.com (مطابقت با پسوند)\nregex:.*\\.example\\.com$ (مطابقت با regex)\nexample.com (مطابقت دقیق)",
|
||||||
|
"communication_key": "کلید ارتباطی",
|
||||||
|
"communication_key_desc": "برای احراز هویت نود استفاده میشود.",
|
||||||
|
"communication_key_placeholder": "لطفاً وارد کنید",
|
||||||
|
"dns_config": "پیکربندی DNS",
|
||||||
|
"dns_domains_placeholder": "یک قانون دامنه در هر خط، پشتیبانی میکند:\nkeyword:google (مطابقت با کلمه کلیدی)\nsuffix:google.com (مطابقت با پسوند)\nregex:.*\\.example\\.com$ (مطابقت با regex)\nexample.com (مطابقت دقیق)",
|
||||||
|
"dns_proto_placeholder": "نوع را انتخاب کنید",
|
||||||
|
"end_time": "زمان پایان",
|
||||||
|
"ip_strategy": "استراتژی IP",
|
||||||
|
"ip_strategy_desc": "ترجیح نسخه IP را برای اتصالات شبکه انتخاب کنید",
|
||||||
|
"ip_strategy_ipv4": "ترجیح IPv4",
|
||||||
|
"ip_strategy_ipv6": "ترجیح IPv6",
|
||||||
|
"ip_strategy_placeholder": "استراتژی IP را انتخاب کنید",
|
||||||
|
"multiplier": "ضریب",
|
||||||
|
"node_pull_interval": "فاصله کشیدن نود",
|
||||||
|
"node_pull_interval_desc": "چند وقت یکبار نود پیکربندی را میکشد (ثانیه).",
|
||||||
|
"node_push_interval": "فاصله فشردن نود",
|
||||||
|
"node_push_interval_desc": "چند وقت یکبار نود آمار را فشرده میکند (ثانیه).",
|
||||||
|
"outbound_address_placeholder": "آدرس سرور",
|
||||||
|
"outbound_name_placeholder": "نام پیکربندی",
|
||||||
|
"outbound_password_placeholder": "رمز عبور (اختیاری)",
|
||||||
|
"outbound_port_placeholder": "شماره پورت",
|
||||||
|
"outbound_protocol_placeholder": "پروتکل را انتخاب کنید",
|
||||||
|
"outbound_rules_placeholder": "یک قانون در هر خط، پشتیبانی میکند:\nkeyword:google (مطابقت با کلمه کلیدی)\nsuffix:google.com (مطابقت با پسوند)\nregex:.*\\.example\\.com$ (مطابقت با regex)\nexample.com (مطابقت دقیق)\nبرای مسیریابی پیشفرض خالی بگذارید",
|
||||||
|
"reset": "تنظیم مجدد",
|
||||||
|
"save": "ذخیره",
|
||||||
|
"start_time": "زمان شروع",
|
||||||
|
"time_slot": "بازه زمانی",
|
||||||
|
"traffic_report_threshold": "آستانه گزارش ترافیک",
|
||||||
|
"traffic_report_threshold_desc": "حداقل آستانه برای گزارش ترافیک را تنظیم کنید. ترافیک فقط زمانی گزارش میشود که از این مقدار فراتر رود. برای گزارش همه ترافیک، مقدار را 0 تنظیم کنید یا خالی بگذارید."
|
||||||
|
},
|
||||||
|
"saveSuccess": "با موفقیت ذخیره شد",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "پیکربندی پایه",
|
||||||
|
"block": "قوانین مسدود",
|
||||||
|
"dns": "پیکربندی DNS",
|
||||||
|
"outbound": "قوانین خروجی"
|
||||||
|
},
|
||||||
|
"title": "پیکربندی نود"
|
||||||
|
},
|
||||||
"server_key": "کلید سرور",
|
"server_key": "کلید سرور",
|
||||||
"service_name": "نام سرویس",
|
"service_name": "نام سرویس",
|
||||||
|
"sorted_success": "با موفقیت مرتب شد",
|
||||||
"status": "وضعیت",
|
"status": "وضعیت",
|
||||||
"subscribeId": "شناسه اشتراک",
|
"subscribeId": "شناسه اشتراک",
|
||||||
"subscription": "اشتراک",
|
"subscription": "اشتراک",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "تأیید",
|
"confirm": "تأیید",
|
||||||
"confirmDelete": "آیا مطمئن هستید که میخواهید حذف کنید؟",
|
"confirmDelete": "آیا مطمئن هستید که میخواهید حذف کنید؟",
|
||||||
"confirmOffline": "تأیید آفلاین",
|
"confirmOffline": "تأیید آفلاین",
|
||||||
|
"copySubscription": "کپی اشتراک",
|
||||||
|
"copySuccess": "کپی با موفقیت انجام شد",
|
||||||
"create": "ایجاد",
|
"create": "ایجاد",
|
||||||
"createSubscription": "ایجاد اشتراک",
|
"createSubscription": "ایجاد اشتراک",
|
||||||
"createSuccess": "ایجاد با موفقیت انجام شد",
|
"createSuccess": "ایجاد با موفقیت انجام شد",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Valitse protokolla…",
|
"select_protocol": "Valitse protokolla…",
|
||||||
"select_server": "Valitse palvelin…",
|
"select_server": "Valitse palvelin…",
|
||||||
"server": "Palvelin",
|
"server": "Palvelin",
|
||||||
|
"sorted_success": "Lajiteltu onnistuneesti",
|
||||||
"tags": "Tunnisteet",
|
"tags": "Tunnisteet",
|
||||||
"tags_description": "Oikeuksien ryhmittelytunniste (mukaan lukien suunnitelman sitominen ja toimituskäytännöt).",
|
"tags_description": "Oikeuksien ryhmittelytunniste (mukaan lukien suunnitelman sitominen ja toimituskäytännöt).",
|
||||||
"tags_placeholder": "Käytä Enteriä tai pilkkua (,) lisätäksesi useita tunnisteita",
|
"tags_placeholder": "Käytä Enteriä tai pilkkua (,) lisätäksesi useita tunnisteita",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Peruuta",
|
||||||
|
"save": "Tallenna"
|
||||||
|
},
|
||||||
"address": "Osoite",
|
"address": "Osoite",
|
||||||
"address_placeholder": "Palvelimen osoite",
|
"address_placeholder": "Palvelimen osoite",
|
||||||
|
"apiHost": "API-isäntä",
|
||||||
|
"apiHostPlaceholder": "http(s)://esimerkki.com",
|
||||||
"bandwidth_placeholder": "Syötä kaistanleveys, jätä tyhjäksi BBR:lle",
|
"bandwidth_placeholder": "Syötä kaistanleveys, jätä tyhjäksi BBR:lle",
|
||||||
"basic": "Perusasetukset",
|
"basic": "Perusasetukset",
|
||||||
"cancel": "Peruuta",
|
"cancel": "Peruuta",
|
||||||
|
"cert_dns_env": "DNS-ympäristömuuttujat",
|
||||||
|
"cert_dns_provider": "DNS-toimittaja",
|
||||||
|
"cert_mode": "Sertifikaattitila",
|
||||||
|
"cipher": "Salausalgoritmi",
|
||||||
"city": "Kaupunki",
|
"city": "Kaupunki",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Peruuta",
|
|
||||||
"save": "Tallenna"
|
|
||||||
},
|
|
||||||
"communicationKey": "Viestintäavain",
|
|
||||||
"communicationKeyDescription": "Käytetään solmun todennukseen.",
|
|
||||||
"description": "Hallitse solmun viestintäavaimia, vetovälejä ja dynaamisia kertoimia.",
|
|
||||||
"dynamicMultiplier": "Dynaaminen kerroin",
|
|
||||||
"dynamicMultiplierDescription": "Määritä aikaväli ja kertoimet liikenteen laskentaa varten.",
|
|
||||||
"endTime": "Lopetusaika",
|
|
||||||
"inputPlaceholder": "Ole hyvä ja syötä",
|
|
||||||
"multiplier": "Kerroin",
|
|
||||||
"nodePullInterval": "Solmun vetoväli",
|
|
||||||
"nodePullIntervalDescription": "Kuinka usein solmu vetää konfiguraation (sekunteina).",
|
|
||||||
"nodePushInterval": "Solmun työntöväli",
|
|
||||||
"nodePushIntervalDescription": "Kuinka usein solmu työntää tilastoja (sekunteina).",
|
|
||||||
"reset": "Nollaa",
|
|
||||||
"save": "Tallenna",
|
|
||||||
"saveSuccess": "Tallennus onnistui",
|
|
||||||
"startTime": "Aloitusaika",
|
|
||||||
"timeSlot": "Aikaväli",
|
|
||||||
"title": "Solmun konfigurointi"
|
|
||||||
},
|
|
||||||
"confirm": "Vahvista",
|
"confirm": "Vahvista",
|
||||||
"confirmDeleteDesc": "Tätä toimintoa ei voi peruuttaa.",
|
"confirmDeleteDesc": "Tätä toimintoa ei voi peruuttaa.",
|
||||||
"confirmDeleteTitle": "Poista tämä palvelin?",
|
"confirmDeleteTitle": "Poista tämä palvelin?",
|
||||||
"congestion_controller": "Ruuhkansäätö",
|
"congestion_controller": "Ruuhkansäätö",
|
||||||
|
"connect": "Yhdistä",
|
||||||
"copied": "Kopioitu",
|
"copied": "Kopioitu",
|
||||||
"copy": "Kopioi",
|
"copy": "Kopioi",
|
||||||
"country": "Maa",
|
"country": "Maa",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Muokkaa palvelinta",
|
"drawerEditTitle": "Muokkaa palvelinta",
|
||||||
"edit": "Muokkaa",
|
"edit": "Muokkaa",
|
||||||
"enabled": "Käytössä",
|
"enabled": "Käytössä",
|
||||||
"encryption_method": "Salausmenetelmä",
|
"encryption": "Salausmenetelmä",
|
||||||
|
"encryption_client_padding": "Asiakkaan täyte",
|
||||||
|
"encryption_mode": "Tila",
|
||||||
|
"encryption_password": "Salasana",
|
||||||
|
"encryption_password_placeholder": "Jätä tyhjäksi automaattista generointia varten, vaihda manuaalisesti post-kvanttisalausta varten",
|
||||||
|
"encryption_private_key": "Yksityinen avain",
|
||||||
|
"encryption_private_key_placeholder": "Jätä tyhjäksi automaattista generointia varten, vaihda manuaalisesti post-kvanttisalausta varten",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Palvelimen täyte",
|
||||||
|
"encryption_ticket": "Lippuaika",
|
||||||
"expireTime": "Voimassaoloaika",
|
"expireTime": "Voimassaoloaika",
|
||||||
"expired": "Vanhentunut",
|
"expired": "Vanhentunut",
|
||||||
|
"extra": "Lisäasetukset",
|
||||||
"flow": "Virta",
|
"flow": "Virta",
|
||||||
|
"generate_quantum_resistant_key": "Luo kvanttikestävä avain",
|
||||||
|
"generate_standard_encryption_key": "Luo standardi salausavain",
|
||||||
"hop_interval": "Hyppyvälit",
|
"hop_interval": "Hyppyvälit",
|
||||||
"hop_ports": "Hyppysatamat",
|
"hop_ports": "Hyppysatamat",
|
||||||
"hop_ports_placeholder": "esim. 1-65535",
|
"hop_ports_placeholder": "esim. 1-65535",
|
||||||
"host": "Isäntä",
|
"host": "Isäntä",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Asennuskomento",
|
||||||
"ipAddresses": "IP-osoitteet",
|
"ipAddresses": "IP-osoitteet",
|
||||||
"memory": "Muisti",
|
"memory": "Muisti",
|
||||||
"migrate": "Siirrä tiedot",
|
"migrate": "Siirrä tiedot",
|
||||||
"migrateFailed": "Tietojen siirto epäonnistui",
|
"migrateFailed": "Tietojen siirto epäonnistui",
|
||||||
"migrated": "Tiedot siirretty onnistuneesti",
|
"migrated": "Tiedot siirretty onnistuneesti",
|
||||||
"migrating": "Siirretään...",
|
"migrating": "Siirretään...",
|
||||||
|
"mode": "Tila",
|
||||||
"multiplex": "Monistamo",
|
"multiplex": "Monistamo",
|
||||||
"name": "Nimi",
|
"name": "Nimi",
|
||||||
"noData": "Ei tietoja",
|
"noData": "Ei tietoja",
|
||||||
"notAvailable": "Ei saatavilla",
|
"notAvailable": "Ei saatavilla",
|
||||||
|
"obfs": "Häilytys",
|
||||||
|
"obfs_host": "Häilytys isäntä",
|
||||||
"obfs_password": "Häilytyssalasana",
|
"obfs_password": "Häilytyssalasana",
|
||||||
"obfs_password_placeholder": "Syötä häilytyssalasana",
|
"obfs_password_placeholder": "Syötä häilytyssalasana",
|
||||||
|
"obfs_path": "Häilytys polku",
|
||||||
"offline": "Offline",
|
"offline": "Offline",
|
||||||
|
"oneClickInstall": "Yhden napsautuksen asennus",
|
||||||
"online": "Online",
|
"online": "Online",
|
||||||
"onlineUsers": "Verkossa olevat käyttäjät",
|
"onlineUsers": "Verkossa olevat käyttäjät",
|
||||||
"padding_scheme": "Täyttökaavio",
|
"padding_scheme": "Täyttökaavio",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Palvelimet",
|
"pageTitle": "Palvelimet",
|
||||||
"path": "Polku",
|
"path": "Polku",
|
||||||
"please_select": "Ole hyvä ja valitse",
|
"please_select": "Ole hyvä ja valitse",
|
||||||
"plugin": "Laajennuksen asetukset",
|
|
||||||
"plugin_opts": "Laajennusvaihtoehdot",
|
|
||||||
"port": "Portti",
|
"port": "Portti",
|
||||||
"protocol_configurations": "Protokolla-asetukset",
|
"protocol_configurations": "Protokolla-asetukset",
|
||||||
"protocol_configurations_desc": "Ota käyttöön ja määritä tarvittavat protokollatyypit",
|
"protocol_configurations_desc": "Ota käyttöön ja määritä tarvittavat protokollatyypit",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Hex-merkkijono (enintään 16 merkkiä)",
|
"security_short_id_placeholder": "Hex-merkkijono (enintään 16 merkkiä)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Valitse salausmenetelmä",
|
"select_encryption_method": "Valitse salausmenetelmä",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Hallitse solmun viestintäavaimia, vetämis-/työntövälejä.",
|
||||||
|
"dynamic_multiplier": "Dynaaminen kerroin",
|
||||||
|
"dynamic_multiplier_desc": "Määritä aikavälit ja kertoimet liikenteen laskentaa varten.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Yksi domain-sääntö per rivi, tukee:\nkeyword:google (avainsanan vastaavuus)\nsuffix:google.com (päätteiden vastaavuus)\nregex:.*\\.example\\.com$ (regex-vastaavuus)\nexample.com (täsmällinen vastaavuus)",
|
||||||
|
"communication_key": "Viestintäavain",
|
||||||
|
"communication_key_desc": "Käytetään solmun todennukseen.",
|
||||||
|
"communication_key_placeholder": "Ole hyvä ja syötä",
|
||||||
|
"dns_config": "DNS-asetukset",
|
||||||
|
"dns_domains_placeholder": "Yksi domain-sääntö per rivi, tukee:\nkeyword:google (avainsanan vastaavuus)\nsuffix:google.com (päätteiden vastaavuus)\nregex:.*\\.example\\.com$ (regex-vastaavuus)\nexample.com (täsmällinen vastaavuus)",
|
||||||
|
"dns_proto_placeholder": "Valitse tyyppi",
|
||||||
|
"end_time": "Lopetusaika",
|
||||||
|
"ip_strategy": "IP-strategia",
|
||||||
|
"ip_strategy_desc": "Valitse IP-version mieltymys verkkoyhteyksille",
|
||||||
|
"ip_strategy_ipv4": "Suosi IPv4:ää",
|
||||||
|
"ip_strategy_ipv6": "Suosi IPv6:ta",
|
||||||
|
"ip_strategy_placeholder": "Valitse IP-strategia",
|
||||||
|
"multiplier": "Kerroin",
|
||||||
|
"node_pull_interval": "Solmun vetoväli",
|
||||||
|
"node_pull_interval_desc": "Kuinka usein solmu vetää konfiguraation (sekunteina).",
|
||||||
|
"node_push_interval": "Solmun työntöväli",
|
||||||
|
"node_push_interval_desc": "Kuinka usein solmu työntää tilastoja (sekunteina).",
|
||||||
|
"outbound_address_placeholder": "Palvelimen osoite",
|
||||||
|
"outbound_name_placeholder": "Konfiguraation nimi",
|
||||||
|
"outbound_password_placeholder": "Salasana (valinnainen)",
|
||||||
|
"outbound_port_placeholder": "Porttinumero",
|
||||||
|
"outbound_protocol_placeholder": "Valitse protokolla",
|
||||||
|
"outbound_rules_placeholder": "Yksi sääntö per rivi, tukee:\nkeyword:google (avainsanan vastaavuus)\nsuffix:google.com (päätteiden vastaavuus)\nregex:.*\\.example\\.com$ (regex-vastaavuus)\nexample.com (täsmällinen vastaavuus)\nJätä tyhjäksi oletusreititykselle",
|
||||||
|
"reset": "Nollaa",
|
||||||
|
"save": "Tallenna",
|
||||||
|
"start_time": "Aloitusaika",
|
||||||
|
"time_slot": "Aikaväli",
|
||||||
|
"traffic_report_threshold": "Liikennetiedotuksen kynnysarvo",
|
||||||
|
"traffic_report_threshold_desc": "Aseta liikennetiedotuksen vähimmäiskynnys. Liikennettä raportoidaan vain, kun se ylittää tämän arvon. Aseta 0 tai jätä tyhjäksi, jotta kaikki liikenne raportoidaan."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Tallennus onnistui",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Perusasetukset",
|
||||||
|
"block": "Estosäännöt",
|
||||||
|
"dns": "DNS-asetukset",
|
||||||
|
"outbound": "Ulkosäännöt"
|
||||||
|
},
|
||||||
|
"title": "Solmun konfiguraatio"
|
||||||
|
},
|
||||||
"server_key": "Palvelimen avain",
|
"server_key": "Palvelimen avain",
|
||||||
"service_name": "Palvelun nimi",
|
"service_name": "Palvelun nimi",
|
||||||
|
"sorted_success": "Lajiteltu onnistuneesti",
|
||||||
"status": "Tila",
|
"status": "Tila",
|
||||||
"subscribeId": "Tilauksen ID",
|
"subscribeId": "Tilauksen ID",
|
||||||
"subscription": "Tilauksen",
|
"subscription": "Tilauksen",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Vahvista",
|
"confirm": "Vahvista",
|
||||||
"confirmDelete": "Oletko varma, että haluat poistaa?",
|
"confirmDelete": "Oletko varma, että haluat poistaa?",
|
||||||
"confirmOffline": "Vahvista offline-tila",
|
"confirmOffline": "Vahvista offline-tila",
|
||||||
|
"copySubscription": "Kopioi tilaus",
|
||||||
|
"copySuccess": "Kopiointi onnistui",
|
||||||
"create": "Luo",
|
"create": "Luo",
|
||||||
"createSubscription": "Luo tilaus",
|
"createSubscription": "Luo tilaus",
|
||||||
"createSuccess": "Luonti onnistui",
|
"createSuccess": "Luonti onnistui",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Sélectionner un protocole…",
|
"select_protocol": "Sélectionner un protocole…",
|
||||||
"select_server": "Sélectionner un serveur…",
|
"select_server": "Sélectionner un serveur…",
|
||||||
"server": "Serveur",
|
"server": "Serveur",
|
||||||
|
"sorted_success": "Trié avec succès",
|
||||||
"tags": "Étiquettes",
|
"tags": "Étiquettes",
|
||||||
"tags_description": "Étiquette de regroupement de permissions (y compris l'association de plan et les politiques de livraison).",
|
"tags_description": "Étiquette de regroupement de permissions (y compris l'association de plan et les politiques de livraison).",
|
||||||
"tags_placeholder": "Utilisez Entrée ou une virgule (,) pour ajouter plusieurs étiquettes",
|
"tags_placeholder": "Utilisez Entrée ou une virgule (,) pour ajouter plusieurs étiquettes",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Annuler",
|
||||||
|
"save": "Enregistrer"
|
||||||
|
},
|
||||||
"address": "Adresse",
|
"address": "Adresse",
|
||||||
"address_placeholder": "Adresse du serveur",
|
"address_placeholder": "Adresse du serveur",
|
||||||
|
"apiHost": "Hôte API",
|
||||||
|
"apiHostPlaceholder": "http(s)://exemple.com",
|
||||||
"bandwidth_placeholder": "Entrez la bande passante, laissez vide pour BBR",
|
"bandwidth_placeholder": "Entrez la bande passante, laissez vide pour BBR",
|
||||||
"basic": "Configuration de base",
|
"basic": "Configuration de base",
|
||||||
"cancel": "Annuler",
|
"cancel": "Annuler",
|
||||||
|
"cert_dns_env": "Variables d'environnement DNS",
|
||||||
|
"cert_dns_provider": "Fournisseur DNS",
|
||||||
|
"cert_mode": "Mode de certificat",
|
||||||
|
"cipher": "Algorithme de chiffrement",
|
||||||
"city": "Ville",
|
"city": "Ville",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Annuler",
|
|
||||||
"save": "Enregistrer"
|
|
||||||
},
|
|
||||||
"communicationKey": "Clé de communication",
|
|
||||||
"communicationKeyDescription": "Utilisé pour l'authentification du nœud.",
|
|
||||||
"description": "Gérer les clés de communication du nœud, les intervalles de tirage/poussée et les multiplicateurs dynamiques.",
|
|
||||||
"dynamicMultiplier": "Multiplicateur dynamique",
|
|
||||||
"dynamicMultiplierDescription": "Définir des créneaux horaires et des multiplicateurs pour ajuster le comptage du trafic.",
|
|
||||||
"endTime": "Heure de fin",
|
|
||||||
"inputPlaceholder": "Veuillez entrer",
|
|
||||||
"multiplier": "Multiplicateur",
|
|
||||||
"nodePullInterval": "Intervalle de tirage du nœud",
|
|
||||||
"nodePullIntervalDescription": "À quelle fréquence le nœud tire la configuration (secondes).",
|
|
||||||
"nodePushInterval": "Intervalle de poussée du nœud",
|
|
||||||
"nodePushIntervalDescription": "À quelle fréquence le nœud pousse les statistiques (secondes).",
|
|
||||||
"reset": "Réinitialiser",
|
|
||||||
"save": "Enregistrer",
|
|
||||||
"saveSuccess": "Enregistré avec succès",
|
|
||||||
"startTime": "Heure de début",
|
|
||||||
"timeSlot": "Créneau horaire",
|
|
||||||
"title": "Configuration du nœud"
|
|
||||||
},
|
|
||||||
"confirm": "Confirmer",
|
"confirm": "Confirmer",
|
||||||
"confirmDeleteDesc": "Cette action ne peut pas être annulée.",
|
"confirmDeleteDesc": "Cette action ne peut pas être annulée.",
|
||||||
"confirmDeleteTitle": "Supprimer ce serveur ?",
|
"confirmDeleteTitle": "Supprimer ce serveur ?",
|
||||||
"congestion_controller": "Contrôleur de congestion",
|
"congestion_controller": "Contrôleur de congestion",
|
||||||
|
"connect": "Se connecter",
|
||||||
"copied": "Copié",
|
"copied": "Copié",
|
||||||
"copy": "Copier",
|
"copy": "Copier",
|
||||||
"country": "Pays",
|
"country": "Pays",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Modifier le serveur",
|
"drawerEditTitle": "Modifier le serveur",
|
||||||
"edit": "Modifier",
|
"edit": "Modifier",
|
||||||
"enabled": "Activé",
|
"enabled": "Activé",
|
||||||
"encryption_method": "Méthode de chiffrement",
|
"encryption": "Méthode de chiffrement",
|
||||||
|
"encryption_client_padding": "Remplissage client",
|
||||||
|
"encryption_mode": "Mode",
|
||||||
|
"encryption_password": "Mot de passe",
|
||||||
|
"encryption_password_placeholder": "Laissez vide pour une génération automatique, remplacez manuellement pour un chiffrement post-quantique",
|
||||||
|
"encryption_private_key": "Clé privée",
|
||||||
|
"encryption_private_key_placeholder": "Laissez vide pour une génération automatique, remplacez manuellement pour un chiffrement post-quantique",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Remplissage serveur",
|
||||||
|
"encryption_ticket": "Temps de ticket",
|
||||||
"expireTime": "Temps d'expiration",
|
"expireTime": "Temps d'expiration",
|
||||||
"expired": "Expiré",
|
"expired": "Expiré",
|
||||||
|
"extra": "Configuration supplémentaire",
|
||||||
"flow": "Flux",
|
"flow": "Flux",
|
||||||
|
"generate_quantum_resistant_key": "Générer une clé résistante aux quantiques",
|
||||||
|
"generate_standard_encryption_key": "Générer une clé de chiffrement standard",
|
||||||
"hop_interval": "Intervalle de saut",
|
"hop_interval": "Intervalle de saut",
|
||||||
"hop_ports": "Ports de saut",
|
"hop_ports": "Ports de saut",
|
||||||
"hop_ports_placeholder": "ex. 1-65535",
|
"hop_ports_placeholder": "ex. 1-65535",
|
||||||
"host": "Hôte",
|
"host": "Hôte",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Commande d'installation",
|
||||||
"ipAddresses": "Adresses IP",
|
"ipAddresses": "Adresses IP",
|
||||||
"memory": "Mémoire",
|
"memory": "Mémoire",
|
||||||
"migrate": "Migrer les données",
|
"migrate": "Migrer les données",
|
||||||
"migrateFailed": "Échec de la migration des données",
|
"migrateFailed": "Échec de la migration des données",
|
||||||
"migrated": "Données migrées avec succès",
|
"migrated": "Données migrées avec succès",
|
||||||
"migrating": "Migration en cours...",
|
"migrating": "Migration en cours...",
|
||||||
|
"mode": "Mode",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Nom",
|
"name": "Nom",
|
||||||
"noData": "Aucune donnée",
|
"noData": "Aucune donnée",
|
||||||
"notAvailable": "N/A",
|
"notAvailable": "N/A",
|
||||||
|
"obfs": "Obfuscation",
|
||||||
|
"obfs_host": "Hôte Obfs",
|
||||||
"obfs_password": "Mot de passe d'obfuscation",
|
"obfs_password": "Mot de passe d'obfuscation",
|
||||||
"obfs_password_placeholder": "Entrez le mot de passe d'obfuscation",
|
"obfs_password_placeholder": "Entrez le mot de passe d'obfuscation",
|
||||||
|
"obfs_path": "Chemin Obfs",
|
||||||
"offline": "Hors ligne",
|
"offline": "Hors ligne",
|
||||||
|
"oneClickInstall": "Installation en un clic",
|
||||||
"online": "En ligne",
|
"online": "En ligne",
|
||||||
"onlineUsers": "Utilisateurs en ligne",
|
"onlineUsers": "Utilisateurs en ligne",
|
||||||
"padding_scheme": "Schéma de remplissage",
|
"padding_scheme": "Schéma de remplissage",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Serveurs",
|
"pageTitle": "Serveurs",
|
||||||
"path": "Chemin",
|
"path": "Chemin",
|
||||||
"please_select": "Veuillez sélectionner",
|
"please_select": "Veuillez sélectionner",
|
||||||
"plugin": "Configuration du plugin",
|
|
||||||
"plugin_opts": "Options du plugin",
|
|
||||||
"port": "Port",
|
"port": "Port",
|
||||||
"protocol_configurations": "Configurations de protocole",
|
"protocol_configurations": "Configurations de protocole",
|
||||||
"protocol_configurations_desc": "Activer et configurer les types de protocole requis",
|
"protocol_configurations_desc": "Activer et configurer les types de protocole requis",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Chaîne hexadécimale (jusqu'à 16 caractères)",
|
"security_short_id_placeholder": "Chaîne hexadécimale (jusqu'à 16 caractères)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Sélectionner la méthode de chiffrement",
|
"select_encryption_method": "Sélectionner la méthode de chiffrement",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Gérer les clés de communication du nœud, les intervalles de pull/push.",
|
||||||
|
"dynamic_multiplier": "Multiplicateur dynamique",
|
||||||
|
"dynamic_multiplier_desc": "Définir des créneaux horaires et des multiplicateurs pour ajuster le comptage du trafic.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Une règle de domaine par ligne, prend en charge :\nkeyword:google (correspondance par mot-clé)\nsuffix:google.com (correspondance par suffixe)\nregex:.*\\.example\\.com$ (correspondance regex)\nexample.com (correspondance exacte)",
|
||||||
|
"communication_key": "Clé de communication",
|
||||||
|
"communication_key_desc": "Utilisé pour l'authentification du nœud.",
|
||||||
|
"communication_key_placeholder": "Veuillez entrer",
|
||||||
|
"dns_config": "Configuration DNS",
|
||||||
|
"dns_domains_placeholder": "Une règle de domaine par ligne, prend en charge :\nkeyword:google (correspondance par mot-clé)\nsuffix:google.com (correspondance par suffixe)\nregex:.*\\.example\\.com$ (correspondance regex)\nexample.com (correspondance exacte)",
|
||||||
|
"dns_proto_placeholder": "Sélectionnez le type",
|
||||||
|
"end_time": "Heure de fin",
|
||||||
|
"ip_strategy": "Stratégie IP",
|
||||||
|
"ip_strategy_desc": "Choisissez la préférence de version IP pour les connexions réseau",
|
||||||
|
"ip_strategy_ipv4": "Préférer IPv4",
|
||||||
|
"ip_strategy_ipv6": "Préférer IPv6",
|
||||||
|
"ip_strategy_placeholder": "Sélectionnez la stratégie IP",
|
||||||
|
"multiplier": "Multiplicateur",
|
||||||
|
"node_pull_interval": "Intervalle de pull du nœud",
|
||||||
|
"node_pull_interval_desc": "À quelle fréquence le nœud récupère la configuration (secondes).",
|
||||||
|
"node_push_interval": "Intervalle de push du nœud",
|
||||||
|
"node_push_interval_desc": "À quelle fréquence le nœud envoie des statistiques (secondes).",
|
||||||
|
"outbound_address_placeholder": "Adresse du serveur",
|
||||||
|
"outbound_name_placeholder": "Nom de la configuration",
|
||||||
|
"outbound_password_placeholder": "Mot de passe (optionnel)",
|
||||||
|
"outbound_port_placeholder": "Numéro de port",
|
||||||
|
"outbound_protocol_placeholder": "Sélectionnez le protocole",
|
||||||
|
"outbound_rules_placeholder": "Une règle par ligne, prend en charge :\nkeyword:google (correspondance par mot-clé)\nsuffix:google.com (correspondance par suffixe)\nregex:.*\\.example\\.com$ (correspondance regex)\nexample.com (correspondance exacte)\nLaisser vide pour le routage par défaut",
|
||||||
|
"reset": "Réinitialiser",
|
||||||
|
"save": "Enregistrer",
|
||||||
|
"start_time": "Heure de début",
|
||||||
|
"time_slot": "Créneau horaire",
|
||||||
|
"traffic_report_threshold": "Seuil de rapport de trafic",
|
||||||
|
"traffic_report_threshold_desc": "Définir le seuil minimum pour le rapport de trafic. Le trafic ne sera rapporté que s'il dépasse cette valeur. Mettre à 0 ou laisser vide pour rapporter tout le trafic."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Enregistré avec succès",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Configuration de base",
|
||||||
|
"block": "Règles de blocage",
|
||||||
|
"dns": "Configuration DNS",
|
||||||
|
"outbound": "Règles sortantes"
|
||||||
|
},
|
||||||
|
"title": "Configuration du nœud"
|
||||||
|
},
|
||||||
"server_key": "Clé du serveur",
|
"server_key": "Clé du serveur",
|
||||||
"service_name": "Nom du service",
|
"service_name": "Nom du service",
|
||||||
|
"sorted_success": "Trié avec succès",
|
||||||
"status": "Statut",
|
"status": "Statut",
|
||||||
"subscribeId": "ID d'abonnement",
|
"subscribeId": "ID d'abonnement",
|
||||||
"subscription": "Abonnement",
|
"subscription": "Abonnement",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Confirmer",
|
"confirm": "Confirmer",
|
||||||
"confirmDelete": "Êtes-vous sûr de vouloir supprimer ?",
|
"confirmDelete": "Êtes-vous sûr de vouloir supprimer ?",
|
||||||
"confirmOffline": "Confirmer hors ligne",
|
"confirmOffline": "Confirmer hors ligne",
|
||||||
|
"copySubscription": "Copier l'abonnement",
|
||||||
|
"copySuccess": "Copie réussie",
|
||||||
"create": "Créer",
|
"create": "Créer",
|
||||||
"createSubscription": "Créer un abonnement",
|
"createSubscription": "Créer un abonnement",
|
||||||
"createSuccess": "Création réussie",
|
"createSuccess": "Création réussie",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "प्रोटोकॉल चुनें…",
|
"select_protocol": "प्रोटोकॉल चुनें…",
|
||||||
"select_server": "सर्वर चुनें…",
|
"select_server": "सर्वर चुनें…",
|
||||||
"server": "सर्वर",
|
"server": "सर्वर",
|
||||||
|
"sorted_success": "सफलतापूर्वक क्रमबद्ध किया गया",
|
||||||
"tags": "टैग",
|
"tags": "टैग",
|
||||||
"tags_description": "अनुमति समूह टैग (योजना बाइंडिंग और वितरण नीतियों सहित)।",
|
"tags_description": "अनुमति समूह टैग (योजना बाइंडिंग और वितरण नीतियों सहित)।",
|
||||||
"tags_placeholder": "एकाधिक टैग जोड़ने के लिए Enter या कॉमा (,) का उपयोग करें",
|
"tags_placeholder": "एकाधिक टैग जोड़ने के लिए Enter या कॉमा (,) का उपयोग करें",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "रद्द करें",
|
||||||
|
"save": "सहेजें"
|
||||||
|
},
|
||||||
"address": "पता",
|
"address": "पता",
|
||||||
"address_placeholder": "सर्वर का पता",
|
"address_placeholder": "सर्वर का पता",
|
||||||
|
"apiHost": "एपीआई होस्ट",
|
||||||
|
"apiHostPlaceholder": "http(s)://example.com",
|
||||||
"bandwidth_placeholder": "बैंडविड्थ दर्ज करें, BBR के लिए खाली छोड़ें",
|
"bandwidth_placeholder": "बैंडविड्थ दर्ज करें, BBR के लिए खाली छोड़ें",
|
||||||
"basic": "बुनियादी कॉन्फ़िगरेशन",
|
"basic": "बुनियादी कॉन्फ़िगरेशन",
|
||||||
"cancel": "रद्द करें",
|
"cancel": "रद्द करें",
|
||||||
|
"cert_dns_env": "DNS पर्यावरण चर",
|
||||||
|
"cert_dns_provider": "DNS प्रदाता",
|
||||||
|
"cert_mode": "प्रमाणपत्र मोड",
|
||||||
|
"cipher": "एन्क्रिप्शन एल्गोरिदम",
|
||||||
"city": "शहर",
|
"city": "शहर",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "रद्द करें",
|
|
||||||
"save": "सहेजें"
|
|
||||||
},
|
|
||||||
"communicationKey": "संचार कुंजी",
|
|
||||||
"communicationKeyDescription": "नोड प्रमाणीकरण के लिए उपयोग किया जाता है।",
|
|
||||||
"description": "नोड संचार कुंजी, पुल/धक्का अंतराल, और गतिशील गुणांक प्रबंधित करें।",
|
|
||||||
"dynamicMultiplier": "गतिशील गुणांक",
|
|
||||||
"dynamicMultiplierDescription": "यातायात लेखांकन को समायोजित करने के लिए समय स्लॉट और गुणांक परिभाषित करें।",
|
|
||||||
"endTime": "समाप्ति का समय",
|
|
||||||
"inputPlaceholder": "कृपया दर्ज करें",
|
|
||||||
"multiplier": "गुणांक",
|
|
||||||
"nodePullInterval": "नोड पुल अंतराल",
|
|
||||||
"nodePullIntervalDescription": "नोड कितनी बार कॉन्फ़िगरेशन खींचता है (सेकंड में)।",
|
|
||||||
"nodePushInterval": "नोड धक्का अंतराल",
|
|
||||||
"nodePushIntervalDescription": "नोड कितनी बार आँकड़े धकेलता है (सेकंड में)।",
|
|
||||||
"reset": "रीसेट करें",
|
|
||||||
"save": "सहेजें",
|
|
||||||
"saveSuccess": "सफलता से सहेजा गया",
|
|
||||||
"startTime": "शुरुआत का समय",
|
|
||||||
"timeSlot": "समय स्लॉट",
|
|
||||||
"title": "नोड कॉन्फ़िगरेशन"
|
|
||||||
},
|
|
||||||
"confirm": "पुष्टि करें",
|
"confirm": "पुष्टि करें",
|
||||||
"confirmDeleteDesc": "यह क्रिया पूर्ववत नहीं की जा सकती।",
|
"confirmDeleteDesc": "यह क्रिया पूर्ववत नहीं की जा सकती।",
|
||||||
"confirmDeleteTitle": "क्या इस सर्वर को हटाएं?",
|
"confirmDeleteTitle": "क्या इस सर्वर को हटाएं?",
|
||||||
"congestion_controller": "भीड़ नियंत्रण",
|
"congestion_controller": "भीड़ नियंत्रण",
|
||||||
|
"connect": "जोड़ें",
|
||||||
"copied": "कॉपी किया गया",
|
"copied": "कॉपी किया गया",
|
||||||
"copy": "कॉपी करें",
|
"copy": "कॉपी करें",
|
||||||
"country": "देश",
|
"country": "देश",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "सर्वर संपादित करें",
|
"drawerEditTitle": "सर्वर संपादित करें",
|
||||||
"edit": "संपादित करें",
|
"edit": "संपादित करें",
|
||||||
"enabled": "सक्षम",
|
"enabled": "सक्षम",
|
||||||
"encryption_method": "एन्क्रिप्शन विधि",
|
"encryption": "एन्क्रिप्शन विधि",
|
||||||
|
"encryption_client_padding": "क्लाइंट पैडिंग",
|
||||||
|
"encryption_mode": "मोड",
|
||||||
|
"encryption_password": "पासवर्ड",
|
||||||
|
"encryption_password_placeholder": "स्वतः उत्पन्न करने के लिए खाली छोड़ें, पोस्ट-क्वांटम एन्क्रिप्शन के लिए मैन्युअल रूप से बदलें",
|
||||||
|
"encryption_private_key": "निजी कुंजी",
|
||||||
|
"encryption_private_key_placeholder": "स्वतः उत्पन्न करने के लिए खाली छोड़ें, पोस्ट-क्वांटम एन्क्रिप्शन के लिए मैन्युअल रूप से बदलें",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "सर्वर पैडिंग",
|
||||||
|
"encryption_ticket": "टिकट समय",
|
||||||
"expireTime": "समाप्ति समय",
|
"expireTime": "समाप्ति समय",
|
||||||
"expired": "समय समाप्त",
|
"expired": "समय समाप्त",
|
||||||
|
"extra": "अतिरिक्त कॉन्फ़िगरेशन",
|
||||||
"flow": "प्रवाह",
|
"flow": "प्रवाह",
|
||||||
|
"generate_quantum_resistant_key": "क्वांटम-प्रतिरोधी कुंजी उत्पन्न करें",
|
||||||
|
"generate_standard_encryption_key": "मानक एन्क्रिप्शन कुंजी उत्पन्न करें",
|
||||||
"hop_interval": "हॉप अंतराल",
|
"hop_interval": "हॉप अंतराल",
|
||||||
"hop_ports": "हॉप पोर्ट",
|
"hop_ports": "हॉप पोर्ट",
|
||||||
"hop_ports_placeholder": "जैसे 1-65535",
|
"hop_ports_placeholder": "जैसे 1-65535",
|
||||||
"host": "होस्ट",
|
"host": "होस्ट",
|
||||||
"id": "आईडी",
|
"id": "आईडी",
|
||||||
|
"installCommand": "इंस्टॉल कमांड",
|
||||||
"ipAddresses": "आईपी पते",
|
"ipAddresses": "आईपी पते",
|
||||||
"memory": "मेमोरी",
|
"memory": "मेमोरी",
|
||||||
"migrate": "डेटा माइग्रेट करें",
|
"migrate": "डेटा माइग्रेट करें",
|
||||||
"migrateFailed": "डेटा माइग्रेशन विफल",
|
"migrateFailed": "डेटा माइग्रेशन विफल",
|
||||||
"migrated": "डेटा सफलतापूर्वक माइग्रेट किया गया",
|
"migrated": "डेटा सफलतापूर्वक माइग्रेट किया गया",
|
||||||
"migrating": "माइग्रेट किया जा रहा है...",
|
"migrating": "माइग्रेट किया जा रहा है...",
|
||||||
|
"mode": "मोड",
|
||||||
"multiplex": "मल्टीप्लेक्स",
|
"multiplex": "मल्टीप्लेक्स",
|
||||||
"name": "नाम",
|
"name": "नाम",
|
||||||
"noData": "कोई डेटा नहीं",
|
"noData": "कोई डेटा नहीं",
|
||||||
"notAvailable": "उपलब्ध नहीं",
|
"notAvailable": "उपलब्ध नहीं",
|
||||||
|
"obfs": "ओबफस्केशन",
|
||||||
|
"obfs_host": "ओबफ्स होस्ट",
|
||||||
"obfs_password": "अवशोषण पासवर्ड",
|
"obfs_password": "अवशोषण पासवर्ड",
|
||||||
"obfs_password_placeholder": "अवशोषण पासवर्ड दर्ज करें",
|
"obfs_password_placeholder": "अवशोषण पासवर्ड दर्ज करें",
|
||||||
|
"obfs_path": "ओबफ्स पथ",
|
||||||
"offline": "ऑफलाइन",
|
"offline": "ऑफलाइन",
|
||||||
|
"oneClickInstall": "एक-क्लिक इंस्टॉलेशन",
|
||||||
"online": "ऑनलाइन",
|
"online": "ऑनलाइन",
|
||||||
"onlineUsers": "ऑनलाइन उपयोगकर्ता",
|
"onlineUsers": "ऑनलाइन उपयोगकर्ता",
|
||||||
"padding_scheme": "पैडिंग योजना",
|
"padding_scheme": "पैडिंग योजना",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "सर्वर",
|
"pageTitle": "सर्वर",
|
||||||
"path": "पथ",
|
"path": "पथ",
|
||||||
"please_select": "कृपया चुनें",
|
"please_select": "कृपया चुनें",
|
||||||
"plugin": "प्लगइन कॉन्फ़िगरेशन",
|
|
||||||
"plugin_opts": "प्लगइन विकल्प",
|
|
||||||
"port": "पोर्ट",
|
"port": "पोर्ट",
|
||||||
"protocol_configurations": "प्रोटोकॉल कॉन्फ़िगरेशन",
|
"protocol_configurations": "प्रोटोकॉल कॉन्फ़िगरेशन",
|
||||||
"protocol_configurations_desc": "आवश्यक प्रोटोकॉल प्रकारों को सक्षम और कॉन्फ़िगर करें",
|
"protocol_configurations_desc": "आवश्यक प्रोटोकॉल प्रकारों को सक्षम और कॉन्फ़िगर करें",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "हेक्स स्ट्रिंग (16 अक्षरों तक)",
|
"security_short_id_placeholder": "हेक्स स्ट्रिंग (16 अक्षरों तक)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "एन्क्रिप्शन विधि चुनें",
|
"select_encryption_method": "एन्क्रिप्शन विधि चुनें",
|
||||||
|
"server_config": {
|
||||||
|
"description": "नोड संचार कुंजी, खींचने/धकेलने के अंतराल प्रबंधित करें।",
|
||||||
|
"dynamic_multiplier": "गतिशील गुणांक",
|
||||||
|
"dynamic_multiplier_desc": "यातायात लेखांकन को समायोजित करने के लिए समय स्लॉट और गुणांक परिभाषित करें।",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "प्रति पंक्ति एक डोमेन नियम, समर्थन:\nकीवर्ड:google (कीवर्ड मिलान)\nsuffix:google.com (सफिक्स मिलान)\nregex:.*\\.example\\.com$ (regex मिलान)\nexample.com (सटीक मिलान)",
|
||||||
|
"communication_key": "संचार कुंजी",
|
||||||
|
"communication_key_desc": "नोड प्रमाणीकरण के लिए उपयोग किया जाता है।",
|
||||||
|
"communication_key_placeholder": "कृपया दर्ज करें",
|
||||||
|
"dns_config": "DNS कॉन्फ़िगरेशन",
|
||||||
|
"dns_domains_placeholder": "प्रति पंक्ति एक डोमेन नियम, समर्थन:\nकीवर्ड:google (कीवर्ड मिलान)\nsuffix:google.com (सफिक्स मिलान)\nregex:.*\\.example\\.com$ (regex मिलान)\nexample.com (सटीक मिलान)",
|
||||||
|
"dns_proto_placeholder": "प्रकार चुनें",
|
||||||
|
"end_time": "समाप्ति का समय",
|
||||||
|
"ip_strategy": "IP रणनीति",
|
||||||
|
"ip_strategy_desc": "नेटवर्क कनेक्शनों के लिए IP संस्करण प्राथमिकता चुनें",
|
||||||
|
"ip_strategy_ipv4": "IPv4 को प्राथमिकता दें",
|
||||||
|
"ip_strategy_ipv6": "IPv6 को प्राथमिकता दें",
|
||||||
|
"ip_strategy_placeholder": "IP रणनीति चुनें",
|
||||||
|
"multiplier": "गुणांक",
|
||||||
|
"node_pull_interval": "नोड खींचने का अंतराल",
|
||||||
|
"node_pull_interval_desc": "नोड कितनी बार कॉन्फ़िगरेशन खींचता है (सेकंड में)।",
|
||||||
|
"node_push_interval": "नोड धकेलने का अंतराल",
|
||||||
|
"node_push_interval_desc": "नोड कितनी बार आँकड़े धकेलता है (सेकंड में)।",
|
||||||
|
"outbound_address_placeholder": "सर्वर पता",
|
||||||
|
"outbound_name_placeholder": "कॉन्फ़िगरेशन नाम",
|
||||||
|
"outbound_password_placeholder": "पासवर्ड (वैकल्पिक)",
|
||||||
|
"outbound_port_placeholder": "पोर्ट संख्या",
|
||||||
|
"outbound_protocol_placeholder": "प्रोटोकॉल चुनें",
|
||||||
|
"outbound_rules_placeholder": "प्रति पंक्ति एक नियम, समर्थन:\nकीवर्ड:google (कीवर्ड मिलान)\nsuffix:google.com (सफिक्स मिलान)\nregex:.*\\.example\\.com$ (regex मिलान)\nexample.com (सटीक मिलान)\nडिफ़ॉल्ट रूटिंग के लिए खाली छोड़ें",
|
||||||
|
"reset": "रीसेट करें",
|
||||||
|
"save": "सहेजें",
|
||||||
|
"start_time": "शुरुआत का समय",
|
||||||
|
"time_slot": "समय स्लॉट",
|
||||||
|
"traffic_report_threshold": "यातायात रिपोर्ट थ्रेशोल्ड",
|
||||||
|
"traffic_report_threshold_desc": "यातायात रिपोर्टिंग के लिए न्यूनतम थ्रेशोल्ड सेट करें। जब यातायात इस मान को पार करेगा तभी रिपोर्ट किया जाएगा। सभी यातायात रिपोर्ट करने के लिए 0 पर सेट करें या खाली छोड़ें।"
|
||||||
|
},
|
||||||
|
"saveSuccess": "सफलता से सहेजा गया",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "बुनियादी कॉन्फ़िगरेशन",
|
||||||
|
"block": "ब्लॉक नियम",
|
||||||
|
"dns": "DNS कॉन्फ़िगरेशन",
|
||||||
|
"outbound": "आउटबाउंड नियम"
|
||||||
|
},
|
||||||
|
"title": "नोड कॉन्फ़िगरेशन"
|
||||||
|
},
|
||||||
"server_key": "सर्वर कुंजी",
|
"server_key": "सर्वर कुंजी",
|
||||||
"service_name": "सेवा का नाम",
|
"service_name": "सेवा का नाम",
|
||||||
|
"sorted_success": "सफलता से क्रमबद्ध किया गया",
|
||||||
"status": "स्थिति",
|
"status": "स्थिति",
|
||||||
"subscribeId": "सदस्यता आईडी",
|
"subscribeId": "सदस्यता आईडी",
|
||||||
"subscription": "सदस्यता",
|
"subscription": "सदस्यता",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "पुष्टि करें",
|
"confirm": "पुष्टि करें",
|
||||||
"confirmDelete": "क्या आप वाकई हटाना चाहते हैं?",
|
"confirmDelete": "क्या आप वाकई हटाना चाहते हैं?",
|
||||||
"confirmOffline": "ऑफ़लाइन की पुष्टि करें",
|
"confirmOffline": "ऑफ़लाइन की पुष्टि करें",
|
||||||
|
"copySubscription": "सदस्यता कॉपी करें",
|
||||||
|
"copySuccess": "कॉपी सफल",
|
||||||
"create": "सृजन",
|
"create": "सृजन",
|
||||||
"createSubscription": "सदस्यता बनाएं",
|
"createSubscription": "सदस्यता बनाएं",
|
||||||
"createSuccess": "सृजन सफल",
|
"createSuccess": "सृजन सफल",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "Válassza ki a protokollt…",
|
"select_protocol": "Válassza ki a protokollt…",
|
||||||
"select_server": "Válassza ki a szervert…",
|
"select_server": "Válassza ki a szervert…",
|
||||||
"server": "Szerver",
|
"server": "Szerver",
|
||||||
|
"sorted_success": "Sikeresen rendezve",
|
||||||
"tags": "Címkék",
|
"tags": "Címkék",
|
||||||
"tags_description": "Engedélyezési csoportosító címke (beleértve a tervkötést és a szállítási irányelveket).",
|
"tags_description": "Engedélyezési csoportosító címke (beleértve a tervkötést és a szállítási irányelveket).",
|
||||||
"tags_placeholder": "Több címke hozzáadásához használja az Entert vagy a vesszőt (,)",
|
"tags_placeholder": "Több címke hozzáadásához használja az Entert vagy a vesszőt (,)",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Mégse",
|
||||||
|
"save": "Mentés"
|
||||||
|
},
|
||||||
"address": "Cím",
|
"address": "Cím",
|
||||||
"address_placeholder": "Szerver cím",
|
"address_placeholder": "Szerver cím",
|
||||||
|
"apiHost": "API gazda",
|
||||||
|
"apiHostPlaceholder": "http(s)://pelda.com",
|
||||||
"bandwidth_placeholder": "Adja meg a sávszélességet, hagyja üresen a BBR-hez",
|
"bandwidth_placeholder": "Adja meg a sávszélességet, hagyja üresen a BBR-hez",
|
||||||
"basic": "Alapértelmezett Beállítások",
|
"basic": "Alapértelmezett Beállítások",
|
||||||
"cancel": "Mégse",
|
"cancel": "Mégse",
|
||||||
|
"cert_dns_env": "DNS Környezeti Változók",
|
||||||
|
"cert_dns_provider": "DNS Szolgáltató",
|
||||||
|
"cert_mode": "Tanúsítvány Mód",
|
||||||
|
"cipher": "Titkosítási algoritmus",
|
||||||
"city": "Város",
|
"city": "Város",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "Mégse",
|
|
||||||
"save": "Mentés"
|
|
||||||
},
|
|
||||||
"communicationKey": "Kommunikációs kulcs",
|
|
||||||
"communicationKeyDescription": "A node hitelesítéséhez használatos.",
|
|
||||||
"description": "A node kommunikációs kulcsainak, pull/push időközeinek és dinamikus szorzóinak kezelése.",
|
|
||||||
"dynamicMultiplier": "Dinamikus szorzó",
|
|
||||||
"dynamicMultiplierDescription": "Időszakok és szorzók meghatározása a forgalom elszámolásának módosításához.",
|
|
||||||
"endTime": "Befejezési idő",
|
|
||||||
"inputPlaceholder": "Kérjük, adja meg",
|
|
||||||
"multiplier": "Szorzó",
|
|
||||||
"nodePullInterval": "Node pull időköz",
|
|
||||||
"nodePullIntervalDescription": "Milyen gyakran húzza a node a konfigurációt (másodperc).",
|
|
||||||
"nodePushInterval": "Node push időköz",
|
|
||||||
"nodePushIntervalDescription": "Milyen gyakran tolja a node a statisztikákat (másodperc).",
|
|
||||||
"reset": "Visszaállítás",
|
|
||||||
"save": "Mentés",
|
|
||||||
"saveSuccess": "Sikeresen mentve",
|
|
||||||
"startTime": "Kezdési idő",
|
|
||||||
"timeSlot": "Időszak",
|
|
||||||
"title": "Node konfiguráció"
|
|
||||||
},
|
|
||||||
"confirm": "Megerősítés",
|
"confirm": "Megerősítés",
|
||||||
"confirmDeleteDesc": "Ez a művelet nem vonható vissza.",
|
"confirmDeleteDesc": "Ez a művelet nem vonható vissza.",
|
||||||
"confirmDeleteTitle": "Törölni szeretné ezt a szervert?",
|
"confirmDeleteTitle": "Törölni szeretné ezt a szervert?",
|
||||||
"congestion_controller": "Torlaszkezelő",
|
"congestion_controller": "Torlaszkezelő",
|
||||||
|
"connect": "Csatlakozás",
|
||||||
"copied": "Másolva",
|
"copied": "Másolva",
|
||||||
"copy": "Másolás",
|
"copy": "Másolás",
|
||||||
"country": "Ország",
|
"country": "Ország",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "Szerver szerkesztése",
|
"drawerEditTitle": "Szerver szerkesztése",
|
||||||
"edit": "Szerkesztés",
|
"edit": "Szerkesztés",
|
||||||
"enabled": "Engedélyezve",
|
"enabled": "Engedélyezve",
|
||||||
"encryption_method": "Titkosítási módszer",
|
"encryption": "Titkosítási módszer",
|
||||||
|
"encryption_client_padding": "Kliens kitöltés",
|
||||||
|
"encryption_mode": "Mód",
|
||||||
|
"encryption_password": "Jelszó",
|
||||||
|
"encryption_password_placeholder": "Hagyja üresen az automatikus generáláshoz, cserélje ki kézzel a poszt-kvantum titkosításhoz",
|
||||||
|
"encryption_private_key": "Privát kulcs",
|
||||||
|
"encryption_private_key_placeholder": "Hagyja üresen az automatikus generáláshoz, cserélje ki kézzel a poszt-kvantum titkosításhoz",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "Szerver kitöltés",
|
||||||
|
"encryption_ticket": "Jegy idő",
|
||||||
"expireTime": "Lejárati idő",
|
"expireTime": "Lejárati idő",
|
||||||
"expired": "Lejárt",
|
"expired": "Lejárt",
|
||||||
|
"extra": "További konfiguráció",
|
||||||
"flow": "Forgalom",
|
"flow": "Forgalom",
|
||||||
|
"generate_quantum_resistant_key": "Kvantumálló kulcs generálása",
|
||||||
|
"generate_standard_encryption_key": "Szabványos titkosítási kulcs generálása",
|
||||||
"hop_interval": "Ugrás időköz",
|
"hop_interval": "Ugrás időköz",
|
||||||
"hop_ports": "Ugrás portok",
|
"hop_ports": "Ugrás portok",
|
||||||
"hop_ports_placeholder": "pl. 1-65535",
|
"hop_ports_placeholder": "pl. 1-65535",
|
||||||
"host": "Gazda",
|
"host": "Gazda",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "Telepítési parancs",
|
||||||
"ipAddresses": "IP címek",
|
"ipAddresses": "IP címek",
|
||||||
"memory": "Memória",
|
"memory": "Memória",
|
||||||
"migrate": "Adatok migrálása",
|
"migrate": "Adatok migrálása",
|
||||||
"migrateFailed": "Az adatok migrálása sikertelen",
|
"migrateFailed": "Az adatok migrálása sikertelen",
|
||||||
"migrated": "Az adatok sikeresen migrálva",
|
"migrated": "Az adatok sikeresen migrálva",
|
||||||
"migrating": "Migrálás...",
|
"migrating": "Migrálás...",
|
||||||
|
"mode": "Mód",
|
||||||
"multiplex": "Multiplex",
|
"multiplex": "Multiplex",
|
||||||
"name": "Név",
|
"name": "Név",
|
||||||
"noData": "Nincs adat",
|
"noData": "Nincs adat",
|
||||||
"notAvailable": "N/A",
|
"notAvailable": "N/A",
|
||||||
|
"obfs": "Obfuszkálás",
|
||||||
|
"obfs_host": "Obfs gazda",
|
||||||
"obfs_password": "Obfuszkálás jelszó",
|
"obfs_password": "Obfuszkálás jelszó",
|
||||||
"obfs_password_placeholder": "Adja meg az obfuszkálás jelszót",
|
"obfs_password_placeholder": "Adja meg az obfuszkálás jelszót",
|
||||||
|
"obfs_path": "Obfs útvonal",
|
||||||
"offline": "Offline",
|
"offline": "Offline",
|
||||||
|
"oneClickInstall": "Egylépéses telepítés",
|
||||||
"online": "Online",
|
"online": "Online",
|
||||||
"onlineUsers": "Online felhasználók",
|
"onlineUsers": "Online felhasználók",
|
||||||
"padding_scheme": "Kitöltési Sémák",
|
"padding_scheme": "Kitöltési Sémák",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "Szerverek",
|
"pageTitle": "Szerverek",
|
||||||
"path": "Útvonal",
|
"path": "Útvonal",
|
||||||
"please_select": "Kérjük, válasszon",
|
"please_select": "Kérjük, válasszon",
|
||||||
"plugin": "Bővítmény Beállítások",
|
|
||||||
"plugin_opts": "Bővítmény Opciók",
|
|
||||||
"port": "Port",
|
"port": "Port",
|
||||||
"protocol_configurations": "Protokoll Beállítások",
|
"protocol_configurations": "Protokoll Beállítások",
|
||||||
"protocol_configurations_desc": "Engedélyezze és konfigurálja a szükséges protokolltípusokat",
|
"protocol_configurations_desc": "Engedélyezze és konfigurálja a szükséges protokolltípusokat",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "Hexadecimális karakterlánc (legfeljebb 16 karakter)",
|
"security_short_id_placeholder": "Hexadecimális karakterlánc (legfeljebb 16 karakter)",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "Válassza ki a titkosítási módszert",
|
"select_encryption_method": "Válassza ki a titkosítási módszert",
|
||||||
|
"server_config": {
|
||||||
|
"description": "Node kommunikációs kulcsok kezelése, pull/push időközök.",
|
||||||
|
"dynamic_multiplier": "Dinamikus szorzó",
|
||||||
|
"dynamic_multiplier_desc": "Időszakok és szorzók meghatározása a forgalom elszámolásának módosításához.",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "Egy domain szabály soronként, támogatja:\nkeyword:google (kulcsszó egyezés)\nsuffix:google.com (végződés egyezés)\nregex:.*\\.example\\.com$ (regex egyezés)\nexample.com (pontos egyezés)",
|
||||||
|
"communication_key": "Kommunikációs kulcs",
|
||||||
|
"communication_key_desc": "A node hitelesítéséhez használatos.",
|
||||||
|
"communication_key_placeholder": "Kérjük, adja meg",
|
||||||
|
"dns_config": "DNS Beállítások",
|
||||||
|
"dns_domains_placeholder": "Egy domain szabály soronként, támogatja:\nkeyword:google (kulcsszó egyezés)\nsuffix:google.com (végződés egyezés)\nregex:.*\\.example\\.com$ (regex egyezés)\nexample.com (pontos egyezés)",
|
||||||
|
"dns_proto_placeholder": "Válassza ki a típust",
|
||||||
|
"end_time": "Befejezési idő",
|
||||||
|
"ip_strategy": "IP Stratégia",
|
||||||
|
"ip_strategy_desc": "Válassza ki az IP verzió preferenciát a hálózati kapcsolatokhoz",
|
||||||
|
"ip_strategy_ipv4": "IPv4 előnyben",
|
||||||
|
"ip_strategy_ipv6": "IPv6 előnyben",
|
||||||
|
"ip_strategy_placeholder": "Válassza ki az IP stratégiát",
|
||||||
|
"multiplier": "Szorzó",
|
||||||
|
"node_pull_interval": "Node lehúzási időköz",
|
||||||
|
"node_pull_interval_desc": "Milyen gyakran húzza le a node a konfigurációt (másodperc).",
|
||||||
|
"node_push_interval": "Node feltöltési időköz",
|
||||||
|
"node_push_interval_desc": "Milyen gyakran tölti fel a node a statisztikákat (másodperc).",
|
||||||
|
"outbound_address_placeholder": "Szerver címe",
|
||||||
|
"outbound_name_placeholder": "Konfiguráció neve",
|
||||||
|
"outbound_password_placeholder": "Jelszó (opcionális)",
|
||||||
|
"outbound_port_placeholder": "Port szám",
|
||||||
|
"outbound_protocol_placeholder": "Válassza ki a protokollt",
|
||||||
|
"outbound_rules_placeholder": "Egy szabály soronként, támogatja:\nkeyword:google (kulcsszó egyezés)\nsuffix:google.com (végződés egyezés)\nregex:.*\\.example\\.com$ (regex egyezés)\nexample.com (pontos egyezés)\nHagyja üresen az alapértelmezett útvonalhoz",
|
||||||
|
"reset": "Visszaállítás",
|
||||||
|
"save": "Mentés",
|
||||||
|
"start_time": "Kezdési idő",
|
||||||
|
"time_slot": "Időszak",
|
||||||
|
"traffic_report_threshold": "Forgalom Jelentési Küszöb",
|
||||||
|
"traffic_report_threshold_desc": "Állítsa be a forgalom jelentésének minimális küszöbét. A forgalmat csak akkor jelentjük, ha meghaladja ezt az értéket. Állítsa 0-ra vagy hagyja üresen, hogy minden forgalmat jelenteni tudjon."
|
||||||
|
},
|
||||||
|
"saveSuccess": "Sikeresen mentve",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "Alapértelmezett Beállítások",
|
||||||
|
"block": "Blokkolási Szabályok",
|
||||||
|
"dns": "DNS Beállítások",
|
||||||
|
"outbound": "Kimenő Szabályok"
|
||||||
|
},
|
||||||
|
"title": "Node konfiguráció"
|
||||||
|
},
|
||||||
"server_key": "Szerver kulcs",
|
"server_key": "Szerver kulcs",
|
||||||
"service_name": "Szolgáltatás neve",
|
"service_name": "Szolgáltatás neve",
|
||||||
|
"sorted_success": "Sikeresen rendezve",
|
||||||
"status": "Állapot",
|
"status": "Állapot",
|
||||||
"subscribeId": "Előfizetési ID",
|
"subscribeId": "Előfizetési ID",
|
||||||
"subscription": "Előfizetés",
|
"subscription": "Előfizetés",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "Megerősítés",
|
"confirm": "Megerősítés",
|
||||||
"confirmDelete": "Biztosan törölni szeretné?",
|
"confirmDelete": "Biztosan törölni szeretné?",
|
||||||
"confirmOffline": "Megerősítés offline",
|
"confirmOffline": "Megerősítés offline",
|
||||||
|
"copySubscription": "Előfizetés másolása",
|
||||||
|
"copySuccess": "Másolás sikeres",
|
||||||
"create": "Létrehozás",
|
"create": "Létrehozás",
|
||||||
"createSubscription": "Előfizetés létrehozása",
|
"createSubscription": "Előfizetés létrehozása",
|
||||||
"createSuccess": "Sikeres létrehozás",
|
"createSuccess": "Sikeres létrehozás",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"select_protocol": "プロトコルを選択…",
|
"select_protocol": "プロトコルを選択…",
|
||||||
"select_server": "サーバーを選択…",
|
"select_server": "サーバーを選択…",
|
||||||
"server": "サーバー",
|
"server": "サーバー",
|
||||||
|
"sorted_success": "正常にソートされました",
|
||||||
"tags": "タグ",
|
"tags": "タグ",
|
||||||
"tags_description": "権限グループ化タグ(プランバインディングおよび配信ポリシーを含む)。",
|
"tags_description": "権限グループ化タグ(プランバインディングおよび配信ポリシーを含む)。",
|
||||||
"tags_placeholder": "複数のタグを追加するにはEnterまたはカンマ(,)を使用してください",
|
"tags_placeholder": "複数のタグを追加するにはEnterまたはカンマ(,)を使用してください",
|
||||||
|
|||||||
@ -1,38 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"actions": {
|
||||||
|
"cancel": "キャンセル",
|
||||||
|
"save": "保存"
|
||||||
|
},
|
||||||
"address": "アドレス",
|
"address": "アドレス",
|
||||||
"address_placeholder": "サーバーアドレス",
|
"address_placeholder": "サーバーアドレス",
|
||||||
|
"apiHost": "APIホスト",
|
||||||
|
"apiHostPlaceholder": "http(s)://example.com",
|
||||||
"bandwidth_placeholder": "帯域幅を入力してください。BBRの場合は空白のままにしてください。",
|
"bandwidth_placeholder": "帯域幅を入力してください。BBRの場合は空白のままにしてください。",
|
||||||
"basic": "基本設定",
|
"basic": "基本設定",
|
||||||
"cancel": "キャンセル",
|
"cancel": "キャンセル",
|
||||||
|
"cert_dns_env": "DNS環境変数",
|
||||||
|
"cert_dns_provider": "DNSプロバイダー",
|
||||||
|
"cert_mode": "証明書モード",
|
||||||
|
"cipher": "暗号化アルゴリズム",
|
||||||
"city": "都市",
|
"city": "都市",
|
||||||
"config": {
|
|
||||||
"actions": {
|
|
||||||
"cancel": "キャンセル",
|
|
||||||
"save": "保存"
|
|
||||||
},
|
|
||||||
"communicationKey": "通信キー",
|
|
||||||
"communicationKeyDescription": "ノード認証に使用されます。",
|
|
||||||
"description": "ノードの通信キー、プル/プッシュ間隔、動的倍率を管理します。",
|
|
||||||
"dynamicMultiplier": "動的倍率",
|
|
||||||
"dynamicMultiplierDescription": "トラフィック計算を調整するための時間スロットと倍率を定義します。",
|
|
||||||
"endTime": "終了時間",
|
|
||||||
"inputPlaceholder": "入力してください",
|
|
||||||
"multiplier": "倍率",
|
|
||||||
"nodePullInterval": "ノードプル間隔",
|
|
||||||
"nodePullIntervalDescription": "ノードが設定をプルする頻度(秒)。",
|
|
||||||
"nodePushInterval": "ノードプッシュ間隔",
|
|
||||||
"nodePushIntervalDescription": "ノードが統計をプッシュする頻度(秒)。",
|
|
||||||
"reset": "リセット",
|
|
||||||
"save": "保存",
|
|
||||||
"saveSuccess": "保存に成功しました",
|
|
||||||
"startTime": "開始時間",
|
|
||||||
"timeSlot": "時間スロット",
|
|
||||||
"title": "ノード設定"
|
|
||||||
},
|
|
||||||
"confirm": "確認",
|
"confirm": "確認",
|
||||||
"confirmDeleteDesc": "この操作は元に戻せません。",
|
"confirmDeleteDesc": "この操作は元に戻せません。",
|
||||||
"confirmDeleteTitle": "このサーバーを削除しますか?",
|
"confirmDeleteTitle": "このサーバーを削除しますか?",
|
||||||
"congestion_controller": "混雑制御",
|
"congestion_controller": "混雑制御",
|
||||||
|
"connect": "接続",
|
||||||
"copied": "コピーしました",
|
"copied": "コピーしました",
|
||||||
"copy": "コピー",
|
"copy": "コピー",
|
||||||
"country": "国",
|
"country": "国",
|
||||||
@ -49,28 +36,46 @@
|
|||||||
"drawerEditTitle": "サーバーを編集",
|
"drawerEditTitle": "サーバーを編集",
|
||||||
"edit": "編集",
|
"edit": "編集",
|
||||||
"enabled": "有効",
|
"enabled": "有効",
|
||||||
"encryption_method": "暗号化方式",
|
"encryption": "暗号化方式",
|
||||||
|
"encryption_client_padding": "クライアントパディング",
|
||||||
|
"encryption_mode": "モード",
|
||||||
|
"encryption_password": "パスワード",
|
||||||
|
"encryption_password_placeholder": "自動生成のために空白のままにし、ポスト量子暗号化のために手動で置き換えてください",
|
||||||
|
"encryption_private_key": "秘密鍵",
|
||||||
|
"encryption_private_key_placeholder": "自動生成のために空白のままにし、ポスト量子暗号化のために手動で置き換えてください",
|
||||||
|
"encryption_rtt": "RTT",
|
||||||
|
"encryption_server_padding": "サーバーパディング",
|
||||||
|
"encryption_ticket": "チケット時間",
|
||||||
"expireTime": "有効期限",
|
"expireTime": "有効期限",
|
||||||
"expired": "期限切れ",
|
"expired": "期限切れ",
|
||||||
|
"extra": "追加設定",
|
||||||
"flow": "フロー",
|
"flow": "フロー",
|
||||||
|
"generate_quantum_resistant_key": "量子耐性キーを生成",
|
||||||
|
"generate_standard_encryption_key": "標準暗号化キーを生成",
|
||||||
"hop_interval": "ホップ間隔",
|
"hop_interval": "ホップ間隔",
|
||||||
"hop_ports": "ホップポート",
|
"hop_ports": "ホップポート",
|
||||||
"hop_ports_placeholder": "例: 1-65535",
|
"hop_ports_placeholder": "例: 1-65535",
|
||||||
"host": "ホスト",
|
"host": "ホスト",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
|
"installCommand": "インストールコマンド",
|
||||||
"ipAddresses": "IPアドレス",
|
"ipAddresses": "IPアドレス",
|
||||||
"memory": "メモリ",
|
"memory": "メモリ",
|
||||||
"migrate": "データを移行する",
|
"migrate": "データを移行する",
|
||||||
"migrateFailed": "データの移行に失敗しました",
|
"migrateFailed": "データの移行に失敗しました",
|
||||||
"migrated": "データが正常に移行されました",
|
"migrated": "データが正常に移行されました",
|
||||||
"migrating": "移行中...",
|
"migrating": "移行中...",
|
||||||
|
"mode": "モード",
|
||||||
"multiplex": "マルチプレックス",
|
"multiplex": "マルチプレックス",
|
||||||
"name": "名前",
|
"name": "名前",
|
||||||
"noData": "データなし",
|
"noData": "データなし",
|
||||||
"notAvailable": "利用不可",
|
"notAvailable": "利用不可",
|
||||||
|
"obfs": "難読化",
|
||||||
|
"obfs_host": "難読化ホスト",
|
||||||
"obfs_password": "難読化パスワード",
|
"obfs_password": "難読化パスワード",
|
||||||
"obfs_password_placeholder": "難読化パスワードを入力してください",
|
"obfs_password_placeholder": "難読化パスワードを入力してください",
|
||||||
|
"obfs_path": "難読化パス",
|
||||||
"offline": "オフライン",
|
"offline": "オフライン",
|
||||||
|
"oneClickInstall": "ワンクリックインストール",
|
||||||
"online": "オンライン",
|
"online": "オンライン",
|
||||||
"onlineUsers": "オンラインユーザー",
|
"onlineUsers": "オンラインユーザー",
|
||||||
"padding_scheme": "パディングスキーム",
|
"padding_scheme": "パディングスキーム",
|
||||||
@ -78,8 +83,6 @@
|
|||||||
"pageTitle": "サーバー",
|
"pageTitle": "サーバー",
|
||||||
"path": "パス",
|
"path": "パス",
|
||||||
"please_select": "選択してください",
|
"please_select": "選択してください",
|
||||||
"plugin": "プラグイン設定",
|
|
||||||
"plugin_opts": "プラグインオプション",
|
|
||||||
"port": "ポート",
|
"port": "ポート",
|
||||||
"protocol_configurations": "プロトコル設定",
|
"protocol_configurations": "プロトコル設定",
|
||||||
"protocol_configurations_desc": "必要なプロトコルタイプを有効にして設定します",
|
"protocol_configurations_desc": "必要なプロトコルタイプを有効にして設定します",
|
||||||
@ -101,8 +104,54 @@
|
|||||||
"security_short_id_placeholder": "16文字以内の16進数文字列",
|
"security_short_id_placeholder": "16文字以内の16進数文字列",
|
||||||
"security_sni": "SNI",
|
"security_sni": "SNI",
|
||||||
"select_encryption_method": "暗号化方式を選択",
|
"select_encryption_method": "暗号化方式を選択",
|
||||||
|
"server_config": {
|
||||||
|
"description": "ノード通信キー、プル/プッシュ間隔を管理します。",
|
||||||
|
"dynamic_multiplier": "動的乗数",
|
||||||
|
"dynamic_multiplier_desc": "トラフィック計算を調整するための時間スロットと乗数を定義します。",
|
||||||
|
"fields": {
|
||||||
|
"block_rules_placeholder": "1行に1つのドメインルール、サポート:\nkeyword:google(キーワードマッチング)\nsuffix:google.com(サフィックスマッチング)\nregex:.*\\.example\\.com$(正規表現マッチング)\nexample.com(完全一致)",
|
||||||
|
"communication_key": "通信キー",
|
||||||
|
"communication_key_desc": "ノード認証に使用されます。",
|
||||||
|
"communication_key_placeholder": "入力してください",
|
||||||
|
"dns_config": "DNS設定",
|
||||||
|
"dns_domains_placeholder": "1行に1つのドメインルール、サポート:\nkeyword:google(キーワードマッチング)\nsuffix:google.com(サフィックスマッチング)\nregex:.*\\.example\\.com$(正規表現マッチング)\nexample.com(完全一致)",
|
||||||
|
"dns_proto_placeholder": "タイプを選択",
|
||||||
|
"end_time": "終了時間",
|
||||||
|
"ip_strategy": "IP戦略",
|
||||||
|
"ip_strategy_desc": "ネットワーク接続のためのIPバージョンの優先度を選択します。",
|
||||||
|
"ip_strategy_ipv4": "IPv4を優先",
|
||||||
|
"ip_strategy_ipv6": "IPv6を優先",
|
||||||
|
"ip_strategy_placeholder": "IP戦略を選択",
|
||||||
|
"multiplier": "乗数",
|
||||||
|
"node_pull_interval": "ノードプル間隔",
|
||||||
|
"node_pull_interval_desc": "ノードが設定をプルする頻度(秒)。",
|
||||||
|
"node_push_interval": "ノードプッシュ間隔",
|
||||||
|
"node_push_interval_desc": "ノードが統計をプッシュする頻度(秒)。",
|
||||||
|
"outbound_address_placeholder": "サーバーアドレス",
|
||||||
|
"outbound_name_placeholder": "設定名",
|
||||||
|
"outbound_password_placeholder": "パスワード(オプション)",
|
||||||
|
"outbound_port_placeholder": "ポート番号",
|
||||||
|
"outbound_protocol_placeholder": "プロトコルを選択",
|
||||||
|
"outbound_rules_placeholder": "1行に1つのルール、サポート:\nkeyword:google(キーワードマッチング)\nsuffix:google.com(サフィックスマッチング)\nregex:.*\\.example\\.com$(正規表現マッチング)\nexample.com(完全一致)\nデフォルトルーティングには空白のままにしてください",
|
||||||
|
"reset": "リセット",
|
||||||
|
"save": "保存",
|
||||||
|
"start_time": "開始時間",
|
||||||
|
"time_slot": "時間スロット",
|
||||||
|
"traffic_report_threshold": "トラフィックレポートの閾値",
|
||||||
|
"traffic_report_threshold_desc": "トラフィック報告の最小閾値を設定します。この値を超えた場合のみトラフィックが報告されます。すべてのトラフィックを報告するには0に設定するか、空白のままにしてください。"
|
||||||
|
},
|
||||||
|
"saveSuccess": "正常に保存されました",
|
||||||
|
"tabs": {
|
||||||
|
"basic": "基本設定",
|
||||||
|
"block": "ブロックルール",
|
||||||
|
"dns": "DNS設定",
|
||||||
|
"outbound": "アウトバウンドルール"
|
||||||
|
},
|
||||||
|
"title": "ノード設定"
|
||||||
|
},
|
||||||
"server_key": "サーバーキー",
|
"server_key": "サーバーキー",
|
||||||
"service_name": "サービス名",
|
"service_name": "サービス名",
|
||||||
|
"sorted_success": "正常にソートされました",
|
||||||
"status": "ステータス",
|
"status": "ステータス",
|
||||||
"subscribeId": "サブスクリプションID",
|
"subscribeId": "サブスクリプションID",
|
||||||
"subscription": "サブスクリプション",
|
"subscription": "サブスクリプション",
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"confirm": "確認",
|
"confirm": "確認",
|
||||||
"confirmDelete": "削除してもよろしいですか?",
|
"confirmDelete": "削除してもよろしいですか?",
|
||||||
"confirmOffline": "オフラインを確認",
|
"confirmOffline": "オフラインを確認",
|
||||||
|
"copySubscription": "サブスクリプションをコピー",
|
||||||
|
"copySuccess": "コピーが成功しました",
|
||||||
"create": "作成",
|
"create": "作成",
|
||||||
"createSubscription": "サブスクリプションを作成",
|
"createSubscription": "サブスクリプションを作成",
|
||||||
"createSuccess": "作成成功",
|
"createSuccess": "作成成功",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user