Merge "feat: hide fip input based on policy, add description field to secgroup rule, show project description on the project switch page"
This commit is contained in:
@@ -135,6 +135,10 @@ export class ProjectSelect extends ModalAction {
|
|||||||
title: t('ID'),
|
title: t('ID'),
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t('Description'),
|
||||||
|
dataIndex: 'description',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('Enabled'),
|
title: t('Enabled'),
|
||||||
dataIndex: 'enabled',
|
dataIndex: 'enabled',
|
||||||
|
@@ -25,6 +25,7 @@ import { qosEndpoint } from 'client/client/constants';
|
|||||||
import { projectTableOptions } from 'resources/keystone/project';
|
import { projectTableOptions } from 'resources/keystone/project';
|
||||||
import { isAdminPage } from 'utils';
|
import { isAdminPage } from 'utils';
|
||||||
import { toJS } from 'mobx';
|
import { toJS } from 'mobx';
|
||||||
|
import { checkPolicyRule } from 'resources/skyline/policy';
|
||||||
|
|
||||||
export class Allocate extends ModalAction {
|
export class Allocate extends ModalAction {
|
||||||
static id = 'allocate';
|
static id = 'allocate';
|
||||||
@@ -261,6 +262,13 @@ export class Allocate extends ModalAction {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
canSpecifyFloatingIp() {
|
||||||
|
return (
|
||||||
|
checkPolicyRule('create_floatingip') &&
|
||||||
|
checkPolicyRule('create_floatingip:floating_ip_address')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
get formItems() {
|
get formItems() {
|
||||||
const {
|
const {
|
||||||
networks,
|
networks,
|
||||||
@@ -338,6 +346,7 @@ export class Allocate extends ModalAction {
|
|||||||
name: 'floating_ip_address',
|
name: 'floating_ip_address',
|
||||||
label: t('Floating IP Address'),
|
label: t('Floating IP Address'),
|
||||||
hidden: !selectedSubnet || batchAllocate,
|
hidden: !selectedSubnet || batchAllocate,
|
||||||
|
display: this.canSpecifyFloatingIp(),
|
||||||
type: 'ip-input',
|
type: 'ip-input',
|
||||||
version: selectedSubnet && (selectedSubnet.ip_version || 4),
|
version: selectedSubnet && (selectedSubnet.ip_version || 4),
|
||||||
},
|
},
|
||||||
|
@@ -261,16 +261,14 @@ export class Create extends ModalAction {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'sourcePort',
|
name: 'sourcePort',
|
||||||
label:
|
label: t('Port or Port Range'),
|
||||||
|
extra:
|
||||||
direction === 'egress'
|
direction === 'egress'
|
||||||
? t('Destination Port/Port Range')
|
? t('Input destination port or port range (example: 80 or 80:160)')
|
||||||
: t('Source Port/Port Range'),
|
: t('Input source port or port range (example: 80 or 80:160)'),
|
||||||
type: 'port-range',
|
type: 'port-range',
|
||||||
required: showSourcePort,
|
required: showSourcePort,
|
||||||
hidden: !showSourcePort,
|
hidden: !showSourcePort,
|
||||||
extra:
|
|
||||||
direction === 'egress' &&
|
|
||||||
t('Input destination port or port range (example: 80 or 80:160)'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ipProtocol',
|
name: 'ipProtocol',
|
||||||
@@ -302,6 +300,13 @@ export class Create extends ModalAction {
|
|||||||
hidden: !isCustomIcmp,
|
hidden: !isCustomIcmp,
|
||||||
help: t('Please input ICMP code(0-255)'),
|
help: t('Please input ICMP code(0-255)'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: t('Description'),
|
||||||
|
type: 'textarea',
|
||||||
|
required: false,
|
||||||
|
placeholder: t('Description for this rule'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'remoteType',
|
name: 'remoteType',
|
||||||
label: t('Remote Type'),
|
label: t('Remote Type'),
|
||||||
|
@@ -77,6 +77,11 @@ export const getSelfColumns = (self) => [
|
|||||||
dataIndex: 'port_range',
|
dataIndex: 'port_range',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t('Description'),
|
||||||
|
dataIndex: 'description',
|
||||||
|
isHideable: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('Remote IP Prefix'),
|
title: t('Remote IP Prefix'),
|
||||||
dataIndex: 'remote_ip_prefix',
|
dataIndex: 'remote_ip_prefix',
|
||||||
|
Reference in New Issue
Block a user