mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-05 21:12:13 +08:00
V2.4.1 FE
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import { alarm } from 'store/alarm';
|
||||
import { IMonitorGroups } from 'types/base-type';
|
||||
import { getValueFromLocalStorage, setValueToLocalStorage } from 'lib/local-storage';
|
||||
import { getValueFromLocalStorage, setValueToLocalStorage, deleteValueFromLocalStorage } from 'lib/local-storage';
|
||||
import { VirtualScrollSelect } from '../../../component/virtual-scroll-select';
|
||||
|
||||
interface IAlarmSelectProps {
|
||||
@@ -36,6 +36,10 @@ export class AlarmSelect extends React.Component<IAlarmSelectProps> {
|
||||
onChange && onChange(params);
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
deleteValueFromLocalStorage('monitorGroups');
|
||||
}
|
||||
|
||||
public render() {
|
||||
const { value, isDisabled } = this.props;
|
||||
return (
|
||||
|
||||
@@ -149,9 +149,9 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
|
||||
public handleSelectChange = (e: string, type: 'topic' | 'consumerGroup' | 'location') => {
|
||||
switch (type) {
|
||||
case 'topic':
|
||||
if (!this.clusterId) {
|
||||
return message.info('请选择集群');
|
||||
}
|
||||
// if (!this.clusterId) {
|
||||
// return message.info('请选择集群');
|
||||
// }
|
||||
this.topicName = e;
|
||||
const type = this.dealMonitorType();
|
||||
if (['kafka-consumer-maxLag', 'kafka-consumer-maxDelayTime', 'kafka-consumer-lag'].indexOf(type) > -1) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import { pagination } from 'constants/table';
|
||||
import { urlPrefix } from 'constants/left-menu';
|
||||
import { alarm } from 'store/alarm';
|
||||
import 'styles/table-filter.less';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
@observer
|
||||
export class AlarmList extends SearchAndFilterContainer {
|
||||
@@ -24,7 +25,7 @@ export class AlarmList extends SearchAndFilterContainer {
|
||||
if (app.active !== '-1' || searchKey !== '') {
|
||||
data = origin.filter(d =>
|
||||
((d.name !== undefined && d.name !== null) && d.name.toLowerCase().includes(searchKey as string)
|
||||
|| ((d.operator !== undefined && d.operator !== null) && d.operator.toLowerCase().includes(searchKey as string)))
|
||||
|| ((d.operator !== undefined && d.operator !== null) && d.operator.toLowerCase().includes(searchKey as string)))
|
||||
&& (app.active === '-1' || d.appId === (app.active + '')),
|
||||
);
|
||||
} else {
|
||||
@@ -55,9 +56,7 @@ export class AlarmList extends SearchAndFilterContainer {
|
||||
{this.renderSearch('名称:', '请输入告警规则或者操作人')}
|
||||
<li className="right-btn-1">
|
||||
<Button type="primary">
|
||||
<a href={`${urlPrefix}/alarm/add`}>
|
||||
新增规则
|
||||
</a>
|
||||
<Link to={`/alarm/add`}>新增规则</Link>
|
||||
</Button>
|
||||
</li>
|
||||
</>
|
||||
@@ -68,6 +67,9 @@ export class AlarmList extends SearchAndFilterContainer {
|
||||
if (!alarm.monitorStrategies.length) {
|
||||
alarm.getMonitorStrategies();
|
||||
}
|
||||
if (!app.data.length) {
|
||||
app.getAppList();
|
||||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
|
||||
Reference in New Issue
Block a user