diff --git a/webui/src/App.vue b/webui/src/App.vue index ae4a665..acfa02c 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -26,20 +26,20 @@ export default { // Leave response as is return response; }, error => { - if (error.response != undefined) { + if (error.response.status != 0) { // If the response is 401, redirect to /login if (error.response.status === 401) { this.$router.push({ path: '/login' }) - return + return; } // Show the error message from the server in a modal this.showModal("Error " + error.response.status, error.response.data['status']) - return + return; } // Show the error message from axios in a modal this.showModal("Error", error.toString()); - return error; + return; }); } } diff --git a/webui/src/services/axios.js b/webui/src/services/axios.js index 6835c5a..6a85b3d 100644 --- a/webui/src/services/axios.js +++ b/webui/src/services/axios.js @@ -3,7 +3,7 @@ import getCurrentSession from "./authentication"; const instance = axios.create({ baseURL: __API_URL__, - timeout: 1000 * 20 + timeout: 1000 * 60 }); //axios.interceptors.request.use(function (config) { diff --git a/webui/src/views/HomeView.vue b/webui/src/views/HomeView.vue index 018b269..1fa7fec 100644 --- a/webui/src/views/HomeView.vue +++ b/webui/src/views/HomeView.vue @@ -2,12 +2,12 @@ export default { data: function() { return { - errormsg: null, loading: false, stream_data: [], data_ended: false, start_idx: 0, limit: 1, + loadingError: false, } }, methods: { @@ -23,16 +23,18 @@ export default { }, async loadContent() { this.loading = true; - this.errormsg = null; - try { - let response = await this.$axios.get("/stream?start_index=" + this.start_idx + "&limit=" + this.limit); - if (response.data.length == 0) this.data_ended = true; - else this.stream_data = this.stream_data.concat(response.data); - this.loading = false; - } catch (e) { - // todo: handle better - this.errormsg = e.toString(); + + let response = await this.$axios.get("/stream?start_index=" + this.start_idx + "&limit=" + this.limit); + + if (response == null) { + this.loading = false + this.loadingError = true + return } + + if (response.data.length == 0) this.data_ended = true; + else this.stream_data = this.stream_data.concat(response.data); + this.loading = false; }, scroll () { window.onscroll = () => { @@ -58,8 +60,6 @@ export default {