-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display aws metadata frontend (#650)
* Implement the AWS cloud details frontend view * Add e2e AWS cloud details tests * Rename to provider details and handle unknown case * Make aws table acronyms uppercase
- Loading branch information
Showing
10 changed files
with
228 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
|
||
import ListView from '@components/ListView'; | ||
|
||
const AwsDetails = ({ provider, provider_data }) => { | ||
return ( | ||
<div className="mt-4 bg-white shadow rounded-lg py-4 px-8"> | ||
<ListView | ||
className="grid-rows-2" | ||
orientation="vertical" | ||
rows={2} | ||
data={[ | ||
{ | ||
title: 'Provider', | ||
content: provider, | ||
render: (content) => <p className="uppercase">{content}</p>, | ||
}, | ||
{ title: 'Instance type', content: provider_data?.instance_type }, | ||
{ title: 'Instance ID', content: provider_data?.instance_id }, | ||
{ | ||
title: 'Data disk number', | ||
content: provider_data?.data_disk_number, | ||
}, | ||
{ | ||
title: 'Account ID', | ||
content: provider_data?.account_id, | ||
}, | ||
{ title: 'AMI ID', content: provider_data?.ami_id }, | ||
{ | ||
title: 'Region', | ||
content: `${provider_data?.region} (${provider_data?.availability_zone})`, | ||
}, | ||
{ title: 'VPC ID', content: provider_data?.vpc_id }, | ||
]} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AwsDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
|
||
import ListView from '@components/ListView'; | ||
|
||
const AzureDetails = ({ provider, provider_data }) => { | ||
return ( | ||
<div className="mt-4 bg-white shadow rounded-lg py-4 px-8"> | ||
<ListView | ||
className="grid-rows-2" | ||
orientation="vertical" | ||
rows={2} | ||
data={[ | ||
{ | ||
title: 'Provider', | ||
content: provider, | ||
render: (content) => <p className="capitalize">{content}</p>, | ||
}, | ||
{ title: 'VM Size', content: provider_data?.vm_size }, | ||
{ title: 'VM Name', content: provider_data?.vm_name }, | ||
{ | ||
title: 'Data disk number', | ||
content: provider_data?.data_disk_number, | ||
}, | ||
{ | ||
title: 'Resource group', | ||
content: provider_data?.resource_group, | ||
}, | ||
{ title: 'Offer', content: provider_data?.offer }, | ||
{ title: 'Location', content: provider_data?.location }, | ||
{ title: 'SKU', content: provider_data?.sku }, | ||
]} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AzureDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import Pill from '@components/Pill'; | ||
|
||
import AzureDetails from './AzureDetails'; | ||
import AwsDetails from './AwsDetails'; | ||
|
||
const ProviderDetails = ({ provider, provider_data }) => { | ||
switch (provider) { | ||
case 'azure': | ||
return <AzureDetails provider={provider} provider_data={provider_data} />; | ||
case 'aws': | ||
return <AwsDetails provider={provider} provider_data={provider_data} />; | ||
default: | ||
return ( | ||
<Pill className="bg-gray-200 text-gray-800 shadow"> | ||
Provider not recognized | ||
</Pill> | ||
); | ||
} | ||
}; | ||
|
||
export default ProviderDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ures/scenarios/host-details/9cd46919-5f19-59aa-993e-cf3736c71053_cloud_discovery_aws.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"discovery_type": "cloud_discovery", | ||
"agent_id": "9cd46919-5f19-59aa-993e-cf3736c71053", | ||
"payload": { | ||
"Provider": "aws", | ||
"Metadata": { | ||
"account_id": "123456", | ||
"ami_id": "ami-12345", | ||
"availability_zone": "eu-west-1a", | ||
"data_disk_number": 1, | ||
"instance_id": "i-12345", | ||
"instance_type": "t3.micro", | ||
"region": "eu-west-1", | ||
"vpc_id": "vpc-12345" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
.../scenarios/host-details/9cd46919-5f19-59aa-993e-cf3736c71053_cloud_discovery_unknown.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"discovery_type": "cloud_discovery", | ||
"agent_id": "9cd46919-5f19-59aa-993e-cf3736c71053", | ||
"payload": { | ||
"Provider": "unknown", | ||
"Metadata": {} | ||
} | ||
} |