diff --git a/finetuner/labeler/ui/index.html b/finetuner/labeler/ui/index.html index d2522b8ab..2dee7de8d 100644 --- a/finetuner/labeler/ui/index.html +++ b/finetuner/labeler/ui/index.html @@ -20,196 +20,41 @@ v-if="is_conn_broken"> Can not connect to the server on {{host_address}} Please check your connection. - +
-
-
-

Select all texts similar to:

-

{{get_content(doc)}}

-
-
-
    -
  • -
    - {{get_content(match)}} -
    {{matchIndex}}
    -
    - -
  • -
-
- -
+ +
-
-
-

Select all images similar to the image on left

- -
-
-
-
-
- -
-
{{matchIndex}}
-
-
-
- -
+ +
@@ -228,7 +73,10 @@

{{get_content(doc)}}

- + + + + \ No newline at end of file diff --git a/finetuner/labeler/ui/js/components/image-match-card.vue.js b/finetuner/labeler/ui/js/components/image-match-card.vue.js new file mode 100644 index 000000000..7b936bd1f --- /dev/null +++ b/finetuner/labeler/ui/js/components/image-match-card.vue.js @@ -0,0 +1,44 @@ +const imageMatchCard = { + props: { + doc: Object, + docIdx: Number, + getContent: Function, + toggleRelevance: Function, + invertSelection: Function, + submitDoc: Function, + }, + template: ` +
+
+

Select all images similar to the image on right

+ +
+
+
+
+
+ +
+
{{matchIndex}}
+
+
+
+ +
+ `, + mounted() { + } +} \ No newline at end of file diff --git a/finetuner/labeler/ui/js/components/sidebar.vue.js b/finetuner/labeler/ui/js/components/sidebar.vue.js new file mode 100644 index 000000000..14c46d1c2 --- /dev/null +++ b/finetuner/labeler/ui/js/components/sidebar.vue.js @@ -0,0 +1,141 @@ +const sidebar = { + props: { + labelerConfig : Object, + viewTemplate: Object, + tags: Array, + isBusy: Boolean, + progressStats: Object, + positiveRate: Number, + negativeRate: Number, + advancedConfig: Object, + }, + template: ` + + `, + mounted() { + console.log("sidebar is loaded") + } +} \ No newline at end of file diff --git a/finetuner/labeler/ui/js/components/text-match-card.vue.js b/finetuner/labeler/ui/js/components/text-match-card.vue.js new file mode 100644 index 000000000..d8b4b8530 --- /dev/null +++ b/finetuner/labeler/ui/js/components/text-match-card.vue.js @@ -0,0 +1,45 @@ +const textMatchCard = { + props: { + doc: Object, + docIdx: Number, + getContent: Function, + toggleRelevance: Function, + invertSelection: Function, + submitDoc: Function, + }, + template: ` +
+
+

Select all texts similar to:

+

{{getContent(doc)}}

+
+
+
    +
  • +
    + {{getContent(match)}} +
    {{matchIndex}}
    +
    + +
  • +
+
+ +
+ `, + mounted() { + } +} \ No newline at end of file diff --git a/finetuner/labeler/ui/main.js b/finetuner/labeler/ui/js/main.js similarity index 98% rename from finetuner/labeler/ui/main.js rename to finetuner/labeler/ui/js/main.js index 13f1b7d2f..8e4a9198d 100644 --- a/finetuner/labeler/ui/main.js +++ b/finetuner/labeler/ui/js/main.js @@ -2,6 +2,11 @@ const urlParams = new URLSearchParams(window.location.search); Vue.use(VueAwesomeSwiper) const app = new Vue({ el: '#app', + components: { + "sidebar": sidebar, + "image-match-card": imageMatchCard, + "text-match-card": textMatchCard, + }, data: { is_busy: false, is_conn_broken: false,