changeset 1388:df30521b2c0b

importqueue: refreshbutton
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 27 Nov 2018 16:41:07 +0100
parents 13c6d44cf604
children d872b0a6567a
files client/src/components/admin/Importqueue.vue
diffstat 1 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/admin/Importqueue.vue	Tue Nov 27 16:02:58 2018 +0100
+++ b/client/src/components/admin/Importqueue.vue	Tue Nov 27 16:41:07 2018 +0100
@@ -48,6 +48,9 @@
                 </tr>
               </tbody>
             </table>
+            <div>
+              <button @click="refresh" class="btn btn-info refresh">Refresh</button>
+            </div>
           </div>
         </div>
       </div>
@@ -100,6 +103,21 @@
         this.accepted = false;
         this.rejected = false;
       }
+    },
+    loadQueue() {
+      this.$store.dispatch("imports/getImports").catch(error => {
+        const { status, data } = error.response;
+        displayError({
+          title: "Backend Error",
+          message: `${status}: ${data.message || data}`
+        });
+      });
+    },
+    mounted() {
+      this.loadQueue();
+    },
+    refresh() {
+      this.loadQueue();
     }
   },
   computed: {
@@ -179,20 +197,16 @@
         "btn-dark": this.accepted
       };
     }
-  },
-  mounted() {
-    this.$store.dispatch("imports/getImports").catch(error => {
-      const { status, data } = error.response;
-      displayError({
-        title: "Backend Error",
-        message: `${status}: ${data.message || data}`
-      });
-    });
   }
 };
 </script>
 
 <style lang="sass" scoped>
+.refresh
+  position: absolute
+  right: $offset
+  bottom: $offset
+
 .spacer
   height: 100vh