# HG changeset patch # User Thomas Junk # Date 1550140227 -3600 # Node ID dedd7bbee846f59337e657ee87ce73df99e7128e # Parent c5bbe2409a52ac33ddf069cc80d694b1713d07a2 testclient: ufa, vgm implemented diff -r c5bbe2409a52 -r dedd7bbee846 client/src/components/importschedule/Importscheduledetail.vue --- a/client/src/components/importschedule/Importscheduledetail.vue Thu Feb 14 11:21:33 2019 +0100 +++ b/client/src/components/importschedule/Importscheduledetail.vue Thu Feb 14 11:30:27 2019 +0100 @@ -93,7 +93,10 @@ @@ -140,7 +143,9 @@ :depth="depth" > @@ -516,6 +521,8 @@ directImportAvailable() { switch (this.import_) { case this.$options.IMPORTTYPES.BOTTLENECK: + case this.$options.IMPORTTYPES.FAIRWAYAVAILABILITY: + case this.$options.IMPORTTYPES.GAUGEMEASUREMENT: return true; default: return false; @@ -663,11 +670,26 @@ this.day = null; this.dayOfMonth = null; }, - triggerBottleneckFileUpload() { + triggerFileUpload() { if (!this.uploadFile) return; let formData = new FormData(); - formData.append("ubn", this.uploadFile); - HTTP.post("/imports/ubn", formData, { + let routeParam = ""; + switch (this.import_) { + case this.$options.IMPORTTYPES.BOTTLENECK: + routeParam = "ubn"; + break; + case this.$options.IMPORTTYPES.FAIRWAYAVAILABILITY: + routeParam = "ufa"; + break; + case this.$options.IMPORTTYPES.GAUGEMEASUREMENT: + routeParam = "ugm"; + break; + default: + throw new Error("invalid importroute"); + } + + formData.append(routeParam, this.uploadFile); + HTTP.post("/imports/" + routeParam, formData, { headers: { "X-Gemma-Auth": localStorage.getItem("token"), "Content-Type": "multipart/form-data" @@ -701,7 +723,7 @@ if (!this.import_) return; if (this.directImport) { if (!this.uploadFile) return; - this.triggerBottleneckFileUpload(); + this.triggerFileUpload(); return; } let data = {};