diff --git a/.vscode/launch.json b/.vscode/launch.json index 5bb51767..38c9a528 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,15 +1,6 @@ { "version": "0.2.0", "configurations": [ - { - "type": "java", - "name": "Debug (Launch) - SisvietnamvnApp", - "request": "launch", - "mainClass": "com.sisvietnamvn.web.SisvietnamvnApp", - "projectName": "sisvietnamvn", - "cwd": "${workspaceFolder}/sisvietnamvn_main", - "vmArgs": "-Dspring.profiles.active=dev" - }, { "type": "java", "name": "Debug (Attach) - Port 5005", diff --git a/README.md b/README.md index 12cf94e1..dae185c9 100644 --- a/README.md +++ b/README.md @@ -126,4 +126,37 @@ Tôi đã chạy lệnh ./gradlew spotlessApply để tự động dọn dẹp v (Lưu ý: Có một lỗi riêng trong lệnh chạy test ./gradlew test liên quan đến cấu hình taskExecutor bị thiếu của dự án gốc đối với môi trường test, nhưng nó hoàn toàn không ảnh hưởng đến việc chạy ứng dụng thực tế bằng ./gradlew bootRun). -Bạn có thể refresh lại trang web để kiểm tra màu sắc trên menu header nhé, nó đã được sửa lại thành màu đen rồi! \ No newline at end of file +Bạn có thể refresh lại trang web để kiểm tra màu sắc trên menu header nhé, nó đã được sửa lại thành màu đen rồi! + +## How to Debug (VS Code) + +1. **Start the Application in Debug Mode**: + Open a terminal in the project directory (`sisvietnamvn_main`) and run: + ```bash + ./gradlew bootRun --debug-jvm + ``` + The application will start and pause, displaying: `Listening for transport dt_socket at address: 5005`. + +2. **Configure VS Code**: + Ensure your `.vscode/launch.json` has the following configuration: + ```json + { + "type": "java", + "name": "Debug (Attach) - Port 5005", + "request": "attach", + "hostName": "127.0.0.1", + "port": 5005, + "projectName": "sisvietnamvn" + } + ``` + +3. **Attach the Debugger**: + - Go to the **Run and Debug** view in VS Code (`Ctrl+Shift+D`). + - Select **Debug (Attach) - Port 5005** from the dropdown at the top. + - Click the green **Play** button (or press `F5`). + - The application will resume booting. + +4. **Set Breakpoints & Debug**: + - Open any Java file (e.g., `SwiperSliderPlugin.java`). + - Click in the left margin next to a line number to place a red breakpoint. + - Trigger the code (e.g., by navigating to the page in your browser). Execution will pause at your breakpoint, allowing you to inspect variables! \ No newline at end of file diff --git a/sisvietnamvn_main/fix_admin_form.py b/sisvietnamvn_main/fix_admin_form.py new file mode 100644 index 00000000..bdaca015 --- /dev/null +++ b/sisvietnamvn_main/fix_admin_form.py @@ -0,0 +1,458 @@ +with open("src/main/resources/templates/plugins/swiper-slider/admin-form.html", "w", encoding="utf-8") as f: + f.write(""" +
+