From 12f87844a8dcf15f6b9ae7bc60b6e452e5118421 Mon Sep 17 00:00:00 2001 From: tianhai Date: Tue, 11 Feb 2025 16:14:27 +0800 Subject: [PATCH 01/15] feat: add high availability mode by deploy param --- ui/package.json | 2 + ui/src/pages/cluster/add/index.tsx | 50 ++++++++++++++++++- .../cluster/components/editPopForm/index.tsx | 40 ++++++++++++++- ui/src/pages/cluster/index.tsx | 4 +- ui/src/pages/insightDetail/cluster/index.tsx | 45 +++++++++++++++-- ui/src/utils/request.ts | 3 ++ 6 files changed, 137 insertions(+), 7 deletions(-) diff --git a/ui/package.json b/ui/package.json index ded7c44c..43b68d50 100644 --- a/ui/package.json +++ b/ui/package.json @@ -62,7 +62,9 @@ "release": "standard-version", "dev": "GENERATE_SOURCEMAP=false PORT=8000 craco start", "start": "GENERATE_SOURCEMAP=false PORT=8080 HTTPS=true craco start", + "start:inner": "GENERATE_SOURCEMAP=false PORT=8080 HTTPS=true REACT_APP_DEPLOY_MODE=HIGH_AVAILABILITY craco start", "build": "GENERATE_SOURCEMAP=false PUBLIC_URL=/public/ craco build", + "build:inner": "GENERATE_SOURCEMAP=false PUBLIC_URL=/public/ REACT_APP_DEPLOY_MODE=HIGH_AVAILABILITY craco build", "lint:prettier": "prettier --write src\"/**/*.+(js|ts|tsx|jsx|json|md|json)\"", "lint:style": "stylelint src\"/**/*.+(css|scss|less|stylus|sass|postcss)\" --fix", "lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx src", diff --git a/ui/src/pages/cluster/add/index.tsx b/ui/src/pages/cluster/add/index.tsx index f9a5890f..2f92dd96 100644 --- a/ui/src/pages/cluster/add/index.tsx +++ b/ui/src/pages/cluster/add/index.tsx @@ -1,11 +1,20 @@ import React, { useState, useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { ArrowLeftOutlined, UploadOutlined } from '@ant-design/icons' -import { Form, Input, Space, Button, Upload, message, notification } from 'antd' +import { + Form, + Input, + Space, + Button, + Upload, + message, + notification, + Select, +} from 'antd' import type { UploadProps } from 'antd' import { useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' -import { HOST, useAxios } from '@/utils/request' +import { HOST, isHighAvailability, useAxios } from '@/utils/request' import Yaml from '@/components/yaml' import { fireConfetti } from '@/utils/confetti' @@ -13,6 +22,8 @@ import styles from './styles.module.less' const { TextArea } = Input +const { Option } = Select + const RegisterCluster = () => { const { t } = useTranslation() const [form] = Form.useForm() @@ -161,6 +172,41 @@ const RegisterCluster = () => { >