Commit c84a4330 authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3322836 by yas, hosomitm, Ryo Yamashita: Add a detailed view and list...

Issue #3322836 by yas, hosomitm, Ryo Yamashita: Add a detailed view and list view to SPA (OpenStack Network)
parent 96cc6c9f
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_NETWORK_TEMPLATE from 'constant/templates/entity/openstack/network';
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';
@@ -105,6 +106,7 @@ const ENTITY_INFO_LIST = [
  OPENSTACK_KEY_PAIR_TEMPLATE,
  OPENSTACK_VOLUME_TEMPLATE,
  OPENSTACK_SNAPSHOT_TEMPLATE,
  OPENSTACK_NETWORK_TEMPLATE,
  OPENSTACK_SUBNET_TEMPLATE,
  VMWARE_HOST_TEMPLATE,
  VMWARE_VM_TEMPLATE,
+36 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/entity/openstack/network.ts: 36 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_NETWORK_TEMPLATE: EntityInfoTemplate = {
  cloudServiceProvider: 'openstack',
  entityName: 'network',
  entityRecords: [
    {
      panelName: 'Network',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Name', name: 'name', type: 'default' },
        { labelName: 'Network ID', name: 'network_id', type: 'default' },
        { labelName: 'Project ID', name: 'project_id', type: 'default' },
        { labelName: 'Status', name: 'status', type: 'default' },
        { labelName: 'Admin State', name: 'admin_state_up', type: 'boolean', value: ['up', 'down'] },
        { labelName: 'Shared', name: 'shared', type: 'boolean', value: ['yes', 'no'] },
        { labelName: 'External', name: 'external', type: 'boolean', value: ['yes', 'no'] },
        { labelName: 'MTU', name: 'mtu', type: 'number' },
        { labelName: 'Network Type', name: 'network_type', type: 'default' },
        { labelName: 'Segmentation ID', name: 'segmentation_id', type: 'number' },
        { labelName: 'Availability Zones', name: 'availability_zones', type: 'array' },
        { labelName: 'Created', name: 'created', type: 'datetime' },
      ]
    },
    {
      panelName: 'Others',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Cloud service provider ID', name: 'cloud_context', type: 'default' },
      ]
    }
  ]
};

export default OPENSTACK_NETWORK_TEMPLATE;
+54 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/templates/menu/menu_template.json: 54 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1874,6 +1874,60 @@
        }
      ]
    },
    {
      "cloudServiceProvider": "openstack",
      "labelName": "Networks",
      "entityName": "network",
      "entityColumn": [
        {
          "labelName": "Name",
          "name": "name",
          "type": "default"
        },
        {
          "labelName": "Subnets",
          "name": "subnets",
          "type": "array"
        },
        {
          "labelName": "Shared",
          "name": "shared",
          "type": "boolean",
          "value": [
            "yes",
            "no"
          ]
        },
        {
          "labelName": "External",
          "name": "external",
          "type": "boolean",
          "value": [
            "yes",
            "no"
          ]
        },
        {
          "labelName": "Status",
          "name": "status",
          "type": "default"
        },
        {
          "labelName": "Admin state",
          "name": "admin_state_up",
          "type": "boolean",
          "value": [
            "up",
            "down"
          ]
        },
        {
          "labelName": "Availability Zones",
          "name": "availability_zones",
          "type": "array"
        }
      ]
    },
    {
      "cloudServiceProvider": "openstack",
      "labelName": "Subnets",
+3 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/service/convert.ts: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -170,6 +170,9 @@ export const convertDataToTextForUI = (data: any, ec: EntityColumn, dataCache: {
    case 'boolean':
      return data ? ec.value[0] : ec.value[1];
    case 'array':
      if (!Array.isArray(data)) {
        return data;
      }
      return data.map((r: any) => `${r}`).join(', ');
    case 'join':
      for (const record of dataCache[ec.info.entityTypeId]) {