mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-05 21:12:13 +08:00
fix: Topic 列表趋势图优化 & 相关文案调整
This commit is contained in:
@@ -1,19 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import {
|
import { Alert, Button, Checkbox, Divider, Drawer, Form, Input, InputNumber, Modal, notification, Select, Utils } from 'knowdesign';
|
||||||
Alert,
|
|
||||||
Button,
|
|
||||||
Checkbox,
|
|
||||||
Divider,
|
|
||||||
Drawer,
|
|
||||||
Form,
|
|
||||||
Input,
|
|
||||||
InputNumber,
|
|
||||||
Modal,
|
|
||||||
notification,
|
|
||||||
Select,
|
|
||||||
Utils,
|
|
||||||
} from 'knowdesign';
|
|
||||||
import { PlusOutlined, DownOutlined, UpOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DownOutlined, UpOutlined } from '@ant-design/icons';
|
||||||
import Api from '@src/api/index';
|
import Api from '@src/api/index';
|
||||||
|
|
||||||
@@ -120,9 +107,9 @@ export default (props: any) => {
|
|||||||
res =
|
res =
|
||||||
item.name === 'cleanup.policy'
|
item.name === 'cleanup.policy'
|
||||||
? item.defaultValue
|
? item.defaultValue
|
||||||
.replace(/\[|\]|\s+/g, '')
|
.replace(/\[|\]|\s+/g, '')
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter((_) => _)
|
.filter((_) => _)
|
||||||
: item.defaultValue;
|
: item.defaultValue;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res = [];
|
res = [];
|
||||||
@@ -317,7 +304,7 @@ export default (props: any) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div className="create-topic-flex-layout">
|
<div className="create-topic-flex-layout">
|
||||||
<Form.Item name={['properties', 'max.message.bytes']} label="max message size">
|
<Form.Item name={['properties', 'max.message.bytes']} label="Max message size">
|
||||||
<InputNumber
|
<InputNumber
|
||||||
min={0}
|
min={0}
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
@@ -329,7 +316,11 @@ export default (props: any) => {
|
|||||||
{defaultConfigs
|
{defaultConfigs
|
||||||
.filter((dc) => !customDefaultFields.includes(dc.name))
|
.filter((dc) => !customDefaultFields.includes(dc.name))
|
||||||
.map((configItem, i) => (
|
.map((configItem, i) => (
|
||||||
<Form.Item key={i} name={['properties', configItem.name]} label={configItem.name}>
|
<Form.Item
|
||||||
|
key={i}
|
||||||
|
name={['properties', configItem.name]}
|
||||||
|
label={configItem.name.slice(0, 1).toUpperCase() + configItem.name.slice(1)}
|
||||||
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
> span {
|
> span {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
color: #74788d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +37,7 @@
|
|||||||
width: 120px;
|
width: 120px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.batch-btn{
|
.batch-btn {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.add-btn {
|
.add-btn {
|
||||||
@@ -51,44 +52,44 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.metric-data-wrap {
|
.metric-data-wrap {
|
||||||
display: flex;
|
// display: flex;
|
||||||
align-items: center;
|
// align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.cur-val {
|
.cur-val {
|
||||||
width: 34px;
|
display: block;
|
||||||
margin-right: 11px;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.dcloud-spin-nested-loading{
|
.dcloud-spin-nested-loading {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.del-topic-modal,
|
.del-topic-modal,
|
||||||
.cluster-topic-add {
|
.cluster-topic-add {
|
||||||
.tip-info {
|
.tip-info {
|
||||||
height: 27px;
|
display: flex;
|
||||||
line-height: 27px;
|
|
||||||
color: #592d00;
|
color: #592d00;
|
||||||
padding: 0 14px;
|
padding: 6px 14px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
background: #fffae0;
|
background: #fffae0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
.anticon {
|
.anticon {
|
||||||
color: #ffc300;
|
color: #ffc300;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
.test-right-away {
|
.test-right-away {
|
||||||
color: #556ee6;
|
color: #556ee6;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.dcloud-alert-content{
|
.dcloud-alert-content {
|
||||||
flex: none;
|
flex: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cluster-topic-add {
|
.cluster-topic-add {
|
||||||
.data-save-time-label{
|
.data-save-time-label {
|
||||||
&>.dcloud-form-item-control{
|
& > .dcloud-form-item-control {
|
||||||
&>.dcloud-form-item-explain{
|
& > .dcloud-form-item-explain {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,11 +125,11 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #556EE6;
|
color: #556ee6;
|
||||||
.txt {
|
.txt {
|
||||||
width: 26px;
|
width: 26px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
color: #556EE6;
|
color: #556ee6;
|
||||||
font-family: @font-family;
|
font-family: @font-family;
|
||||||
}
|
}
|
||||||
.anticon {
|
.anticon {
|
||||||
@@ -226,12 +227,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.create-topic-flex-layout {
|
||||||
.create-topic-flex-layout{
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.dcloud-form-item{
|
.dcloud-form-item {
|
||||||
width: 370px;
|
width: 370px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,21 +91,9 @@ const AutoPage = (props: any) => {
|
|||||||
if (metricName === 'HealthScore') {
|
if (metricName === 'HealthScore') {
|
||||||
return Math.round(orgVal);
|
return Math.round(orgVal);
|
||||||
} else if (metricName === 'LogSize') {
|
} else if (metricName === 'LogSize') {
|
||||||
return Number(Utils.formatAssignSize(orgVal, 'MB')).toString().length > 3 ? (
|
return Number(Utils.formatAssignSize(orgVal, 'MB'));
|
||||||
<Tooltip title={Utils.formatAssignSize(orgVal, 'MB')}>
|
|
||||||
{Number(Utils.formatAssignSize(orgVal, 'MB')).toString().slice(0, 3) + '...'}
|
|
||||||
</Tooltip>
|
|
||||||
) : (
|
|
||||||
Number(Utils.formatAssignSize(orgVal, 'MB'))
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return Number(Utils.formatAssignSize(orgVal, 'KB')).toString().length > 3 ? (
|
return Number(Utils.formatAssignSize(orgVal, 'KB'));
|
||||||
<Tooltip title={Utils.formatAssignSize(orgVal, 'KB')}>
|
|
||||||
{Number(Utils.formatAssignSize(orgVal, 'KB')).toString().slice(0, 3) + '...'}
|
|
||||||
</Tooltip>
|
|
||||||
) : (
|
|
||||||
Number(Utils.formatAssignSize(orgVal, 'KB'))
|
|
||||||
);
|
|
||||||
// return Utils.formatAssignSize(orgVal, 'KB');
|
// return Utils.formatAssignSize(orgVal, 'KB');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,15 +104,15 @@ const AutoPage = (props: any) => {
|
|||||||
const points = record.metricLines.find((item: any) => item.metricName === metricName)?.metricPoints || [];
|
const points = record.metricLines.find((item: any) => item.metricName === metricName)?.metricPoints || [];
|
||||||
return (
|
return (
|
||||||
<div className="metric-data-wrap">
|
<div className="metric-data-wrap">
|
||||||
<span className="cur-val">{calcCurValue(record, metricName)}</span>
|
|
||||||
<SmallChart
|
<SmallChart
|
||||||
width={'100%'}
|
width={'100%'}
|
||||||
height={40}
|
height={30}
|
||||||
chartData={{
|
chartData={{
|
||||||
name: record.metricName,
|
name: record.metricName,
|
||||||
data: points.map((item: any) => ({ time: item.timeStamp, value: item.value })),
|
data: points.map((item: any) => ({ time: item.timeStamp, value: item.value })),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<span className="cur-val">{calcCurValue(record, metricName)}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -268,12 +256,16 @@ const AutoPage = (props: any) => {
|
|||||||
|
|
||||||
const menu = (
|
const menu = (
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item>
|
{global.hasPermission(ClustersPermissionMap.TOPIC_CHANGE_REPLICA) && (
|
||||||
<a onClick={() => setChangeVisible(true)}>扩缩副本</a>
|
<Menu.Item>
|
||||||
</Menu.Item>
|
<a onClick={() => setChangeVisible(true)}>扩缩副本</a>
|
||||||
<Menu.Item>
|
</Menu.Item>
|
||||||
<a onClick={() => setMoveVisible(true)}>迁移副本</a>
|
)}
|
||||||
</Menu.Item>
|
{global.hasPermission(ClustersPermissionMap.TOPIC_MOVE_REPLICA) && (
|
||||||
|
<Menu.Item>
|
||||||
|
<a onClick={() => setMoveVisible(true)}>迁移副本</a>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -345,11 +337,14 @@ const AutoPage = (props: any) => {
|
|||||||
setSearchKeywordsInput(e.target.value);
|
setSearchKeywordsInput(e.target.value);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Dropdown overlay={menu} trigger={['click']}>
|
{(global.hasPermission(ClustersPermissionMap.TOPIC_CHANGE_REPLICA) ||
|
||||||
<Button className="batch-btn" icon={<DownOutlined />} type="primary" ghost>
|
global.hasPermission(ClustersPermissionMap.TOPIC_MOVE_REPLICA)) && (
|
||||||
批量操作
|
<Dropdown overlay={menu} trigger={['click']}>
|
||||||
</Button>
|
<Button className="batch-btn" icon={<DownOutlined />} type="primary" ghost>
|
||||||
</Dropdown>
|
批量变更
|
||||||
|
</Button>
|
||||||
|
</Dropdown>
|
||||||
|
)}
|
||||||
{global.hasPermission && global.hasPermission(ClustersPermissionMap.TOPIC_ADD) ? (
|
{global.hasPermission && global.hasPermission(ClustersPermissionMap.TOPIC_ADD) ? (
|
||||||
<Create onConfirm={getTopicsList}></Create>
|
<Create onConfirm={getTopicsList}></Create>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user