Commit 75b4d53a authored by Masami  Suzuki's avatar Masami Suzuki Committed by Yas Naoi
Browse files

Issue #3322725 by Masami, yas, Ryo Yamashita: Add the functions for OpenStack...

Issue #3322725 by Masami, yas, Ryo Yamashita: Add the functions for OpenStack Subnet in the SPA (CRUD)
parent 3f09b135
Loading
Loading
Loading
Loading
+2 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/entity/entity_info_template.ts: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import OPENSTACK_NETWORK_INTERFACE_TEMPLATE from 'constant/templates/entity/open
import OPENSTACK_SECURITY_GROUP_TEMPLATE from 'constant/templates/entity/openstack/security_group';
import OPENSTACK_SNAPSHOT_TEMPLATE from 'constant/templates/entity/openstack/snapshot';
import OPENSTACK_VOLUME_TEMPLATE from 'constant/templates/entity/openstack/volume';
import OPENSTACK_SUBNET_TEMPLATE from 'constant/templates/entity/openstack/subnet';
import VMWARE_HOST_TEMPLATE from 'constant/templates/entity/vmware/host';
import VMWARE_VM_TEMPLATE from 'constant/templates/entity/vmware/vm';

@@ -104,6 +105,7 @@ const ENTITY_INFO_LIST = [
  OPENSTACK_KEY_PAIR_TEMPLATE,
  OPENSTACK_VOLUME_TEMPLATE,
  OPENSTACK_SNAPSHOT_TEMPLATE,
  OPENSTACK_SUBNET_TEMPLATE,
  VMWARE_HOST_TEMPLATE,
  VMWARE_VM_TEMPLATE,
];
+35 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/entity/openstack/subnet.ts: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
import EntityInfoTemplate from 'model/EntityInfoTemplate';

// Template for displaying detailed information about entities in OpenStack.
const OPENSTACK_SUBNET_TEMPLATE: EntityInfoTemplate = {
  cloudServiceProvider: 'openstack',
  entityName: 'subnet',
  entityRecords: [
    {
      panelName: 'Subnet',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Name', name: 'name', type: 'default' },
        { labelName: 'Subnet ID', name: 'subnet_id', type: 'default' },
        { labelName: 'Project ID', name: 'project_id', type: 'default' },
        { labelName: 'Network', name: 'network_id', type: 'join', info: {
          entityTypeId: 'openstack_network', keyColumn: 'network_id', valueColumn: 'name' } },
        { labelName: 'IP Version', name: 'ip_version', type: 'default' },
        { labelName: 'CIDR', name: 'cidr', type: 'default' },
        { labelName: 'Allocation Pools', name: 'allocation_pools', type: 'default' },
        { labelName: 'Gateway IP', name: 'gateway_ip', type: 'default' },
        { labelName: 'Enable DHCP', name: 'enable_dhcp', type: 'boolean', value: ['yes', 'no'] },
        { labelName: 'Created', name: 'created', type: 'datetime' },
      ]
    },
    {
      panelName: 'Others',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Cloud service provider ID', name: 'cloud_context', type: 'default' },
      ]
    },
  ]
};

export default OPENSTACK_SUBNET_TEMPLATE;
+2 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/form/entity_form_template.ts: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import OPENSTACK_NETWORK_INTERFACE_TEMPLATE from 'constant/templates/form/openst
import OPENSTACK_SECURITY_GROUP_TEMPLATE from 'constant/templates/form/openstack/security_group';
import OPENSTACK_SNAPSHOT_TEMPLATE from 'constant/templates/form/openstack/snapshot';
import OPENSTACK_VOLUME_TEMPLATE from 'constant/templates/form/openstack/volume';
import OPENSTACK_SUBNET_TEMPLATE from 'constant/templates/form/openstack/subnet';
import VMWARE_VM_TEMPLATE from 'constant/templates/form/vmware/vm';

