<commit_before>import { ReactiveVar } from 'meteor/reactive-var'
import { Template } from 'meteor/templating';

Template.dashboard.onCreated(function () {
  // Get reference to template instance
  const templateInstance = this;

  // Create reactive variable for Elasticsearch host
  templateInstance.elasticsearchHost = new ReactiveVar();

  // Handle changes to Elasticsearch host
  templateInstance.autorun(function () {
    // Get value of Elasticsearch host
    const host = templateInstance.elasticsearchHost.get();

    console.log(host);
  });
});

Template.dashboard.events({
  'submit #elasticsearch-host' (event, templateInstance) {
    // prevent default form action
    event.preventDefault();

    // Get Elasticsearch host from form
    const host = event.target.host.value;

    // Update Elasticsearch host reactive variable
    templateInstance.elasticsearchHost.set(host);
  }
});<commit_msg>Call getElasticsearchData when host changes<commit_after>import { ReactiveVar } from 'meteor/reactive-var'
import { Template } from 'meteor/templating';

Template.dashboard.onCreated(function () {
  // Get reference to template instance
  const templateInstance = this;

  // Create reactive variable for Elasticsearch host
  templateInstance.elasticsearchHost = new ReactiveVar();

  // Handle changes to Elasticsearch host
  templateInstance.autorun(function () {
    // Get value of Elasticsearch host
    const host = templateInstance.elasticsearchHost.get();

    if (host) {
      Meteor.call('getElasticsearchData', host);
    }
  });
});

Template.dashboard.events({
  'submit #elasticsearch-host' (event, templateInstance) {
    // prevent default form action
    event.preventDefault();

    // Get Elasticsearch host from form
    const host = event.target.host.value;

    // Update Elasticsearch host reactive variable
    templateInstance.elasticsearchHost.set(host);
  }
});
{'fraction_non_alphanumeric': 0.10157894736842105, 'fraction_numerical': 0.0, 'mean_word_length': 3.9505208333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1854935', 'n_tokens_mistral': 501, 'n_tokens_neox': 509, 'n_words': 137}