diff --git a/_deploy.py b/_deploy.py index 4b13e51..598b7f9 100644 --- a/_deploy.py +++ b/_deploy.py @@ -55,7 +55,7 @@ class UserConfig(object): 'password': None, 'key_file': None, 'port': 22, - 'timeout': 30 + 'timeout': 300 } def __init__(self, username=None, password=None, key_file=None, port=None, timeout=None): diff --git a/plugins/oceanbase/4.0.0.0/parameter.yaml b/plugins/oceanbase/4.0.0.0/parameter.yaml index 25de063..134c7a6 100644 --- a/plugins/oceanbase/4.0.0.0/parameter.yaml +++ b/plugins/oceanbase/4.0.0.0/parameter.yaml @@ -1051,7 +1051,7 @@ name_local: 集群系统内存 essential: true type: CAPACITY_MB - default: 30G + default: 0 min_value: 0M max_value: NULL section: OBSERVER diff --git a/plugins/oceanbase/4.2.0.0/parameter.yaml b/plugins/oceanbase/4.2.0.0/parameter.yaml index 60493fe..3670c87 100644 --- a/plugins/oceanbase/4.2.0.0/parameter.yaml +++ b/plugins/oceanbase/4.2.0.0/parameter.yaml @@ -1048,7 +1048,7 @@ name_local: 集群系统内存 essential: true type: CAPACITY_MB - default: 30G + default: 0 min_value: 0M max_value: NULL section: OBSERVER diff --git a/plugins/oceanbase/4.2.1.0/parameter.yaml b/plugins/oceanbase/4.2.1.0/parameter.yaml index f1baa5c..8c295c3 100644 --- a/plugins/oceanbase/4.2.1.0/parameter.yaml +++ b/plugins/oceanbase/4.2.1.0/parameter.yaml @@ -1048,7 +1048,7 @@ name_local: 集群系统内存 essential: true type: CAPACITY_MB - default: 30G + default: 0 min_value: 0M max_value: NULL section: OBSERVER diff --git a/plugins/oceanbase/4.2.1.4/parameter.yaml b/plugins/oceanbase/4.2.1.4/parameter.yaml index 69ffe0e..2fe7eea 100644 --- a/plugins/oceanbase/4.2.1.4/parameter.yaml +++ b/plugins/oceanbase/4.2.1.4/parameter.yaml @@ -1060,7 +1060,7 @@ name_local: 集群系统内存 essential: true type: CAPACITY_MB - default: 30G + default: 0 min_value: 0M max_value: NULL section: OBSERVER diff --git a/plugins/oceanbase/4.2.2.0/parameter.yaml b/plugins/oceanbase/4.2.2.0/parameter.yaml index 5314272..5642780 100644 --- a/plugins/oceanbase/4.2.2.0/parameter.yaml +++ b/plugins/oceanbase/4.2.2.0/parameter.yaml @@ -1060,7 +1060,7 @@ name_local: 集群系统内存 essential: true type: CAPACITY_MB - default: 30G + default: 0 min_value: 0M max_value: NULL section: OBSERVER diff --git a/plugins/oceanbase/4.3.0.0/parameter.yaml b/plugins/oceanbase/4.3.0.0/parameter.yaml index 17a3fd1..509578a 100644 --- a/plugins/oceanbase/4.3.0.0/parameter.yaml +++ b/plugins/oceanbase/4.3.0.0/parameter.yaml @@ -1060,7 +1060,7 @@ name_local: 集群系统内存 essential: true type: CAPACITY_MB - default: 30G + default: 0 min_value: 0M max_value: NULL section: OBSERVER diff --git a/rpm/ob-deploy.spec b/rpm/ob-deploy.spec index a3ced27..ec77ab0 100644 --- a/rpm/ob-deploy.spec +++ b/rpm/ob-deploy.spec @@ -121,6 +121,7 @@ cd ${RPM_BUILD_ROOT}/usr/obd/optimize && ln -s obproxy obproxy-ce %post +#!/bin/bash # chkconfig: 2345 10 90 # description: obd .... chmod -R 755 /usr/obd/* @@ -128,11 +129,46 @@ chown -R root:root /usr/obd/* find /usr/obd -type f -exec chmod 644 {} \; chmod +x /usr/bin/obd chmod +x /usr/obd/lib/executer/executer27/bin/executer +if [[ $(DIRS=(/home /root); for dir in "${DIRS[@]}"; do [ -d "$dir" ] && find "$dir" -name "env.sh" |xargs -r grep 'OBD_INSTALL_PRE' | xargs -r echo; done) ]]; then + echo "Detected residual environment variables of oceanbase-all-in-one in the system. Please execute \`rm -rf ~/.obd/version && rm -rf ~/.oceanbase-all-in-one/obd && obd env set OBD_INSTALL_PRE / \` under the user who installed all-in-one and rerun." +fi echo -e 'Installation of obd finished successfully\nPlease source /etc/profile.d/obd.sh to enable it' #/sbin/chkconfig --add obd #/sbin/chkconfig obd on %changelog +* Tue Oct 12 2024 obd 2.10.1 + - new features: adapt to Oceanbase-CE 4.3.3 + - new features: add OCP MetaDB version verification functionality + - optimizations: refine default component configuration logic for white screen deployments + - enhancements: improve user experience on low-performance machines +* Tue Sep 03 2024 obd 2.10.0 + - new features: adapt to Oceanbase-CE 4.3.3 + - new features: adapt to OBProxy 4.3.1 + - enhancements: support component management in graphical interface + - enhancements: support selecting business type when deploying OceanBase database in graphical interface + - enhancements: optimize edit-config logic to prevent users from mistakenly redeploying the cluster + - enhancements: optimize restart parameter passing logic to avoid overwriting user configurations + - enhancements: optimize disk usage logic + - enhancem¸ents: print connection information when creating tenants + - enhancements: test command group supports automatic installation of toolkits + - enhancements: support sysbench testing multiple scenarios and threads in one run + - enhancements: support tpch testing for data import via bypass + - enhancements: support specifying monitor_user when deploying OBAgent + - enhancements: automatic log desensitization + - bug fixes: fixed an issue where deploying OCP with automatic takeover of MetaDB had unexpected SSH port behavior + - bug fixds: fixed an issue where unexpected parameters were passed when restarting OCP + - bug fixds: fixed an issue where the existing obconfig_url configuration did not take effect during Oceanbase deployment + - bug fixds: fixed an issue where destroying OCP resulted in directory deletion errors in specific scenarios + - bug fixds: fixed an issue where encountering a program interruption during upgrade caused unexpected re-upgrade behaviorfixed an issue where unexpected parameters were passed when restarting OCP + - bug fixds: fixed an issue where the existing obconfig_url configuration did not take effect during Oceanbase deployment + - bug fixds: fixed an issue where destroying OCP resulted in directory deletion errors in specific scenarios + - bug fixds: fixed an issue where encountering a program interruption during upgrade caused unexpected re-upgrade behavior +* Tue Jun 18 2024 obd 2.9.2 + - bug fixes: fixed an issue where OCP taken over encountered exceptions during upgrades. +* Thu Jun 13 2024 obd 2.9.1 + - bug fixes: fixed an issue where an exception occurred when deploying OCP and OceanBase simultaneously + - enhancements: optimize the OBShell deployment check * Fri Apr 19 2024 obd 2.9.0 - new features: support for graphical deployment of ConfigServer - new features: supports custom production_mode, scenario configuration in graphical deployment of OceanBase diff --git a/ssh.py b/ssh.py index 3442ae3..72fb6f0 100644 --- a/ssh.py +++ b/ssh.py @@ -52,7 +52,7 @@ class SshConfig(object): - def __init__(self, host, username='root', password=None, key_filename=None, port=22, timeout=30): + def __init__(self, host, username='root', password=None, key_filename=None, port=22, timeout=300): self.host = host self.username = username self.password = password if password is None else str(password) diff --git a/web/package.json b/web/package.json index d395bae..d67385e 100644 --- a/web/package.json +++ b/web/package.json @@ -35,7 +35,7 @@ "classnames": "^2.3.2", "copy-to-clipboard": "3.3.3", "cross-env": "7.0.3", - "i18next": "^23.8.1", + "i18next": "^23.15.2", "jsencrypt": "^3.3.2", "lodash": "^4.17.21", "lottie-web": "5.10.2", diff --git a/web/src/component/DeployConfig/index.tsx b/web/src/component/DeployConfig/index.tsx index 7698d90..4440cb1 100644 --- a/web/src/component/DeployConfig/index.tsx +++ b/web/src/component/DeployConfig/index.tsx @@ -39,6 +39,7 @@ import copy from 'copy-to-clipboard'; import NP from 'number-precision'; import { useEffect, useRef, useState } from 'react'; import { getLocale, history, useModel } from 'umi'; +import { isEmpty } from 'lodash'; import EnStyles from '../../pages/Obdeploy/indexEn.less'; import ZhStyles from '../../pages/Obdeploy/indexZh.less'; import CustomFooter from '../CustomFooter'; @@ -53,7 +54,6 @@ import { getCompoents } from './constants'; const locale = getLocale(); const styles = locale === 'zh-CN' ? ZhStyles : EnStyles; - export default function DeployConfig({ setCurrent, current, @@ -99,24 +99,26 @@ export default function DeployConfig({ OCPComponent, } = getCompoents(OBD_DOCS, OCP_DOCS, OBPROXY_DOCS); const [componentLoading, setComponentLoading] = useState(false); + // 获取当前的路由 const taiPath = getTailPath(); const isUpdate = taiPath === 'update'; const isNewDB = taiPath === 'install'; const [form] = ProForm.useForm(); + // 下一步按钮loading 手动设置 const [nextLoading, setNextLoading] = useState(false); const checkRegInfo = { reg: isUpdate ? updateClusterNameReg : clusterNameReg, msg: isUpdate ? intl.formatMessage({ - id: 'OBD.component.DeployConfig.ItStartsWithALetter.1', - defaultMessage: - '以英文字母开头、英文或数字结尾,可包含英文、数字、连字符和下划线,且长度为 2 ~ 32', - }) + id: 'OBD.component.DeployConfig.ItStartsWithALetter.1', + defaultMessage: + '以英文字母开头、英文或数字结尾,可包含英文、数字、连字符和下划线,且长度为 2 ~ 32', + }) : intl.formatMessage({ - id: 'OBD.component.DeployConfig.ItStartsWithALetter', - defaultMessage: - '以英文字母开头、英文或数字结尾,可包含英文、数字和下划线,且长度为 2 ~ 32', - }), + id: 'OBD.component.DeployConfig.ItStartsWithALetter', + defaultMessage: + '以英文字母开头、英文或数字结尾,可包含英文、数字和下划线,且长度为 2 ~ 32', + }), }; const { components = {} } = ocpConfigData || {}; const { oceanbase = {} } = components || {}; @@ -180,6 +182,7 @@ export default function DeployConfig({ }); } }; + const getColumns = () => { const columns: ColumnsType = [ { @@ -193,12 +196,31 @@ export default function DeployConfig({ return ( <> {name} - {!record.versionInfo.length && ( + { + ( + !record?.versionInfo?.find(item => item.version === '4.2.1.8') + || !record.versionInfo.length + ) && + name === 'OceanBase' && isNewDB && + } + {!record.versionInfo.length && name !== 'OceanBase' && ( + )} @@ -218,10 +240,10 @@ export default function DeployConfig({ record.key === OCEANBASE ? obVersionInfo : record.key === OBPROXY - ? obproxyVersionInfo - : ocpVersionInfo; + ? obproxyVersionInfo + : ocpVersionInfo; - if (selectVersion) { + if (selectVersion && !isEmpty(selectVersion.version)) { selectVersion.valueInfo = { value: selectVersion?.value, label: ( @@ -258,9 +280,12 @@ export default function DeployConfig({ } else { selectVersion = {}; } + return ( // 版本联动 ocp是社区版,ob也得是社区版,obproxy不支持选择并且版本号与ob前两位一致 - + {record.key === OBPROXY ? ( // 用div包裹可以使Tooltip生效
@@ -281,49 +306,58 @@ export default function DeployConfig({ popupClassName={styles?.popupClassName} > {_.map((item: any) => { + const metaDBLimit = isNewDB && record.key === OCEANBASE && item.version !== '4.2.1.8' + const OptionValue = `${item.version}-${item?.release}-${item.md5}` return ( - - V {item.version} - {item?.release ? `-${item?.release}` : ''} - - {item.versionType === 'ce' ? ( - - {intl.formatMessage({ - id: 'OBD.component.DeployConfig.CommunityEdition', - defaultMessage: '社区版', - })} - - ) : ( - - {intl.formatMessage({ - id: 'OBD.component.DeployConfig.CommercialEdition', - defaultMessage: '商业版', - })} - - )} - {item?.type === 'local' ? ( - - - {intl.formatMessage({ - id: 'OBD.pages.components.InstallConfig.LocalImage', - defaultMessage: '本地镜像', - })} + + + V {item.version} + {item?.release ? `-${item?.release}` : ''} - ) : ( - '' - )} + {item.versionType === 'ce' ? ( + + {intl.formatMessage({ + id: 'OBD.component.DeployConfig.CommunityEdition', + defaultMessage: '社区版', + })} + + ) : ( + + {intl.formatMessage({ + id: 'OBD.component.DeployConfig.CommercialEdition', + defaultMessage: '商业版', + })} + + )} + {item?.type === 'local' ? ( + + + {intl.formatMessage({ + id: 'OBD.pages.components.InstallConfig.LocalImage', + defaultMessage: '本地镜像', + })} + + ) : ( + '' + )} + ); })} @@ -371,6 +405,7 @@ export default function DeployConfig({ if (['CONFIGURED', 'DESTROYED'].includes(data?.status)) { return Promise.resolve(); } + setNextLoading(false); return Promise.reject( new Error( intl.formatMessage( @@ -411,7 +446,7 @@ export default function DeployConfig({ }; const caculateSize = (originSize: number): number => { - return Number(NP.divide(NP.divide(originSize, 1024), 1024).toFixed(2)); + return Number(NP.divide(NP.divide(originSize, 1024), 1024).toFixed(2)) || 0; }; const getVersion = (name: string, info?: any[]) => { if (!info) return []; @@ -449,6 +484,9 @@ export default function DeployConfig({ return data.info[0]; } } + if (data.name === 'oceanbase') { + return data.info?.find((item) => item.version === '4.2.1.8'); + } return data.info[0]; }; @@ -464,14 +502,14 @@ export default function DeployConfig({ const setInitVersion = (data: any) => { let versionInfo = getRecommendInfo(data); let detail = { - version: versionInfo.version, - release: versionInfo.release, - md5: versionInfo.md5, - versionType: versionInfo.version_type || 'business', - value: `${versionInfo.version}-${versionInfo.release}`, + version: versionInfo?.version, + release: versionInfo?.release, + md5: versionInfo?.md5, + versionType: versionInfo?.version_type || 'business', + value: `${versionInfo?.version}-${versionInfo?.release}`, }; if (data.name === OCEANBASE) { - setObVersionInfo(detail); + setObVersionInfo(!versionInfo?.version ? {} : detail) } if (data.name === OCP) { setOcpVersionInfo(detail); @@ -618,7 +656,7 @@ export default function DeployConfig({ }); } } - } catch (err) {} + } catch (err) { } } setOcpConfigData({ ...newOcpConfigData }); @@ -641,7 +679,7 @@ export default function DeployConfig({ key: component?.key!, }; setInitVersion(item); - memory += getRecommendInfo(item).estimated_size; + memory += getRecommendInfo(item)?.estimated_size; dataSource.push(temp); return memory; }; @@ -663,6 +701,8 @@ export default function DeployConfig({ } }; + const OceanBaseNoVersion = !tableData?.find(item => item.key === "oceanbase")?.versionInfo?.find(item1 => item1.version === '4.2.1.8') + const { run: fetchListRemoteMirrors } = useRequest(listRemoteMirrors, { onSuccess: () => { setComponentLoading(false); @@ -721,7 +761,6 @@ export default function DeployConfig({ const noVersion = dataSource.length !== wholeComponents.current.length; judgVersions(dataSource.length); - if (noVersion) { const { success: mirrorSuccess, data: mirrorData } = await fetchListRemoteMirrors(); @@ -753,6 +792,7 @@ export default function DeployConfig({ } else { setComponentLoading(false); } + completionComponent(dataSource); isNewDB && sortComponent(dataSource); setDeployMemory(memory); @@ -826,7 +866,16 @@ export default function DeployConfig({ }), validateTrigger: ['onBlur', 'onChange'], }; - + const metaDbAlert = return ( <> @@ -838,13 +887,13 @@ export default function DeployConfig({ title={ isNewDB ? intl.formatMessage({ - id: 'OBD.component.DeployConfig.BasicConfiguration', - defaultMessage: '基础配置', - }) + id: 'OBD.component.DeployConfig.BasicConfiguration', + defaultMessage: '基础配置', + }) : intl.formatMessage({ - id: 'OBD.component.DeployConfig.DeploymentConfiguration', - defaultMessage: '部署配置', - }) + id: 'OBD.component.DeployConfig.DeploymentConfiguration', + defaultMessage: '部署配置', + }) } className="card-padding-bottom-24" > @@ -889,12 +938,12 @@ export default function DeployConfig({ {intl.formatMessage( - { - id: 'OBD.pages.components.InstallConfig.EstimatedInstallationRequiresSizeMb', - defaultMessage: '预计安装需要 {size}MB 空间', - }, - { size: caculateSize(deployMemory) }, - )} + { + id: 'OBD.pages.components.InstallConfig.EstimatedInstallationRequiresSizeMb', + defaultMessage: '预计安装需要 {size}MB 空间', + }, + { size: caculateSize(deployMemory) }, + )} } @@ -907,30 +956,32 @@ export default function DeployConfig({ > {existNoVersion ? ( unavailableList?.length ? ( - - {intl.formatMessage({ - id: 'OBD.component.DeployConfig.IfTheCurrentEnvironmentCannot', - defaultMessage: - '如当前环境无法正常访问外网,建议使用 OceanBase\n 离线安装包进行安装部署。', - })} - - + <> + {intl.formatMessage({ - id: 'OBD.component.DeployConfig.GoToDownloadOfflineInstallation', - defaultMessage: '前往下载离线安装', + id: 'OBD.component.DeployConfig.IfTheCurrentEnvironmentCannot', + defaultMessage: + '如当前环境无法正常访问外网,建议使用 OceanBase\n 离线安装包进行安装部署。', })} - - - } - type="error" - showIcon - style={{ marginTop: '16px' }} - /> + + {intl.formatMessage({ + id: 'OBD.component.DeployConfig.GoToDownloadOfflineInstallation', + defaultMessage: '前往下载离线安装', + })} + + + } + type="error" + showIcon + style={{ marginTop: '16px' }} + /> + {isNewDB && metaDbAlert} + ) : ( ) - ) : null} + ) : + OceanBaseNoVersion && isNewDB && + metaDbAlert + } diff --git a/web/src/component/InstallProcess/index.tsx b/web/src/component/InstallProcess/index.tsx index 3c2caec..48a9978 100644 --- a/web/src/component/InstallProcess/index.tsx +++ b/web/src/component/InstallProcess/index.tsx @@ -12,7 +12,7 @@ import NP from 'number-precision'; import 'video.js/dist/video-js.css'; import { getLocale } from 'umi'; import styles from './index.less'; -import InsstallResult from '@/component/InsstallResult'; +import InstallResultDisplay from '@/component/InstallResultDisplay'; export interface InstallProcessProps { id?: number; @@ -81,7 +81,7 @@ const InstallProcess: React.FC = ({ installType === 'OCP' ? OCP.getOcpReinstallTaskLog : Metadb.getMetadbReinstallTaskLog; - + const getTaskFn = isReinstall ? getReinstallTaskFn : OCP.getOcpUpgradeTask; const getTaskLogFn = isReinstall ? getreInstallTaskLogFn @@ -90,7 +90,7 @@ const InstallProcess: React.FC = ({ const { run: getInstallTask, data: installResultData } = useRequest( getTaskFn, { - manual:true, + manual: true, onSuccess: ({ success, data }) => { if (success) { setOpenLog(data?.result === 'FAILED' || data?.result === 'RUNNING'); @@ -150,7 +150,7 @@ const InstallProcess: React.FC = ({ const { run: getInstallTaskLog, data: installLogData } = useRequest( getTaskLogFn, { - manual:true, + manual: true, onSuccess: ({ success }: API.OBResponseInstallLog_) => { if (success && installStatus === 'RUNNING') { setTimeout(() => { @@ -229,7 +229,7 @@ const InstallProcess: React.FC = ({ path: '/assets/database/data.json', }); }; - + useEffect(() => { if (installInfo.id) { if (type === 'update') { @@ -310,7 +310,7 @@ const InstallProcess: React.FC = ({ bodyStyle={{ padding: (installType === 'OCP' && installStatus === 'RUNNING') || - installStatus === 'RUNNING' + installStatus === 'RUNNING' ? 24 : 0, }} @@ -329,13 +329,13 @@ const InstallProcess: React.FC = ({ {installType}{' '} {type === 'update' ? intl.formatMessage({ - id: 'OBD.component.InstallProcess.Upgraded', - defaultMessage: '升级中', - }) + id: 'OBD.component.InstallProcess.Upgraded', + defaultMessage: '升级中', + }) : intl.formatMessage({ - id: 'OBD.component.InstallProcess.Deploying', - defaultMessage: '部署中', - })} + id: 'OBD.component.InstallProcess.Deploying', + defaultMessage: '部署中', + })}
= ({
) : ( - = ({ {type === 'update' ? intl.formatMessage({ - id: 'OBD.component.InstallProcess.UpgradeLogs', - defaultMessage: '升级日志', - }) + id: 'OBD.component.InstallProcess.UpgradeLogs', + defaultMessage: '升级日志', + }) : intl.formatMessage({ - id: 'OBD.component.InstallProcess.DeploymentLogs', - defaultMessage: '部署日志', - })} + id: 'OBD.component.InstallProcess.DeploymentLogs', + defaultMessage: '部署日志', + })} >; } -const InstallResult: React.FC = ({ +const InstallResult: React.FC = ({ ocpInfo = {}, upgradeOcpInfo, installStatus, @@ -568,13 +568,13 @@ const InstallResult: React.FC = ({ {type === 'update' ? intl.formatMessage({ - id: 'OBD.component.InstallResult.UpgradeLogs', - defaultMessage: '升级日志', - }) + id: 'OBD.component.InstallResult.UpgradeLogs', + defaultMessage: '升级日志', + }) : intl.formatMessage({ - id: 'OBD.component.InstallResult.DeploymentLogs', - defaultMessage: '部署日志', - })} + id: 'OBD.component.InstallResult.DeploymentLogs', + defaultMessage: '部署日志', + })} (defaultSiteUrl); const setPassword = (password: string) => { form.setFieldValue(['ocpserver', 'admin_password'], password); @@ -86,18 +86,14 @@ export default function ServiceConfig({ form.setFieldValue(['ocpserver', 'ocp_site_url'], value); }; + useEffect(() => { - if (typeof isSingleOcpNode !== 'undefined' && !ocpserver.ocp_site_url) { - if (isSingleOcpNode && ip.length) { - let url = `http://${ip[0]}:8080`; - setSiteUrl(url); - form.setFieldValue(['ocpserver', 'ocp_site_url'], url); - } else { - setSiteUrl(''); - form.setFieldValue(['ocpserver', 'ocp_site_url'], ''); - } + if (ip.length) { + let url = `http://${ip[0]}:8080`; + setSiteUrl(url); + form.setFieldValue(['ocpserver', 'ocp_site_url'], url); } - }, [isSingleOcpNode]); + }, []); useUpdateEffect(() => { form.setFieldsValue({ @@ -143,19 +139,19 @@ export default function ServiceConfig({ title={ isLowVersion ? intl.formatMessage( - { - id: 'OBD.component.OCPConfigNew.ServiceConfig.ThePasswordMustBeMet', - defaultMessage: '密码需满足:{{OCPPASSWORDERROR}}', - }, - { OCPPASSWORDERROR: OCP_PASSWORD_ERROR_REASON_OLD }, - ) + { + id: 'OBD.component.OCPConfigNew.ServiceConfig.ThePasswordMustBeMet', + defaultMessage: '密码需满足:{{OCPPASSWORDERROR}}', + }, + { OCPPASSWORDERROR: OCP_PASSWORD_ERROR_REASON_OLD }, + ) : intl.formatMessage( - { - id: 'OBD.component.OCPConfigNew.ServiceConfig.ThePasswordMustBeMet', - defaultMessage: '密码需满足:{{OCPPASSWORDERROR}}', - }, - { OCPPASSWORDERROR: OCP_PASSWORD_ERROR_REASON }, - ) + { + id: 'OBD.component.OCPConfigNew.ServiceConfig.ThePasswordMustBeMet', + defaultMessage: '密码需满足:{{OCPPASSWORDERROR}}', + }, + { OCPPASSWORDERROR: OCP_PASSWORD_ERROR_REASON }, + ) } > diff --git a/web/src/component/PreCheck/preCheck.tsx b/web/src/component/PreCheck/preCheck.tsx index 961e958..f06d209 100644 --- a/web/src/component/PreCheck/preCheck.tsx +++ b/web/src/component/PreCheck/preCheck.tsx @@ -82,6 +82,7 @@ export default function PreCehckComponent({ hasManual, setOnlyManual, handleAutoRepair, + handelCheck, hasAuto, recoverLoading, showFailedList, @@ -135,7 +136,7 @@ export default function PreCehckComponent({ timelineContainer.onmousewheel = handleScrollTimeline; // ie , chrome timelineContainer?.addEventListener('DOMMouseScroll', handleScrollTimeline); // firefox return () => { - timelineContainer.onmousewheel = () => {}; + timelineContainer.onmousewheel = () => { }; timelineContainer?.removeEventListener( 'DOMMouseScroll', handleScrollTimeline, @@ -166,7 +167,7 @@ export default function PreCehckComponent({ return () => { const failedContainer = document.getElementById('failed-container'); if (failedContainer) { - failedContainer.onmousewheel = () => {}; + failedContainer.onmousewheel = () => { }; failedContainer?.removeEventListener( 'DOMMouseScroll', handleScrollFailed, @@ -212,17 +213,17 @@ export default function PreCehckComponent({ checkStatus ? checkFinished ? intl.formatMessage({ - id: 'OBD.component.PreCheck.preCheck.CheckCompleted', - defaultMessage: '检查完成', - }) + id: 'OBD.component.PreCheck.preCheck.CheckCompleted', + defaultMessage: '检查完成', + }) : intl.formatMessage({ - id: 'OBD.component.PreCheck.preCheck.Checking', - defaultMessage: '检查中', - }) - : intl.formatMessage({ - id: 'OBD.component.PreCheck.preCheck.CheckFailed', - defaultMessage: '检查失败', + id: 'OBD.component.PreCheck.preCheck.Checking', + defaultMessage: '检查中', }) + : intl.formatMessage({ + id: 'OBD.component.PreCheck.preCheck.CheckFailed', + defaultMessage: '检查失败', + }) } gutter={16} className="card-padding-bottom-24" @@ -274,9 +275,9 @@ export default function PreCehckComponent({ percent={ statusData?.finished ? NP.times( - NP.divide(statusData?.finished, statusData?.total!), - 100, - ) + NP.divide(statusData?.finished, statusData?.total!), + 100, + ) : 0 } status={checkStatus ? progressStatus : 'exception'} @@ -294,9 +295,8 @@ export default function PreCehckComponent({ return ( { + // handelCheck() + // handleAutoRepair() + // }} loading={recoverLoading} data-aspm-click="c307513.d317292" data-aspm-desc={intl.formatMessage({ diff --git a/web/src/i18n/strings/en-US.json b/web/src/i18n/strings/en-US.json index 9d368ef..3c766b7 100644 --- a/web/src/i18n/strings/en-US.json +++ b/web/src/i18n/strings/en-US.json @@ -1067,5 +1067,8 @@ "OBD.Obdeploy.ClusterConfig.PortObproxySql": "Port OBProxy SQL", "OBD.Obdeploy.ClusterConfig.PortObproxyRpc": "Port OBProxy RPC", "OBD.pages.ComponentUninstall.UninstallConfig.ByDefaultComponentsWithDependencies": "By default, components with dependencies are uninstalled.", - "OBD.pages.Obdeploy.InstallFinished.ConnectionString": "Connection string" + "OBD.pages.Obdeploy.InstallFinished.ConnectionString": "Connection string", + "OBD.component.DeployConfig.UnableToObtainTheAvailable": "Unable to obtain the available installation package", + "OBD.component.DeployConfig.ByDefaultTheDatabaseVersion": "By default, the database version of MetaDB is 4.2.1.8. You cannot modify the database version.", + "OBD.component.InsstallResult.TheSystemWillUpgradeOcp": "The system will upgrade OCP Agent by default. Please go to OCP Task Center to view the upgrade progress." } diff --git a/web/src/i18n/strings/zh-CN.json b/web/src/i18n/strings/zh-CN.json index e990bc3..5238eb1 100644 --- a/web/src/i18n/strings/zh-CN.json +++ b/web/src/i18n/strings/zh-CN.json @@ -1067,5 +1067,8 @@ "OBD.Obdeploy.ClusterConfig.PortObproxySql": "OBProxy SQL 端口", "OBD.Obdeploy.ClusterConfig.PortObproxyRpc": "OBProxy RPC 端口", "OBD.pages.ComponentUninstall.UninstallConfig.ByDefaultComponentsWithDependencies": "系统会默认卸载存在相互依赖关系的组件", - "OBD.pages.Obdeploy.InstallFinished.ConnectionString": "连接字符串" + "OBD.pages.Obdeploy.InstallFinished.ConnectionString": "连接字符串", + "OBD.component.DeployConfig.UnableToObtainTheAvailable": "无法获取可用安装包", + "OBD.component.DeployConfig.ByDefaultTheDatabaseVersion": "系统默认 MetaDB 的数据库版本为 4.2.1.8,暂不支持修改版本。", + "OBD.component.InsstallResult.TheSystemWillUpgradeOcp": "系统将默认升级 OCP Agent,请前往 OCP 任务中心查看升级进度" } diff --git a/web/src/pages/Obdeploy/CheckInfo.tsx b/web/src/pages/Obdeploy/CheckInfo.tsx index 75d9850..15cbfd5 100644 --- a/web/src/pages/Obdeploy/CheckInfo.tsx +++ b/web/src/pages/Obdeploy/CheckInfo.tsx @@ -55,15 +55,15 @@ export const formatConfigData = ( if (formatedConfigData.components) isOBConfig = true; Object.keys(_configData).forEach((key) => { if (typeof _configData[key] === 'object') { - for (let i = 0; i < _configData[key].parameters.length; i++) { - const parameter = _configData[key].parameters[i]; + for (let i = 0; i < _configData[key]?.parameters.length; i++) { + const parameter = _configData[key]?.parameters[i]; // 筛选原则:修改过下拉框或者输入框的参数传给后端;自动分配、值为空的参数均不传给后端 if ( (!parameter.adaptive && !isExist(parameter.value)) || parameter.adaptive || !parameter.isChanged ) { - _configData[key].parameters?.splice(i--, 1); + _configData[key]?.parameters?.splice(i--, 1); } if (parameter.key === 'ocp_meta_tenant_memory_size') { parameter.value = changeParameterUnit(parameter).value; @@ -301,11 +301,11 @@ export default function CheckInfo() { more: oceanbase?.parameters?.length ? [ - { - label: componentsConfig[oceanbaseComponent].labelName, - parameters: oceanbase?.parameters, - }, - ] + { + label: componentsConfig[oceanbaseComponent].labelName, + parameters: oceanbase?.parameters, + }, + ] : [], }, ]; diff --git a/web/src/pages/Obdeploy/InstallConfig.tsx b/web/src/pages/Obdeploy/InstallConfig.tsx index 102aec1..8899f48 100644 --- a/web/src/pages/Obdeploy/InstallConfig.tsx +++ b/web/src/pages/Obdeploy/InstallConfig.tsx @@ -240,7 +240,7 @@ export default function InstallConfig() { } } }); - + const noVersion = Object.keys(newComponentsVersionInfo).length !== allComponentsName.length; @@ -666,6 +666,23 @@ export default function InstallConfig() { } }; + useEffect(() => { + // 默认勾选项,只取 obproxy + // https://project.alipay.com/project/W24001004950/P24001006922/requirement?openWorkItemId=2024100800104636325&status=status&workItemView=72fcab42129ae1bd489e077d + setSelectedConfig(['obproxy']) + }, []) + + const rowSelection = { + hideSelectAll: true, + onSelect: handleSelect, + // 默认勾选项,需排除掉缺少必要安装包 + selectedRowKeys: selectedConfig?.filter((item: string) => { + return componentsVersionInfo[item]?.version + }), + getCheckboxProps: (record) => ({ + disabled: !componentsVersionInfo[record.key]?.version, + }), + }; const caculateSize = (originSize: number): string => { return NP.divide(NP.divide(originSize, 1024), 1024).toFixed(2); }; @@ -1119,11 +1136,7 @@ export default function InstallConfig() { key={componentInfo.group} > { @@ -491,9 +492,9 @@ const Update: React.FC = () => { disabled={precheckOcpUpgradeLoading || preCheckLoading} loading={precheckOcpUpgradeLoading || preCheckLoading} onClick={() => { - if(needDestroy){ + if (needDestroy) { handleDestroyDeployment({ name: cluster_name }); - }else{ + } else { refresh(); setInstallStatus('RUNNING'); }