feat: support editing pool admin_state_up
1. support editing admin_state_up when edit listener's pool of lb 2. support display admin_state_up info in the pool info card in the listener detail page 3. update lb algorithm display in the pool info card in the listener detail page Change-Id: I80a500c6d67b51203c1d2e5868f94c4800c72714
This commit is contained in:
parent
081ff7ee8b
commit
772b1b5d46
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Update editing admin_state_up for listener's pool:
|
||||||
|
|
||||||
|
* Support editing admin_state_up when edit listener's pool of lb.
|
||||||
|
|
||||||
|
* Support display admin_state_up info in the pool info card in the listener detail page.
|
||||||
|
|
||||||
|
* Update lb algorithm display in the pool info card in the listener detail page.
|
@ -50,20 +50,13 @@ export class EditPoolInfo extends ModalAction {
|
|||||||
|
|
||||||
get defaultValue() {
|
get defaultValue() {
|
||||||
const { pool } = this.state;
|
const { pool } = this.state;
|
||||||
const { name, description, protocol, lb_algorithm } = pool;
|
const { name, description, protocol, lb_algorithm, admin_state_up } = pool;
|
||||||
if (name && this.formRef.current) {
|
|
||||||
this.formRef.current.setFieldsValue({
|
|
||||||
name,
|
|
||||||
description,
|
|
||||||
protocol,
|
|
||||||
lb_algorithm,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
protocol,
|
protocol,
|
||||||
lb_algorithm,
|
lb_algorithm,
|
||||||
|
admin_state_up,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +77,9 @@ export class EditPoolInfo extends ModalAction {
|
|||||||
async getPoolDetail() {
|
async getPoolDetail() {
|
||||||
const { default_pool_id } = this.item;
|
const { default_pool_id } = this.item;
|
||||||
const pool = await this.store.fetchDetail({ id: default_pool_id });
|
const pool = await this.store.fetchDetail({ id: default_pool_id });
|
||||||
this.setState({ pool });
|
this.setState({ pool }, () => {
|
||||||
|
this.updateDefaultValue();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get formItems() {
|
get formItems() {
|
||||||
@ -115,6 +110,12 @@ export class EditPoolInfo extends ModalAction {
|
|||||||
options: Algorithm,
|
options: Algorithm,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'admin_state_up',
|
||||||
|
label: t('Admin State Up'),
|
||||||
|
type: 'switch',
|
||||||
|
tip: t('Defines the admin state of the pool.'),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,8 +16,9 @@ import { inject, observer } from 'mobx-react';
|
|||||||
import globalListenerStore from 'stores/octavia/listener';
|
import globalListenerStore from 'stores/octavia/listener';
|
||||||
import Base from 'containers/BaseDetail';
|
import Base from 'containers/BaseDetail';
|
||||||
import { HealthMonitorStore } from 'stores/octavia/health-monitor';
|
import { HealthMonitorStore } from 'stores/octavia/health-monitor';
|
||||||
import { getInsertHeaderCard } from 'src/resources/octavia/lb';
|
import { getInsertHeaderCard } from 'resources/octavia/lb';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
|
import { algorithmDict } from 'resources/octavia/pool';
|
||||||
|
|
||||||
export class BaseDetail extends Base {
|
export class BaseDetail extends Base {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -63,7 +64,8 @@ export class BaseDetail extends Base {
|
|||||||
|
|
||||||
get PoolInfo() {
|
get PoolInfo() {
|
||||||
const { default_pool = {} } = this.detailData || {};
|
const { default_pool = {} } = this.detailData || {};
|
||||||
const { name, protocol, lb_algorithm, description } = default_pool;
|
const { name, protocol, lb_algorithm, description, admin_state_up } =
|
||||||
|
default_pool;
|
||||||
const options = [
|
const options = [
|
||||||
{
|
{
|
||||||
label: t('Name'),
|
label: t('Name'),
|
||||||
@ -75,7 +77,11 @@ export class BaseDetail extends Base {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('LB Algorithm'),
|
label: t('LB Algorithm'),
|
||||||
content: lb_algorithm || '-',
|
content: algorithmDict[lb_algorithm] || lb_algorithm || '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('Admin State Up'),
|
||||||
|
content: admin_state_up ? t('On') : t('Off'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Description'),
|
label: t('Description'),
|
||||||
|
@ -23,7 +23,7 @@ export const BackendProtocol = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const algorithmDict = {
|
export const algorithmDict = {
|
||||||
LEAST_CONNECTIONS: t('LEAST_CONNECTIONS'),
|
LEAST_CONNECTIONS: t('LEAST_CONNECTIONS'),
|
||||||
ROUND_ROBIN: t('ROUND_ROBIN'),
|
ROUND_ROBIN: t('ROUND_ROBIN'),
|
||||||
SOURCE_IP: t('SOURCE_IP'),
|
SOURCE_IP: t('SOURCE_IP'),
|
||||||
|
Loading…
Reference in New Issue
Block a user