open-nomad/ui/app/components/job-service-row.js
2023-04-10 15:36:59 +00:00

28 lines
677 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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;
}
}