github.com/hernad/nomad@v1.6.112/ui/app/controllers/jobs/run/index.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import { getOwner } from '@ember/application';
     7  import Controller from '@ember/controller';
     8  import { action } from '@ember/object';
     9  import { inject as service } from '@ember/service';
    10  
    11  export default class RunController extends Controller {
    12    @service router;
    13  
    14    queryParams = ['template'];
    15  
    16    @action
    17    handleSaveAsTemplate() {
    18      getOwner(this)
    19        .lookup('controller:jobs.run')
    20        .setTemplate(this.model._newDefinition);
    21    }
    22  
    23    onSubmit(id, namespace) {
    24      this.router.transitionTo('jobs.job', `${id}@${namespace || 'default'}`);
    25    }
    26  }