add 'groupName' parameter

This commit is contained in:
langghaha 2020-04-22 01:10:05 +08:00
parent 900fa661ee
commit 1bef71058f
4 changed files with 29 additions and 18 deletions

View File

@ -25,6 +25,7 @@ class EditInstanceDialog extends React.Component {
static propTypes = { static propTypes = {
serviceName: PropTypes.string, serviceName: PropTypes.string,
clusterName: PropTypes.string, clusterName: PropTypes.string,
groupName: PropTypes.string,
openLoading: PropTypes.string, openLoading: PropTypes.string,
closeLoading: PropTypes.string, closeLoading: PropTypes.string,
getInstanceList: PropTypes.func, getInstanceList: PropTypes.func,
@ -54,7 +55,14 @@ class EditInstanceDialog extends React.Component {
} }
onConfirm() { onConfirm() {
const { serviceName, clusterName, getInstanceList, openLoading, closeLoading } = this.props; const {
serviceName,
clusterName,
groupName,
getInstanceList,
openLoading,
closeLoading,
} = this.props;
const { ip, port, ephemeral, weight, enabled, metadataText } = this.state.editInstance; const { ip, port, ephemeral, weight, enabled, metadataText } = this.state.editInstance;
request({ request({
method: 'PUT', method: 'PUT',
@ -62,6 +70,7 @@ class EditInstanceDialog extends React.Component {
data: { data: {
serviceName, serviceName,
clusterName, clusterName,
groupName,
ip, ip,
port, port,
ephemeral, ephemeral,

View File

@ -78,13 +78,14 @@ class InstanceTable extends React.Component {
switchState(index, record) { switchState(index, record) {
const { instance } = this.state; const { instance } = this.state;
const { ip, port, ephemeral, weight, enabled, metadata } = record; const { ip, port, ephemeral, weight, enabled, metadata } = record;
const { clusterName, serviceName } = this.props; const { clusterName, serviceName, groupName } = this.props;
request({ request({
method: 'PUT', method: 'PUT',
url: 'v1/ns/instance', url: 'v1/ns/instance',
data: { data: {
serviceName, serviceName,
clusterName, clusterName,
groupName,
ip, ip,
port, port,
ephemeral, ephemeral,
@ -112,7 +113,7 @@ class InstanceTable extends React.Component {
render() { render() {
const { locale = {} } = this.props; const { locale = {} } = this.props;
const { clusterName, serviceName } = this.props; const { clusterName, serviceName, groupName } = this.props;
const { instance, pageSize, loading } = this.state; const { instance, pageSize, loading } = this.state;
return instance.count ? ( return instance.count ? (
<div> <div>
@ -178,6 +179,7 @@ class InstanceTable extends React.Component {
ref={this.editInstanceDialog} ref={this.editInstanceDialog}
serviceName={serviceName} serviceName={serviceName}
clusterName={clusterName} clusterName={clusterName}
groupName={groupName}
openLoading={() => this.openLoading()} openLoading={() => this.openLoading()}
closeLoading={() => this.closeLoading()} closeLoading={() => this.closeLoading()}
getInstanceList={() => this.getInstanceList()} getInstanceList={() => this.getInstanceList()}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long