in console-ui/src/pages/ServiceManagement/SubscriberList/SubscriberList.js [63:134]
serviceName: getParams('name') || '',
groupName: getParams('groupName') || '',
},
nowNamespaceId: getParams('namespace') || 'public',
};
this.field = new Field(this);
}
componentDidMount() {
const { search } = this.state;
if (search.serviceName) {
this.querySubscriberList();
}
}
openLoading() {
this.setState({ loading: true });
}
closeLoading() {
this.setState({ loading: false });
}
querySubscriberList() {
const { searchServiceNamePrompt } = this.props.locale;
const { search, pageSize, pageNo, nowNamespaceId = '' } = this.state;
if (!search.serviceName) {
Message.error(searchServiceNamePrompt);
return;
}
this.props.getSubscribers({
...search,
pageSize,
pageNo,
namespaceId: nowNamespaceId,
});
}
switchNamespace = () => {
this.props.removeSubscribers();
};
setNowNameSpace = (nowNamespaceName, nowNamespaceId, nowNamespaceDesc) =>
this.setState({
nowNamespaceName,
nowNamespaceId,
nowNamespaceDesc,
});
render() {
const { locale = {}, subscriberData = {} } = this.props;
const { count = 0, subscribers = [] } = subscriberData;
const subscribersArray = Array.isArray(subscribers) ? subscribers : [];
const {
pubNoData,
subscriberList,
serviceName,
serviceNamePlaceholder,
groupName,
groupNamePlaceholder,
query,
} = locale;
const { search, nowNamespaceName, nowNamespaceId, nowNamespaceDesc } = this.state;
const { init, getValue } = this.field;
this.init = init;
this.getValue = getValue;
return (
<div className="main-container subscriber-list">
<Loading
shape="flower"
style={{