feat: support disable/enable snat
1. support disable snat when the router's enable_snat is true 2. support enable snat when the router's enable_snat is false Change-Id: I15a0eee4760100d923bc9a7d3619f5caf35cbe27
This commit is contained in:
parent
e1a9d17f4c
commit
d02497a15d
@ -0,0 +1,8 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Support disable/enable SNAT for router:
|
||||
|
||||
* Support disable SNAT when the router's `enable_snat` is `true`.
|
||||
|
||||
* Support enable SNAT when the router's `enable_snat` is `false`.
|
@ -788,6 +788,7 @@
|
||||
"Disable Compute Service": "Disable Compute Service",
|
||||
"Disable Gateway": "Disable Gateway",
|
||||
"Disable Neutron Agent": "Disable Neutron Agent",
|
||||
"Disable SNAT": "Disable SNAT",
|
||||
"Disable TLS": "Disable TLS",
|
||||
"Disable compute host": "Disable compute host",
|
||||
"Disabled": "Disabled",
|
||||
@ -914,6 +915,7 @@
|
||||
"Enable Project": "Enable Project",
|
||||
"Enable QoS Policy": "Enable QoS Policy",
|
||||
"Enable Registry": "Enable Registry",
|
||||
"Enable SNAT": "Enable SNAT",
|
||||
"Enable Service": "Enable Service",
|
||||
"Enable User": "Enable User",
|
||||
"Enable auto heal": "Enable auto heal",
|
||||
|
@ -788,6 +788,7 @@
|
||||
"Disable Compute Service": "Compute Service 비활성화",
|
||||
"Disable Gateway": "Gateway 비활성화",
|
||||
"Disable Neutron Agent": "Neutron Agent 비활성화",
|
||||
"Disable SNAT": "SNAT 비활성화",
|
||||
"Disable TLS": "TLS 비활성화",
|
||||
"Disable compute host": "Compute Host 비활성화",
|
||||
"Disabled": "비활성화됨",
|
||||
@ -914,6 +915,7 @@
|
||||
"Enable Project": "Project 활성화",
|
||||
"Enable QoS Policy": "QoS Policy 활성화",
|
||||
"Enable Registry": "Registr 활성화",
|
||||
"Enable SNAT": "SNAT 활성화",
|
||||
"Enable Service": "Service 활성화",
|
||||
"Enable User": "User 활성화",
|
||||
"Enable auto heal": "Auto Heal 활성화",
|
||||
|
@ -788,6 +788,7 @@
|
||||
"Disable Compute Service": "Отключить службу вычислений",
|
||||
"Disable Gateway": "Отключить шлюз",
|
||||
"Disable Neutron Agent": "Отключить агента Neutron",
|
||||
"Disable SNAT": "Отключить SNAT",
|
||||
"Disable TLS": "Отключить TLS",
|
||||
"Disable compute host": "Отключить узел вычислений",
|
||||
"Disabled": "Отключено",
|
||||
@ -914,6 +915,7 @@
|
||||
"Enable Project": "Включить проект",
|
||||
"Enable QoS Policy": "Включить политику QoS",
|
||||
"Enable Registry": "Включить реестр",
|
||||
"Enable SNAT": "Включить SNAT",
|
||||
"Enable Service": "Включить сервис",
|
||||
"Enable User": "Включить пользователя",
|
||||
"Enable auto heal": "Включить автоматическое восстановление",
|
||||
|
@ -788,6 +788,7 @@
|
||||
"Disable Compute Service": "Hesaplama Servisini Devre Dışı Bırak",
|
||||
"Disable Gateway": "Ağ Geçidini Devre Dışı Bırak",
|
||||
"Disable Neutron Agent": "Neutron Ajanını Devre Dışı Bırak",
|
||||
"Disable SNAT": "SNAT Devre Dışı Bırak",
|
||||
"Disable TLS": "TLS'yi Devre Dışı Bırak",
|
||||
"Disable compute host": "Hesaplama ana bilgisayarını devre dışı bırak",
|
||||
"Disabled": "Devre Dışı",
|
||||
@ -914,6 +915,7 @@
|
||||
"Enable Project": "Projeyi Etkinleştir",
|
||||
"Enable QoS Policy": "QoS İlkesini Etkinleştir",
|
||||
"Enable Registry": "Kayıt Defterini Etkinleştir",
|
||||
"Enable SNAT": "SNAT Etkinleştir",
|
||||
"Enable Service": "Hizmeti Etkinleştir",
|
||||
"Enable User": "Kullanıcıyı Etkinleştir",
|
||||
"Enable auto heal": "Otomatik Onarımı Etkinleştir",
|
||||
|
@ -788,6 +788,7 @@
|
||||
"Disable Compute Service": "禁用计算服务",
|
||||
"Disable Gateway": "禁用网关",
|
||||
"Disable Neutron Agent": "禁用网络服务",
|
||||
"Disable SNAT": "禁用 SNAT",
|
||||
"Disable TLS": "禁用TLS",
|
||||
"Disable compute host": "禁用计算节点",
|
||||
"Disabled": "已关闭",
|
||||
@ -914,6 +915,7 @@
|
||||
"Enable Project": "启用项目",
|
||||
"Enable QoS Policy": "启用QoS策略",
|
||||
"Enable Registry": "启用注册表",
|
||||
"Enable SNAT": "启用 SNAT",
|
||||
"Enable Service": "启用服务",
|
||||
"Enable User": "启用用户",
|
||||
"Enable auto heal": "启用自动修复",
|
||||
|
55
src/pages/network/containers/Router/actions/DisableSnat.jsx
Normal file
55
src/pages/network/containers/Router/actions/DisableSnat.jsx
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright 2021 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { ConfirmAction } from 'containers/Action';
|
||||
import globalRouterStore from 'stores/neutron/router';
|
||||
|
||||
export default class DisableSnat extends ConfirmAction {
|
||||
get id() {
|
||||
return 'disable-snat';
|
||||
}
|
||||
|
||||
get title() {
|
||||
return t('Disable SNAT');
|
||||
}
|
||||
|
||||
get actionName() {
|
||||
return t('Disable SNAT');
|
||||
}
|
||||
|
||||
policy = [
|
||||
'update_router',
|
||||
'update_router:external_gateway_info',
|
||||
'update_router:external_gateway_info:network_id',
|
||||
'update_router:external_gateway_info:enable_snat',
|
||||
];
|
||||
|
||||
allowedCheckFunc = (item) => {
|
||||
return item?.external_gateway_info?.enable_snat;
|
||||
};
|
||||
|
||||
onSubmit = (item) => {
|
||||
const {
|
||||
id,
|
||||
external_gateway_info: { network_id },
|
||||
} = item;
|
||||
const body = {
|
||||
external_gateway_info: {
|
||||
network_id,
|
||||
enable_snat: false,
|
||||
},
|
||||
};
|
||||
return globalRouterStore.edit({ id }, body);
|
||||
};
|
||||
}
|
57
src/pages/network/containers/Router/actions/EnableSnat.jsx
Normal file
57
src/pages/network/containers/Router/actions/EnableSnat.jsx
Normal file
@ -0,0 +1,57 @@
|
||||
// Copyright 2021 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { ConfirmAction } from 'containers/Action';
|
||||
import globalRouterStore from 'stores/neutron/router';
|
||||
|
||||
export default class EnableSnat extends ConfirmAction {
|
||||
get id() {
|
||||
return 'enable-snat';
|
||||
}
|
||||
|
||||
get title() {
|
||||
return t('Enable SNAT');
|
||||
}
|
||||
|
||||
get actionName() {
|
||||
return t('Enable SNAT');
|
||||
}
|
||||
|
||||
policy = [
|
||||
'update_router',
|
||||
'update_router:external_gateway_info',
|
||||
'update_router:external_gateway_info:network_id',
|
||||
'update_router:external_gateway_info:enable_snat',
|
||||
];
|
||||
|
||||
allowedCheckFunc = (item) => {
|
||||
return (
|
||||
item?.external_gateway_info && !item.external_gateway_info.enable_snat
|
||||
);
|
||||
};
|
||||
|
||||
onSubmit = (item) => {
|
||||
const {
|
||||
id,
|
||||
external_gateway_info: { network_id },
|
||||
} = item;
|
||||
const body = {
|
||||
external_gateway_info: {
|
||||
network_id,
|
||||
enable_snat: true,
|
||||
},
|
||||
};
|
||||
return globalRouterStore.edit({ id }, body);
|
||||
};
|
||||
}
|
@ -20,6 +20,8 @@ import SetGateway from './SetGateway';
|
||||
// import AssociateFip from './AssociateFip';
|
||||
import ConnectSubnet from './ConnectSubnet';
|
||||
import DisconnectSubnet from './DisconnectSubnet';
|
||||
import EnableSnat from './EnableSnat';
|
||||
import DisableSnat from './DisableSnat';
|
||||
// import DisassociateFip from './DisassociateFip';
|
||||
|
||||
const actionConfigs = {
|
||||
@ -41,6 +43,12 @@ const actionConfigs = {
|
||||
{
|
||||
action: SetGateway,
|
||||
},
|
||||
{
|
||||
action: EnableSnat,
|
||||
},
|
||||
{
|
||||
action: DisableSnat,
|
||||
},
|
||||
// {
|
||||
// action: AssociateFip,
|
||||
// },
|
||||
|
Loading…
Reference in New Issue
Block a user