Files
opsxsql/frontend
logan e0cb505d43 refactor: 数据源弹框交互重构 + test-connection API
1. 类型选择前置: 4个数据源类型卡片(MySQL/PG/Redis/Mongo)放最前面
2. 根据类型动态渲染: Redis隐藏用户名/数据库, 显示数据库编号
3. 环境支持自定义输入: 预设开发/预发/生产/测试/UAT + 自定义...
4. 去掉流程配置: 不再需要配置审批流程
5. 测试连接优先: 底部左侧「测试连接」按钮, 连接成功后才能「添加数据源」
6. 后端新增 POST /test-connection: 不保存实例直接测试连接参数
7. 类型切换自动填充默认端口: mysql:3306, pg:5432, redis:6379, mongo:27017
8. 连接测试结果展示: 成功(绿色+版本号) / 失败(红色+错误信息)
9. 修改连接参数时自动清除测试结果, 需重新测试

前端构建零错误, 后端202测试通过
2026-05-22 23:32:56 +08:00
..

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])