open-nomad/ui/app/components/job-service-row.js
Phil Renaud a381ecaa09
[ui] Service Discovery: provide a quick link to the Consul UI if available (#14537)
* Test for aggregate service health and consul agg service health

* If a consul UI link is present, show a nice little link

* Also add to job services page

* Reallocate consul url in mock
2022-09-12 10:00:30 -04:00

23 lines
599 B
JavaScript

import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
export default class JobServiceRowComponent extends Component {
@service router;
@service system;
@action
gotoService(service) {
if (service.provider === 'nomad') {
this.router.transitionTo('jobs.job.services.service', service.name, {
queryParams: { level: service.level },
instances: service.instances,
});
}
}
get consulRedirectLink() {
return this.system.agent.get('config')?.UI?.Consul?.BaseUIURL;
}
}