mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 09:00:40 +00:00
Set up all things for first query
This commit is contained in:
@ -27,13 +27,13 @@ def recv_query(message):
|
||||
|
||||
def observe_corpus_analysis_connection(app, corpus_id, session_id):
|
||||
logger = logging.getLogger(__name__)
|
||||
corpus = Corpus.query.filter_by(id=corpus_id).first()
|
||||
with app.app_context():
|
||||
cqi_client = CQiClient(host='172.25.0.2')
|
||||
cqi_client = CQiClient(host=corpus.analysis_container_ip)
|
||||
while session_id in connected_sessions:
|
||||
logger.warning(cqi_client.ctrl_ping())
|
||||
logger.warning('Run container, run!')
|
||||
socketio.sleep(3)
|
||||
corpus = Corpus.query.filter_by(id=corpus_id).first()
|
||||
corpus.status = 'stop analysis'
|
||||
db.session.commit()
|
||||
logger.warning('Stop container, stop!')
|
||||
|
@ -442,7 +442,8 @@ class Corpus(db.Model):
|
||||
status = db.Column(db.String(16))
|
||||
title = db.Column(db.String(32))
|
||||
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
|
||||
analysis_ip = db.Column(db.String(16))
|
||||
analysis_container_ip = db.Column(db.String(16))
|
||||
analysis_container_name = db.Column(db.String(32))
|
||||
# Relationships
|
||||
files = db.relationship('CorpusFile',
|
||||
backref='corpus',
|
||||
|
@ -61,11 +61,14 @@
|
||||
statusElement.classList.remove(...Object.values(CorpusList.STATUS_COLORS));
|
||||
statusElement.classList.add(CorpusList.STATUS_COLORS[status] || CorpusList.STATUS_COLORS['default']);
|
||||
statusElement.innerText = status;
|
||||
if (status === 'prepared' || status === 'start analysis' || status === 'analysing') {
|
||||
var analyseBtn = document.getElementById('analyse');
|
||||
var analyseBtn = document.getElementById('analyse');
|
||||
if (status === 'prepared') {
|
||||
analyseBtn.classList.remove('hide', 'disabled');
|
||||
} else if (status === 'analysing' || status === 'start analysis' || status === 'stop analysis') {
|
||||
analyseBtn.classList.remove('hide');
|
||||
analyseBtn.classList.add('disabled');
|
||||
}
|
||||
if (status === 'prepared' || status === 'start analysis' || status === 'analysing') {
|
||||
if (status === 'prepared' || status === 'start analysis' || status === 'analysing' || status === 'stop analysis') {
|
||||
var prepareBtn = document.getElementById('prepare');
|
||||
prepareBtn.classList.add('hide');
|
||||
}
|
||||
|
Reference in New Issue
Block a user