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.
|
||||
|
||||
import { ConfirmAction } from 'containers/Action';
|
||||
import _ from 'lodash';
|
||||
import globalVirtualAdapterStore from 'stores/neutron/virtual-adapter';
|
||||
|
||||
export default class DeleteAction extends ConfirmAction {
|
||||
@ -53,17 +52,16 @@ export default class DeleteAction extends ConfirmAction {
|
||||
return true;
|
||||
}
|
||||
|
||||
onSubmit = async (data) => {
|
||||
const { allowed_address_pairs = [], id } = globalVirtualAdapterStore.detail;
|
||||
_.remove(
|
||||
allowed_address_pairs,
|
||||
(item) => item.ip_address === data.ip_address
|
||||
onSubmit = async (data, containerProps) => {
|
||||
const { allowed_address_pairs = [], id } = containerProps.detail;
|
||||
const newData = allowed_address_pairs.filter(
|
||||
(i) => i.ip_address !== data.ip_address
|
||||
);
|
||||
return globalVirtualAdapterStore
|
||||
.update(
|
||||
{ id },
|
||||
{
|
||||
allowed_address_pairs,
|
||||
allowed_address_pairs: newData,
|
||||
}
|
||||
)
|
||||
.then((ret) => {
|
||||
|
@ -16,9 +16,7 @@ import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import Base from 'containers/List';
|
||||
import globalVirtualAdapterStore, {
|
||||
VirtualAdapterStore,
|
||||
} from 'stores/neutron/virtual-adapter';
|
||||
import { VirtualAdapterStore } from 'stores/neutron/virtual-adapter';
|
||||
import { portStatus } from 'resources/port';
|
||||
import { emptyActionConfig } from 'utils/constants';
|
||||
import actionConfigs from './actions';
|
||||
@ -27,9 +25,7 @@ import actionConfigs from './actions';
|
||||
@observer
|
||||
export default class VirtualAdapter extends Base {
|
||||
init() {
|
||||
this.store = this.inDetailPage
|
||||
? new VirtualAdapterStore()
|
||||
: globalVirtualAdapterStore;
|
||||
this.store = new VirtualAdapterStore();
|
||||
this.downloadStore = new VirtualAdapterStore();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user