github.com/hernad/nomad@v1.6.112/ui/app/components/variable-form/job-template-editor.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  // @ts-check
     7  import { action } from '@ember/object';
     8  import Component from '@glimmer/component';
     9  import { tracked } from '@glimmer/tracking';
    10  
    11  export default class JobTemplateEditor extends Component {
    12    @tracked description;
    13    @tracked template;
    14    @action
    15    establishKeyValues() {
    16      this.description = this.args.keyValues.findBy('key', 'description')?.value;
    17      this.template = this.args.keyValues.findBy('key', 'template')?.value;
    18    }
    19  
    20    @action
    21    updateDescription(event) {
    22      this.args.updateKeyValue('description', event.target.value);
    23    }
    24    @action
    25    updateTemplate(value) {
    26      this.args.updateKeyValue('template', value);
    27    }
    28  }