From e962e95115f329efd5a96bbd02a2bf29936107b3 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Sun, 2 Nov 2025 03:07:45 -0800 Subject: [PATCH 01/11] Add Russian Language --- frontend/src/lang/ru.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 frontend/src/lang/ru.json diff --git a/frontend/src/lang/ru.json b/frontend/src/lang/ru.json new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/frontend/src/lang/ru.json @@ -0,0 +1 @@ + From bfa0555fc0fa63016c5d491157f7ebacf709d82e Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Sun, 2 Nov 2025 03:10:07 -0800 Subject: [PATCH 02/11] Add Russian localization --- frontend/src/lang/ru.json | 73 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/frontend/src/lang/ru.json b/frontend/src/lang/ru.json index 8b13789..bb08fd7 100644 --- a/frontend/src/lang/ru.json +++ b/frontend/src/lang/ru.json @@ -1 +1,72 @@ - +{ + "loginTitle": "Вход в панель администратора", + "username": "Имя пользователя", + "password": "Пароль", + "loginButton": "Войти", + "loginError": "Неверное имя пользователя или пароль.", + "dashboard": "Панель управления", + "userManagement": "Управление пользователями", + "nodeManagement": "Управление узлами", + "logout": "Выйти", + "nodes": "Узлы", + "users": "Пользователи", + "server": "Сервер", + "settings": "Настройки", + "saveSettingsButton": "Сохранить настройки", + "totalUsers": "Всего пользователей", + "activeAndInactive": "Активные и неактивные", + "averageCPU": "Средняя загрузка CPU", + "currentUsage": "Текущее использование", + "memory": "Память", + "disk": "Диск", + "uptime": "Время работы", + "sinceLastBoot": "С момента последней загрузки", + "addNewUser": "Добавить нового пользователя", + "addNewNode": "Добавить новый узел", + "activeUsers": "Активные пользователи", + "inactiveUsers": "Неактивные пользователи", + "nodesTotal": "Всего узлов", + "nodesActive": "Активные узлы", + "nodesInactive": "Неактивные узлы", + "th_username": "Имя пользователя", + "th_expiryDate": "Дата истечения", + "th_status": "Статус", + "th_owner": "Владелец", + "th_actions": "Действия", + "th_nodeName": "Узел", + "modal_editNodeTitle": "Редактировать узел", + "updateNodeButton": "Обновить узел", + "th_address": "Адрес", + "th_protocol": "Протокол", + "status_active": "Активен", + "status_inactive": "Неактивен", + "downloadButton": "Скачать", + "deleteButton": "Удалить", + "editButton": "Редактировать", + "downloadConfig": "Получить конфиг", + "checkStatus": "Проверить статус", + "downloadConfigFromNode": "Скачать конфиг с", + "enterUsername": "Введите имя пользователя для генерации конфига", + "selectNodeForDownload": "Выберите источник для", + "downloadSource": "Источник скачивания", + "mainPanel": "Главная панель (по умолчанию)", + "modal_createUserTitle": "Создать нового пользователя", + "modal_editUserTitle": "Редактировать пользователя", + "modal_expiryDate": "Дата истечения", + "modal_createNodeTitle": "Создать новый узел", + "cancelButton": "Отмена", + "createUserButton": "Создать пользователя", + "updateUserButton": "Обновить пользователя", + "createNodeButton": "Создать узел", + "nodeName": "Имя узла", + "nodeHostname": "Хостнейм", + "nodePort": "Порт", + "tunnelAddress": "Адрес туннеля", + "ovpnPort": "Порт OVPN", + "key": "Ключ", + "setNewSetting": "Установить новую настройку", + "nodeCreatedAt": "Создан", + "noNodesFound": "Узлы не найдены.", + "optional": "Необязательно", + "deleteNodeConfirm": "Вы уверены, что хотите удалить узел" +} From 4f4cc5e8feee36d047da2d8b75e3948accdd085d Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Sun, 2 Nov 2025 03:11:53 -0800 Subject: [PATCH 03/11] Include Russian language support in i18n Added Russian translations to i18n configuration. --- frontend/src/i18n.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/i18n.js b/frontend/src/i18n.js index 4157176..01a163d 100644 --- a/frontend/src/i18n.js +++ b/frontend/src/i18n.js @@ -3,6 +3,7 @@ import { initReactI18next } from 'react-i18next'; import enTranslation from './lang/en.json'; import faTranslation from './lang/fa.json'; +import ruTranslation from './lang/ru.json'; const resources = { en: { @@ -11,6 +12,9 @@ const resources = { fa: { translation: faTranslation, }, + ru: { + translation: ruTranslation, + }, }; i18n @@ -25,4 +29,5 @@ i18n }, }); -export default i18n; \ No newline at end of file + +export default i18n; From b9a565235999b4c1c51c24b1d52efeaa492cd9b5 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Sun, 2 Nov 2025 03:15:57 -0800 Subject: [PATCH 04/11] Refactor language change logic in DashboardLayout --- frontend/src/pages/DashboardLayout.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/DashboardLayout.jsx b/frontend/src/pages/DashboardLayout.jsx index 6e620bf..419d32d 100644 --- a/frontend/src/pages/DashboardLayout.jsx +++ b/frontend/src/pages/DashboardLayout.jsx @@ -15,10 +15,13 @@ const DashboardLayout = () => { }; const changeLanguage = () => { - const newLang = i18n.language === 'en' ? 'fa' : 'en'; - i18n.changeLanguage(newLang); - document.documentElement.dir = newLang === 'fa' ? 'rtl' : 'ltr'; - }; + const langs = ['en', 'fa', 'ru']; + const current = i18n.language; + const next = langs[(langs.indexOf(current as any) + 1) % langs.length]; + + i18n.changeLanguage(next); + document.documentElement.dir = next === 'fa' ? 'rtl' : 'ltr'; +}; return (
@@ -57,4 +60,4 @@ const DashboardLayout = () => { ); }; -export default DashboardLayout; \ No newline at end of file +export default DashboardLayout; From 52bb6bf375afa6cbc15b20dc7f365707dd3e2fe8 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Mon, 3 Nov 2025 20:55:11 -0800 Subject: [PATCH 05/11] Fix repository URL in install script --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 73cc22d..c9bc193 100644 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ pip3 install colorama pexpect requests uuid uv alembic if [ ! -d "$INSTALL_DIR" ]; then echo -e "${YELLOW}Downloading latest release...${NC}" - LATEST_URL=$(curl -s https://api.github.com/repos/primeZdev/ov-panel/releases/latest \ + LATEST_URL=$(curl -s https://api.github.com/repos/iroblivionspark/ov-panel/releases/latest \ | grep "tarball_url" \ | cut -d '"' -f 4) @@ -36,4 +36,4 @@ else fi cd "$INSTALL_DIR" -$PYTHON installer.py \ No newline at end of file +$PYTHON installer.py From fb053a147aa68943f70b44d2f2e1ae7fea649639 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Mon, 3 Nov 2025 21:05:59 -0800 Subject: [PATCH 06/11] Modify pip install to break system packages Updated pip install command to include --break-system-packages option. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c9bc193..f4032d7 100644 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ NC="\033[0m" apt update -y apt install -y python3 python3-pip wget curl git -y pip3 install --upgrade pip -pip3 install colorama pexpect requests uuid uv alembic +pip3 install colorama pexpect requests uuid uv alembic --break-system-packages if [ ! -d "$INSTALL_DIR" ]; then echo -e "${YELLOW}Downloading latest release...${NC}" From fbf20b708461d20478a1c977d7a9d63a81ff552a Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Wed, 5 Nov 2025 12:01:22 -0800 Subject: [PATCH 07/11] Update pip3 install command in install.sh Removed the --break-system-packages option from pip3 install command. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f4032d7..c9bc193 100644 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ NC="\033[0m" apt update -y apt install -y python3 python3-pip wget curl git -y pip3 install --upgrade pip -pip3 install colorama pexpect requests uuid uv alembic --break-system-packages +pip3 install colorama pexpect requests uuid uv alembic if [ ! -d "$INSTALL_DIR" ]; then echo -e "${YELLOW}Downloading latest release...${NC}" From d86975351d3d5804888920ff79100aff9f5af6fa Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Wed, 5 Nov 2025 15:30:56 -0800 Subject: [PATCH 08/11] Add GitHub Actions workflow for frontend build and deploy --- .github/workflows/build-frontend.yml | 99 ++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/build-frontend.yml diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml new file mode 100644 index 0000000..b0124b8 --- /dev/null +++ b/.github/workflows/build-frontend.yml @@ -0,0 +1,99 @@ +name: Build Frontend + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +env: + NODE_VERSION: '22.12.0' + BUILD_DIR: 'dist' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Detect package manager + id: pm + run: | + if [ -f pnpm-lock.yaml ]; then echo "manager=pnpm" >> $GITHUB_OUTPUT; + elif [ -f yarn.lock ]; then echo "manager=yarn" >> $GITHUB_OUTPUT; + else echo "manager=npm" >> $GITHUB_OUTPUT; fi + + - name: Cache node modules (explicit) + uses: actions/cache@v4 + with: + # caching both lockfile & node_modules is useful; key changes on lockfile changes + path: | + ~/.npm + node_modules + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node-${{ env.NODE_VERSION }}- + + - name: Install dependencies + run: | + if [ "${{ steps.pm.outputs.manager }}" = "pnpm" ]; then + corepack enable + corepack prepare pnpm@latest --activate + pnpm install --frozen-lockfile + elif [ "${{ steps.pm.outputs.manager }}" = "yarn" ]; then + corepack enable + corepack prepare yarn@stable --activate + yarn install --frozen-lockfile + else + npm ci + fi + + - name: Optional: Patch known JSX/TSX casts (uncomment if you want automatic quick-fix) + if: false + run: | + + + - name: Build + run: npm run build + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: frontend-dist + path: ${{ env.BUILD_DIR }} + + + deploy_pages: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: frontend-dist + path: ./site + + - name: Deploy to GitHub Pages + uses: actions/configure-pages@v4 + - name: Upload artifact for Pages + run: | + mkdir -p ./artifact + cp -R ./site/* ./artifact/ + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./artifact From e7def77be90f1313fd68b7807ff330241b513d72 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Wed, 5 Nov 2025 15:31:27 -0800 Subject: [PATCH 09/11] Fix type assertion in changeLanguage function --- frontend/src/pages/DashboardLayout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/DashboardLayout.jsx b/frontend/src/pages/DashboardLayout.jsx index 419d32d..93a45bd 100644 --- a/frontend/src/pages/DashboardLayout.jsx +++ b/frontend/src/pages/DashboardLayout.jsx @@ -17,7 +17,7 @@ const DashboardLayout = () => { const changeLanguage = () => { const langs = ['en', 'fa', 'ru']; const current = i18n.language; - const next = langs[(langs.indexOf(current as any) + 1) % langs.length]; + const next = langs[(langs.indexOf(current) + 1) % langs.length]; i18n.changeLanguage(next); document.documentElement.dir = next === 'fa' ? 'rtl' : 'ltr'; From f7dc0ae5b7b585f4ce479700e784a5b34b060480 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Wed, 5 Nov 2025 15:41:07 -0800 Subject: [PATCH 10/11] Refactor GitHub Actions workflow for frontend build --- .github/workflows/build-frontend.yml | 98 ++++++---------------------- 1 file changed, 21 insertions(+), 77 deletions(-) diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml index b0124b8..516843e 100644 --- a/.github/workflows/build-frontend.yml +++ b/.github/workflows/build-frontend.yml @@ -1,99 +1,43 @@ -name: Build Frontend +name: Auto Build & Push Frontend on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write + branches: [ "main" ] # وقتی روی main پوش بشه، اجرا میشه + workflow_dispatch: # قابلیت اجرای دستی هم داره env: NODE_VERSION: '22.12.0' - BUILD_DIR: 'dist' + BUILD_DIR: 'dist' # خروجی vite build jobs: - build: + build_and_push: runs-on: ubuntu-latest steps: - - name: Checkout repo + - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 # نیاز داریم تاریخچه کامل برای push داشته باشیم - - name: Use Node.js ${{ env.NODE_VERSION }} + - name: Setup Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - - - name: Detect package manager - id: pm - run: | - if [ -f pnpm-lock.yaml ]; then echo "manager=pnpm" >> $GITHUB_OUTPUT; - elif [ -f yarn.lock ]; then echo "manager=yarn" >> $GITHUB_OUTPUT; - else echo "manager=npm" >> $GITHUB_OUTPUT; fi - - - name: Cache node modules (explicit) - uses: actions/cache@v4 - with: - # caching both lockfile & node_modules is useful; key changes on lockfile changes - path: | - ~/.npm - node_modules - key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node-${{ env.NODE_VERSION }}- + cache: 'npm' - name: Install dependencies - run: | - if [ "${{ steps.pm.outputs.manager }}" = "pnpm" ]; then - corepack enable - corepack prepare pnpm@latest --activate - pnpm install --frozen-lockfile - elif [ "${{ steps.pm.outputs.manager }}" = "yarn" ]; then - corepack enable - corepack prepare yarn@stable --activate - yarn install --frozen-lockfile - else - npm ci - fi - - - name: Optional: Patch known JSX/TSX casts (uncomment if you want automatic quick-fix) - if: false - run: | + run: npm ci - - - name: Build + - name: Build frontend run: npm run build - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: frontend-dist - path: ${{ env.BUILD_DIR }} - - - deploy_pages: - needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - steps: - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: frontend-dist - path: ./site + # اگر می‌خواهی فایل‌هایی از بیلد حذف شوند قبل از push (اختیاری) + # - name: Clean up dist (optional) + # run: rm -rf dist/some-unwanted-folder - - name: Deploy to GitHub Pages - uses: actions/configure-pages@v4 - - name: Upload artifact for Pages - run: | - mkdir -p ./artifact - cp -R ./site/* ./artifact/ - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + - name: Push build to branch 'build' + uses: peaceiris/actions-gh-pages@v4 with: - path: ./artifact + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: build # شاخه‌ای که بیلد میره + publish_dir: ${{ env.BUILD_DIR }} + force_orphan: true # شاخه جدید با تاریخچه خالی From e36da208f7e10828cffe160dcf262b3d54e9c1a0 Mon Sep 17 00:00:00 2001 From: OblivionSpark Date: Wed, 5 Nov 2025 15:43:34 -0800 Subject: [PATCH 11/11] Update GitHub Actions workflow for frontend build --- .github/workflows/build-frontend.yml | 55 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml index 516843e..c0a1df3 100644 --- a/.github/workflows/build-frontend.yml +++ b/.github/workflows/build-frontend.yml @@ -1,43 +1,60 @@ -name: Auto Build & Push Frontend +name: Build Frontend (from frontend/) and Push Build Branch on: push: - branches: [ "main" ] # وقتی روی main پوش بشه، اجرا میشه - workflow_dispatch: # قابلیت اجرای دستی هم داره + branches: [ "main" ] + workflow_dispatch: env: NODE_VERSION: '22.12.0' - BUILD_DIR: 'dist' # خروجی vite build + FRONTEND_DIR: 'frontend' + BUILD_DIR: 'dist' + PUBLISH_BRANCH: 'build' # change to gh-pages if you prefer jobs: build_and_push: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout repo uses: actions/checkout@v4 with: - fetch-depth: 0 # نیاز داریم تاریخچه کامل برای push داشته باشیم + fetch-depth: 0 - - name: Setup Node.js ${{ env.NODE_VERSION }} + - name: Setup Node.js ${{ env.NODE_VERSION }} (with npm cache pointing to frontend lockfile) uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Build frontend + cache-dependency-path: '${{ env.FRONTEND_DIR }}/package-lock.json' + + - name: Show node/npm versions + run: | + node -v + npm -v + + - name: Install dependencies (frontend) + working-directory: ${{ env.FRONTEND_DIR }} + run: | + # Use npm ci if lockfile exists, else fallback to npm install + if [ -f package-lock.json ]; then + npm ci + else + npm install + fi + + - name: Build (frontend) + working-directory: ${{ env.FRONTEND_DIR }} run: npm run build - # اگر می‌خواهی فایل‌هایی از بیلد حذف شوند قبل از push (اختیاری) - # - name: Clean up dist (optional) - # run: rm -rf dist/some-unwanted-folder + - name: Verify build output + run: | + echo "Listing build output:" + ls -la ${{ env.FRONTEND_DIR }}/${{ env.BUILD_DIR }} - - name: Push build to branch 'build' + - name: Publish dist to branch '${{ env.PUBLISH_BRANCH }}' uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: build # شاخه‌ای که بیلد میره - publish_dir: ${{ env.BUILD_DIR }} - force_orphan: true # شاخه جدید با تاریخچه خالی + publish_branch: ${{ env.PUBLISH_BRANCH }} + publish_dir: ${{ env.FRONTEND_DIR }}/${{ env.BUILD_DIR }} + force_orphan: true