Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ds033 bugfixs in cluster #700

Merged
merged 15 commits into from
Jan 7, 2025
52 changes: 38 additions & 14 deletions ui/src/pages/Cluster/Detail/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ const ClusterOverview: React.FC = () => {
defaultMessage: '解除托管已成功',
}),
);
setFieldsValue({
name: undefined,
controlParameter: undefined,
accordance: undefined,
});
refresh();
clusterDetailRefresh();
}
Expand Down Expand Up @@ -466,18 +471,16 @@ const ClusterOverview: React.FC = () => {
dataIndex: 'accordance',
width: 100,
render: (text: boolean) => {
const tagColor = text ? 'green' : 'gold';
const tagContent = text
? intl.formatMessage({
return text ? (
<Tag color={'green'}>
{intl.formatMessage({
id: 'src.pages.Cluster.Detail.Overview.9A3A4407',
defaultMessage: '已匹配',
})
: intl.formatMessage({
id: 'src.pages.Cluster.Detail.Overview.D6588C55',
defaultMessage: '不匹配',
});

return <Tag color={tagColor}>{tagContent}</Tag>;
})}
</Tag>
) : (
'/'
);
},
},
{
Expand All @@ -488,6 +491,14 @@ const ClusterOverview: React.FC = () => {
dataIndex: 'controlParameter',
align: 'center',
render: (text, record) => {
const disableUnescrow = [
'memory_limit',
'datafile_maxsize',
'datafile_next',
'enable_syslog_recycle',
'max_syslog_file_count',
];

return (
<Space size={1}>
<Button
Expand All @@ -505,6 +516,7 @@ const ClusterOverview: React.FC = () => {
{text && (
<Button
type="link"
disabled={disableUnescrow.includes(record.name)}
TianWuwt marked this conversation as resolved.
Show resolved Hide resolved
loading={patchOBClusterloading}
onClick={() => {
patchOBCluster(ns, name, {
Expand Down Expand Up @@ -673,7 +685,7 @@ const ClusterOverview: React.FC = () => {
if (name !== undefined) {
setParametersData(
newParametersData?.filter((item) =>
item.name?.includes(name),
item.name?.includes(name.trim()),
),
);
}
Expand All @@ -699,7 +711,7 @@ const ClusterOverview: React.FC = () => {
setParametersData(
newParametersData?.filter(
(item) =>
item.name?.includes(name) &&
item.name?.includes(name.trim()) &&
item.controlParameter === controlParameter,
),
);
Expand All @@ -708,7 +720,7 @@ const ClusterOverview: React.FC = () => {
setParametersData(
newParametersData?.filter(
(item) =>
item.name?.includes(name) &&
item.name?.includes(name.trim()) &&
item.accordance === accordance,
),
);
Expand All @@ -721,7 +733,19 @@ const ClusterOverview: React.FC = () => {
setParametersData(
newParametersData?.filter(
(item) =>
item.name?.includes(name) &&
item.name?.includes(name.trim()) &&
item.controlParameter === controlParameter &&
item.accordance === accordance,
),
);
}
if (
controlParameter !== undefined &&
accordance !== undefined
) {
setParametersData(
newParametersData?.filter(
(item) =>
item.controlParameter === controlParameter &&
item.accordance === accordance,
),
Expand Down
9 changes: 8 additions & 1 deletion ui/src/pages/Cluster/New/Topo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ export default function Topo({ form }) {
</Form.Item>
</Col>
<Col span={topologyConfiguration === 'nodeSelector' ? 8 : 6}>
<Form.Item label={'Value'} name={[name, 'values']}>
<Form.Item
label={'Value'}
name={
topologyConfiguration === 'Toleration'
? [name, 'value']
: [name, 'values']
}
>
{topologyConfiguration === 'nodeSelector' ? (
<Select
showSearch
Expand Down
6 changes: 4 additions & 2 deletions ui/src/pages/Cluster/New/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ export default function New() {
const topologyValue = strTrim(values)?.topology?.map((item) => ({
...item,
nodeSelector: undefined,
affinities: item?.affinities?.concat(item?.nodeSelector),
affinities:
item?.affinities?.concat(item?.nodeSelector) ||
item?.nodeSelector ||
item?.affinities,
}));

values.topology = topologyValue;

const res = await createClusterReportWrap({ ...strTrim(values) });
if (res.successful) {
message.success(res.message, 3);
Expand Down
7 changes: 5 additions & 2 deletions ui/src/pages/Tenant/Detail/Overview/BasicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { intl } from '@/utils/intl';
import { findByValue } from '@oceanbase/util';
import { useRequest } from 'ahooks';
import { Card, Checkbox, Descriptions, Tag, message } from 'antd';
import { isEmpty } from 'lodash';

export default function BasicInfo({
info = {},
Expand Down Expand Up @@ -112,13 +113,15 @@ export default function BasicInfo({
>
<Descriptions column={5}>
{Object.keys(InfoConfig).map((key, index) => {
const statusItem = findByValue(STATUS_LIST, info[key]);
const statusItem = findByValue(STATUS_LIST, info.status);
return (
<Descriptions.Item key={index} label={InfoConfig[key]}>
{key !== 'status' ? (
info[key]
) : (
) : !isEmpty(statusItem) ? (
<Tag color={statusItem.badgeStatus}>{statusItem.label}</Tag>
) : (
'-'
)}
</Descriptions.Item>
);
Expand Down
Loading