fix #26, too big image
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"title": "Gancio",
|
"title": "Gancio",
|
||||||
"description": "A shared agenda for local communities",
|
"description": "A shared agenda for local communities",
|
||||||
"baseurl": "http://localhost:3000",
|
"baseurl": "http://localhost:13120",
|
||||||
"server": {
|
"server": {
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": 3000
|
"port": 13120
|
||||||
},
|
},
|
||||||
"db": {
|
"db": {
|
||||||
"dialect": "sqlite",
|
"dialect": "sqlite",
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
FROM node:latest
|
FROM node:latest
|
||||||
EXPOSE 13120
|
EXPOSE 13120
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
#COPY config/default.json /data/gancio/config/gancio_config.json
|
RUN yarn global add gancio
|
||||||
RUN yarn global add gancio
|
|
||||||
#ENTRYPOINT ["gancio", "--config", "/gancio/config.json"]
|
|
||||||
#CMD ["gancio", "start", "--config", "/data/gancio/gancio_config.json"]
|
|
||||||
@@ -129,7 +129,8 @@ const it = {
|
|||||||
recurrent_1m_ordinal: 'Il {n} {days} di ogni mese',
|
recurrent_1m_ordinal: 'Il {n} {days} di ogni mese',
|
||||||
recurrent_2m_ordinal: 'Il {n} {days} un mese sì e uno no',
|
recurrent_2m_ordinal: 'Il {n} {days} un mese sì e uno no',
|
||||||
due: 'alle',
|
due: 'alle',
|
||||||
from: 'Dalle'
|
from: 'Dalle',
|
||||||
|
image_too_big: 'Immagine troppo grande! Massimo 4M'
|
||||||
},
|
},
|
||||||
|
|
||||||
admin: {
|
admin: {
|
||||||
|
|||||||
@@ -102,6 +102,8 @@
|
|||||||
:limit="1"
|
:limit="1"
|
||||||
:auto-upload='false'
|
:auto-upload='false'
|
||||||
drag
|
drag
|
||||||
|
accept='image/*'
|
||||||
|
:on-remove='cleanFile'
|
||||||
:on-change='uploadedFile'
|
:on-change='uploadedFile'
|
||||||
:multiple='false'
|
:multiple='false'
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
@@ -347,7 +349,16 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$refs.address.focus()
|
this.$refs.address.focus()
|
||||||
},
|
},
|
||||||
|
cleanFile () {
|
||||||
|
this.event.image = null
|
||||||
|
},
|
||||||
uploadedFile(file, fileList) {
|
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
|
this.event.image = file
|
||||||
},
|
},
|
||||||
async done () {
|
async done () {
|
||||||
@@ -414,8 +425,15 @@ export default {
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
Message({ type: 'success', showClose: true, message: this.$auth.loggedIn ? this.$t('event.added') : this.$t('event.added_anon')})
|
Message({ type: 'success', showClose: true, message: this.$auth.loggedIn ? this.$t('event.added') : this.$t('event.added_anon')})
|
||||||
} catch (e) {
|
} 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
|
this.loading = false
|
||||||
Message({ type: 'danger', showClose: true, message: e })
|
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user