<commit_before><template>
  <div id="binder">
    <b-form-select v-model="selected" :options="binders" class="m-md-2">
    </b-form-select>
    から
    <b-form-input id="queryBox" v-model="query" type="text" placeholder="レシピ名"></b-form-input>
    を検索

    <b-table striped hover :items="recipes" :fields="fields" @row-clicked="showDetail">
      <template slot="recipe" scope="recipe">
        {{recipe.レシピ名}}
      </template>
    </b-table>

    <b-card header="レシピ情報" v-model="msg">
      {{msg}}
    </b-card>
  </div>
</template>

<script>
import _ from 'lodash'
import { baseURL, restCall } from './rest'

export default {
  name: 'binder',
  data: function() {
    return {
      msg: '',
      query: '',
      selected: '',
      binders: [],
      recipes: [],
      fields: {
        レシピ名: {
          label: 'レシピ名',
          sortable: true,
        }
      }
    }
  },
  watch: {
    query: function() {
      this.getRecipes()
    }
  },
  mounted: function() {
    var that = this;
    restCall('GET', baseURL+'/binders', function(xhr) {
      console.log("てすてす")
      if (xhr.readyState==4 && xhr.status==200) {
        var result = JSON.parse(xhr.response)
        that.binders = [{text: '全てのバインダー', value: '/recipes'}].concat(
          result['バインダー一覧'].map(function(b) { return { text: b.バインダー名, value: b.レシピ一覧 }; })
        )
        console.log("バインダー: "+that.binders)
      }
    })
  },
  methods: {
    getRecipes: _.debounce(
      function() {
        var that = this;
        restCall('GET', baseURL+this.selected+'?migemo=true&query='+this.query, function(xhr) {
          if (xhr.readyState==4 && xhr.status==200) {
            var result = JSON.parse(xhr.response)
            that.recipes = result['レシピ一覧'];
          }
        })
      },
      500
    ),
    showDetail: function(item, index) {
      this.msg = this.recipes[index].レシピ名
    },
  },
}
</script>
<commit_msg>デバッグ出力を削除<commit_after><template>
  <div id="binder">
    <b-form-select v-model="selected" :options="binders" class="m-md-2">
    </b-form-select>
    から
    <b-form-input id="queryBox" v-model="query" type="text" placeholder="レシピ名"></b-form-input>
    を検索

    <b-table striped hover :items="recipes" :fields="fields" @row-clicked="showDetail">
      <template slot="recipe" scope="recipe">
        {{recipe.レシピ名}}
      </template>
    </b-table>

    <b-card header="レシピ情報" v-model="msg">
      {{msg}}
    </b-card>
  </div>
</template>

<script>
import _ from 'lodash'
import { baseURL, restCall } from './rest'

export default {
  name: 'binder',
  data: function() {
    return {
      msg: '',
      query: '',
      selected: '',
      binders: [],
      recipes: [],
      fields: {
        レシピ名: {
          label: 'レシピ名',
          sortable: true,
        }
      }
    }
  },
  watch: {
    query: function() {
      this.getRecipes()
    }
  },
  mounted: function() {
    var that = this;
    restCall('GET', baseURL+'/binders', function(xhr) {
      if (xhr.readyState==4 && xhr.status==200) {
        var result = JSON.parse(xhr.response)
        that.binders = [{text: '全てのバインダー', value: '/recipes'}].concat(
          result['バインダー一覧'].map(function(b) { return { text: b.バインダー名, value: b.レシピ一覧 }; })
        )
      }
    })
  },
  methods: {
    getRecipes: _.debounce(
      function() {
        var that = this;
        restCall('GET', baseURL+this.selected+'?migemo=true&query='+this.query, function(xhr) {
          if (xhr.readyState==4 && xhr.status==200) {
            var result = JSON.parse(xhr.response)
            that.recipes = result['レシピ一覧'];
          }
        })
      },
      500
    ),
    showDetail: function(item, index) {
      this.msg = this.recipes[index].レシピ名
    },
  },
}
</script>

{'fraction_non_alphanumeric': 0.18252271512560128, 'fraction_numerical': 0.006413682522715126, 'mean_word_length': 2.2018819503849443, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4283334', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1392, 'n_words': 233}