Commit 2e53461d authored by Ryo Yamashita's avatar Ryo Yamashita Committed by Yas Naoi
Browse files

Issue #3266233 by Ryo Yamashita, yas: Add entity list views for VMware in SPA

parent 99d62255
Loading
Loading
Loading
Loading
+12 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/launch_template.ts: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -35,6 +35,11 @@ const OPENSTACK_LAUNCH_TEMPLATE_LIST: EntityColumn[] = [];

const DEFAULT_OPENSTACK_LAUNCH_TEMPLATE: EntityColumn = { labelName: 'Cloud Service Provider ID', name: 'cloud_context', type: 'default' };

// Template for displaying the Launch template in VMware.
const VMWARE_LAUNCH_TEMPLATE_LIST: EntityColumn[] = [];

const DEFAULT_VMWARE_LAUNCH_TEMPLATE: EntityColumn = { labelName: 'Cloud Service Provider ID', name: 'cloud_context', type: 'default' };

/**
 * Get LaunchTemplateColumnList by cloud_context.
 *
@@ -64,6 +69,13 @@ const getLaunchTemplateColumnList = (cloudContext: CloudContext): EntityColumn[]
          DEFAULT_OPENSTACK_LAUNCH_TEMPLATE,
          ...OPENSTACK_LAUNCH_TEMPLATE_LIST
        ];
    case 'vmware':
      return cloudContext.name !== 'ALL'
        ? VMWARE_LAUNCH_TEMPLATE_LIST
        : [
          DEFAULT_VMWARE_LAUNCH_TEMPLATE,
          ...VMWARE_LAUNCH_TEMPLATE_LIST
        ];
  }
};

+71 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/menu_template.json: 71 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1879,5 +1879,76 @@
        }
      ]
    }
  ],
  [
    {
      "cloudServiceProvider": "vmware",
      "labelName": "Hosts",
      "entityName": "host",
      "entityColumn": [
        {
          "labelName": "Name",
          "name": "name",
          "type": "default"
        },
        {
          "labelName": "Host",
          "name": "host",
          "type": "default"
        },
        {
          "labelName": "Power State",
          "name": "power_state",
          "type": "default"
        },
        {
          "labelName": "Connection State",
          "name": "connection_state",
          "type": "default"
        },
        {
          "labelName": "Created",
          "name": "created",
          "type": "datetime"
        }
      ]
    },
    {
      "cloudServiceProvider": "vmware",
      "labelName": "VMs",
      "entityName": "vm",
      "entityColumn": [
        {
          "labelName": "Name",
          "name": "name",
          "type": "default"
        },
        {
          "labelName": "VM ID",
          "name": "vm_id",
          "type": "default"
        },
        {
          "labelName": "State",
          "name": "power_state",
          "type": "default"
        },
        {
          "labelName": "CPU Count",
          "name": "cpu_count",
          "type": "default"
        },
        {
          "labelName": "Memory Size (MiB)",
          "name": "memory_size",
          "type": "default"
        },
        {
          "labelName": "Created",
          "name": "created",
          "type": "datetime"
        }
      ]
    }
  ]
]
+11 −1
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/menu_template.ts: 11 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -11,7 +11,15 @@ const K8S_MENU_LIST = menu_template[1] as MenuTemplate[];
// Template for displaying a list of entities in OpenStack.
const OPENSTACK_MENU_LIST = menu_template[2] as MenuTemplate[];

export const MENU_TEMPLATE_LIST = [...AWS_MENU_LIST, ...K8S_MENU_LIST, ...OPENSTACK_MENU_LIST];
// Template for displaying a list of entities in VMware.
const VMWARE_MENU_LIST = menu_template[3] as MenuTemplate[];

export const MENU_TEMPLATE_LIST = [
  ...AWS_MENU_LIST,
  ...K8S_MENU_LIST,
  ...OPENSTACK_MENU_LIST,
  ...VMWARE_MENU_LIST
];

export const getMenuTemplateList = (cloudServiceProvider: CloudServiceProvider) => {
  switch (cloudServiceProvider) {
@@ -21,5 +29,7 @@ export const getMenuTemplateList = (cloudServiceProvider: CloudServiceProvider)
      return K8S_MENU_LIST;
    case 'openstack':
      return OPENSTACK_MENU_LIST;
    case 'vmware':
      return VMWARE_MENU_LIST;
  }
}
+2 −1
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/other.ts: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -26,8 +26,9 @@ export const DEFAULT_CLOUD_CONTEXTS: CloudContext[] = [
  { cloudServiceProvider: 'aws_cloud', name: 'ALL', labelName: 'AWS Cloud (ALL)' },
  { cloudServiceProvider: 'k8s', name: 'ALL', labelName: 'K8s (ALL)' },
  { cloudServiceProvider: 'openstack', name: 'ALL', labelName: 'OpenStack (ALL)' },
  { cloudServiceProvider: 'vmware', name: 'ALL', labelName: 'VMware (ALL)' },
];

export const CLOUD_SERVICE_PROVIDER_LIST: CloudServiceProvider[] = [
  'aws_cloud', 'k8s', 'openstack',
  'aws_cloud', 'k8s', 'openstack', 'vmware',
];
+2 −0
Changes for modules/cloud_dashboard/cloud_dashboard/src/constant/project_template.ts: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ export const getProjectColumnList = (cloudContext: CloudContext): EntityColumn[]
      return [];
    case 'openstack':
      return [];
    case 'vmware':
      return [];
    case 'k8s':
      return cloudContext.name !== 'ALL'
        ? K8S_PROJECT_TEMPLATE_LIST
Loading