github.com/hernad/nomad@v1.6.112/ui/app/components/metadata-kv.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  <tr data-test-attributes-section>
     7    {{#if this.editing}}
     8      <td colspan="2">
     9        <MetadataEditor
    10          @kv={{hash key=this.prefixedKey value=this.value}}
    11          @onEdit={{this.onEdit}}
    12          @constantKey={{true}}
    13          @autofocusValue={{true}}
    14          >
    15          <button
    16            data-test-update-metadata
    17            disabled={{or (not @key) (not @value)}}
    18            type="submit"
    19            class="button is-primary"
    20            {{on "click" (queue
    21              (action @onKVSave (hash key=this.prefixedKey value=this.value))
    22              (action (mut this.editing) false)
    23            )}}
    24          >
    25            Update {{this.prefixedKey}}
    26          </button>
    27          <button
    28            data-test-delete-metadata
    29            type="button"
    30            class="button is-danger"
    31            {{on "click" (queue
    32              (action @onKVSave (hash key=this.prefixedKey value=null))
    33              (action (mut this.editing) false)
    34            )}}
    35          >
    36            Delete Property
    37          </button>
    38          <button
    39            data-test-cancel-metadata
    40            type="button"
    41            class="button"
    42            {{on "click" 
    43              (queue
    44                (action (mut this.editing) false)
    45                (action (mut this.value) @value)
    46              )
    47            }}
    48          >
    49            Cancel
    50          </button>
    51        </MetadataEditor>
    52      </td>
    53    {{else}}
    54      <td data-test-key>
    55        {{#if @prefix}}<span class="is-faded" data-test-prefix>{{@prefix}}.</span>{{/if}}
    56        {{~@key}}
    57      </td>
    58      <td title="{{@value}}">
    59        <CopyButton
    60          @inset={{true}}
    61          @compact={{true}}
    62          @clipboardText={{@value}}
    63        />
    64        <span data-test-value>{{@value}}</span>
    65        {{#if @editable}}
    66        <button class="button is-light is-compact edit-existing-metadata-button" type="button"
    67          {{on "click" (action (mut this.editing) true)}}
    68          
    69        >Edit</button>
    70        {{/if}}
    71      </td>
    72    {{/if}}
    73  </tr>