ui: Add `Service.Namespace` variable to dashboard URL templates (#11640)

We currently allow only Datacenter, Service.Name, this PR adds Service.Namespace.
This commit is contained in:
John Cowen 2021-11-25 10:47:07 +00:00 committed by GitHub
parent 124fa8f168
commit 635d773ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 8 deletions

3
.changelog/11640.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Include `Service.Namespace` into available variables for `dashboard_url_templates`
```

View File

@ -186,10 +186,16 @@ as |items item dc|}}
}}
as |config|>
{{#if config.data.dashboard_url_templates.service}}
<a href={{render-template config.data.dashboard_url_templates.service (hash
<a
href={{render-template config.data.dashboard_url_templates.service
(hash
Datacenter=dc.Name
Service=(hash Name=item.Service.Service)
)}}
Service=(hash
Name=item.Service.Service
Namespace=(or item.Service.Namespace '')
)
)
}}
target="_blank"
rel="noopener noreferrer"
data-test-dashboard-anchor

View File

@ -103,10 +103,15 @@ as |nspace dc items topology|}}
@service={{items.firstObject}}
@topology={{topology}}
@metricsHref={{render-template config.data.dashboard_url_templates.service (hash
@metricsHref={{render-template config.data.dashboard_url_templates.service
(hash
Datacenter=dc.Name
Service=items.firstObject
)}}
Service=(hash
Name=items.firstObject.Name
Namespace=(or items.firstObject.Namespace '')
)
)
}}
@isRemoteDC={{not dc.Local}}
@hasMetricsProvider={{gt config.data.metrics_provider.length 0}}
@oncreate={{route-action 'createIntention'}}