changeset 5356:3216b4a19023 extented-report

spinner added to info tool's download link for DQL reports
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 22 Jun 2021 14:44:34 +0200
parents 16c026da50b1
children 273de2f65985
files client/src/components/identify/Identify.vue
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/identify/Identify.vue	Tue Jun 22 14:40:59 2021 +0200
+++ b/client/src/components/identify/Identify.vue	Tue Jun 22 14:44:34 2021 +0200
@@ -187,6 +187,12 @@
       >
         <translate>Download</translate>
         <div class="d-flex flex-column">
+          <font-awesome-icon
+            v-if="loadingDQL"
+            icon="spinner"
+            :spin="true"
+            fixed-width
+          />
           <a
             v-if="DQLDownloadAllowed"
             href="#"
@@ -297,6 +303,7 @@
   name: "identify",
   data() {
     return {
+      loadingDQL: false,
       refGaugeStatus: "",
       gaugeStatus: "",
       gaugeCoeffs: null,
@@ -311,6 +318,7 @@
     ...mapState("gauges", ["gauges"]),
     ...mapGetters("user", ["isWaterwayAdmin", "isSysAdmin"]),
     DQLDownloadAllowed() {
+      if (this.loadingDQL) return false;
       return this.isWaterwayAdmin || this.isSysAdmin;
     },
     identifiedLabel() {
@@ -422,6 +430,7 @@
   },
   methods: {
     downloadDataQualityReport() {
+      this.loadingDQL = true;
       HTTP.get(`/data/report/default`, {
         responseType: "blob",
         headers: {
@@ -447,6 +456,9 @@
             title: this.$gettext("Backend Error"),
             message: message
           });
+        })
+        .finally(() => {
+          this.loadingDQL = false;
         });
     },
     getGaugeStatusText(feature) {