Skip to content
Snippets Groups Projects
Commit a411dce6 authored by Edward Alexander Jaya's avatar Edward Alexander Jaya
Browse files

Fix searching on collab

parent 56046fb7
Branches
5 merge requests!40Release First Version,!31Output feature,!26Feature collab,!25Feature collab,!21Add dockerize
Pipeline #23251 passed with stage
in 44 seconds
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
images: {}, images: {},
keyword: '', keyword: '',
isViewerActive: false, isViewerActive: false,
perPage: 2, perPage: 12,
totalRows: 0, totalRows: 0,
page: 1, page: 1,
timer: '', timer: '',
...@@ -129,6 +129,7 @@ export default { ...@@ -129,6 +129,7 @@ export default {
this.updateUI = !this.updateUI this.updateUI = !this.updateUI
}, },
async getAllImagesWithLabelStatus() { async getAllImagesWithLabelStatus() {
this.images = {}
await this.getAllImages(this.perPage, this.page, this.keyword) await this.getAllImages(this.perPage, this.page, this.keyword)
await this.getImageCurrentlyBeingLabelled() await this.getImageCurrentlyBeingLabelled()
}, },
...@@ -149,19 +150,28 @@ export default { ...@@ -149,19 +150,28 @@ export default {
throw error throw error
} }
}, },
openViewer (image) { async openViewer (image) {
console.log(image) console.log(image)
if (!image.isCurrentlyLabeled) { if (!image.isCurrentlyLabeled) {
this.$router.push({ path: '/viewer', query: { url: image.url, id: image.id }}) var url = '/api/accesscontrol/' + image.id
try {
await this.$axios.get(url)
alert("This image is currently Labeled")
} catch (e) {
this.$router.push({ path: '/viewer', query: { url: image.url, id: image.id }})
}
} }
}, },
debounceWrapper (e) { debounceWrapper (e) {
this.page = 1 this.page = 1
this.keyword = e.target.value
// alert(this.keyword)
this.debounceInput(e) this.debounceInput(e)
}, },
// Only fires when user stops typing // Only fires when user stops typing
debounceInput: debounce(async function (e) { debounceInput: debounce(async function () {
await this.getAllImages(this.perPage, this.page, e.target.value) await this.getAllImagesWithLabelStatus()
// await this.getAllImages(this.perPage, this.page, e.target.value)
}, 500) }, 500)
} }
} }
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
}, },
async created () { async created () {
await this.startHeartBeat() await this.startHeartBeat()
this.timer = setInterval(this.startHeartBeat, 5000) this.timer = setInterval(this.startHeartBeat, 90000)
}, },
mounted () { mounted () {
this.image.url = this.$route.query.url this.image.url = this.$route.query.url
...@@ -101,7 +101,6 @@ export default { ...@@ -101,7 +101,6 @@ export default {
} catch(error) { } catch(error) {
console.log(error) console.log(error)
} }
clearInterval(this.timer) clearInterval(this.timer)
}, },
methods: { methods: {
...@@ -113,10 +112,17 @@ export default { ...@@ -113,10 +112,17 @@ export default {
} catch (error) { } catch (error) {
this.showFailedAlert("An error occured", error) this.showFailedAlert("An error occured", error)
await this.closeViewer() await this.closeViewer()
} }
},
handler () {
alert("tET")
}, },
async closeViewer () { async closeViewer () {
await this.deleteImageAccessControlByImageID(this.image.id) try {
await this.deleteImageAccessControlByImageID(this.image.id)
} catch (error) {
console.log(error)
}
this.$router.push('/main/label') this.$router.push('/main/label')
}, },
onMouseDownHandler (e) { onMouseDownHandler (e) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment