ui: Add 'self-managed' badge when CONSUL_HCP_MANAGED_RUNTIME=self (#14496)

This commit is contained in:
John Cowen 2022-09-08 11:45:20 +01:00 committed by GitHub
parent efb2ecbb2e
commit 84039e3d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 5 deletions

View File

@ -58,6 +58,9 @@
{{else}}
<div class="dc-name" data-test-datacenter-single>
{{@dcs.firstObject.Name}}
{{#if (env 'CONSUL_HCP_MANAGED_RUNTIME')}}
<span>Self-managed</span>
{{/if}}
</div>
{{/if}}
</li>

View File

@ -13,6 +13,17 @@
nav .dcs li.is-local span {
@extend %menu-panel-badge;
}
nav .dcs .dc-name {
color: rgb(var(--tone-gray-600));
padding: 3.25px 0px;
font-weight: var(--typo-weight-semibold)
}
nav .dcs .dc-name span {
@extend %pill-200;
margin-left: 1rem;
background-color: rgb(var(--tone-gray-300));
color: rgb(var(--tone-gray-999));
}
nav li.partitions,
nav li.nspaces {
@extend %main-nav-vertical-popover-menu;
@ -50,11 +61,6 @@
top: 2px;
margin-left: 2px;
}
.dc-name {
color: rgb(var(--tone-gray-600));
padding: 3.25px 0px;
font-weight: var(--typo-weight-semibold)
}
}
.hashicorp-consul {
@extend %hashicorp-consul;

View File

@ -132,6 +132,8 @@ export default function(config = {}, win = window, doc = document) {
return operatorConfig.LocalDatacenter;
case 'CONSUL_DATACENTER_PRIMARY':
return operatorConfig.PrimaryDatacenter;
case 'CONSUL_HCP_MANAGED_RUNTIME':
return operatorConfig.HCPManagedRuntime;
case 'CONSUL_API_PREFIX':
// we want API prefix to look like an env var for if we ever change
// operator config to be an API request, we need this variable before we
@ -267,6 +269,7 @@ export default function(config = {}, win = window, doc = document) {
case 'CONSUL_UI_CONFIG':
case 'CONSUL_DATACENTER_LOCAL':
case 'CONSUL_DATACENTER_PRIMARY':
case 'CONSUL_HCP_MANAGED_RUNTIME':
case 'CONSUL_API_PREFIX':
case 'CONSUL_HCP_URL':
case 'CONSUL_ACLS_ENABLED':