github.com/hernad/nomad@v1.6.112/ui/app/components/job-page/parts/summary-chart.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  // @ts-check
     7  import Component from '@glimmer/component';
     8  import { action } from '@ember/object';
     9  import { camelize } from '@ember/string';
    10  import { inject as service } from '@ember/service';
    11  
    12  export default class JobPagePartsSummaryChartComponent extends Component {
    13    @service router;
    14  
    15    @action
    16    gotoAllocations(status) {
    17      this.router.transitionTo('jobs.job.allocations', this.args.job, {
    18        queryParams: {
    19          status: JSON.stringify(status),
    20          namespace: this.args.job.get('namespace.name'),
    21        },
    22      });
    23    }
    24  
    25    @action
    26    onSliceClick(ev, slice) {
    27      this.gotoAllocations([camelize(slice.label)]);
    28    }
    29  }