Commit 1e252df4 authored by Ryo Yamashita's avatar Ryo Yamashita Committed by Yas Naoi
Browse files

Issue #3264872 by Ryo Yamashita, yas: Add a detailed view to SPA (OpenStack Instances)

parent bb1bb2fa
Loading
Loading
Loading
Loading
+6 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/entity_info_template/aws_cloud/instance.ts: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -36,6 +36,12 @@ const AWS_CLOUD_INSTANCE_TEMPLATE: EntityInfoTemplate = {
        { labelName: 'Private IPs', name: 'private_ips', type: 'default' },
        { labelName: 'Public DNS', name: 'public_dns', type: 'default' },
        { labelName: 'Security groups', name: 'security_groups', type: 'default' },
        { labelName: 'Key pair name', name: 'key_pair_name', type: 'join', info: {
            entityTypeId: 'aws_cloud_key_pair',
            keyColumn: 'key_pair_name',
            valueColumn: 'name',
          }
        },
        {
          labelName: 'VPC ID', name: 'vpc_id', type: 'join', info: {
            entityTypeId: 'aws_cloud_vpc',
+2 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/entity_info_template/entity_info_template.ts: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import K8S_INGRESS_TEMPLATE from 'constant/entity_info_template/k8s/ingress';
import K8S_LIMIT_RANGE_TEMPLATE from 'constant/entity_info_template/k8s/limit_range';
import K8S_API_SERVICE_TEMPLATE from 'constant/entity_info_template/k8s/api_service';
import K8S_SCHEDULE_TEMPLATE from 'constant/entity_info_template/k8s/schedule';
import OPENSTACK_INSTANCE_TEMPLATE from 'constant/entity_info_template/openstack/instance';

const ENTITY_INFO_LIST = [
  AWS_CLOUD_INSTANCE_TEMPLATE,
@@ -86,6 +87,7 @@ const ENTITY_INFO_LIST = [
  K8S_LIMIT_RANGE_TEMPLATE,
  K8S_API_SERVICE_TEMPLATE,
  K8S_SCHEDULE_TEMPLATE,
  OPENSTACK_INSTANCE_TEMPLATE,
];

export const UPPERCASE_WORD_SET = new Set([
+92 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/entity_info_template/openstack/instance.ts: 92 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_INSTANCE_TEMPLATE: EntityInfoTemplate = {
  cloudServiceProvider: 'openstack',
  entityName: 'instance',
  entityRecords: [
    {
      panelName: 'Instance',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Name', name: 'name', type: 'default' },
        { labelName: 'Instance ID', name: 'instance_id', type: 'default' },
        { labelName: 'Instance State', name: 'instance_state', type: 'default' },
        { labelName: 'Instance type', name: 'instance_type', type: 'default' },
        { labelName: 'Cost', name: 'cost', type: 'cost' },
        { labelName: 'AMI Image', name: 'image_id', type: 'default' },
        { labelName: 'Virtualization', name: 'virtualization', type: 'default' },
        { labelName: 'Reservation', name: 'reservation', type: 'default' },
        { labelName: 'AWS account ID', name: 'account_id', type: 'default' },
        { labelName: 'Launch Time', name: 'launch_time', type: 'datetime' },
        { labelName: 'Created', name: 'created', type: 'datetime' },
      ]
    },
    {
      panelName: 'Network',
      tableRecordList: [],
      keyValueRecords: [
        {
          labelName: 'Public IP', name: 'public_ip', type: 'join', info: {
            entityTypeId: 'openstack_floating_ip',
            keyColumn: 'public_ip',
            valueColumn: 'name',
          }
        },
        { labelName: 'Private IPs', name: 'private_ips', type: 'default' },
        { labelName: 'Public DNS', name: 'public_dns', type: 'default' },
        { labelName: 'Security groups', name: 'security_groups', type: 'default' },
        { labelName: 'Key pair name', name: 'key_pair_name', type: 'join', info: {
            entityTypeId: 'openstack_key_pair',
            keyColumn: 'key_pair_name',
            valueColumn: 'name',
          }
        },
        {
          labelName: 'VPC ID', name: 'vpc_id', type: 'join', info: {
            entityTypeId: 'openstack_security_group',
            keyColumn: 'vpc_id',
            valueColumn: 'name',
          }
        },
        {
          labelName: 'Subnet ID', name: 'subnet_id', type: 'join', info: {
            entityTypeId: 'aws_cloud_subnet',
            keyColumn: 'subnet_id',
            valueColumn: 'name',
          }
        },
        { labelName: 'Availability Zone', name: 'availability_zone', type: 'default' },
        { labelName: 'Network interfaces', name: 'network_interfaces', type: 'array' },
      ]
    },
    {
      panelName: 'Storage',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Root Device Type', name: 'root_device_type', type: 'default' },
        { labelName: 'Root Device', name: 'root_device', type: 'default' },
        { labelName: 'EBS Optimized', name: 'ebs_optimized', type: 'boolean', value: ['On', 'Off'] },
        { labelName: 'Volume', name: 'block_devices', type: 'default' },
      ]
    },
    {
      panelName: 'Tags',
      tableRecordList: ['tags'],
      keyValueRecords: [
        { labelName: 'Tags', name: 'tags', type: 'default' },
      ]
    },
    {
      panelName: 'Option',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Termination protection', name: 'termination_protection', type: 'boolean', value: ['On', 'Off'] },
        { labelName: 'AMI Launch Index', name: 'ami_launch_index', type: 'default' },
        { labelName: 'Tenancy', name: 'tenancy', type: 'default' },
      ]
    },
  ]
};

export default OPENSTACK_INSTANCE_TEMPLATE;
+1 −1
Changes for modules/cloud_dashboard/cloud_dashboard/src/molecules/KeyValueBlock.tsx: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ const KeyValueBlock = ({ record }: { record: EntityInfoRecordData }) => {
  }

  // Return empty element if the record does not have a value.
  if (record.value.length < 1) {
  if (record.value === ' (null)' || record.value.length < 1) {
    return <></>;
  }