From aecf8e22bad713f6413f48ab419028dce0227081 Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Sun, 9 Oct 2022 03:02:05 +0300 Subject: [PATCH] add: upload result modal --- frontend/src/components/UploadScreen.vue | 18 +++++++++++++++++- frontend/src/main.js | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/UploadScreen.vue b/frontend/src/components/UploadScreen.vue index c2db79c..9d40fd4 100644 --- a/frontend/src/components/UploadScreen.vue +++ b/frontend/src/components/UploadScreen.vue @@ -4,6 +4,7 @@
+ @@ -26,9 +27,24 @@ export default { .then(res => res.json()) .then(data => this.response = data) .catch((e) => console.log(e)) - .then(()=>console.log(this.response)) + .then(()=>this.showModal=!this.showModal) } }, + computed: { + result(){ + if (this.response.status === "Success") { + return { + status: "Success!", + message: `Accepted: ${this.response.accepted}\nProcessed: ${this.response.processed}\nProcessing time ${this.response.process_time}` + } + } else { + return { + status: "Failure!", + message: this.response.detail + } + } + }, + } } diff --git a/frontend/src/main.js b/frontend/src/main.js index 0f4cfcc..b5ad01b 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -28,6 +28,7 @@ import { VaProgressCircle, VaSlider, VaChip, + VaModal, } from 'vuestic-ui' import 'vuestic-ui/dist/styles/essential.css' import 'vuestic-ui/dist/styles/grid.css' @@ -70,6 +71,7 @@ app.use(createVuesticEssential({ VaProgressCircle, VaSlider, VaChip, + VaModal, } }));