diff --git a/Frontend/src/app/models/crawlingstatus.ts b/Frontend/src/app/models/crawlingstatus.ts new file mode 100644 index 0000000..c54d914 --- /dev/null +++ b/Frontend/src/app/models/crawlingstatus.ts @@ -0,0 +1,7 @@ +export interface CrawlingStatus { + process_id: number; + started_timestamp: Date; + combinations_to_crawl: number; + successful_crawls: number; + failed_crawls: number; +} diff --git a/Frontend/src/app/services/api.service.ts b/Frontend/src/app/services/api.service.ts index 4181455..8d06a81 100644 --- a/Frontend/src/app/services/api.service.ts +++ b/Frontend/src/app/services/api.service.ts @@ -10,6 +10,7 @@ import {FavoriteShop} from '../models/favoriteshop'; import {ContactPerson} from '../models/contactperson'; import {Category} from '../models/category'; import {Manufacturer} from '../models/manufacturer'; +import {CrawlingStatus} from '../models/crawlingstatus'; @Injectable({ providedIn: 'root' @@ -575,4 +576,25 @@ export class ApiService { process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`); } } + + + /* ______ ___ _____ __ __ + / ____/________ __ __/ (_)___ ____ _ / ___// /_____ _/ /___ _______ + / / / ___/ __ `/ | /| / / / / __ \/ __ `/ \__ \/ __/ __ `/ __/ / / / ___/ + / /___/ / / /_/ /| |/ |/ / / / / / / /_/ / ___/ / /_/ /_/ / /_/ /_/ (__ ) + \____/_/ \__,_/ |__/|__/_/_/_/ /_/\__, / /____/\__/\__,_/\__/\__,_/____/ + /____/ + */ + + /** + * Gets the current crawling status + * @return Observable An observable containing a single crawling status object + */ + getCurrentCrawlingStatus(): Observable { + try { + return this.http.get((this.apiUrl + '/crawlingstatus')); + } catch (exception) { + process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`); + } + } }