open-nomad/ui/app/components/metadata-kv.js
Michael Schurter 35d65c7c7e
Dynamic Node Metadata (#15844)
Fixes #14617
Dynamic Node Metadata allows Nomad users, and their jobs, to update Node metadata through an API. Currently Node metadata is only reloaded when a Client agent is restarted.

Includes new UI for editing metadata as well.

---------

Co-authored-by: Phil Renaud <phil.renaud@hashicorp.com>
2023-02-07 14:42:25 -08:00

20 lines
480 B
JavaScript

import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class MetadataKvComponent extends Component {
@tracked editing = false;
@tracked value = this.args.value;
get prefixedKey() {
return this.args.prefix
? `${this.args.prefix}.${this.args.key}`
: this.args.key;
}
@action onEdit(event) {
if (event.key === 'Escape') {
this.editing = false;
}
}
}