fix: Fix for port manage security groups & delete
1. fix for port manage security groups 2. fix port delete allowed address pair Change-Id: Ifbff7d6de779227b53880dd70dc811693be9b0ab
This commit is contained in:
parent
e63243dbb4
commit
74e1006ced
@ -13,7 +13,6 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { ConfirmAction } from 'containers/Action';
|
import { ConfirmAction } from 'containers/Action';
|
||||||
import _ from 'lodash';
|
|
||||||
import globalVirtualAdapterStore from 'stores/neutron/virtual-adapter';
|
import globalVirtualAdapterStore from 'stores/neutron/virtual-adapter';
|
||||||
|
|
||||||
export default class DeleteAction extends ConfirmAction {
|
export default class DeleteAction extends ConfirmAction {
|
||||||
@ -53,17 +52,16 @@ export default class DeleteAction extends ConfirmAction {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit = async (data) => {
|
onSubmit = async (data, containerProps) => {
|
||||||
const { allowed_address_pairs = [], id } = globalVirtualAdapterStore.detail;
|
const { allowed_address_pairs = [], id } = containerProps.detail;
|
||||||
_.remove(
|
const newData = allowed_address_pairs.filter(
|
||||||
allowed_address_pairs,
|
(i) => i.ip_address !== data.ip_address
|
||||||
(item) => item.ip_address === data.ip_address
|
|
||||||
);
|
);
|
||||||
return globalVirtualAdapterStore
|
return globalVirtualAdapterStore
|
||||||
.update(
|
.update(
|
||||||
{ id },
|
{ id },
|
||||||
{
|
{
|
||||||
allowed_address_pairs,
|
allowed_address_pairs: newData,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((ret) => {
|
.then((ret) => {
|
||||||
|
@ -16,9 +16,7 @@ import React from 'react';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { observer, inject } from 'mobx-react';
|
import { observer, inject } from 'mobx-react';
|
||||||
import Base from 'containers/List';
|
import Base from 'containers/List';
|
||||||
import globalVirtualAdapterStore, {
|
import { VirtualAdapterStore } from 'stores/neutron/virtual-adapter';
|
||||||
VirtualAdapterStore,
|
|
||||||
} from 'stores/neutron/virtual-adapter';
|
|
||||||
import { portStatus } from 'resources/port';
|
import { portStatus } from 'resources/port';
|
||||||
import { emptyActionConfig } from 'utils/constants';
|
import { emptyActionConfig } from 'utils/constants';
|
||||||
import actionConfigs from './actions';
|
import actionConfigs from './actions';
|
||||||
@ -27,9 +25,7 @@ import actionConfigs from './actions';
|
|||||||
@observer
|
@observer
|
||||||
export default class VirtualAdapter extends Base {
|
export default class VirtualAdapter extends Base {
|
||||||
init() {
|
init() {
|
||||||
this.store = this.inDetailPage
|
this.store = new VirtualAdapterStore();
|
||||||
? new VirtualAdapterStore()
|
|
||||||
: globalVirtualAdapterStore;
|
|
||||||
this.downloadStore = new VirtualAdapterStore();
|
this.downloadStore = new VirtualAdapterStore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user