AddCorpus.vue 3.52 KB
Newer Older
1
<template>
Quentin David's avatar
Quentin David committed
2
3
4
  <v-container flex fill-height>
    <v-tabs grow
      v-model="tab"
5
    >
Quentin David's avatar
Quentin David committed
6
7
8
9
      <v-tab
        v-for="item in tab_items"
        :key="item.tab"
      >
Quentin David's avatar
Quentin David committed
10
        {{ $t(item.tab) }}
Quentin David's avatar
Quentin David committed
11
      </v-tab>
12

Quentin David's avatar
Quentin David committed
13
14
      <v-tabs-items v-model="tab" class="my-4" vertical>
        <v-tab-item>
15
          <!-- Local files -->
Quentin David's avatar
Quentin David committed
16
17
18
19
20
          <v-card outlined height=8em>
            <v-card-text
              class="justify-center text-center"
            >
              <v-file-input
Quentin David's avatar
Quentin David committed
21
                :label="$t('local-file-label')"
Quentin David's avatar
Quentin David committed
22
                multiple
Quentin David's avatar
Quentin David committed
23
                :hint="$t('local-file-hint')"
Quentin David's avatar
Quentin David committed
24
25
26
27
28
29
30
31
                persistent-hint
                small-chips
              >
              </v-file-input>
            </v-card-text>
          </v-card>
        </v-tab-item>
        <v-tab-item>
32
          <!-- Input text -->
Quentin David's avatar
Quentin David committed
33
34
35
          <InputText />
        </v-tab-item>
        <v-tab-item>
36
          <!-- Profile text -->
Quentin David's avatar
Quentin David committed
37
38
39
          <v-card outlined height=8em>
            <v-card-text>
              <v-select :items="test_profile_corpus"
Quentin David's avatar
Quentin David committed
40
41
                :label="$t('profile-corpus-label')"
                :hint="$t('profile-corpus-hint')"
Quentin David's avatar
Quentin David committed
42
43
44
45
46
47
48
49
                persistent-hint
                outlined
              >
              </v-select>
            </v-card-text>
          </v-card>
        </v-tab-item>
        <v-tab-item>
50
          <!-- Shared corpus -->
Quentin David's avatar
Quentin David committed
51
52
53
54
55
          <v-card outlined height=8em>
            <v-card-text
              class="justify-center text-center"
            > 
              <v-select :items="test_common_corpus"
Quentin David's avatar
Quentin David committed
56
                :label="$t('shared-corpus-label')"
Quentin David's avatar
Quentin David committed
57
58
59
60
61
62
63
64
65
                outlined
              >
              </v-select>
            </v-card-text>
          </v-card>
        </v-tab-item>
      </v-tabs-items>
    </v-tabs>
  </v-container>
66
67
68
69
70
71
72
73
</template>
<script>
  import InputText from '@/components/DefineCorpus/InputText';

  export default {
      data: () => ({
          tab: null,
          tab_items: [
Quentin David's avatar
Quentin David committed
74
75
76
77
            { tab: 'local-file', content: 'Fichier local'},
            { tab: 'input-text', content: InputText},
            { tab: 'profile-corpus', content: 'Corpus du profil'},
            { tab: 'shared-corpus', content: 'Corpus partagé'},
78
79
80
          ],
          selected: null,
          test: { "fr": false, "en": false},
Quentin David's avatar
Quentin David committed
81
          test_profile_corpus: ["My_Corpus1","À la recherche du temps perdu", "Libé_1980_2010"],
82
          test_common_corpus: ["CommonCorpus1", "LIPN_Articles", "Sequoia","LaVoixDuNord_Solr"]
83
84
85
86
87
      }),
      components: {
        InputText,
      }
  }
Quentin David's avatar
Quentin David committed
88
89
90
91
92
93
94
95
96
97
98
99
</script>
<i18n>
{
  "fr":{
    "local-file":"Depuis un fichier local",
    "input-text":"Depuis un champ de texte",
    "profile-corpus":"Depuis un corpus du profil",
    "shared-corpus":"Depuis un corpus partagé",
    "local-file-label":"Choisissez un ou plusieurs fichiers",
    "local-file-hint":"Formats acceptés: PDF, TXT, ...",
    "profile-corpus-label":"Choisissez le corpus que vous voulez traiter",
    "profile-corpus-hint":"Vous pouvez définir vos corpora dans votre profil",
100
    "shared-corpus-label":"Choisissez le corpus que vous voulez traiter"
Quentin David's avatar
Quentin David committed
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  },
  "en":{
    "local-file":"From a local file",
    "input-text":"From a text field",
    "profile-corpus":"From a profile corpus",
    "shared-corpus":"From a shared corpus",
    "local-file-label":"Chose one or multiple files",
    "local-file-hint":"Accepted formats: PDF, TXT, ...",
    "profile-corpus-label":"Chose the corpus you want to process",
    "profile-corpus-hint":"You can define your corpora in your profile",
    "shared-corpus-label":"Chose the corpus you want to process"
  }
}
</i18n>