const ENTITY_FORM_LIST = [
@@ -58,6 +59,7 @@ const ENTITY_FORM_LIST = [
  ...OPENSTACK_NETWORK_INTERFACE_TEMPLATE,
  ...OPENSTACK_SNAPSHOT_TEMPLATE,
  ...OPENSTACK_VOLUME_TEMPLATE,
  ...OPENSTACK_SUBNET_TEMPLATE,
  ...OPENSTACK_CLOUD_LAUNCH_TEMPLATE,
  ...VMWARE_VM_TEMPLATE,
  ...AWS_CLOUD_LAUNCH_TEMPLATE,
+106 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/form/openstack/subnet.ts: 106 added lines, 0 removed lines.
Original line number Diff line number Diff line
import EntityFormTemplate from 'model/EntityFormTemplate';

const OPENSTACK_SUBNET_TEMPLATE: EntityFormTemplate[] = [
  {
    cloudServiceProvider: 'openstack',
    entityName: 'subnet',
    actionType: 'create',
    entityRecords: [
      {
        type: 'panel',
        panelName: 'Subnet',
        keyValueRecords: [
          { type: 'default', labelName: 'Name', name: 'name', defaultValue: '', required: true },
          {
            type: 'select', labelName: 'Network', name: 'network_id',
            url: '/cloud_dashboard/openstack/{cloud_context}/networks',
            defaultValue: '',
            required: true,
          },
          { type: 'default', labelName: 'CIDR', name: 'cidr', defaultValue: '', required: true },
          { type: 'select-local', name: 'ip_version', labelName: 'IP Version', defaultValue: '', required: true, value: [
            { name: 'IPv4', labelName: 'IPv4' },
            { name: 'IPv6', labelName: 'IPv6' },
          ] },
          { type: 'default', labelName: 'Gateway IP', name: 'gateway_ip', defaultValue: '' },
          {
            type: 'boolean', labelName: 'Disable Gateway', name: 'disable_gateway',
            defaultValue: false
          },
          {
            type: 'boolean', labelName: 'Enable DHCP', name: 'enable_dhcp',
            defaultValue: true
          },
          {
            type: 'textarea', labelName: 'Allocation Pools', name: 'allocation_pools',
            defaultValue: ''
          },
          {
            type: 'textarea', labelName: 'DNS Name Servers', name: 'dns_name_servers',
            defaultValue: ''
          },
          {
            type: 'textarea', labelName: 'Host Routes', name: 'host_routes',
            defaultValue: ''
          },
        ]
      }
    ]
  },
  {
    cloudServiceProvider: 'openstack',
    entityName: 'subnet',
    actionType: 'edit',
    entityRecords: [
      {
        type: 'panel',
        panelName: 'Subnet',
        keyValueRecords: [
          { type: 'default', labelName: 'Name', name: 'name', defaultValue: '', required: true },
          {
            type: 'join', labelName: 'Network', name: 'network_id', info: {
              entityTypeId: 'openstack_network',
              keyColumn: 'network_id',
            }, defaultValue: '', readOnly: true
          },
          { type: 'default', labelName: 'CIDR', name: 'cidr', defaultValue: '', required: true },
          { type: 'default', labelName: 'Gateway IP', name: 'gateway_ip', defaultValue: '' },
          {
            type: 'boolean', labelName: 'Disable Gateway', name: 'disable_gateway',
            defaultValue: false
          },
          {
            type: 'boolean', labelName: 'Enable DHCP', name: 'enable_dhcp',
            defaultValue: true
          },
          {
            type: 'textarea', labelName: 'Allocation Pools', name: 'allocation_pools',
            defaultValue: ''
          },
          {
            type: 'textarea', labelName: 'DNS Name Servers', name: 'dns_name_servers',
            defaultValue: ''
          },
          {
            type: 'textarea', labelName: 'Host Routes', name: 'host_routes',
            defaultValue: ''
          },
        ]
      }
    ]
  },
  {
    cloudServiceProvider: 'openstack',
    entityName: 'subnet',
    actionType: 'delete',
    entityRecords: [
      {
        type: 'label',
        text: 'Are you sure you want to delete the {{entityName}} {{name}}?'
      },
    ],
    submitButtonLabel: 'Delete'
  },
]

export default OPENSTACK_SUBNET_TEMPLATE;
+32 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/menu/menu_template.json: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1873,6 +1873,38 @@
          "type": "datetime"
        }
      ]
    },
    {
      "cloudServiceProvider": "openstack",
      "labelName": "Subnets",
      "entityName": "subnet",
      "entityColumn": [
        {
          "labelName": "Name",
          "name": "name",
          "type": "default"
        },
        {
          "labelName": "Network",
          "name": "network_id",
          "type": "default"
        },
        {
          "labelName": "CIDR",
          "name": "cidr",
          "type": "default"
        },
        {
          "labelName": "IP Version",
          "name": "ip_version",
          "type": "default"
        },
        {
          "labelName": "Gateway IP",
          "name": "gateway_ip",
          "type": "default"
        }
      ]
    }
  ],
  [
Loading