changeset 3198:b0328646e34f

statistics: include los selection
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 08 May 2019 15:26:59 +0200
parents 9d38df37c1f8
children 25a26f666ee8
files client/src/components/Statistics.vue client/src/store/diagram.js
diffstat 2 files changed, 27 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Statistics.vue	Wed May 08 15:08:27 2019 +0200
+++ b/client/src/components/Statistics.vue	Wed May 08 15:26:59 2019 +0200
@@ -59,6 +59,14 @@
             </select>
           </div>
           <div class="d-flex flex-column mb-3">
+            <small class="my-auto text-muted"><translate>LOS</translate></small>
+            <select v-model="los" class="form-control">
+              <option value="1">1</option>
+              <option value="2">2</option>
+              <option value="3">3</option>
+            </select>
+          </div>
+          <div class="d-flex flex-column mb-3">
             <small for="from" class="my-auto text-muted"
               ><translate>Date from</translate></small
             ><input
@@ -123,7 +131,8 @@
           feature: this.selectedFairwayAvailabilityFeature,
           from: this.from,
           to: this.to,
-          frequency: this.frequency
+          frequency: this.frequency,
+          LOS: this.los
         })
         .then(() => {
           this.loading = false;
@@ -179,7 +188,8 @@
       "selectedFairwayAvailabilityFeature",
       "from",
       "to",
-      "frequency"
+      "frequency",
+      "LOS"
     ]),
     ...mapState("imports", ["stretches"]),
     ...mapState("bottlenecks", ["bottlenecksList", "selectedBottleneck"]),
@@ -192,6 +202,14 @@
         this.selectedFairwayAvailabilityFeature == null
       );
     },
+    los: {
+      get() {
+        return this.LOS;
+      },
+      set(value) {
+        this.$store.commit("diagram/setLOS", value);
+      }
+    },
     fromDate: {
       get() {
         return this.from;
--- a/client/src/store/diagram.js	Wed May 08 15:08:27 2019 +0200
+++ b/client/src/store/diagram.js	Wed May 08 15:26:59 2019 +0200
@@ -28,7 +28,8 @@
     to: null,
     frequency: null,
     fwData: null,
-    legend: null
+    legend: null,
+    LOS: null
   };
 };
 
@@ -37,6 +38,9 @@
   namespaced: true,
   state: init(),
   mutations: {
+    setLOS: (state, LOS) => {
+      state.LOS = LOS;
+    },
     setFrequency: (state, frequency) => {
       state.frequency = frequency;
     },
@@ -63,12 +67,12 @@
   actions: {
     loadAvailableFairwayDepth: ({ commit }, options) => {
       return new Promise((resolve, reject) => {
-        const { feature, from, to, frequency } = options;
+        const { feature, from, to, frequency, LOS } = options;
         const start = encodeURIComponent("00:00:00+07:00");
         const end = encodeURIComponent("23:59:59+07:00");
         const URL = `/data/bottleneck/fairway-depth/${encodeURIComponent(
           feature.properties.name
-        )}?from=${from}T${start}&to=${to}T${end}&mode=${frequency}`;
+        )}?from=${from}T${start}&to=${to}T${end}&mode=${frequency}&los=${LOS}`;
         HTTP.get(URL, {
           headers: { "X-Gemma-Auth": localStorage.getItem("token") }
         })