From 278284eae0f2581954275417c844f00d1ba6ff2e Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 19 Jun 2025 13:50:26 +0800 Subject: [PATCH 1/3] Add GitHub Actions workflow to deploy XControl panel --- .github/workflows/deploy-xcontrol-panel.yml | 57 +++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/deploy-xcontrol-panel.yml diff --git a/.github/workflows/deploy-xcontrol-panel.yml b/.github/workflows/deploy-xcontrol-panel.yml new file mode 100644 index 0000000..7198de4 --- /dev/null +++ b/.github/workflows/deploy-xcontrol-panel.yml @@ -0,0 +1,57 @@ +name: Deploy Xcontrol-panel to Cloudflare Pages + +on: + pull_request: + paths: + - 'ui/nextjs/**' + - '.github/workflows/deploy-xcontrol-panel.yml' + workflow_dispatch: + paths: + - 'ui/nextjs/**' + - '.github/workflows/deploy-xcontrol-panel.yml' + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ui/nextjs + + steps: + - name: 📦 Checkout source code + uses: actions/checkout@v4 + + - name: 🧰 Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: 📥 Install dependencies + run: yarn install --frozen-lockfile + + - name: 🛠️ Build static site + run: yarn build # next build (output: 'export' 会自动产出 ./out) + + - name: 🚀 Deploy to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + projectName: xcontrol-panel # 和 Pages 控制台里看到的项目名保持一致 + directory: ui/nextjs/out # 指定到子目录 out + wranglerVersion: '4' # 升级到 Wrangler v4,避免 v2 大量警告 + +# - name: 📤 Deploy to VPS via rsync +# env: +# RSYNC_SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }} +# VPS_HOST: ${{ secrets.VPS_HOST }} +# run: | +# mkdir -p ~/.ssh +# echo "$RSYNC_SSH_KEY" > ~/.ssh/id_rsa +# chmod 600 ~/.ssh/id_rsa +# ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts +# rsync -av out/ root@"$VPS_HOST":/mnt/data/website/ --delete + + - name: ✅ Confirm deployment complete + run: echo "✅ Homepage deployed to Cloudflare & VPS Site." From b7e59c33a5cb2c8147858b80720a07a30bf45dfa Mon Sep 17 00:00:00 2001 From: shenlan Date: Thu, 19 Jun 2025 14:27:07 +0800 Subject: [PATCH 2/3] chore: update nextjs yarn.lock --- ui/nextjs/yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/nextjs/yarn.lock b/ui/nextjs/yarn.lock index 4b52d63..e90ba88 100644 --- a/ui/nextjs/yarn.lock +++ b/ui/nextjs/yarn.lock @@ -522,10 +522,10 @@ lru-cache@^10.2.0: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== -lucide-react@^0.517.0: - version "0.517.0" - resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.517.0.tgz#195ed8bd18e72462b012ba4e36d4474e480ff44c" - integrity sha512-TQCwwbwIuVG6SSutUC2Ol6PRXcuZndqoVAnDa7S7xb/RWPaiKTvLwX7byUKeh0pUgvtFh0NZZwFIDuMSeB7Iwg== +lucide-react@^0.292.0: + version "0.292.0" + resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.292.0.tgz#c8a06b2ccd8a348a88669def3c0291c035de2884" + integrity sha512-rRgUkpEHWpa5VCT66YscInCQmQuPCB1RFRzkkxMxg4b+jaL0V12E3riWWR2Sh5OIiUhCwGW/ZExuEO4Az32E6Q== merge2@^1.3.0: version "1.4.1" From 211f46b89cc48640a08dcd7c80ac491cacbca336 Mon Sep 17 00:00:00 2001 From: shenlan Date: Thu, 19 Jun 2025 17:06:56 +0800 Subject: [PATCH 3/3] Add bilingual terms and contact sections --- ui/homepage/app/page.tsx | 4 ++++ ui/homepage/components/Contact.tsx | 17 ++++++++++++++ ui/homepage/components/NavBar.tsx | 20 +++++++++------- ui/homepage/components/Terms.tsx | 23 +++++++++++++++++++ ui/homepage/i18n/translations.ts | 37 ++++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 ui/homepage/components/Contact.tsx create mode 100644 ui/homepage/components/Terms.tsx diff --git a/ui/homepage/app/page.tsx b/ui/homepage/app/page.tsx index b969f22..0f60fad 100644 --- a/ui/homepage/app/page.tsx +++ b/ui/homepage/app/page.tsx @@ -2,6 +2,8 @@ import Hero from '@components/Hero' import Features from '@components/Features' import OpenSource from '@components/OpenSource' import DownloadSection from '@components/DownloadSection' +import Terms from '@components/Terms' +import Contact from '@components/Contact' import Footer from '@components/Footer' import NavBar from '@components/NavBar' @@ -14,6 +16,8 @@ export default function Page() { + +