mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	Add inga method to cqi_over_socketio
This commit is contained in:
		@@ -150,6 +150,20 @@ class CQiCorpus {
 | 
			
		||||
 | 
			
		||||
    this.socket.emit('cqi.corpora.corpus.update_db', args);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  inga() {
 | 
			
		||||
    return new Promise((resolve, reject) => {
 | 
			
		||||
      const args = {corpus_name: this.name};
 | 
			
		||||
 | 
			
		||||
      this.socket.emit('cqi.corpora.corpus.inga', args, response => {
 | 
			
		||||
        if (response.code === 200) {
 | 
			
		||||
          resolve(response.payload);
 | 
			
		||||
        } else {
 | 
			
		||||
          reject(response);
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,10 @@ class CorpusAnalysisApp {
 | 
			
		||||
      .then(
 | 
			
		||||
        cQiCorpus => {
 | 
			
		||||
          this.data.corpus = {o: cQiCorpus};
 | 
			
		||||
          cQiCorpus.inga().then(
 | 
			
		||||
            response => {console.log(response.payload);},  // Hier wird das promise behandelt, wenn es erfolgreich war
 | 
			
		||||
            response => {console.log(`${response.code}: ${response.msg}`);}  // Hier wenn es nicht erfolgreich war
 | 
			
		||||
          );
 | 
			
		||||
          // TODO: Don't do this here
 | 
			
		||||
          cQiCorpus.updateDb();
 | 
			
		||||
          this.enableActionElements();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user