diff --git a/start-industry.bat b/start-industry.bat index 44be2af..df4a6d0 100644 --- a/start-industry.bat +++ b/start-industry.bat @@ -4,37 +4,39 @@ setlocal enabledelayedexpansion :: ======================================== :: Education System - Windows Startup Script +:: 教务系统 - Windows启动脚本 :: ======================================== :MAIN_MENU cls echo ======================================== echo Education System - Smart Launcher +echo 教务系统 - 智能启动器 echo ======================================== echo. -echo Select an option: +echo Select an option / 请选择一个选项: echo. -echo 0 - Start All Industries +echo 0 - Start All Industries / 启动所有产业 echo -------------- -echo 1 - Cultural Tourism (Port: 5150) -echo 2 - Smart Manufacturing (Port: 5151) -echo 3 - Smart Development (Port: 5152) -echo 4 - Finance and Commerce (Port: 5153) -echo 5 - Visual Design (Port: 5154) -echo 6 - Transportation and Logistics (Port: 5155) -echo 7 - Healthcare (Port: 5156) -echo 8 - Civil and Water Engineering (Port: 5157) -echo 9 - Food Industry (Port: 5158) -echo 10 - Chemical Industry (Port: 5159) -echo 11 - Energy Industry (Port: 5160) -echo 12 - Environmental Protection (Port: 5161) +echo 1 - Cultural Tourism / 文旅产业 (Port/端口: 5150) +echo 2 - Smart Manufacturing / 智能制造 (Port/端口: 5151) +echo 3 - Smart Development / 智能开发 (Port/端口: 5152) +echo 4 - Finance and Commerce / 财经商贸 (Port/端口: 5153) +echo 5 - Visual Design / 视觉设计 (Port/端口: 5154) +echo 6 - Transportation / 交通物流 (Port/端口: 5155) +echo 7 - Healthcare / 大健康 (Port/端口: 5156) +echo 8 - Civil Engineering / 土木水利 (Port/端口: 5157) +echo 9 - Food Industry / 食品产业 (Port/端口: 5158) +echo 10 - Chemical Industry / 化工产业 (Port/端口: 5159) +echo 11 - Energy Industry / 能源产业 (Port/端口: 5160) +echo 12 - Environmental / 环保产业 (Port/端口: 5161) echo -------------- -echo A - Stop All Industries -echo S - Check Status -echo Q - Exit +echo A - Stop All / 停止所有 +echo S - Check Status / 查看状态 +echo Q - Exit / 退出 echo. -set /p choice=Enter your choice: +set /p choice=Enter your choice / 请输入选项: if "%choice%"=="0" goto START_ALL if "%choice%"=="1" goto START_1 @@ -53,87 +55,87 @@ if /i "%choice%"=="A" goto STOP_ALL if /i "%choice%"=="S" goto CHECK_STATUS if /i "%choice%"=="Q" goto EXIT -echo Invalid option! +echo Invalid option! / 无效选项! timeout /t 2 >nul goto MAIN_MENU :START_ALL echo. -echo Starting all industries... -call :START_INDUSTRY "frontend" "Cultural Tourism" 5150 -call :START_INDUSTRY "frontend_智能制造" "Smart Manufacturing" 5151 -call :START_INDUSTRY "frontend_智能开发" "Smart Development" 5152 -call :START_INDUSTRY "frontend_财经商贸" "Finance Commerce" 5153 -call :START_INDUSTRY "frontend_视觉设计" "Visual Design" 5154 -call :START_INDUSTRY "frontend_交通物流" "Transportation" 5155 -call :START_INDUSTRY "frontend_大健康" "Healthcare" 5156 -call :START_INDUSTRY "frontend_土木水利" "Civil Engineering" 5157 -call :START_INDUSTRY "frontend_食品" "Food Industry" 5158 -call :START_INDUSTRY "frontend_化工" "Chemical Industry" 5159 -call :START_INDUSTRY "frontend_能源" "Energy Industry" 5160 -call :START_INDUSTRY "frontend_环保" "Environmental" 5161 +echo Starting all industries... / 正在启动所有产业... +call :START_INDUSTRY "frontend" "Cultural Tourism / 文旅产业" 5150 +call :START_INDUSTRY "frontend_智能制造" "Smart Manufacturing / 智能制造" 5151 +call :START_INDUSTRY "frontend_智能开发" "Smart Development / 智能开发" 5152 +call :START_INDUSTRY "frontend_财经商贸" "Finance Commerce / 财经商贸" 5153 +call :START_INDUSTRY "frontend_视觉设计" "Visual Design / 视觉设计" 5154 +call :START_INDUSTRY "frontend_交通物流" "Transportation / 交通物流" 5155 +call :START_INDUSTRY "frontend_大健康" "Healthcare / 大健康" 5156 +call :START_INDUSTRY "frontend_土木水利" "Civil Engineering / 土木水利" 5157 +call :START_INDUSTRY "frontend_食品" "Food Industry / 食品产业" 5158 +call :START_INDUSTRY "frontend_化工" "Chemical Industry / 化工产业" 5159 +call :START_INDUSTRY "frontend_能源" "Energy Industry / 能源产业" 5160 +call :START_INDUSTRY "frontend_环保" "Environmental / 环保产业" 5161 echo. -echo All industries started! +echo All industries started! / 所有产业已启动! pause goto MAIN_MENU :START_1 -call :START_INDUSTRY "frontend" "Cultural Tourism" 5150 +call :START_INDUSTRY "frontend" "Cultural Tourism / 文旅产业" 5150 pause goto MAIN_MENU :START_2 -call :START_INDUSTRY "frontend_智能制造" "Smart Manufacturing" 5151 +call :START_INDUSTRY "frontend_智能制造" "Smart Manufacturing / 智能制造" 5151 pause goto MAIN_MENU :START_3 -call :START_INDUSTRY "frontend_智能开发" "Smart Development" 5152 +call :START_INDUSTRY "frontend_智能开发" "Smart Development / 智能开发" 5152 pause goto MAIN_MENU :START_4 -call :START_INDUSTRY "frontend_财经商贸" "Finance Commerce" 5153 +call :START_INDUSTRY "frontend_财经商贸" "Finance Commerce / 财经商贸" 5153 pause goto MAIN_MENU :START_5 -call :START_INDUSTRY "frontend_视觉设计" "Visual Design" 5154 +call :START_INDUSTRY "frontend_视觉设计" "Visual Design / 视觉设计" 5154 pause goto MAIN_MENU :START_6 -call :START_INDUSTRY "frontend_交通物流" "Transportation" 5155 +call :START_INDUSTRY "frontend_交通物流" "Transportation / 交通物流" 5155 pause goto MAIN_MENU :START_7 -call :START_INDUSTRY "frontend_大健康" "Healthcare" 5156 +call :START_INDUSTRY "frontend_大健康" "Healthcare / 大健康" 5156 pause goto MAIN_MENU :START_8 -call :START_INDUSTRY "frontend_土木水利" "Civil Engineering" 5157 +call :START_INDUSTRY "frontend_土木水利" "Civil Engineering / 土木水利" 5157 pause goto MAIN_MENU :START_9 -call :START_INDUSTRY "frontend_食品" "Food Industry" 5158 +call :START_INDUSTRY "frontend_食品" "Food Industry / 食品产业" 5158 pause goto MAIN_MENU :START_10 -call :START_INDUSTRY "frontend_化工" "Chemical Industry" 5159 +call :START_INDUSTRY "frontend_化工" "Chemical Industry / 化工产业" 5159 pause goto MAIN_MENU :START_11 -call :START_INDUSTRY "frontend_能源" "Energy Industry" 5160 +call :START_INDUSTRY "frontend_能源" "Energy Industry / 能源产业" 5160 pause goto MAIN_MENU :START_12 -call :START_INDUSTRY "frontend_环保" "Environmental" 5161 +call :START_INDUSTRY "frontend_环保" "Environmental / 环保产业" 5161 pause goto MAIN_MENU @@ -144,57 +146,61 @@ set "port=%~3" echo. echo ======================================== -echo Starting %name% (Port: %port%) +echo Starting / 正在启动: %name% +echo Port / 端口: %port% echo ======================================== if not exist "%dir%" ( - echo [ERROR] Directory %dir% does not exist! + echo [ERROR/错误] Directory does not exist! / 目录不存在: %dir% exit /b 1 ) netstat -an | findstr ":%port%" >nul 2>&1 if %errorlevel%==0 ( - echo [WARNING] Port %port% is already in use - set /p stop_choice=Stop existing service and restart? (y/n): + echo [WARNING/警告] Port is already in use / 端口已被占用: %port% + set /p stop_choice=Stop existing service? / 停止现有服务? (y/n): if /i "!stop_choice!"=="y" ( - echo Stopping service on port %port%... + echo Stopping service... / 正在停止服务... for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%port%"') do ( taskkill /F /PID %%a >nul 2>&1 ) timeout /t 2 >nul ) else ( - echo Skipping %name% + echo Skipping... / 跳过... exit /b 1 ) ) cd "%dir%" 2>nul if not exist "node_modules" ( - echo [INFO] Dependencies not found, installing... - echo This may take 1-3 minutes, please wait... + echo [INFO/信息] Installing dependencies... / 正在安装依赖... + echo Please wait 1-3 minutes... / 请等待1-3分钟... call npm install if !errorlevel! neq 0 ( - echo [ERROR] Failed to install dependencies for %name%! + echo [ERROR/错误] Installation failed! / 安装失败! cd .. exit /b 1 ) - echo [SUCCESS] Dependencies installed for %name%! + echo [SUCCESS/成功] Dependencies installed! / 依赖安装完成! ) else ( - echo [INFO] Dependencies already exist for %name% + echo [INFO/信息] Dependencies exist / 依赖已存在 ) -echo [INFO] Starting %name%... +echo [INFO/信息] Starting service... / 正在启动服务... start /min cmd /c "npm run dev" cd .. +echo Waiting for startup... / 等待启动... timeout /t 3 >nul netstat -an | findstr ":%port%" >nul 2>&1 if %errorlevel%==0 ( - echo [SUCCESS] %name% started successfully! - echo Access URL: http://localhost:%port% + echo [SUCCESS/成功] Started successfully! / 启动成功! + echo. + echo Access URL / 访问地址: http://localhost:%port% + echo. ) else ( - echo [ERROR] Failed to start %name%! + echo [ERROR/错误] Failed to start! / 启动失败! exit /b 1 ) @@ -202,12 +208,12 @@ exit /b 0 :STOP_ALL echo. -echo Stopping all industry services... +echo Stopping all services... / 正在停止所有服务... taskkill /F /IM node.exe >nul 2>&1 if %errorlevel%==0 ( - echo All services stopped successfully! + echo All services stopped! / 所有服务已停止! ) else ( - echo No running services found. + echo No services running / 没有运行的服务 ) pause goto MAIN_MENU @@ -215,34 +221,37 @@ goto MAIN_MENU :CHECK_STATUS cls echo ======================================== -echo Industry Running Status +echo Industry Status / 产业运行状态 echo ======================================== echo. -call :CHECK_PORT 5150 "Cultural Tourism" -call :CHECK_PORT 5151 "Smart Manufacturing" -call :CHECK_PORT 5152 "Smart Development" -call :CHECK_PORT 5153 "Finance Commerce" -call :CHECK_PORT 5154 "Visual Design" -call :CHECK_PORT 5155 "Transportation" -call :CHECK_PORT 5156 "Healthcare" -call :CHECK_PORT 5157 "Civil Engineering" -call :CHECK_PORT 5158 "Food Industry" -call :CHECK_PORT 5159 "Chemical Industry" -call :CHECK_PORT 5160 "Energy Industry" -call :CHECK_PORT 5161 "Environmental" +call :CHECK_PORT 5150 "Cultural Tourism / 文旅产业" +call :CHECK_PORT 5151 "Smart Manufacturing / 智能制造" +call :CHECK_PORT 5152 "Smart Development / 智能开发" +call :CHECK_PORT 5153 "Finance Commerce / 财经商贸" +call :CHECK_PORT 5154 "Visual Design / 视觉设计" +call :CHECK_PORT 5155 "Transportation / 交通物流" +call :CHECK_PORT 5156 "Healthcare / 大健康" +call :CHECK_PORT 5157 "Civil Engineering / 土木水利" +call :CHECK_PORT 5158 "Food Industry / 食品产业" +call :CHECK_PORT 5159 "Chemical Industry / 化工产业" +call :CHECK_PORT 5160 "Energy Industry / 能源产业" +call :CHECK_PORT 5161 "Environmental / 环保产业" echo. -pause +echo Press any key to continue... / 按任意键继续... +pause >nul goto MAIN_MENU :CHECK_PORT netstat -an | findstr ":%1" >nul 2>&1 if %errorlevel%==0 ( - echo [RUNNING] %~2 - Port: %1 - http://localhost:%1 + echo [RUNNING/运行中] %~2 - Port/端口: %1 + echo URL: http://localhost:%1 ) else ( - echo [STOPPED] %~2 - Port: %1 + echo [STOPPED/未启动] %~2 - Port/端口: %1 ) exit /b 0 :EXIT -echo Goodbye! +echo Goodbye! / 再见! +timeout /t 1 >nul exit \ No newline at end of file