improve loading on site page
This commit is contained in:
parent
856f769cee
commit
aa90ed8cc4
|
@ -45,6 +45,7 @@ def import_worker():
|
|||
geofetures = []
|
||||
messages = []
|
||||
try:
|
||||
# The actual import.
|
||||
geojson_data, kml_conv_messages = kml_to_geojson(item['raw_kml'])
|
||||
messages.extend(kml_conv_messages)
|
||||
geofetures, typing_messages = geojson_to_geofeature(geojson_data)
|
||||
|
@ -61,7 +62,7 @@ def import_worker():
|
|||
messages.append(create_import_log_msg(f'{err_name}: {err_msg}'))
|
||||
log_to_db(msg, level=DatabaseLogLevel.ERROR, user_id=item['user_id'], source=DatabaseLogSource.IMPORT)
|
||||
traceback.print_exc()
|
||||
features = []
|
||||
features = [] # dummy data
|
||||
if success:
|
||||
features = [json.loads(x.model_dump_json()) for x in geofetures]
|
||||
with CursorFromConnectionFromPool(cursor_factory=RealDictCursor) as cursor:
|
||||
|
|
|
@ -38,6 +38,7 @@ export default {
|
|||
return {
|
||||
msg: "",
|
||||
importResponse: {},
|
||||
currentId: null,
|
||||
}
|
||||
},
|
||||
mixins: [authMixin],
|
||||
|
@ -53,10 +54,15 @@ export default {
|
|||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(async vm => {
|
||||
if (vm.currentId !== vm.id) {
|
||||
vm.msg = ""
|
||||
vm.importResponse = []
|
||||
vm.currentId = null
|
||||
axios.get('/api/data/item/import/get/' + vm.id).then(response => {
|
||||
if (!response.data.success) {
|
||||
vm.handleError(response.data.msg)
|
||||
} else {
|
||||
vm.currentId = vm.id
|
||||
if (Object.keys(response.data).length > 0) {
|
||||
vm.importResponse = response.data
|
||||
}
|
||||
|
@ -64,7 +70,8 @@ export default {
|
|||
}
|
||||
}).catch(error => {
|
||||
vm.handleError(error.message)
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
};
|
||||
|
|
|
@ -36,7 +36,6 @@ export default {
|
|||
file: null,
|
||||
disableUpload: false,
|
||||
uploadMsg: "",
|
||||
processQueue: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -78,10 +77,6 @@ export default {
|
|||
this.uploadMsg = error.response.data.msg
|
||||
}
|
||||
},
|
||||
async fetchQueueList() {
|
||||
const response = await axios.get('/api/data/item/import/get/mine')
|
||||
this.processQueue = response.data.data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue