feat: update editing admin_state_up for listener

update editing and display admin_state_up for lb's listener

Change-Id: Ie36a59786a278e4ae67d7b95697456e02d97c9e4
This commit is contained in:
zhangjingwei 2023-11-14 14:39:43 +08:00
parent 772b1b5d46
commit 73653da708
5 changed files with 43 additions and 5 deletions

View File

@ -0,0 +1,12 @@
---
features:
- |
Update editing admin_state_up for lb's listener:
* Support editing admin_state_up when creating listener in the lb detail page.
* Support editing admin_state_up when editing listener.
* Support display admin_state_up info in the listener tab in the lb detail page.
* Support display admin_state_up info in the listener detail page.

View File

@ -92,6 +92,7 @@ export class Create extends ModalAction {
ssl_parsing_method: 'one-way', ssl_parsing_method: 'one-way',
sni_enabled: false, sni_enabled: false,
connection_limit: -1, connection_limit: -1,
admin_state_up: true,
}; };
} }
@ -203,6 +204,12 @@ export class Create extends ModalAction {
extra: t('-1 means no connection limit'), extra: t('-1 means no connection limit'),
required: true, required: true,
}, },
{
name: 'admin_state_up',
label: t('Admin State Up'),
type: 'switch',
tip: t('Defines the admin state of the listener.'),
},
insertHeaderFormItem, insertHeaderFormItem,
]; ];
} }

View File

@ -51,13 +51,22 @@ export class Edit extends Base {
get defaultValue() { get defaultValue() {
const { item } = this.props; const { item } = this.props;
const {
name,
description,
protocol,
protocol_port,
connection_limit,
admin_state_up,
} = item || {};
const values = { const values = {
name: item.name, name,
description: item.description, description,
protocol: item.protocol, protocol,
protocol_port: item.protocol_port, protocol_port,
connection_limit: item.connection_limit, connection_limit,
insert_headers: getInsertHeadersFormValueFromListener(item), insert_headers: getInsertHeadersFormValueFromListener(item),
admin_state_up,
}; };
if (item.protocol === 'TERMINATED_HTTPS') { if (item.protocol === 'TERMINATED_HTTPS') {
if (item.default_tls_container_ref) { if (item.default_tls_container_ref) {

View File

@ -66,6 +66,11 @@ export class ListenerDetail extends Base {
title: t('Max connect'), title: t('Max connect'),
dataIndex: 'connection_limit', dataIndex: 'connection_limit',
}, },
{
title: t('Admin State Up'),
dataIndex: 'admin_state_up',
render: (value) => (value ? t('On') : t('Off')),
},
{ {
title: t('Description'), title: t('Description'),
dataIndex: 'description', dataIndex: 'description',

View File

@ -93,6 +93,11 @@ export class Listeners extends Base {
title: t('Max connect'), title: t('Max connect'),
dataIndex: 'connection_limit', dataIndex: 'connection_limit',
}, },
{
title: t('Admin State Up'),
dataIndex: 'admin_state_up',
render: (value) => (value ? t('On') : t('Off')),
},
]; ];
get searchFilters() { get searchFilters() {