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

Fix foldering when folder does not exist

parent 7d9764e9
Branches
3 merge requests!40Release First Version,!36Feature foldering,!21Add dockerize
Pipeline #24424 passed with stage
in 49 seconds
...@@ -49,15 +49,34 @@ export default { ...@@ -49,15 +49,34 @@ export default {
var urlGet = '/api/image/datasets' var urlGet = '/api/image/datasets'
const response = await this.$axios.get(urlGet).catch((error) => console.error(error)) const response = await this.$axios.get(urlGet).catch((error) => console.error(error))
if (response.data.status === "success") { if (response.data.status === "success") {
response.data.data.forEach((dataset) => { if (response.data.data) {
var key = "value" response.data.data.forEach((dataset) => {
var obj = {} var key = "value"
obj[key] = dataset var obj = {}
this.config.options.push(obj) obj[key] = dataset
}) this.config.options.push(obj)
})
}
} }
if (this.dropdownValue) { if (this.dropdownValue) {
this.config.placeholder = this.dropdownValue this.config.placeholder = this.dropdownValue
} else {
if (!this.isFolderNotExist()) {
if (this.isUpload) {
this.config.placeholder = this.config.options[1].value
} else {
this.config.placeholder = this.config.options[0].value
}
this.dataset = this.config.placeholder
this.$emit("onDatasetChanged", this.dataset)
}
}
},
isFolderNotExist () {
if (this.isUpload) {
return this.config.options.length <= 1
} else {
return this.config.options.length <= 0
} }
}, },
async setNewSelectedOption(selectedOption) { async setNewSelectedOption(selectedOption) {
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
images: {}, images: {},
keyword: '', keyword: '',
isViewerActive: false, isViewerActive: false,
perPage: 3, perPage: 12,
totalRows: 0, totalRows: 0,
page: 1, page: 1,
timer: '', timer: '',
...@@ -243,6 +243,7 @@ export default { ...@@ -243,6 +243,7 @@ export default {
.slot-margin { .slot-margin {
margin-left: 1.5rem; margin-left: 1.5rem;
margin-top: -0.15rem;
} }
.flex-display { .flex-display {
......
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