X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=example-apps%2FROBO%2FRoboUI%2Fsrc%2Fapp%2Frobo.service.ts;h=6546fe7a88c3a9238658a8424e75234359085527;hb=e6d40ddb2640f434a9d7d7ed99566e5e8fa60cc1;hp=53aaeb62f9776fbdd426f0ed8ced829293448106;hpb=85ef2c5c9325797279cdcaf5cc7e58b0eacfcaaa;p=ealt-edge.git diff --git a/example-apps/ROBO/RoboUI/src/app/robo.service.ts b/example-apps/ROBO/RoboUI/src/app/robo.service.ts index 53aaeb6..6546fe7 100644 --- a/example-apps/ROBO/RoboUI/src/app/robo.service.ts +++ b/example-apps/ROBO/RoboUI/src/app/robo.service.ts @@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; import { Observable,throwError } from 'rxjs' import { timer, Subscription, pipe } from 'rxjs'; +import { switchMap } from 'rxjs/operators'; import { cameraData, camerainfo, cameraDetails, monitorDetails, monitorinfo, cameraID, appsPvcs, backupRestore, monitorImage } from './datainterface' @@ -13,24 +14,32 @@ import { cameraData, camerainfo, cameraDetails, monitorDetails, monitorinfo, cam export class RoboService { private baseUrl = 'http://localhost:30091'; + private inventoryBaseUrl = 'http://localhost:30092'; private postCameraDetailsUrl = this.inventoryBaseUrl + '/v1/monitor/cameras' private cameraDetailsUrl = this.inventoryBaseUrl + '/v1/monitor/cameras' + private cameraDetails_url = './../assets/data/sample.json' + + private monitorDetails_url = './../assets/data/inventory.json' private monitorDetailsUrl = this.inventoryBaseUrl + '/v1/inventry/table' + private monitorImageUrl = this.inventoryBaseUrl + '/v1/inventry/image' + private triggerObjUrl = this.inventoryBaseUrl + '/v1/monitor/cameras/' + private appsPvcsDetailsUrl = this.baseUrl + '/v1/robo/apps-pvcs' + private appsPvcsDetails_url = './../assets/data/appspvc.json' + private backupRestoreDetailsUrl = this.baseUrl + '/v1/robo/backup-restore' + + private backupRestoreDetails_url = './../assets/data/backuprestore.json' + private postBackupDetailsUrl = this.baseUrl + '/v1/robo/backup' - private postRestoreDetailsUrl = this.baseUrl + '/v1/robo/restore' - private disasterUrl = this.baseUrl + '/v1/robo/disaster' - private cameraDetails_url = './../assets/data/camera.json' - private backupRestoreDetails_url = './../assets/data/backuprestore.json' - private appsPvcsDetails_url = './../assets/data/appspvc.json' - private monitorDetails_url = './../assets/data/inventory.json' + private postRestoreDetailsUrl = this.baseUrl + '/v1/robo/restore' + private disasterUrl = this.baseUrl + '/v1/robo/disaster' constructor(private http:HttpClient) { } @@ -57,13 +66,20 @@ export class RoboService { return this.http.get(this.cameraDetailsUrl); } - getMonitorInfo(): Observable { + getMonitorInfo(): Observable { debugger; - return this.http.get(this.monitorDetailsUrl); + return this.http.get(this.monitorDetailsUrl); } + + getMonitorImage(): Observable { debugger; + // return timer(0, 2000) + // .pipe( + + // switchMap(_ => this.http.get(this.monitorImageUrl)), + // ); return this.http.get(this.monitorImageUrl); } @@ -71,7 +87,11 @@ export class RoboService { triggerDetection(data): Observable { console.log(data); debugger; + this.triggerObjUrl = this.inventoryBaseUrl + '/v1/monitor/cameras/'; this.triggerObjUrl = this.triggerObjUrl + data; + + debugger; + console.log(this.triggerObjUrl); return this.http.get(this.triggerObjUrl) } @@ -79,6 +99,10 @@ export class RoboService { return this.http.get(this.appsPvcsDetailsUrl); } + // getBackupRestoreInfo(): Observable { + // } + // return this.http.get(this.backupRestoreDetails_url); + getBackupRestoreInfo(): Observable { return this.http.get(this.backupRestoreDetailsUrl); } @@ -98,4 +122,4 @@ export class RoboService { debugger; return this.http.post(this.postRestoreDetailsUrl, data) } -} \ No newline at end of file +}