mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Display a real progress bar when updates are processed
This commit is contained in:
		| @@ -52,7 +52,16 @@ $(window).on('load', function () { | ||||
|     if (status.type == "Progressing") { | ||||
|       const id = 'update-' + status.update_id; | ||||
|       const content = $(`#${id} .updateStatus.content`); | ||||
|       content.html('progressing... ' + JSON.stringify(status.meta)); | ||||
|  | ||||
|       let html; | ||||
|       let { type, processed_number_of_documents, total_number_of_documents } = status.meta; | ||||
|       if (type === 'DocumentsAddition' && processed_number_of_documents && total_number_of_documents) { | ||||
|         let progress = Math.round(processed_number_of_documents / total_number_of_documents * 100); | ||||
|         html = `<progress class="progress" title="${progress}%" value="${progress}" max="100"></progress>`; | ||||
|       } else { | ||||
|         html = `<progress class="progress" max="100"></progress>`; | ||||
|       } | ||||
|       content.html(html); | ||||
|     } | ||||
|  | ||||
|     if (status.type == "Processed") { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user