feat(cluster): add reload and restart for nginx

This commit is contained in:
Jacky 2025-04-05 15:37:47 +08:00
parent c086455772
commit 2d437ff0cc
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
24 changed files with 2897 additions and 1239 deletions

56
.cursor/rules/backend.mdc Normal file
View file

@ -0,0 +1,56 @@
---
description: backend
globs:
alwaysApply: false
---
# Cursor Rules
You are an expert in Go, Gin, Gorm, Gen, Cosy (https://cosy.uozi.org/) with a deep understanding of best practices and performance optimization techniques in these technologies.
## 1. Code Style and Structure
- **Concise and Maintainable Code:**
Write technically accurate and easily understandable Go code with relevant examples.
- **API Controllers:**
Implement API controllers in the `api/$modules_name` directory.
- **Database Models:**
Define database table models in the `model/` folder.
- **Query Simplification:**
Use [Gen](mdc:https:/cosy.uozi.org) to streamline query operations, reducing boilerplate code.
- **Business Logic and Error Handling:**
Place complex API logic and custom error definitions in `internal/$modules_name`. Follow the best practices outlined in the [Cosy Error Handler](mdc:https:/cosy.uozi.org/error-handler).
- **Routing:**
Register all application routes in the `router/` directory.
- **Configuration Management:**
Manage and register configuration settings in the `settings/` directory.
## 2. CRUD Operations
- **Standardized Operations:**
Utilize [Cosy](mdc:https:/cosy.uozi.org) to implement Create, Read, Update, and Delete (CRUD) operations consistently across the project.
## 3. Performance Optimization
- **Efficient Database Pagination:**
Implement database pagination techniques to handle large datasets efficiently.
- **Overall Performance:**
Apply performance optimization techniques to ensure fast response times and resource efficiency.
## 4. File Organization and Formatting
- **Modular Files:**
Keep individual files concise by splitting code based on functionality, promoting better readability and maintainability.
- **Consistent Syntax and Formatting:**
Follow consistent coding standards and formatting rules across the project to enhance clarity.
## 5. Documentation and Comments
- **English Language:**
All code comments and documentation should be written in English to maintain consistency and accessibility.

View file

@ -0,0 +1,44 @@
---
description: frontend
globs:
alwaysApply: false
---
You are an expert in TypeScript, Node.js, Vite, Vue.js, Vue Router, Pinia, VueUse, Ant Design Vue, and UnoCSS, with a deep understanding of best practices and performance optimization techniques in these technologies.
  
    Code Style and Structure
    - Write concise, maintainable, and technically accurate TypeScript code with relevant examples.
    - Use functional and declarative programming patterns; avoid classes.
    - Favor iteration and modularization to adhere to DRY principles and avoid code duplication.
    - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
    - Organize files systematically: each file should contain only related content, such as exported components, subcomponents, helpers, static content, and types.
- Define API and types in app/src/api
  
    Naming Conventions
- In src/components, the name should be CamelCase (e.g., app/src/components/ChatGPT/ChatGPT.vue)
    - In src/views, the folder name should be lower case with underline, but the component name should be CamelCase (e.g., app/src/views/system/About.vue)
    - Favor named exports for functions.
  
    TypeScript Usage
    - Use TypeScript for all code; prefer interfaces over types for their extendability and ability to merge.
  
    Syntax and Formatting
    - Use the "function" keyword for pure functions to benefit from hoisting and clarity.
    - Always use the Vue Composition API script setup style.
- Use Vue3.4+ features like defineModel(), useTemplateRef(), v-bind Same-name Shorthand
  
    UI and Styling
    - Use Ant Design Vue, UnoCSS for components and styling.
    - Implement responsive design with UnoCSS and Antdv Flex layout; use a mobile-first approach.
  
    Performance Optimization
    - Leverage VueUse functions where applicable to enhance reactivity and performance.
    - Wrap asynchronous components in Suspense with a fallback UI.
    - Use dynamic loading for non-critical components.
    - Optimize images: use WebP format, include size data, implement lazy loading.
    - Implement an optimized chunking strategy during the Vite build process, such as code splitting, to generate smaller bundle sizes.
  
    Key Conventions
    - Optimize Web Vitals (LCP, CLS, FID) using tools like Lighthouse or WebPageTest.
Comments
- Always response in English