Commit a4c557e3 authored by Robin Tissot's avatar Robin Tissot
Browse files

Merge branch 'develop'

parents 5e40af5a 171b1a95
......@@ -113,7 +113,7 @@ WSGI_APPLICATION = 'escriptorium.wsgi.application'
DATABASES = {
'default': {
'ENGINE': os.getenv('SQL_ENGINE', 'django.db.backends.postgresql'),
'NAME': os.getenv('POSTGRES_DB', os.path.join(BASE_DIR, 'escriptorium')),
'NAME': os.getenv('POSTGRES_DB', 'escriptorium'),
'USER': os.getenv('POSTGRES_USER', 'postgres'),
'PASSWORD': os.getenv('POSTGRES_PASSWORD', 'postgres'),
'HOST': os.getenv('SQL_HOST', 'localhost'),
......
......@@ -10,22 +10,20 @@ services:
# - ./app/:/usr/src/app/
- static:/usr/src/app/static
- media:/usr/src/app/media
depends_on:
- db
- redis
command: /bin/true
web:
<<: *app
command: uwsgi --ini /usr/src/app/uwsgi.ini
expose:
- 8000
channelserver:
<<: *app
command: daphne --bind 0.0.0.0 --port 5000 -v 1 escriptorium.asgi:application
expose:
- 5000
depends_on:
- web
db:
image: postgres:10.5-alpine
......@@ -47,9 +45,6 @@ services:
- media:/usr/src/app/media
ports:
- 8080:80
depends_on:
- web
- channelserver
# elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:6.5.1
......@@ -73,14 +68,10 @@ services:
celery-main:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q default -c ${CELERY_MAIN_CONC:-10} --max-tasks-per-child=10"
depends_on:
- web
celery-low-priority:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q low-priority -c ${CELERY_LOW_CONC:-10} --max-tasks-per-child=10"
depends_on:
- web
celery-gpu: &celery-gpu
<<: *app
......@@ -88,25 +79,18 @@ services:
- KRAKEN_TRAINING_DEVICE=cpu
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q gpu -c 1 --max-tasks-per-child=1"
shm_size: '3gb'
depends_on:
- web
flower:
image: mher/flower
command: ["flower", "--broker=redis://redis:6379/0", "--port=5555"]
ports:
- 5555:5555
depends_on:
- redis
# No need while we don't have regular tasks
# celerybeat:
# build:
# context: ./app
# env_file: variables.env
# depends_on:
# - db
# - redis
# volumes:
# - ./static/:/usr/src/app/static
# - ./media/:/usr/src/app/media
......@@ -116,6 +100,7 @@ services:
mail:
build: ./exim
image: registry.gitlab.inria.fr/scripta/escriptorium/mail
expose:
- 25
environment:
......
......@@ -85,7 +85,6 @@ export const mutations = {
tr[transcription.transcription] = transcription
state.all[index] = { ...state.all[index], transcriptions: tr }
}
state.all[index] = { ...state.all[index], currentTrans: transcription }
// Force reference update on the whole array
// so that all components get a full refresh after an update
state.all = [...state.all]
......
......@@ -96,13 +96,16 @@ export const actions = {
async updateLineTranscriptionVersion({commit, dispatch, rootState}, {line, content}) {
commit('lines/updateTranscriptionVersion', { pk: line.pk, content: content }, {root: true})
const l = rootState.lines.all.find(li=>li.pk == line.pk)
let data = {
content: l.currentTrans.content,
line: l.currentTrans.line,
transcription: l.currentTrans.transcription
}
if (rootState.lines.editedLine) {
commit('lines/setEditedLine', l, {root: true})
}
if (l.currentTrans.pk) {
await dispatch('updateContent', {pk: l.currentTrans.pk, content: data, currentTransLine: l.currentTrans.line})
......@@ -115,6 +118,7 @@ export const actions = {
try {
const resp = await api.createContent(rootState.document.id, rootState.parts.pk, content)
commit('lines/setTranscriptions', { pk: currentTransLine, transcription: resp.data }, {root: true})
commit('lines/updateCurrentTrans', resp.data.transcription, {root: true})
} catch (err) {
console.log('couldnt create transcription!', err);
}
......@@ -124,6 +128,7 @@ export const actions = {
try {
const resp = await api.updateContent(rootState.document.id, rootState.parts.pk, pk, content)
commit('lines/setTranscriptions', { pk: currentTransLine, transcription: resp.data }, {root: true})
commit('lines/updateCurrentTrans', resp.data.transcription, {root: true})
} catch (err) {
console.log('couldnt update transcription!', err);
}
......
......@@ -162,7 +162,6 @@ import HelpVersions from './HelpVersions.vue';
import HelpCompareTranscriptions from './HelpCompareTranscriptions.vue';
export default Vue.extend({
props: ['line'],
components: {
LineVersion,
HelpVersions,
......@@ -196,6 +195,9 @@ export default Vue.extend({
}
},
computed: {
line () {
return this.$store.state.lines.editedLine
},
momentDate() {
return moment.tz(this.line.currentTrans.version_updated_at, this.timeZone);
},
......
......@@ -17,8 +17,7 @@
</div>
</div>
<TranscriptionModal v-if="$store.state.lines.editedLine"
v-bind:line="$store.state.lines.editedLine">
<TranscriptionModal v-if="$store.state.lines.editedLine">
</TranscriptionModal>
</div>
</template>
......
DOMAIN=localhost
SECRET_KEY=changeme
SQL_HOST=db
SQL_PORT=5432
# POSTGRES_USER=postgres
# POSTGRES_PASSWORD=postgres
# POSTGRES_DB=escriptorium
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment