Eric Tröbs 4 lat temu
rodzic
commit
c47bb6374a

+ 4 - 0
webui/src/assets/icons/check.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+    <path fill-rule="evenodd"
+          d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path>
+</svg>

+ 1 - 3
webui/src/components/media/annotated-image.vue

@@ -7,8 +7,7 @@
 
     <annotation-box v-if="current"
                     :image="image"
-                    :position="current"
-                    :immutable="true"/>
+                    :position="current"/>
 
     <annotation-box v-for="(result, index) in predictions"
                     :type="result.origin"
@@ -17,7 +16,6 @@
                     :image="image"
                     :position="result"
                     :socket="socket"
-                    :immutable="false"
                     :box-url="mediaUrl + '/' + result.id"
                     @resize="resize"/>
   </div>

+ 11 - 1
webui/src/components/media/annotation-box.vue

@@ -7,6 +7,7 @@
 
     <div class="buttons">
       <template v-if="!immutable">
+        <img v-if="confirmationButton" alt="confirm" src="@/assets/icons/check.svg" @click="confirmSelf">
         <img alt="delete" src="@/assets/icons/trash.svg" @click="deleteSelf">
       </template>
     </div>
@@ -21,8 +22,11 @@
 <script>
 export default {
   name: "annotation-box",
-  props: ['type', 'image', 'position', 'socket', 'immutable', 'boxUrl'],
+  props: ['type', 'image', 'position', 'socket', 'boxUrl'],
   computed: {
+    immutable: function () {
+      return !this.type;
+    },
     backgroundColor: function () {
       switch (this.type) {
         case 'user':
@@ -33,6 +37,9 @@ export default {
           return 'rgba(255, 255, 255, 0.3)';
       }
     },
+    confirmationButton: function () {
+      return this.type === 'pipeline';
+    },
     style: function () {
       const left = this.image.left;
       const top = this.image.top;
@@ -49,6 +56,9 @@ export default {
     }
   },
   methods: {
+    confirmSelf: function () {
+      this.updateSelf(this.position);
+    },
     deleteSelf: function () {
       this.socket.post(this.boxUrl, {delete: true, id: this.id});
     },