35d65c7c7e
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>
20 lines
480 B
JavaScript
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;
|
|
}
|
|
}
|
|
}
|