From 08b551201fe72e71fd031a22542439d3e1b70169 Mon Sep 17 00:00:00 2001 From: Fulgen301 Date: Sun, 16 Sep 2018 16:59:45 +0200 Subject: Initial adapt to LegacyClonk --- src/pages/UploadCreate.vue | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'src/pages/UploadCreate.vue') diff --git a/src/pages/UploadCreate.vue b/src/pages/UploadCreate.vue index 4b27725..c435a2f 100644 --- a/src/pages/UploadCreate.vue +++ b/src/pages/UploadCreate.vue @@ -43,7 +43,7 @@ @@ -61,7 +61,7 @@ -

Now please upload your mod files (e.g. the .ocs file). You have to upload at least one file

+

Now please upload your mod files (e.g. the .c4s file). You have to upload at least one file

@@ -83,9 +83,9 @@ - + {{ file.filename }} - {{ file._id }} + {{ file.id }} {{ file.length | prettyBytes }} uploaded {{ file.uploadDate|moment("from") }} @@ -110,13 +110,13 @@
- Successfully saved your mod with the id {{ savedScenario._id }} + Successfully saved your mod with the id {{ savedScenario.id }}
Upload another one + @click="$router.push({name: 'upload-detail', params: {uploadId: savedScenario.id}})"> Show the saved mod @@ -167,8 +167,8 @@ return { url: `${this.$http.defaults.baseURL}/media`, paramName: 'media', - headers: { Authorization: `Bearer ${this.$store.state.user.authToken}` }, - acceptedFiles: '.ocs,.ocf,.ocd,.ocg,.ocr,.c4d,.c4g,.c4f,.c4r,.c4s,c4v', + headers: { Authorization: `JWT ${this.$store.state.user.authToken}` }, + acceptedFiles: '.ocs,.ocf,.ocd,.ocg,.ocr,.ocu,.c4d,.c4g,.c4f,.c4r,.c4s,.c4v,.c4l,.c4u', dictDefaultMessage: "

Drop your mod files here or click to upload

", maxFilesize: 30, // MB } @@ -177,7 +177,7 @@ return { url: `${this.$http.defaults.baseURL}/media`, paramName: 'media', - headers: { Authorization: `Bearer ${this.$store.state.user.authToken}` }, + headers: { Authorization: `JWT ${this.$store.state.user.authToken}` }, acceptedFiles: '.png,.jpg', dictDefaultMessage: "

Drop your image here or click to upload

", maxFilesize: 3, // MB @@ -195,7 +195,7 @@ if (!this.pic) { return '' } - return `${this.$http.defaults.baseURL}/media/${this.pic._id}` + return `${this.$http.defaults.baseURL}/media/${this.pic.id}` }, }, watch: { @@ -209,11 +209,7 @@ deleteFile (idx) { let file = this.files[idx] this.files.splice(idx, 1) - this.$http.delete(`${this.$http.defaults.baseURL}/media/${file._id}`) - }, - picUploadSuccess (file, response) { - this.pic = response - this.$refs.picDropzone.disable() + this.$http.delete(`${this.$http.defaults.baseURL}/media/${file.id}`) }, uploadSuccess (file, response) { this.files.push(response) @@ -238,8 +234,7 @@ let params = { title: this.title, description: this.description, - files: this.files.map(el => el._id), - pic: this.pic, + files: this.files.map(el => el.id), tags: this.tags, } this.$http.post('/uploads', params) -- cgit v1.2.3-54-g00ecf