<commit_before><template>
  <div>
    <h3>{{ $t('message.webhookPageTitle') }}</h3>
    <div class="row">
      <div class="col-xs-12">
        <div class="artifact-grid row row-flex row-flex-wrap">
          <div class="col-sm-4">
            <div class="card" style="width:100%; min-height: 500px">
              <div class="card-header">
                <a class="btn btn-sm btn-success fr" @click="addNewHook">{{ $t('message.addWebhookBtn') }}</a>
                <h5 style="margin:0;">{{ $t('message.webhookListTitle') }}</h5>
              </div>
              <hr>
              <div class="card-content" style="margin-top: 0; padding-top: 0;">
                <table class="table table-striped">
                  <thead>
                  <tr>
                    <th scope="col">{{ $t('message.webhookListNameHdr') }}</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr v-for="hook in webhooks" :key="hook.id" @click="select(hook)" class="clickable"
                      v-bind:class="{selected: curHook === hook}">
                    <td>
                      <div>{{hook.name}} <i class="far fa-clipboard fr clip" @click="copyUrl(hook.id, $event)" @mouseover="toggleUrl(hook.id,true)" @mouseout="toggleUrl(hook.id,false)" title="Copy Url To Clipboard">
                        <div v-bind:id="'whc-'+hook.id" class="post-url-copy">{{generatePostUrl(hook)}}</div>
                      </i>
                      </div>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
          <div class="col-sm-8 details-output">
            <div class="flex-col">
              <div class="card">
                <div class="card-header">
                  <h5 style="margin:0;">{{ $t('message.webhookDetailTitle') }}</h5>
                </div>
                <hr>
                <div class="card-content">
                  <div v-if="curHook">
                    <div class="form-group"><label>{{ $t('message.webhookPostUrlLabel') }}</label><span class="form-control fc-span-adj">{{postUrl}}</span>
                    </div>
                    <div class="form-group"><label>{{ $t('message.webhookNameLabel') }}</label><input v-model="curHook.name" class="form-control"></div>
                    <div class="form-group"><label>{{ $t('message.webhookUserLabel') }}</label>
                      <input v-model="curHook.user" class="form-control" v-if="curHook.isNew">
                      <span class="form-control readonly fc-span-adj" v-else>{{curHook.user}}</span>
                    </div>
                    <div class="form-group"><label>{{ $t('message.webhookRolesLabel') }}</label><input v-model="curHook.roles" class="form-control"></div>
                    <div class="form-group"><label>{{ $t('message.webhookEventPluginLabel') }}</label><select v-model="curHook.eventPlugin"
                                                                     @change="setSelectedPlugin()" class="form-control">
                      <option v-for="plugin in webhookPlugins" :key="plugin.name" v-bind:value="plugin.name">{{plugin.title}}</option>
                    </select></div>
                    <div class="row">
                      <div class="col-sm-3 form-margin"><label>{{ $t('message.webhookEnabledLabel') }}</label></div>
                      <div class="col-sm-5">
                        <div class="checkbox"><input type="checkbox" v-model="curHook.enabled" class="form-control"><label></label></div>
                      </div>
                    </div>
                    <div v-if="selectedPlugin && showPluginConfig">
                      <h5>{{ $t('message.webhookPluginCfgTitle') }}</h5>
                      <hr>
                      <plugin-config
                        :mode="'edit'"
                        :serviceName="'WebhookEvent'"
                        v-model="selectedPlugin"
                        :provider="curHook.eventPlugin"
                        :key="curHook.name"
                        :show-title="false"
                        :show-description="false"
                        v-if="!customConfigComponent"
                      ><commit_msg>Hide URL when not available<commit_after><template>
  <div>
    <h3>{{ $t('message.webhookPageTitle') }}</h3>
    <div class="row">
      <div class="col-xs-12">
        <div class="artifact-grid row row-flex row-flex-wrap">
          <div class="col-sm-4">
            <div class="card" style="width:100%; min-height: 500px">
              <div class="card-header">
                <a class="btn btn-sm btn-success fr" @click="addNewHook">{{ $t('message.addWebhookBtn') }}</a>
                <h5 style="margin:0;">{{ $t('message.webhookListTitle') }}</h5>
              </div>
              <hr>
              <div class="card-content" style="margin-top: 0; padding-top: 0;">
                <table class="table table-striped">
                  <thead>
                  <tr>
                    <th scope="col">{{ $t('message.webhookListNameHdr') }}</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr v-for="hook in webhooks" :key="hook.id" @click="select(hook)" class="clickable"
                      v-bind:class="{selected: curHook === hook}">
                    <td>
                      <div>{{hook.name}} <i class="far fa-clipboard fr clip" @click="copyUrl(hook.id, $event)" @mouseover="toggleUrl(hook.id,true)" @mouseout="toggleUrl(hook.id,false)" title="Copy Url To Clipboard">
                        <div v-bind:id="'whc-'+hook.id" class="post-url-copy">{{generatePostUrl(hook)}}</div>
                      </i>
                      </div>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
          <div class="col-sm-8 details-output">
            <div class="flex-col">
              <div class="card">
                <div class="card-header">
                  <h5 style="margin:0;">{{ $t('message.webhookDetailTitle') }}</h5>
                </div>
                <hr>
                <div class="card-content">
                  <div v-if="curHook">
                    <div v-if="!curHook.isNew" class="form-group"><label>{{ $t('message.webhookPostUrlLabel') }}</label><span class="form-control fc-span-adj">{{postUrl}}</span>
                    </div>
                    <div class="form-group"><label>{{ $t('message.webhookNameLabel') }}</label><input v-model="curHook.name" class="form-control"></div>
                    <div class="form-group"><label>{{ $t('message.webhookUserLabel') }}</label>
                      <input v-model="curHook.user" class="form-control" v-if="curHook.isNew">
                      <span class="form-control readonly fc-span-adj" v-else>{{curHook.user}}</span>
                    </div>
                    <div class="form-group"><label>{{ $t('message.webhookRolesLabel') }}</label><input v-model="curHook.roles" class="form-control"></div>
                    <div class="form-group"><label>{{ $t('message.webhookEventPluginLabel') }}</label><select v-model="curHook.eventPlugin"
                                                                     @change="setSelectedPlugin()" class="form-control">
                      <option v-for="plugin in webhookPlugins" :key="plugin.name" v-bind:value="plugin.name">{{plugin.title}}</option>
                    </select></div>
                    <div class="row">
                      <div class="col-sm-3 form-margin"><label>{{ $t('message.webhookEnabledLabel') }}</label></div>
                      <div class="col-sm-5">
                        <div class="checkbox"><input type="checkbox" v-model="curHook.enabled" class="form-control"><label></label></div>
                      </div>
                    </div>
                    <div v-if="selectedPlugin && showPluginConfig">
                      <h5>{{ $t('message.webhookPluginCfgTitle') }}</h5>
                      <hr>
                      <plugin-config
                        :mode="'edit'"
                        :serviceName="'WebhookEvent'"
                        v-model="selectedPlugin"
                        :provider="curHook.eventPlugin"
                        :key="curHook.name"
                        :show-title="false"
                        :show-description="false"
                        v-if="!customConfigComponent"
                      >
{'fraction_non_alphanumeric': 0.17128228996974634, 'fraction_numerical': 0.005585292064230859, 'mean_word_length': 1.511689070718878, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 201, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2369040', 'n_tokens_mistral': 2460, 'n_tokens_neox': 2284, 'n_words': 385}