Skip to content
Snippets Groups Projects
Commit 97cdf035 authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3072494 by Xiaohua Guan, yas: Check the cost of a Instance Type from...

Issue #3072494 by Xiaohua Guan, yas: Check the cost of a Instance Type from the ServerTemplate listing page
parent f7d0df79
No related branches found
No related tags found
No related merge requests found
......@@ -1287,6 +1287,15 @@ function aws_cloud_update_8175() {
], 'aws_cloud');
}
/**
* Change field_instance_type formatter to instance_type_link_formatter.
*/
function aws_cloud_update_8176() {
cloud_update_yml_definitions([
'core.entity_view_display.cloud_server_template.aws_cloud.default.yml',
], 'aws_cloud');
}
/**
* Helper function to add fields to the entity type.
*
......
......@@ -67,7 +67,7 @@ content:
label: inline
settings: { }
third_party_settings: { }
type: list_key
type: instance_type_link_formatter
region: content
field_kernel_id:
weight: 7
......
......@@ -2,6 +2,7 @@
namespace Drupal\aws_cloud\Controller\Ec2;
use Drupal\Core\Url;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityStorageInterface;
......@@ -138,7 +139,18 @@ class AwsCloudServerTemplateListBuilder extends CloudServerTemplateListBuilder {
}
// Instance type.
$row[] = $entity->get('field_instance_type')->value;
$instance_type = $entity->get('field_instance_type')->value;
$row[] = [
'data' => [
'#type' => 'link',
'#url' => Url::fromRoute(
'aws_cloud.instance_type_prices',
['cloud_context' => $entity->getCloudContext()],
['fragment' => $instance_type]
),
'#title' => $instance_type,
],
];
// Security groups.
$htmls = [];
......
......@@ -22,6 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* field_types = {
* "string",
* "uri",
* "list_string",
* }
* )
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment