diff --git a/config/default.json b/config/default.json index bea1db9a..8d0ff7de 100644 --- a/config/default.json +++ b/config/default.json @@ -1,10 +1,10 @@ { "title": "Gancio", "description": "A shared agenda for local communities", - "baseurl": "http://localhost:3000", + "baseurl": "http://localhost:13120", "server": { "host": "localhost", - "port": 3000 + "port": 13120 }, "db": { "dialect": "sqlite", diff --git a/docker/Dockerfile b/docker/Dockerfile index fa0b483c..6a554408 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,4 @@ FROM node:latest EXPOSE 13120 WORKDIR / -#COPY config/default.json /data/gancio/config/gancio_config.json -RUN yarn global add gancio -#ENTRYPOINT ["gancio", "--config", "/gancio/config.json"] -#CMD ["gancio", "start", "--config", "/data/gancio/gancio_config.json"] +RUN yarn global add gancio \ No newline at end of file diff --git a/locales/it.js b/locales/it.js index a7995c49..0cc667c3 100644 --- a/locales/it.js +++ b/locales/it.js @@ -129,7 +129,8 @@ const it = { recurrent_1m_ordinal: 'Il {n} {days} di ogni mese', recurrent_2m_ordinal: 'Il {n} {days} un mese sì e uno no', due: 'alle', - from: 'Dalle' + from: 'Dalle', + image_too_big: 'Immagine troppo grande! Massimo 4M' }, admin: { diff --git a/pages/add/_edit.vue b/pages/add/_edit.vue index f5e77a84..8da9619c 100644 --- a/pages/add/_edit.vue +++ b/pages/add/_edit.vue @@ -102,6 +102,8 @@ :limit="1" :auto-upload='false' drag + accept='image/*' + :on-remove='cleanFile' :on-change='uploadedFile' :multiple='false' :file-list="fileList" @@ -347,7 +349,16 @@ export default { } this.$refs.address.focus() }, + cleanFile () { + this.event.image = null + }, uploadedFile(file, fileList) { + if (file.size / 1024/ 1024 > 4) { + Message({ type: 'warning', showClose: true, message: this.$tc('event.image_too_big') }) + this.fileList = [] + return false + } + this.fileList = [{name: file.name, url: file.url}] this.event.image = file }, async done () { @@ -414,8 +425,15 @@ export default { this.loading = false Message({ type: 'success', showClose: true, message: this.$auth.loggedIn ? this.$t('event.added') : this.$t('event.added_anon')}) } catch (e) { + switch(e.request.status) { + case 413: + Message({ type: 'error', showClose: true, message: this.$t('event.image_too_big') }) + break; + default: + console.error(e) + Message({ type: 'error', showClose: true, message: e }) + } this.loading = false - Message({ type: 'danger', showClose: true, message: e }) console.error(e) } }