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'),
|
||||
dataIndex: 'id',
|
||||
},
|
||||
{
|
||||
title: t('Description'),
|
||||
dataIndex: 'description',
|
||||
},
|
||||
{
|
||||
title: t('Enabled'),
|
||||
dataIndex: 'enabled',
|
||||
|
@@ -25,6 +25,7 @@ import { qosEndpoint } from 'client/client/constants';
|
||||
import { projectTableOptions } from 'resources/keystone/project';
|
||||
import { isAdminPage } from 'utils';
|
||||
import { toJS } from 'mobx';
|
||||
import { checkPolicyRule } from 'resources/skyline/policy';
|
||||
|
||||
export class Allocate extends ModalAction {
|
||||
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() {
|
||||
const {
|
||||
networks,
|
||||
@@ -338,6 +346,7 @@ export class Allocate extends ModalAction {
|
||||
name: 'floating_ip_address',
|
||||
label: t('Floating IP Address'),
|
||||
hidden: !selectedSubnet || batchAllocate,
|
||||
display: this.canSpecifyFloatingIp(),
|
||||
type: 'ip-input',
|
||||
version: selectedSubnet && (selectedSubnet.ip_version || 4),
|
||||
},
|
||||
|
@@ -261,16 +261,14 @@ export class Create extends ModalAction {
|
||||
},
|
||||
{
|
||||
name: 'sourcePort',
|
||||
label:
|
||||
label: t('Port or Port Range'),
|
||||
extra:
|
||||
direction === 'egress'
|
||||
? t('Destination Port/Port Range')
|
||||
: t('Source Port/Port Range'),
|
||||
? t('Input destination port or port range (example: 80 or 80:160)')
|
||||
: t('Input source port or port range (example: 80 or 80:160)'),
|
||||
type: 'port-range',
|
||||
required: showSourcePort,
|
||||
hidden: !showSourcePort,
|
||||
extra:
|
||||
direction === 'egress' &&
|
||||
t('Input destination port or port range (example: 80 or 80:160)'),
|
||||
},
|
||||
{
|
||||
name: 'ipProtocol',
|
||||
@@ -302,6 +300,13 @@ export class Create extends ModalAction {
|
||||
hidden: !isCustomIcmp,
|
||||
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',
|
||||
label: t('Remote Type'),
|
||||
|
@@ -77,6 +77,11 @@ export const getSelfColumns = (self) => [
|
||||
dataIndex: 'port_range',
|
||||
isHideable: true,
|
||||
},
|
||||
{
|
||||
title: t('Description'),
|
||||
dataIndex: 'description',
|
||||
isHideable: true,
|
||||
},
|
||||
{
|
||||
title: t('Remote IP Prefix'),
|
||||
dataIndex: 'remote_ip_prefix',
|
||||
|
Reference in New Issue
Block a user