Skip to content

Commit

Permalink
service list add view subscriber feat (alibaba#5185)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoyann committed Mar 25, 2021
1 parent cb289d3 commit 8cef69e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions console-ui/src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const I18N_CONF = {
prompt: 'Confirm',
promptDelete: 'Do you want to delete the service?',
create: 'Create Service',
subscriber: 'Subscriber',
},
SubscriberList: {
subscriberList: 'Subscriber List',
Expand Down
1 change: 1 addition & 0 deletions console-ui/src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const I18N_CONF = {
prompt: '提示',
promptDelete: '确定要删除当前服务吗?',
create: '创建服务',
subscriber: '订阅者',
},
SubscriberList: {
subscriberList: '订阅者列表',
Expand Down
11 changes: 11 additions & 0 deletions console-ui/src/pages/ServiceManagement/ServiceList/ServiceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ class ServiceList extends React.Component {
this.showcode.current.getInstance().openDialog(record);
}

querySubscriber(record) {
const { name, groupName } = record;
const namespace = this.state.nowNamespaceId;
this.props.history.push(generateUrl('/subscriberList', { namespace, name, groupName }));
}

handlePageSizeChange(pageSize) {
this.setState({ pageSize }, () => this.queryServiceList());
}
Expand Down Expand Up @@ -187,6 +193,7 @@ class ServiceList extends React.Component {
detail,
sampleCode,
deleteAction,
subscriber,
} = locale;
const { search, nowNamespaceName, nowNamespaceId, hasIpCount } = this.state;
const { init, getValue } = this.field;
Expand Down Expand Up @@ -304,6 +311,10 @@ class ServiceList extends React.Component {
{sampleCode}
</a>
<span style={{ marginRight: 5 }}>|</span>
<a style={{ marginRight: 5 }} onClick={() => this.querySubscriber(record)}>
{subscriber}
</a>
<span style={{ marginRight: 5 }}>|</span>
<a onClick={() => this.deleteService(record)} style={{ marginRight: 5 }}>
{deleteAction}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ import {
Loading,
Pagination,
Table,
Dialog,
Message,
ConfigProvider,
} from '@alifd/next';
import { connect } from 'react-redux';
import { getSubscribers, removeSubscribers } from '../../../reducers/subscribers';
import { request } from '../../../globalLib';
import { getParams } from '../../../globalLib';
import RegionGroup from '../../../components/RegionGroup';

import './SubscriberList.scss';
Expand Down Expand Up @@ -60,13 +59,21 @@ class SubscriberList extends React.Component {
pageSize: 10,
pageNo: 1,
search: {
serviceName: '',
groupName: '',
serviceName: getParams('name') || '',
groupName: getParams('groupName') || '',
},
nowNamespaceId: getParams('namespace') || '',
};
this.field = new Field(this);
}

componentDidMount() {
const { search } = this.state;
if (search.serviceName) {
this.querySubscriberList();
}
}

openLoading() {
this.setState({ loading: true });
}
Expand All @@ -91,7 +98,6 @@ class SubscriberList extends React.Component {
}

switchNamespace = () => {
this.setState({ search: { serviceName: '', groupName: '' } });
this.props.removeSubscribers();
};

Expand Down

0 comments on commit 8cef69e

Please sign in to comment.